Skip to content

Commit

Permalink
Improve variable declaration mappings in commit
Browse files Browse the repository at this point in the history
spring-projects/spring-framework@d912770
Rename Variable	specificAccessors : List<PropertyAccessor> to exactMatches : List<T> in method public getAccessorsToTry(targetType Class<?>, accessors List<T>) : List<T> from class org.springframework.expression.spel.ast.AstUtils
Rename Variable	generalAccessors : List<PropertyAccessor> to genericMatches : List<T> in method public getAccessorsToTry(targetType Class<?>, accessors List<T>) : List<T> from class org.springframework.expression.spel.ast.AstUtils
  • Loading branch information
tsantalis committed Dec 26, 2024
1 parent 4a44ffa commit 7b2adb2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/gr/uom/java/xmi/decomposition/LeafMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,22 @@ else if(!nestedUnderCatchBlockOfSameType1 && nestedUnderCatchBlockOfSameType2) {
else if(streamAPIMigration2 && !streamAPIMigration1) {
return 1;
}
if(this.getFragment1().getVariableDeclarations().size() > 0 && this.getFragment2().getVariableDeclarations().size() > 0 &&
o.getFragment1().getVariableDeclarations().size() > 0 && o.getFragment2().getVariableDeclarations().size() > 0 &&
Math.abs(distance1 - distance2) < 0.02) {
int depthDiff1 = Math.abs(this.getFragment1().getDepth() - this.getFragment2().getDepth());
int depthDiff2 = Math.abs(o.getFragment1().getDepth() - o.getFragment2().getDepth());
if(depthDiff1 != depthDiff2) {
return Integer.valueOf(depthDiff1).compareTo(Integer.valueOf(depthDiff2));
}
else {
int indexDiff1 = Math.abs(this.getFragment1().getIndex() - this.getFragment2().getIndex());
int indexDiff2 = Math.abs(o.getFragment1().getIndex() - o.getFragment2().getIndex());
if(indexDiff1 != indexDiff2) {
return Integer.valueOf(indexDiff1).compareTo(Integer.valueOf(indexDiff2));
}
}
}
return Double.compare(distance1, distance2);
}
else {
Expand Down

0 comments on commit 7b2adb2

Please sign in to comment.