File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/main/java/gr/uom/java/xmi/diff Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11package gr .uom .java .xmi .diff ;
22
3+ import static gr .uom .java .xmi .Constants .JAVA ;
4+
35import java .util .ArrayList ;
46import java .util .Collections ;
57import java .util .Iterator ;
1315import gr .uom .java .xmi .UMLAttribute ;
1416import gr .uom .java .xmi .UMLInitializer ;
1517import gr .uom .java .xmi .UMLOperation ;
18+ import gr .uom .java .xmi .decomposition .AbstractCodeMapping ;
1619import gr .uom .java .xmi .decomposition .UMLOperationBodyMapper ;
1720
1821public class UMLAnonymousClassDiff extends UMLAbstractClassDiff {
@@ -210,6 +213,15 @@ private void checkForOperationSignatureChanges() throws RefactoringMinerTimedOut
210213 UMLOperationBodyMapper mapper = new UMLOperationBodyMapper (operation1 , operation2 , classDiff );
211214 int mappings = mapper .mappingsWithoutBlocks ();
212215 if (mappings > 0 ) {
216+ if (!operation1 .getName ().equals (operation2 .getName ()) && mappings == 1 ) {
217+ for (AbstractCodeMapping mapping : mapper .getMappings ()) {
218+ String statement = mapping .getFragment1 ().getString ();
219+ if (statement .equals (JAVA .RETURN_TRUE ) || statement .equals (JAVA .RETURN_FALSE ) ||
220+ statement .equals (JAVA .RETURN_THIS ) || statement .equals (JAVA .RETURN_NULL ) || statement .equals (JAVA .RETURN_STATEMENT )) {
221+ mappings --;
222+ }
223+ }
224+ }
213225 int nonMappedElementsT1 = mapper .nonMappedElementsT1 ();
214226 int nonMappedElementsT2 = mapper .nonMappedElementsT2 ();
215227 if ((mappings > nonMappedElementsT1 && mappings > nonMappedElementsT2 ) ||
You can’t perform that action at this time.
0 commit comments