[fyi][icedyea-web] allow null in SecurityValueValidator

Adam Domurad adomurad at redhat.com
Thu Feb 28 06:37:43 PST 2013


On 02/28/2013 09:35 AM, Jiri Vanek wrote:
> On 02/28/2013 09:18 AM, Jiri Vanek wrote:
>> I have overlooked that validate() is called also on fully constructed 
>> map, not only during its loading from file.
>> In fully constructed map the null is of course possible. If detected, 
>> then default is returned by getter.
>>
>> J.
>
> There was obvious NPE hidden in previous patch. Thanx Adam for catch.
>
> Version2 attached.
>
> J.
> diff -r 56c94adc52ea ChangeLog
> --- a/ChangeLog    Wed Feb 27 17:00:48 2013 +0100
> +++ b/ChangeLog    Thu Feb 28 15:33:49 2013 +0100
> @@ -1,3 +1,8 @@
> +2013-02-28  Jiri Vanek  <jvanek at redhat.com>
> +
> +    * netx/net/sourceforge/jnlp/config/SecurityValueValidator.java: 
> modifed
> +    null check - no considered as correct value as being valid value 
> in runtime.
> +
>  2013-02-27  Jiri Vanek  <jvanek at redhat.com>
>
>      Added backend and settings for extended applet security
> diff -r 56c94adc52ea 
> netx/net/sourceforge/jnlp/config/SecurityValueValidator.java
> --- a/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java 
>  Wed Feb 27 17:00:48 2013 +0100
> +++ b/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java 
>  Thu Feb 28 15:33:49 2013 +0100
> @@ -45,7 +45,10 @@
>      @Override
>      public void validate(Object value) throws IllegalArgumentException {
>          if (value == null) {
> -            throw new IllegalArgumentException("Value can't be null");
> +            //null is correct, it means it is not user set

Really small nit:   I find a space after // more readable

> +            //and so defautl hsoudl be sued whatever it is

s/defautl hsoudl be sued/the default should be used/

> +            //returning to prevent NPE in fromString

I think we can do without this comment. It isn't necessary to understand 
the code.

> +            return;
>          }
>          if (value instanceof AppletSecurityLevel) {
>              //??

Otherwise looks good (feel free to push).

Thanks.
-Adam




More information about the distro-pkg-dev mailing list