ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37760] - Helper method 'setMapper' on PropertySet does not work
Date Mon, 05 Dec 2005 20:47:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37760>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37760





------- Additional Comments From gverig@yahoo.com  2005-12-05 21:47 -------
(In reply to comment #0)
> public void setMapper(String type, String from, String to) {
>         Mapper m = createMapper();
>         Mapper.MapperType mapperType = new Mapper.MapperType();
>         mapperType.setValue(type);
>         m.setFrom(from);
>         m.setTo(to);
>     }
> 
> Note that mapperType is never added to the mapper. This creates a hard-to-debug
> problem (especially for a dumb newb like me).
> I found this problem on 1.6.5 version of Ant (above link is for current
> subversion state for this file). For me the problem occured when I tried to use
> <script> to create a CallTarget task with PropertySet.

(In reply to comment #3)
> It probably depends upon createMapper() not only creating the mapper, but adding
> it to the list. Which is exactly what it does:
> 
>    public Mapper createMapper() {
>         assertNotReference();
>         if (mapper != null) {
>             throw new BuildException("Too many <mapper>s!");
>         }
>         mapper = new Mapper(getProject());
>         return mapper;
>     }
> 
> I don't think this is the cause of whatever problem you encountered.

No, attaching Mapper to the task is not a problem. The problem is that
mapeprType is never attached to the mapper
After
  Mapper.MapperType mapperType = new Mapper.MapperType();
  mapperType.setValue(type);
There needs to be
  m.setType(mapperType);

I do not have a [not] working scrip, I will try to add it by the end of the day,
but basically what I did is I added a task through
project.createTask("antcall"); , obtained property set and tried to add Mapper
with setMapper method. Which failed with message stating that type was not
defined (see the code, type is created but never attached to the mapper).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message