Details
-
Type: Bug
-
Status: Resolved
-
Priority: 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 :
Description
Assume there is a class
public class A {
public void doSomething() throws Exception1, Exception2, ExceptionN
}
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
Field | Original Value | New Value |
---|---|---|
Assignee | Robert Scholte [ rfscholte ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 1.10 [ 15020 ] | |
Fix Version/s | 1.9.2 [ 15471 ] |
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.