[rfc][icedtea-web] net.sourceforge.jnlp.ResourcesTest fix

Omair Majid omajid at redhat.com
Fri Sep 13 13:00:24 PDT 2013


On 09/13/2013 02:46 PM, Andrew Azores wrote:
> Renamed some variables and removed an assertion that the user plugin
> directory (~/.mozilla/plugins) must exist, as it may not

Thanks for doing the cleanup. The code is so much more readable now!

If your IDE has refactoring support, please use that instead of renaming
things manually.

> -        if (f2 != null) {
> -            Assert.assertTrue("browser's users-plugins  location should exist " + f2.toString() + " for " + browser.getID().toString(), f2.exists());

Please move the comment below about no user-plugins directory to here.

> -        File[] ff1 = new File[0];
> -        if (f1 != null) {
> -            ff1 = f1.listFiles();
> +        File[] defaultPlugins = new File[0];
> +        if (defaultPlugins != null) {
> +            defaultPlugins = defaultPluginDir.listFiles();
>          }

This looks like a mistake. It should be `if (defaultPluginDir != null)`,
right?

> -        File[] ff2 = new File[0];
> -        if (f2 != null) {
> -            ff2 = f2.listFiles();
> +        File[] userPlugins = null;
> +        if (userPluginDir != null) {
> +            userPlugins = userPluginDir.listFiles();
>          }
> +        if (userPlugins == null) {
> +            userPlugins = new File[0];
> +        }

Why not use the idiom used in defaultPlugins and declare and initialize
userPlugins to new File[0] at once?

Cheers,
Omair

-- 
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681



More information about the distro-pkg-dev mailing list