[rfc][icedtea-web] JNLPClassLoader for-loop and Enumeration cleanup

Jiri Vanek jvanek at redhat.com
Tue Nov 12 23:53:02 PST 2013


On 11/13/2013 12:03 AM, Omair Majid wrote:
> Hi,
>
> * Andrew Azores <aazores at redhat.com> [2013-11-12 12:48]:
>> 2) Wraps some Enumeration usage in Collections.list(), so that the
>> result is Iterable. This removes extra boilerplate and reduces the
>> number of loop variables creeping out of absolute minimal scope, and
>> again allows the usage of for-each-loops. Other Enumeration usage in
>> the class is unfortunately part of its public interface, so in those
>> cases nothing has been done.
>
> Compared to the rest of the changes, this looks a little unsafe, since
> there is a cost associated with converting an enumeration to list.
> Still, there should be no performance impact.
>
>> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
>
>> -            tracker.addResource(jars[i].getLocation(),
>> -                                jars[i].getVersion(),
>> -                                file.getDownloadOptions(),
>> -                                jars[i].isCacheable() ? JNLPRuntime.getDefaultUpdatePolicy() : UpdatePolicy.FORCE
>> -                               );
>> +            tracker.addResource(jar.getLocation(),
>> +                    jar.getVersion(), file.getDownloadOptions(),
>> +                    jar.isCacheable() ? JNLPRuntime.getDefaultUpdatePolicy() : UpdatePolicy.FORCE);
>
> I find the previous style (each argument on it's own line) more
> readable. But not a big deal.
>
> Feel free to push.
>
> Cheers,
> Omair
>

this *should* go to 1,4 as it will make backporting much easier.



More information about the distro-pkg-dev mailing list