commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30959] - [collections] fails the method TransformedMap.transformedMap
Date Wed, 01 Sep 2004 16:24: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=30959>.
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=30959

[collections] fails the method TransformedMap.transformedMap





------- Additional Comments From tirso.canela@altana.es  2004-09-01 16:24 -------
Sorry, my english  is very bad.

PROBLEM: I think Method MapUtils.transformedMap fails because method 
TransformedMap.transformedMap fails too, because internally the constructor 
TransformerMap takes the parameters but it doesn´t perform anything with them.

See Attachment Test Case:

I want to add 5 to each one of the members of  the Map:

1) FIRST TEST: DOESN´T WORKS (because internally the constructor TransformerMap 
takes the parameters but it doesn´t perform anything with them.)


2) SECOND TEST: IT WORKS, but i think that it is not a correct solution or i 
don´t understand the MapUtils.transformedMap philosophia.


3) One possible solution could be changing TrasformerMap constructor like this:

    protected TransformedMap(Map map, Transformer keyTransformer, Transformer 
valueTransformer) {
        super(map);
        this.keyTransformer = keyTransformer;
        this.valueTransformer = valueTransformer;
         
        //New
        transformMap(map);
}

4) Another possible solution could be changing the method 
TransformedMap.transformMap from protected to public.

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


Mime
View raw message