Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 0.5
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      The Enumeration in org.apache.commons.discovery.tools.Service is broken - it
      will only work in the (admittedly common) case where you do:

      while(e.hasMoreElements()) e.nextElement();

      If you repeatedly call nextElement(), you will get the wrong results. In
      particular, this uggly but technically correct code will fail to behave sanely:

      try

      { while(true) e.nextElement(); }

      catch (NoSuchElementException e) {
      }

      The code needs hacking arround to look something more like this:

      return new Enumeration() {
      private Object object = getNextClassInstance();

      public boolean hasMoreElements()

      { return object != null; }

      public Object nextElement() {
      if(object == null)

      { throw new NoSuchElementException(); }

      Object obj = object;
      object = getNextClassInstance();
      return obj;
      }

      private Object getNextClassInstance()

      { // as before }

      };

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2676d 10h 11m 1 Simone Tripodi 08/Apr/11 07:53
        Resolved Resolved Closed Closed
        54d 13h 47m 1 Simone Tripodi 01/Jun/11 21:41
        Simone Tripodi made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Simone Tripodi added a comment -

        included in discovery-05 release

        Show
        Simone Tripodi added a comment - included in discovery-05 release
        Simone Tripodi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Simone Tripodi [ simone.tripodi ]
        Fix Version/s 0.5 [ 12312208 ]
        Resolution Fixed [ 1 ]
        Hide
        Simone Tripodi added a comment -

        Fixed on trunk, see Service r1090139

        Show
        Simone Tripodi added a comment - Fixed on trunk, see Service r1090139
        Henri Yandell made changes -
        Bugzilla Id 25357
        Fix Version/s 0.4 [ 12312156 ]
        Hide
        Henri Yandell added a comment -

        Punting this to beyond 0.4 - Aiming to get a 0.4 released with the latest in SVN and then we'll see if any activity ever happens.

        Show
        Henri Yandell added a comment - Punting this to beyond 0.4 - Aiming to get a 0.4 released with the latest in SVN and then we'll see if any activity ever happens.
        Hide
        Henri Yandell added a comment -

        However... I also don't want to go changing the source much before getting a release out. Tempted to push this to 'later', which will probably be 'never'.

        Show
        Henri Yandell added a comment - However... I also don't want to go changing the source much before getting a release out. Tempted to push this to 'later', which will probably be 'never'.
        Henri Yandell made changes -
        Bugzilla Id 25357
        Fix Version/s 0.4 [ 12312156 ]
        Hide
        Henri Yandell added a comment -

        Can't say I see why the change requests can't be made. Doesn't seem like it would hurt anything for the action code to move from the has(..) method to the next(..) method.

        Any thoughts?

        Show
        Henri Yandell added a comment - Can't say I see why the change requests can't be made. Doesn't seem like it would hurt anything for the action code to move from the has(..) method to the next(..) method. Any thoughts?
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311757 ]
        Henri Yandell made changes -
        Component/s Discovery [ 12311112 ]
        Key COM-994 DISCOVERY-3
        Project Commons [ 12310458 ] Commons Discovery [ 12310472 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 25357 12341145
        Hide
        Richard A. Sitze added a comment -

        acknowledge - this was a design choice... for better or worse.
        Will consider making [wholesale] changes to accomidate,
        but not likely to be done soon.

        Show
        Richard A. Sitze added a comment - acknowledge - this was a design choice... for better or worse. Will consider making [wholesale] changes to accomidate, but not likely to be done soon.
        matthew_pocock created issue -

          People

          • Assignee:
            Simone Tripodi
            Reporter:
            matthew_pocock
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development