Loading ...
Sorry, an error occurred while loading the content.

ConcurrentModificationException

Expand Messages
  • supaphr33k
    I did try to search the archive before posting this. Yahoo groups archive searching leaves much to be desired. Some update to the newer JSX library has caused
    Message 1 of 2 , Dec 2, 2004
    • 0 Attachment
      I did try to search the archive before posting this. Yahoo groups
      archive searching leaves much to be desired.

      Some update to the newer JSX library has caused
      a "ConcurrentModificationException" to be thrown in previously
      working code.

      The following code works with "freeJSX1.0.7.5.jar".
      It does not work with "JSX2.2.3.5.jar" or the commercial version we
      purchased.

      [CODE]
      Vector v = new Vector();
      v.add("1");

      Enumeration enum = Collections.enumeration(v);
      //Enumeration enum = v.elements();

      String xmlString = object2XML(enum);
      Enumeration enum2 = (Enumeration) XML2Object(xmlString);
      while (enum2.hasMoreElements()) {
      enum2.nextElement();
      }
      [/CODE]

      Switching to the commented line for the "enum" declaration will allow
      the code to work. However due to API interfaces, it would require a
      large rewrite effort to stop using Collections.

      Stack trace is as follows, points to the line that calls nextElement.

      java.util.ConcurrentModificationException
      at java.util.AbstractList$Itr.checkForComodification
      (AbstractList.java:448)
      at java.util.AbstractList$Itr.next(AbstractList.java:419)
      at java.util.Collections$6.nextElement(Collections.java:2479)
      at com.steve.test.WSTest.main(WSTest.java:39)


      Any help would be greatly appreciated.
    • Brendan Macmillan
      hi Supaphr33k, Thanks very much for this bug report - it s been a long time since we had a challenge, and it s good to get back into it. I ve duplicated your
      Message 2 of 2 , Dec 3, 2004
      • 0 Attachment
        hi Supaphr33k,

        Thanks very much for this bug report - it's been a long time since we
        had a challenge, and it's good to get back into it.

        I've duplicated your problem, diagnosed it, fixed it and released it:
        http://www.jsx.org/download.html

        I'd appreciate it if you'd download it, and if it's not working
        perfectly, please let us know right away.

        (it was due to a change that was needed for exact internal
        compatibility with Java Object Serialization, but as a result of your
        report, a better way to achieve that aim became apparent, which also
        fixes the bug you found).

        > I did try to search the archive before posting this.
        Thanks. :-)

        > Yahoo groups archive searching leaves much to be desired.
        Why is that? - is it because of the advertisements? I've found the
        search itself quite good. Can you recommend another web-based email
        search that you've liked? (especially when used for support of another
        project)
        BTW: this problem has *never* been reported before, which may help
        explain the difficulty in searching.


        BTW: which company do you work for (that bought a commercial license)?
        (for our records).

        Also, one of our ISPs is down for the weekend (!). To contact us
        before Monday, please use the mailing list, or:
        company@...


        Thanks again for the bug report, and have a great day!
        Brendan

        > Some update to the newer JSX library has caused
        > a "ConcurrentModificationException" to be thrown in previously
        > working code.
        >
        > The following code works with "freeJSX1.0.7.5.jar".
        > It does not work with "JSX2.2.3.5.jar" or the commercial version we
        > purchased.
        >
        > [CODE]
        > Vector v = new Vector();
        > v.add("1");
        >
        > Enumeration enum = Collections.enumeration(v);
        > //Enumeration enum = v.elements();
        >
        > String xmlString = object2XML(enum);
        > Enumeration enum2 = (Enumeration) XML2Object(xmlString);
        > while (enum2.hasMoreElements()) {
        > enum2.nextElement();
        > }
        > [/CODE]
        >
        > Switching to the commented line for the "enum" declaration will
        allow
        > the code to work. However due to API interfaces, it would require
        a
        > large rewrite effort to stop using Collections.
        >
        > Stack trace is as follows, points to the line that calls
        nextElement.
        >
        > java.util.ConcurrentModificationException
        > at java.util.AbstractList$Itr.checkForComodification
        > (AbstractList.java:448)
        > at java.util.AbstractList$Itr.next(AbstractList.java:419)
        > at java.util.Collections$6.nextElement(Collections.java:2479)
        > at com.steve.test.WSTest.main(WSTest.java:39)
        >
        >
        > Any help would be greatly appreciated.
      Your message has been successfully submitted and would be delivered to recipients shortly.