Skip to content

Commit

Permalink
Improvement over previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Sep 20, 2024
1 parent 4fb5333 commit f5427b4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,12 @@ private boolean nestedUnderCatchBlockOfSameExceptionType() {
comp2.getLocationInfo().getCodeElementType().equals(CodeElementType.CATCH_CLAUSE)) {
List<VariableDeclaration> exceptionDeclarations1 = comp1.getVariableDeclarations();
List<VariableDeclaration> exceptionDeclarations2 = comp2.getVariableDeclarations();
if(exceptionDeclarations1.toString().equals(exceptionDeclarations2.toString()) && exceptionDeclarations1.size() > 0) {
return true;
if(exceptionDeclarations1.size() > 0 && exceptionDeclarations2.size() > 0) {
VariableDeclaration v1 = exceptionDeclarations1.get(0);
VariableDeclaration v2 = exceptionDeclarations2.get(0);
if(v1.getType().equals(v2.getType())) {
return true;
}
}
}
return false;
Expand Down

0 comments on commit f5427b4

Please sign in to comment.