cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject Re: svn commit: r123825 - in cocoon/branches/BRANCH_2_1_X/src: blocks/naming/java/org/apache/cocoon/components/namingblocks/portal/ja va/org/apache/cocoon/components/modules/input blocks/portal/java/org/apache/cocoon/environment/portletblocks/portal/ java/org/apache/cocoon/portal/pluto/services/factory blocks/portal/java/org/apache/cocoon/portal/pluto/testjava/org/apache/ cocoon/acting java/org/apache/cocoon/components/modules/outputjava/org/apache/cocoon /components/notification java/org/apache/cocoon/components/treeprocessorjava/org/apache/cocoon/ util java/org/apache/cocoon/xml/dom
Date Sat, 01 Jan 2005 12:23:23 GMT
On Vie, 31 de Diciembre de 2004, 16:17, Joerg Heinicke dijo:
> On 31.12.2004 22:18, antonio@apache.org wrote:
>
>> URL: http://svn.apache.org/viewcvs?view=rev&rev=123825
>
>> Url:
>> http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java?view=diff&rev=123825&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java&r1=123824&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java&r2=123825
>> ==============================================================================
>
>>  	private Attributes map2Attributes (Map map) {
>>  		Attributes attrs = new BasicAttributes (false);
>> -		Iterator keys = map.keySet ().iterator ();
>> -		while (keys.hasNext ()) {
>> -			String key = (String)keys.next ();
>> -			Iterator vals = ((List)map.get (key)).iterator ();
>> -			Attribute attr = new BasicAttribute (key);
>> -			while (vals.hasNext ()) {
>> -				attr.add(vals.next());
>> -			}
>> -			attrs.put (attr);
>> -		}
>> +        for (Iterator i = map.entrySet().iterator(); i.hasNext(); ) {
>> +            Map.Entry me = (Map.Entry)i.next();
>> +            String key = (String)me.getKey();
>> +            Attribute attr = new BasicAttribute(key);
>> +            for (Iterator vals = ((List)me.getValue()).iterator();
>> vals.hasNext(); ) {
>> +                attr.add(vals.next());
>> +            }
>> +        }
>>  		return attrs;
>>  	}
>
> 1. Iterators with for-loop really read bad, using while is much more
> expected IMO.
>
> 2. The file is tab-contaminated.

Yep. I don't formatted to mke easier the checking of changes. :-D
>
> 3. There is a "attrs.put(attr);" missing in your new code I think.

opss. Sorry. Thanks for pointing this out. I will fix it now.

> I wish you all a happy new year!

+1 ;-)

Best Regards,

Antonio Gallardo


Mime
View raw message