[rfc][icedtea-web] Very small SecurityDialog refactor

Andrew Azores aazores at redhat.com
Wed Sep 4 07:58:47 PDT 2013


On 08/29/2013 06:47 AM, Jiri Vanek wrote:
> On 08/26/2013 09:49 PM, Andrew Azores wrote:
>> Changelog:
>> * /netx/net/sourceforge/jnlp/security/SecurityDialogs.java: 
>> refactored return statements following
>> getUserResponse(message) calls
>>
>> Not much to explain here really. Some of the if-else going on was a 
>> bit unnecessary since the return
>> value is boolean as well, and checking if the reference is null 
>> before using the instanceof operator
>> is also not needed as "null instanceof Foo" is defined as false anyway.
>>
>> Thanks,
>>
> hmhmh. You have compressed three blocks of copy pasted code into three 
> small blocks of copy pasted code :)
>
> I would like to move the verbose/compressed code to separate method 
> like getIntegerResponseAsBoolean (with javadoc in case of compressed 
> one - for us dummies from east ;), and with unittest ) and then use 
> this method. As I'm looking into code around, more such an copypasted 
> code is spread here...
> The last hunk looks less readable after the change, but as you wish.
>
> Otherwise nice cleanup.
>
> J.

Alright, made that new method along with tests, and de-compressed the 
code a little bit. Maybe it's a little more readable/obvious now than it 
was as my one-liner :)

Thanks,

-- 
Andrew A

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SecurityDialog_refactor.patch
Type: text/x-patch
Size: 7101 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130904/8eec7f7e/SecurityDialog_refactor.patch 


More information about the distro-pkg-dev mailing list