|
7 | 7 | import gr.uom.java.xmi.diff.UMLOperationDiff; |
8 | 8 | import gr.uom.java.xmi.diff.UMLTypeParameterListDiff; |
9 | 9 | import org.apache.commons.lang3.tuple.Pair; |
| 10 | +import org.refactoringminer.astDiff.matchers.statement.IgnoringCommentsLeafMatcher; |
10 | 11 | import org.refactoringminer.astDiff.models.ExtendedMultiMappingStore; |
11 | 12 | import org.refactoringminer.astDiff.models.OptimizationData; |
12 | 13 | import org.refactoringminer.astDiff.utils.Constants; |
13 | | -import org.refactoringminer.astDiff.matchers.statement.BasicTreeMatcher; |
14 | 14 | import org.refactoringminer.astDiff.matchers.statement.LeafMatcher; |
15 | 15 | import org.refactoringminer.astDiff.utils.Helpers; |
16 | 16 | import org.refactoringminer.astDiff.utils.TreeUtilFunctions; |
@@ -139,7 +139,12 @@ private void processOperationDiff(Tree srcTree, Tree dstTree, UMLOperationBodyMa |
139 | 139 | for (org.apache.commons.lang3.tuple.Pair<UMLAnnotation, UMLAnnotation> umlAnnotationUMLAnnotationPair : umlOperationDiff.getAnnotationListDiff().getCommonAnnotations()) { |
140 | 140 | Tree srcClassAnnotationTree = TreeUtilFunctions.findByLocationInfo(srcTree , umlAnnotationUMLAnnotationPair.getLeft().getLocationInfo()); |
141 | 141 | Tree dstClassAnnotationTree = TreeUtilFunctions.findByLocationInfo(dstTree, umlAnnotationUMLAnnotationPair.getRight().getLocationInfo()); |
142 | | - mappingStore.addMappingRecursively(srcClassAnnotationTree,dstClassAnnotationTree); |
| 142 | + if (srcClassAnnotationTree == null || dstClassAnnotationTree == null) continue; |
| 143 | + if (srcClassAnnotationTree.isIsoStructuralTo(dstClassAnnotationTree)) |
| 144 | + mappingStore.addMappingRecursively(srcClassAnnotationTree, dstClassAnnotationTree); |
| 145 | + else { |
| 146 | + new IgnoringCommentsLeafMatcher().match(srcClassAnnotationTree, dstClassAnnotationTree, mappingStore); |
| 147 | + } |
143 | 148 | } |
144 | 149 | Set<org.apache.commons.lang3.tuple.Pair<UMLType, UMLType>> commonExceptionTypes = umlOperationDiff.getCommonExceptionTypes(); |
145 | 150 | new KeywordMatcher(Constants.THROWS_KEYWORD, THROWS_KEYWORD_LABEL).match(srcTree, dstTree, mappingStore); |
|
0 commit comments