[rfc][icedtea-web] fix itweb-settings set command to allow duplicate strings

Jie Kang jkang at redhat.com
Thu Mar 12 15:14:42 UTC 2015



----- Original Message -----
> Hello,
> 
> This patch fixes the issue where the itweb-settings Set would not allow the
> key and value to be the same value.
> Such as set blah blah. This was due to the isKey() method using .indexOf()
> which would always return the index of the first "blah" registering two keys
> with no values. The fix is to just alternate between the two parts of the if
> statement. It does this by using null for key and checking when it is null,
> to assign a key. When a value is assigned and written then the key is
> assigned back to null.

Hello,

Thanks for the fix :)

Nits below:

-            if (isKey(arg)) {
+            if (key == null) {

I think you should still make sure that the argument is actually a key before assigning it. So something like:

if (key == null && isKey(arg)) { [...] }


Also unit tests for this stuff would be great :D


Regards,

> 
> Thank you,
> Lukasz Dracz

-- 

Jie Kang

OpenJDK Team - Software Engineering Intern


More information about the distro-pkg-dev mailing list