https://issues.apache.org/bugzilla/show_bug.cgi?id=49137
Summary: Ant Symlink task generates Null Pointer exception with
stack trace when trying to delete symlink
Product: Ant
Version: 1.8.0
Platform: Sun
OS/Version: Solaris
Status: NEW
Severity: normal
Priority: P2
Component: Optional Tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
As you can see below, I'm using the symlink task to delete a symlink. The
build.xml has been simplified to the very minimum, so my use case isn't really
obvious here, but what I provided still reproduces the problem. Find the stack
trace at the end of this description.
Here are the details on the environment (java version, build xml, and relevant
directory layout:
masheen# java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
masheen# pwd
/home/bmacphee/project1
masheen# cat build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="project1" default="build" basedir=".">
<target name="build">
<symlink action="delete" link="Templates"/>
</target>
</project>
masheen# ls -go
total 9
lrwxrwxrwx 1 12 Apr 16 09:47 Templates -> ../Templates
-rw-r--r-- 1 199 Apr 16 12:18 build.xml
masheen# ls -go ../
total 9
drwxr-xr-x 2 2 Apr 16 09:47 Templates
drwxr-xr-x 2 4 Apr 16 12:19 project1
masheen# ant
Buildfile: /home/bmacphee/project1/build.xml
build:
[symlink] Removing symlink: Templates
BUILD FAILED
/home/bmacphee/project1/build.xml:4: java.lang.NullPointerException
at
org.apache.tools.ant.util.SymbolicLinkUtils.isSymbolicLink(SymbolicLinkUtils.java:107)
at
org.apache.tools.ant.util.SymbolicLinkUtils.isSymbolicLink(SymbolicLinkUtils.java:73)
at
org.apache.tools.ant.util.SymbolicLinkUtils.deleteSymbolicLink(SymbolicLinkUtils.java:223)
at
org.apache.tools.ant.taskdefs.optional.unix.Symlink.delete(Symlink.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:77)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 1 second
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.