From f5427b42f8ac510526e8c45def7aab9afd06a521 Mon Sep 17 00:00:00 2001 From: tsantalis Date: Fri, 20 Sep 2024 13:09:18 -0400 Subject: [PATCH] Improvement over previous commit --- .../java/gr/uom/java/xmi/decomposition/LeafMapping.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java b/src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java index a4e56c2d4..957e80cb5 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java @@ -1103,8 +1103,12 @@ private boolean nestedUnderCatchBlockOfSameExceptionType() { comp2.getLocationInfo().getCodeElementType().equals(CodeElementType.CATCH_CLAUSE)) { List exceptionDeclarations1 = comp1.getVariableDeclarations(); List 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;