Eliminated false Extract Method in commit
@@ -1665,6 +1665,21 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
if(statement.getLocationInfo().subsumes(anonymous.getLocationInfo())) {
for(UMLOperation anonymousOperation : anonymous.getOperations()) {
if(anonymousOperation.getBody() != null) {
+ boolean exclude = false;
+ if(parentMapper != null) {
+ for(UMLAnonymousClassDiff anonymousClassDiff : parentMapper.getAnonymousClassDiffs()) {
+ for(UMLOperationBodyMapper anonymousMethodMapper : anonymousClassDiff.getOperationBodyMapperList()) {
+ if(anonymousMethodMapper.getContainer1().equals(anonymousOperation) || anonymousMethodMapper.getContainer2().equals(anonymousOperation)) {
+ if(anonymousMethodMapper.getContainer1().getBodyHashCode() == anonymousMethodMapper.getContainer2().getBodyHashCode() &&
+ anonymousOperation.getBodyHashCode() == anonymousMethodMapper.getContainer1().getBodyHashCode()) {
+ exclude = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if(!exclude) {
List<AbstractCodeFragment> anonymousClassLeaves = anonymousOperation.getBody().getCompositeStatement().getLeaves();
for(AbstractCodeFragment anonymousLeaf : anonymousClassLeaves) {
if(!leaves.contains(anonymousLeaf)) {
@@ -1689,6 +1704,7 @@ public class UMLOperationBodyMapper implements Comparable<UMLOperationBodyMapper
}
}
}
+ }
if(!statement.getLambdas().isEmpty()) {
for(LambdaExpressionObject lambda : statement.getLambdas()) {
if(lambda.getBody() != null) {
