[rfc][icedtea-web] Option Parser

Lukasz Dracz ldracz at redhat.com
Fri Aug 22 14:44:17 UTC 2014


Hello,

I refactored the way Boot parses arguments by creating an Option Parser to use. The reason is that this code could be reused in other parts, instead of writing duplicate code. I have also added unit tests for the parser.

2014-08-22  Lukasz Dracz  <ldracz at redhat.com>

    Refactored parsing in Boot to use a new class Option Parser
    * netx/net/sourceforge/jnlp/runtime/Boot.java:
    (getOption, getOptions): removed
    (OptionParser): added
    * netx/net/sourceforge/jnlp/util/OptionParser.java:
    new class (getArgs, checkOption, isOption, getOptionValue)
    * tests/netx/unit/net/sourceforge/jnlp/util/OptionParserTest.java:
    added unit tests for OptionParser (testGetSingleOptionValue, 
    testGetSingleOptionMultipleValues, testGetDifferentOptionValues,
    testUnsupportedOptionValue, testSupportedOptionValueWithNoUse,
    testOptionValueWithNoArgument, testOneOptionMultipleTimesMultipleValues,
    testMultipleOptionsMultipleValues, testCheckOptionExists,
    testCheckOptionExistsAsNotFirstArg, testCheckOptionNotExists,
    testGetArgs, testGetArgsCantModifyValue)

Thank you,
Lukasz Dracz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: optionParser.patch
Type: text/x-patch
Size: 19547 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140822/68a00251/optionParser-0001.patch>


More information about the distro-pkg-dev mailing list