You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Simone Tripodi <si...@apache.org> on 2012/01/11 08:57:17 UTC

Re: svn commit: r1229755 - /maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java

Hi Robert!

> +            for ( String providerType : providerImplementations.keySet() )
>             {
> -                String providerType = (String) i.next();
> -                String providerImplementation = (String) providerImplementations.get( providerType );
> +                String providerImplementation = providerImplementations.get( providerType );

why not just iterating over providerImplementations.entrySet() ?
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

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


Re: svn commit: r1229755 - /maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java

Posted by Robert Scholte <ap...@sourcegrounds.com>.
Hi Simone,

simple answer: because the original code wasn't using the entryset. I only  
added generics, verifying I didn't introduce a potential NPE with new  
for-loops.
I haven't checked if the code could be optimized, but this looks like one.

-Robert

On Wed, 11 Jan 2012 08:57:17 +0100, Simone Tripodi  
<si...@apache.org> wrote:

> Hi Robert!
>
>> +            for ( String providerType :  
>> providerImplementations.keySet() )
>>             {
>> -                String providerType = (String) i.next();
>> -                String providerImplementation = (String)  
>> providerImplementations.get( providerType );
>> +                String providerImplementation =  
>> providerImplementations.get( providerType );
>
> why not just iterating over providerImplementations.entrySet() ?
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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