diff --git a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java index 1c6151871..56ae81525 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java @@ -1223,12 +1223,6 @@ public UMLOperationBodyMapper(UMLAttribute removedAttribute, UMLAttribute addedA leaves2.add(expression2); processLeaves(leaves1, leaves2, new LinkedHashMap(), false); } - if(removedAttribute.getJavadoc() != null && addedAttribute.getJavadoc() != null) { - UMLJavadocDiff diff = new UMLJavadocDiff(removedAttribute.getJavadoc(), addedAttribute.getJavadoc()); - this.javadocDiff = Optional.of(diff); - } - this.commentListDiff = new UMLCommentListDiff(removedAttribute.getComments(), addedAttribute.getComments()); - checkUnmatchedStatementsBeingCommented(); } public UMLOperationBodyMapper(UMLInitializer initializer1, UMLInitializer initializer2, UMLAbstractClassDiff classDiff) throws RefactoringMinerTimedOutException { diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java b/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java index c3f872e18..52623471c 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java @@ -46,6 +46,8 @@ public class UMLAttributeDiff { private UMLOperationBodyMapper mapper; private UMLAbstractClassDiff classDiff; private UMLModelDiff modelDiff; + private Optional javadocDiff = Optional.empty(); + private UMLCommentListDiff commentListDiff; public UMLAttributeDiff(UMLAttribute removedAttribute, UMLAttribute addedAttribute, UMLAbstractClassDiff classDiff, UMLModelDiff modelDiff) throws RefactoringMinerTimedOutException { this.classDiff = classDiff; @@ -125,6 +127,11 @@ else if(!removedAttribute.getType().equalsQualified(addedAttribute.getType())) this.annotationListDiff = new UMLAnnotationListDiff(removedAttribute.getAnnotations(), addedAttribute.getAnnotations()); AbstractExpression initializer1 = removedAttribute.getVariableDeclaration().getInitializer(); AbstractExpression initializer2 = addedAttribute.getVariableDeclaration().getInitializer(); + if(removedAttribute.getJavadoc() != null && addedAttribute.getJavadoc() != null) { + UMLJavadocDiff diff = new UMLJavadocDiff(removedAttribute.getJavadoc(), addedAttribute.getJavadoc()); + this.javadocDiff = Optional.of(diff); + } + this.commentListDiff = new UMLCommentListDiff(removedAttribute.getComments(), addedAttribute.getComments()); if(initializer1 != null && initializer2 != null) { if(!initializer1.getExpression().equals(initializer2.getExpression())) { initializerChanged = true; @@ -195,6 +202,14 @@ public boolean isQualifiedTypeChanged() { return qualifiedTypeChanged; } + public Optional getJavadocDiff() { + return javadocDiff; + } + + public UMLCommentListDiff getCommentListDiff() { + return commentListDiff; + } + public Optional getInitializerMapper() { return Optional.ofNullable(mapper); } diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java b/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java index 60f27cebb..2a99bb859 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java @@ -20,6 +20,8 @@ public class UMLEnumConstantDiff { private boolean argumentsChanged; private UMLAnnotationListDiff annotationListDiff; private UMLAnonymousClassDiff anonymousClassDiff; + private Optional javadocDiff = Optional.empty(); + private UMLCommentListDiff commentListDiff; private Set refactorings = new LinkedHashSet(); public UMLEnumConstantDiff(UMLEnumConstant removedEnumConstant, UMLEnumConstant addedEnumConstant, UMLAbstractClassDiff classDiff, UMLModelDiff modelDiff) throws RefactoringMinerTimedOutException { @@ -46,6 +48,11 @@ public UMLEnumConstantDiff(UMLEnumConstant removedEnumConstant, UMLEnumConstant } } } + if(removedEnumConstant.getJavadoc() != null && addedEnumConstant.getJavadoc() != null) { + UMLJavadocDiff diff = new UMLJavadocDiff(removedEnumConstant.getJavadoc(), addedEnumConstant.getJavadoc()); + this.javadocDiff = Optional.of(diff); + } + this.commentListDiff = new UMLCommentListDiff(removedEnumConstant.getComments(), addedEnumConstant.getComments()); } public UMLEnumConstant getRemovedEnumConstant() { @@ -64,6 +71,14 @@ public boolean isArgumentsChanged() { return argumentsChanged; } + public Optional getJavadocDiff() { + return javadocDiff; + } + + public UMLCommentListDiff getCommentListDiff() { + return commentListDiff; + } + public Optional getAnonymousClassDiff() { return Optional.ofNullable(anonymousClassDiff); }