Skip to content

Commit

Permalink
Enable detection of refactoring
Browse files Browse the repository at this point in the history
Rename Class	org.springframework.test.context.bean.override.convention.TestBeanOverrideProcessor.MethodConventionOverrideMetadata renamed to org.springframework.test.context.bean.override.convention.TestBeanOverrideProcessor.TestBeanOverrideMetadata
spring-projects/spring-framework@2d33aac
  • Loading branch information
tsantalis committed Jan 9, 2025
1 parent f0ea722 commit 04d2c16
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/gr/uom/java/xmi/UMLAbstractClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,14 @@ public MatchResult hasCommonAttributesAndOperations(UMLAbstractClass umlClass) {
String commonSuffix = PrefixSuffixUtils.longestCommonSuffix(this.name, umlClass.name);
String[] tokens1 = LeafType.CAMEL_CASE_SPLIT_PATTERN.split(this.name);
String[] tokens2 = LeafType.CAMEL_CASE_SPLIT_PATTERN.split(umlClass.name);
int commonTokens = 0;
for(String token1 : tokens1) {
for(String token2 : tokens2) {
if(token1.equals(token2)) {
commonTokens++;
}
}
}
RenamePattern pattern = null;
if(!commonPrefix.isEmpty() || !commonSuffix.isEmpty()) {
int beginIndexS1 = this.name.indexOf(commonPrefix) + commonPrefix.length();
Expand Down Expand Up @@ -705,6 +713,13 @@ else if(operation.isConstructor() && !commonPrefix.isEmpty() && !commonSuffix.is
commonConstructors.add(operation);
}
}
else if(operation.isConstructor() && commonTokens >= Math.max(tokens1.length, tokens2.length)/2 &&
!this.isTopLevel() && !umlClass.isTopLevel() && this.getPackageName().equals(umlClass.getPackageName())) {
if(pattern != null && umlClass.containsOperationWithTheSameRenamePattern(operation, pattern.reverse())) {
commonOperations.add(operation);
commonConstructors.add(operation);
}
}
}
for(UMLOperation operation : umlClass.operations) {
if(!operation.isConstructor() && !operation.overridesObject()) {
Expand Down Expand Up @@ -746,6 +761,13 @@ else if(operation.isConstructor() && !commonPrefix.isEmpty() && !commonSuffix.is
commonConstructors.add(operation);
}
}
else if(operation.isConstructor() && commonTokens >= Math.max(tokens1.length, tokens2.length)/2 &&
!this.isTopLevel() && !umlClass.isTopLevel() && this.getPackageName().equals(umlClass.getPackageName())) {
if(pattern != null && this.containsOperationWithTheSameRenamePattern(operation, pattern)) {
commonOperations.add(operation);
commonConstructors.add(operation);
}
}
}
List<UMLAttribute> commonAttributes = new ArrayList<UMLAttribute>();
List<UMLAttribute> identicalAttributes = new ArrayList<UMLAttribute>();
Expand Down

0 comments on commit 04d2c16

Please sign in to comment.