[icedtea-web] RFC: fix 2 issues in fix for versioned/packed jars

Dr Andrew John Hughes ahughes at redhat.com
Fri Feb 11 05:49:27 PST 2011


On 19:20 Thu 10 Feb     , Omair Majid wrote:
> Hi,
> 
> The attached patch fixes 2 issues in my previous patch for adding 
> packed/versioned jar support.
> 
> The first patch fixes names so that all methods that relate to 
> ResourcesDesc are actually named *ResourcesDesc* instead of 
> *ResourceDesc* (s at end of resources).
> 

But why?

> The second fix implements the new method getResourcesDescs in 
> PluginBridge  - the version in JNLPFile causes a NullPointerException 
> for plugins.
> 

Ok.  Please commit the two as separate patches.

> Ok to commit?
> 
> Cheers,
> Omair

> diff -r 0768433ea58d netx/net/sourceforge/jnlp/JNLPFile.java
> --- a/netx/net/sourceforge/jnlp/JNLPFile.java	Thu Feb 10 17:25:18 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/JNLPFile.java	Thu Feb 10 19:11:05 2011 -0500
> @@ -396,15 +396,15 @@
>       * through the default locale and the os.name and os.arch
>       * properties.
>       */
> -    public ResourcesDesc[] getResourceDescs() {
> -        return getResourceDescs(defaultLocale, defaultOS, defaultArch);
> +    public ResourcesDesc[] getResourcesDescs() {
> +        return getResourcesDescs(defaultLocale, defaultOS, defaultArch);
>      }
>  
>      /**
>       * Returns the resources section of the JNLP file for the
>       * specified locale, os, and arch.
>       */
> -    public ResourcesDesc[] getResourceDescs(final Locale locale, final String os, final String arch) {
> +    public ResourcesDesc[] getResourcesDescs(final Locale locale, final String os, final String arch) {
>          List<ResourcesDesc> matchingResources = new ArrayList<ResourcesDesc>();
>          for (ResourcesDesc rescDesc: resources) {
>              if (localMatches(locale, rescDesc.getLocales())
> diff -r 0768433ea58d netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
> --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Thu Feb 10 17:25:18 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java	Thu Feb 10 19:11:05 2011 -0500
> @@ -1255,7 +1255,7 @@
>          boolean usePack = false;
>          boolean useVersion = false;
>  
> -        ResourcesDesc[] descs = file.getResourceDescs();
> +        ResourcesDesc[] descs = file.getResourcesDescs();
>          for (ResourcesDesc desc: descs) {
>              JARDesc[] jars = desc.getJARs();
>              for (JARDesc aJar: jars) {

> diff -r 0768433ea58d netx/net/sourceforge/jnlp/PluginBridge.java
> --- a/netx/net/sourceforge/jnlp/PluginBridge.java	Thu Feb 10 17:25:18 2011 -0500
> +++ b/netx/net/sourceforge/jnlp/PluginBridge.java	Thu Feb 10 19:11:05 2011 -0500
> @@ -244,6 +244,14 @@
>          };
>      }
>  
> +    /**
> +     * Returns the resources section of the JNLP file for the
> +     * specified locale, os, and arch.
> +     */
> +    public ResourcesDesc[] getResourcesDescs(final Locale locale, final String os, final String arch) {
> +        return new ResourcesDesc[] { getResources(locale, os, arch) };
> +    }
> +
>      public boolean isApplet() {
>          return true;
>      }


-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37



More information about the distro-pkg-dev mailing list