Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.9.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      jdk5
    • Number of attachments :
      0

      Description

      Assume there is a class

      public class A {
      public void doSomething() throws Exception1, Exception2, ExceptionN

      { // code }

      }

      Suppose Exception1, and Exception2 are all subclasses of ExceptionN. The exception list returned is an unordered set. I am parsing this class to generate another class, which needs to handle the exceptions of method doSomething(). Sometimes the generated class has compile error. The generated code may looks like

      catch (ExceptionN e) {

      } catch (Exception1 e) {
      }

      Although the method doSomething exception list is not necessary as only more general exception is enough (doSomething() throws ExceptionN.

      This kind class is perfectly legal and exists in one production class.

      I would suggest change the set to list in class MethodDef (List exceptions = new ArrayList()

        Activity

        Hide
        Robert Scholte added a comment -

        Exceptions was a Set, so I think it's better just to change it's implementation. Now it's a LinkedHashSet, which should do the trick as well.

        Show
        Robert Scholte added a comment - Exceptions was a Set, so I think it's better just to change it's implementation. Now it's a LinkedHashSet, which should do the trick as well.
        Robert Scholte made changes -
        Field Original Value New Value
        Assignee Robert Scholte [ rfscholte ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Paul Hammant made changes -
        Fix Version/s 1.10 [ 15020 ]
        Fix Version/s 1.9.2 [ 15471 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            yusheng
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: