You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/04/25 16:41:43 UTC
DO NOT REPLY [Bug 44873] New: Mapper behaviour is different when
using Java 6
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
Summary: Mapper behaviour is different when using Java 6
Product: Ant
Version: 1.7.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: notifications@ant.apache.org
ReportedBy: edward.steel@detica.com
To be specific: using glob mappers and identity mappers within composite
mappers has different behaviour if using Java 6.
My build contains the following:
<target name="-export" if="project.exports">
<mkdir dir="${dir.exp}"/>
<copy todir="${dir.exp}">
<fileset dir="${dir.jar}" includesfile="${file.exports}"
excludes="${pattern.dist.jars.exclude}"/>
<compositemapper>
<globmapper from="*-standalone.jar" to="*.jar"/>
<globmapper from="*-common.jar" to="*.jar"/>
<identitymapper/> <!-- let anything else through -->
</compositemapper>
</copy>
</target>
The intended behaviour of this is to rename any {project}-standalone or
{project}-common jar to {project}.jar, but let the jars go as they are
otherwise. This works as expected with Java 1.4.2 or Java 5 (1.5.0_12):
-export:
[mkdir] Skipping D:\projects\NR52\TIGUtils\export because it already
exists.
fileset: Setup scanner in dir D:\projects\NR52\TIGUtils\tmp\jar with
patternSet{ includes: [] excludes: [] }
[copy] TIGUtils-common.jar added as TIGUtils.jar doesn't exist.
[copy] No sources found.
[copy] Copying 1 file to D:\projects\NR52\TIGUtils\export
[copy] Copying D:\projects\NR52\TIGUtils\tmp\jar\TIGUtils-common.jar to
D:\projects\NR52\TIGUtils\export\TIGUtils.jar
However, when using Java 6 (update 2 or update 6) this does not work:
-export:
[mkdir] Skipping D:\projects\NR52\TIGUtils\export because it already
exists.
fileset: Setup scanner in dir D:\projects\NR52\TIGUtils\tmp\jar with
patternSet{ includes: [] excludes: [] }
[copy] TIGUtils-common.jar added as TIGUtils-common.jar is outdated.
[copy] No sources found.
[copy] Copying 1 file to D:\projects\NR52\TIGUtils\export
[copy] Copying D:\projects\NR52\TIGUtils\tmp\jar\TIGUtils-common.jar to
D:\projects\NR52\TIGUtils\export\TIGUtils-common.jar
When using just the two globmappers, the functionality is as expected, but any
jars that do not match the pattern will not be copied at all. The workaround is
to use two copy tasks, but I would rather keep it the way it is. I'm surprised
the behaviour is inconsistent between java versions.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44873] Add a "firstmatch" composite mapper
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #6 from Stefan Bodewig <bo...@apache.org> 2008-09-26 05:01:05 PST ---
firstmatchmapper is in svn rev 699288.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
DO NOT REPLY [Bug 44873] Add a "firstmatch" composite mapper
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Summary|Mapper behaviour is |Add a "firstmatch" composite
|different when using Java 6 |mapper
Target Milestone|--- |1.8.0
--- Comment #5 from Stefan Bodewig <bo...@apache.org> 2008-09-26 03:52:53 PST ---
compositemapper's sort order is stable with svn revision 699263.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
DO NOT REPLY [Bug 44873] Mapper behaviour is different when using
Java 6
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
--- Comment #4 from Stefan Bodewig <bo...@apache.org> 2008-09-26 03:37:51 PST ---
The composite mapper has two results, since one glob mapper and the identity
mapper match.
<copy> only uses the first result (enablemultiplemappings is false by default).
The documentation of composite mapper doesn't talk about the order of results
and in fact it uses a set in its implementation, making sort order depend on
the Java VM (or the phase of the moon). We could fix that without breaking
anything, and I think I'll do that.
In your case you really want something else, you want some sort of composite
mapper where only the first match is used. We don't have anything like this in
Ant right now. Therefore I will first create a stable sort order and then
change this report to an enhancement request for a different kind of composite
mapper.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
DO NOT REPLY [Bug 44873] Mapper behaviour is different when using
Java 6
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
Stefan Bodewig <bo...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |notifications@ant.apache.org
AssignedTo|notifications@ant.apache.org|bodewig@apache.org
Status|ASSIGNED |NEW
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.
DO NOT REPLY [Bug 44873] Mapper behaviour is different when using
Java 6
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
--- Comment #1 from Peter Reilly <pe...@apache.org> 2008-04-25 09:25:52 PST ---
Thanks for the report.
Can you give a name of a file that
that works on java5 and does not
work on java6 - it will help
with debuging.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44873] Mapper behaviour is different when using
Java 6
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
--- Comment #2 from Edward Steel <ed...@detica.com> 2008-04-25 09:28:44 PST ---
Sure.
The input dir contains a TIGUtils-common.jar, which is expected to map to
TIGUtils.jar in the output dir.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 44873] Mapper behaviour is different when using
Java 6
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44873
Peter Reilly <pe...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #3 from Peter Reilly <pe...@apache.org> 2008-04-25 09:47:09 PST ---
Thanks,
I can see the same problem on my system.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.