Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-195

Fix some iterator boundary check bugs.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • None
    • None
    • CLI-2.x
    • JDK 5

    Description

      This patch can be applied to the current svn checked out version of cli2 (2010-Feb-9th).
      It will make the cli2 compatible to JDK 5 generic type, eliminating all compiling warnings,
      and fix some minor but critical iterator boundary check bugs.

      The bug could be found in the following way: creating some Option object WITHOUT description,
      and use a HelpFormatter to print the helping message, then a NoSuchElementException will be thrown.

      This is because the HelpFormatter.printHelp() did not correctly check the empty status of descriptionIterator.

      And moreover, some implementation of Option.processParent() method did not check the empty status
      of the argument "ListIterator<String> arguments".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              starfish Haixing Hu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 10m
                  10m
                  Remaining:
                  Remaining Estimate - 10m
                  10m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified