From: SourceForge.net <no...@so...> - 2006-08-16 03:22:03
|
Bugs item #1207246, was opened at 2005-05-23 18:14 Message generated for change (Comment added) made by mattinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1207246&group_id=36177 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: logic Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Trevor Harmon (vocaro) Assigned to: Nobody/Anonymous (nobody) Summary: OutOfDate behaves incorrectly if no target paths exist Initial Comment: There is a bug in OutOfDate in the case where <targetfiles> is specified but no paths exist. Here's an example that demonstrates the bug: <outofdate> <sourcefiles> <fileset dir="${src}"> <include name="**/*.hbm.xml"/> </fileset> </sourcefiles> <targetfiles> <fileset dir="${generated}"> <include name="**/*.java"/> </fileset> </targetfiles> <sequential> <hbm2java output="${generated}" classpathref="build.classpath"> <fileset dir="${src}"> <include name="**/ *.hbm.xml"/> </fileset> </hbm2java> </sequential> </outofdate> In this example, note that there is no mapping between .hbm.xml files and .java files. The target output depends on the contents of the .hbm.xml files. Because of this, it is possible (after a clean, for instance) that the directory pointed to by the <targetfiles> section is completely empty. In this case, the targets are clearly out of date, and yet the <outofdate> task thinks that they are not. This is because the block of code on lines 309-323 never sets ret to true. I was able to fix this problem by changing the code block to this: if (targetpaths != null) { String[] paths = targetpaths.list(); if (paths.length == 0) { ret = true; } else { for (int i = 0; i < paths.length; ++i) { if (targetNeedsGen(paths[i], spaths)) { ret = true; } } } } The code block now checks to see if the specified paths are non- existent and, if so, sets ret to true. ---------------------------------------------------------------------- >Comment By: Matt Inger (mattinger) Date: 2006-08-16 03:22 Message: Logged In: YES user_id=83032 I've applied this patch to subversion. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1207246&group_id=36177 |