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 56ae81525..ad1daacbf 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/UMLOperationBodyMapper.java @@ -53,6 +53,7 @@ import gr.uom.java.xmi.diff.UMLAbstractClassDiff; import gr.uom.java.xmi.diff.UMLClassMoveDiff; import gr.uom.java.xmi.diff.UMLCommentListDiff; +import gr.uom.java.xmi.diff.UMLDocumentationDiffProvider; import gr.uom.java.xmi.diff.UMLJavadocDiff; import gr.uom.java.xmi.diff.UMLModelDiff; import gr.uom.java.xmi.diff.UMLOperationDiff; @@ -83,7 +84,7 @@ import org.refactoringminer.api.RefactoringType; import org.refactoringminer.util.PrefixSuffixUtils; -public class UMLOperationBodyMapper implements Comparable { +public class UMLOperationBodyMapper implements Comparable, UMLDocumentationDiffProvider { private VariableDeclarationContainer container1; private VariableDeclarationContainer container2; private Set mappings; 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 52623471c..f6acfc64d 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLAttributeDiff.java @@ -16,7 +16,7 @@ import gr.uom.java.xmi.UMLAttribute; import gr.uom.java.xmi.UMLOperation; import gr.uom.java.xmi.UMLParameter; -import gr.uom.java.xmi.decomposition.AbstractCall; +import gr.uom.java.xmi.VariableDeclarationContainer; import gr.uom.java.xmi.decomposition.AbstractCodeFragment; import gr.uom.java.xmi.decomposition.AbstractCodeMapping; import gr.uom.java.xmi.decomposition.AbstractExpression; @@ -24,10 +24,8 @@ import gr.uom.java.xmi.decomposition.UMLOperationBodyMapper; import gr.uom.java.xmi.decomposition.VariableDeclaration; import gr.uom.java.xmi.decomposition.VariableReferenceExtractor; -import gr.uom.java.xmi.decomposition.replacement.Replacement; -import gr.uom.java.xmi.decomposition.replacement.Replacement.ReplacementType; -public class UMLAttributeDiff { +public class UMLAttributeDiff implements UMLDocumentationDiffProvider { private UMLAttribute removedAttribute; private UMLAttribute addedAttribute; private boolean visibilityChanged; @@ -210,6 +208,14 @@ public UMLCommentListDiff getCommentListDiff() { return commentListDiff; } + public VariableDeclarationContainer getContainer1() { + return removedAttribute; + } + + public VariableDeclarationContainer getContainer2() { + return addedAttribute; + } + public Optional getInitializerMapper() { return Optional.ofNullable(mapper); } diff --git a/src/main/java/gr/uom/java/xmi/diff/UMLDocumentationDiffProvider.java b/src/main/java/gr/uom/java/xmi/diff/UMLDocumentationDiffProvider.java new file mode 100644 index 000000000..b4ced0302 --- /dev/null +++ b/src/main/java/gr/uom/java/xmi/diff/UMLDocumentationDiffProvider.java @@ -0,0 +1,12 @@ +package gr.uom.java.xmi.diff; + +import java.util.Optional; + +import gr.uom.java.xmi.VariableDeclarationContainer; + +public interface UMLDocumentationDiffProvider { + public Optional getJavadocDiff(); + public UMLCommentListDiff getCommentListDiff(); + public VariableDeclarationContainer getContainer1(); + public VariableDeclarationContainer getContainer2(); +} 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 2a99bb859..2cc755cd4 100644 --- a/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java +++ b/src/main/java/gr/uom/java/xmi/diff/UMLEnumConstantDiff.java @@ -11,9 +11,10 @@ import gr.uom.java.xmi.UMLAnnotation; import gr.uom.java.xmi.UMLAnonymousClass; import gr.uom.java.xmi.UMLEnumConstant; +import gr.uom.java.xmi.VariableDeclarationContainer; import gr.uom.java.xmi.decomposition.UMLOperationBodyMapper; -public class UMLEnumConstantDiff { +public class UMLEnumConstantDiff implements UMLDocumentationDiffProvider { private UMLEnumConstant removedEnumConstant; private UMLEnumConstant addedEnumConstant; private boolean renamed; @@ -79,6 +80,14 @@ public UMLCommentListDiff getCommentListDiff() { return commentListDiff; } + public VariableDeclarationContainer getContainer1() { + return removedEnumConstant; + } + + public VariableDeclarationContainer getContainer2() { + return addedEnumConstant; + } + public Optional getAnonymousClassDiff() { return Optional.ofNullable(anonymousClassDiff); }