https://issues.apache.org/bugzilla/show_bug.cgi?id=48715
Summary: FileMatch throws NPE when file2 is smaller than file1
doing text comparison
Product: Ant
Version: 1.8.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: [email protected]
ReportedBy: [email protected]
Usage:
<condition property="files_equal">
<filesmatch file1="${file1}" file2="${file2}" textfile="true"/>
</condition>
Testcase is attached.
Here is the stack trace
java.lang.NullPointerException
at java.lang.String.compareTo(String.java:998)
at
org.apache.tools.ant.util.ResourceUtils.textCompare(ResourceUtils.java:669)
at
org.apache.tools.ant.util.ResourceUtils.compareContent(ResourceUtils.java:592)
at
org.apache.tools.ant.util.ResourceUtils.contentEquals(ResourceUtils.java:556)
at org.apache.tools.ant.util.FileUtils.contentEquals(FileUtils.java:969)
at
org.apache.tools.ant.taskdefs.condition.FilesMatch.eval(FilesMatch.java:92)
at
org.apache.tools.ant.taskdefs.ConditionTask.execute(ConditionTask.java:120)
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:592)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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:592)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
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: 0 seconds
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.