Skip to content

Commit

Permalink
Enable mapping of method pair for register() methods in files
Browse files Browse the repository at this point in the history
spring-test/src/main/java/org/springframework/test/context/bean/override/BeanOverrideBeanPostProcessor.java
spring-test/src/main/java/org/springframework/test/context/bean/override/BeanOverrideBeanFactoryPostProcessor.java
in commit
spring-projects/spring-framework@2d33aac
  • Loading branch information
tsantalis committed Jan 1, 2025
1 parent 8119683 commit b22a612
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/java/gr/uom/java/xmi/diff/UMLClassBaseDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,10 @@ private boolean mappedElementsMoreThanNonMappedT1AndT2(int mappings, UMLOperatio
}
}
}
boolean operationsWithSameName = operationBodyMapper.getContainer1().getName().equals(operationBodyMapper.getContainer2().getName()) &&
!operationBodyMapper.getContainer1().isConstructor() && !operationBodyMapper.getContainer2().isConstructor();
return (mappings > nonMappedElementsT1 && mappings > nonMappedElementsT2) ||
(operationsWithSameName && mappings >= nonMappedElementsT1 && mappings >= nonMappedElementsT2) ||
(nonMappedElementsT1 == 0 && mappings > Math.floor(nonMappedElementsT2/2.0) && !operationBodyMapper.involvesTestMethods()) ||
(nonMappedElementsT2 == 0 && mappings > Math.floor(nonMappedElementsT1/2.0) && !operationBodyMapper.involvesTestMethods() && !(this instanceof UMLClassMoveDiff)) ||
(nonMappedElementsT1 == 0 && exactMappings >= Math.floor(nonMappedElementsT2/2.0) && operationBodyMapper.getContainer1().isConstructor() == operationBodyMapper.getContainer2().isConstructor()) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public void testAllRefactorings() throws Exception {
GitHistoryRefactoringMinerImpl detector = new GitHistoryRefactoringMinerImpl();
TestBuilder test = new TestBuilder(detector, REPOS, Refactorings.All.getValue());
RefactoringPopulator.feedRefactoringsInstances(Refactorings.All.getValue(), Systems.FSE.getValue(), test);
test.assertExpectationsWithGitHubAPI(12404, 21, 226);
test.assertExpectationsWithGitHubAPI(12403, 21, 226);
}
}
4 changes: 2 additions & 2 deletions src/test/resources/oracle/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -77023,8 +77023,8 @@
"type": "Move Method",
"description": "Move Method private createProtocol(protocolConfig ProtocolConfiguration) : org.jgroups.conf.ProtocolConfiguration from class org.jboss.as.clustering.jgroups.JChannelFactory to private createProtocol(stack ProtocolStackConfiguration, protocol ProtocolConfiguration) : org.jgroups.conf.ProtocolConfiguration from class org.infinispan.server.jgroups.JChannelFactory",
"comment": "<p>it is move class/package, but there is a change in the signature</p>",
"validation": "TP",
"detectionTools": "RefactoringMiner, RefDiff",
"validation": "FP",
"detectionTools": "RefDiff",
"validators": "Matin, Nikos"
}, {
"type": "Move Method",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/oracle/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ eb500cca282e39d01a9882e1d0a83186da6d1a26, 3, 0, 0
8707194f003444a9fb8e00bffa2893ef0c2492c6, 4, 0, 0
f36b736cf1206dd1af794d6fb4cee967a3553b1f, 1, 0, 0
d403a0b2322a74dde824094d67b7997c1c371883, 4, 0, 1
8f446b6ddf540e1b1fefca34dd10f45ba7256095, 340, 3, 19
8f446b6ddf540e1b1fefca34dd10f45ba7256095, 339, 3, 19
0bb4cca1105fc6eb86e7c4b75bfff3dbbd55f0c8, 4, 0, 0
c142b8ca3e9f9467931987ee16805cf53e6bc5d2, 5, 0, 0
d7f781da42e54824c17875a6036d3448672637f5, 10, 0, 0
Expand Down

0 comments on commit b22a612

Please sign in to comment.