[RFC][icedtea-web] Fix NumberFormatException in PluginParameters

Jiri Vanek jvanek at redhat.com
Tue Mar 12 03:57:43 PDT 2013


On 03/09/2013 06:51 PM, Thomas Meyer wrote:
> Hi,
>
> Maybe introduced by changeset 741a105054af (Remove redundant HTML-tag
> scanner from ITW. Do not reconstruct tags.)
>
> Handling message: GetJavaObject instance 3 Worker #1/IsPriority=false/IsFree=false/Message=instance 3 reference -161 GetJavaObject
> Exception in thread "NetXPanel initializer" java.lang.NumberFormatException: For input string: "4294967295"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> 	at java.lang.Integer.parseInt(Integer.java:495)
> 	at java.lang.Integer.valueOf(Integer.java:582)
> 	at net.sourceforge.jnlp.PluginParameters.getWidth(PluginParameters.java:154)
> 	at sun.applet.PluginAppletPanelFactory$2.run(PluginAppletPanelFactory.java:104)
> 	at java.lang.Thread.run(Thread.java:722)
>
> Proposed fix:
>
> diff -r e19fe33c82df plugin/icedteanp/java/sun/applet/PluginParameterParser.java
> --- a/plugin/icedteanp/java/sun/applet/PluginParameterParser.java	Tue Mar 05 16:35:40 2013 -0500
> +++ b/plugin/icedteanp/java/sun/applet/PluginParameterParser.java	Sat Mar 09 18:50:17 2013 +0100
> @@ -1,6 +1,5 @@
>   package sun.applet;
>
> -import java.util.Arrays;
>   import java.util.HashMap;
>   import java.util.Map;
>
> @@ -60,7 +59,12 @@
>       }
>
>       static boolean isInt(String s) {
> -        return s.matches("^-?\\d+$");
> +        try{
> +            Integer.parseInt(s);
> +            return true;
> +        } catch(NumberFormatException e) {
> +            return false;
> +        }
>       }
>
>       /**
>
>

Yes please.
Althoug I do not like the exception-driven method, this appears much better then reinvite  more spherical circle where (my) original approach had to lead after (just little bit) deeper investigations...

J:(



More information about the distro-pkg-dev mailing list