Skip to content
Snippets Groups Projects

1.2.2

Merged René Schöne requested to merge dev into main
8 files
+ 79
27
Compare changes
  • Side-by-side
  • Inline
Files
8
  • b1715804
    1.2.2 · b1715804
    René Schöne authored
    - always use refined token method, especially when method from parent also exists
    - also restructure debug output
@@ -75,6 +75,18 @@ aspect ClassAnalysis {
@@ -75,6 +75,18 @@ aspect ClassAnalysis {
IntrinsicTokenMethod tokenMethod = new IntrinsicTokenMethod();
IntrinsicTokenMethod tokenMethod = new IntrinsicTokenMethod();
tokenMethod.setMethod(method);
tokenMethod.setMethod(method);
tokenMethod.setName(tokenName);
tokenMethod.setName(tokenName);
 
TokenMethod previousTokenMethodWithSameName = result.getTokenMethodWithName(tokenName);
 
if (method.getName().startsWith("refined__")) {
 
tokenMethod.setRefined(true);
 
// check for previous non-refined method with same name
 
if (previousTokenMethodWithSameName != null) {
 
// replace previous method instead of adding
 
result.setOtherMethod(tokenMethod, previousTokenMethodWithSameName.myIndex());
 
continue;
 
}
 
} else if (previousTokenMethodWithSameName != null && previousTokenMethodWithSameName.isIntrinsicTokenMethod() && previousTokenMethodWithSameName.asIntrinsicTokenMethod().getRefined()) {
 
continue;
 
}
result.addOtherMethod(tokenMethod);
result.addOtherMethod(tokenMethod);
break;
break;
case "Attribute":
case "Attribute":
@@ -140,6 +152,23 @@ aspect ClassAnalysis {
@@ -140,6 +152,23 @@ aspect ClassAnalysis {
return result;
return result;
}
}
 
TokenMethod ClassAnalysisResult.getTokenMethodWithName(String tokenName) {
 
// this can not be an attribute, since ClassAnalysisResult changes, and we do not use incremental eval
 
for (AnalysedMethod otherMethod : getOtherMethodList()) {
 
if (otherMethod.isTokenMethod()) {
 
TokenMethod tokenMethod = otherMethod.asTokenMethod();
 
if (tokenMethod.getName().equals(tokenName)) {
 
return tokenMethod;
 
}
 
}
 
}
 
return null;
 
}
 
 
inh int AnalysedMethod.myIndex();
 
eq ClassAnalysisResult.getContainmentMethod(int index).myIndex() = index;
 
eq ClassAnalysisResult.getOtherMethod(int index).myIndex() = index;
 
syn java.util.List<String> DumpAst.targetOrder(Class<?> clazz) {
syn java.util.List<String> DumpAst.targetOrder(Class<?> clazz) {
for (java.lang.reflect.Constructor<?> method : clazz.getConstructors()) {
for (java.lang.reflect.Constructor<?> method : clazz.getConstructors()) {
for (java.lang.annotation.Annotation annotation : method.getAnnotations()) {
for (java.lang.annotation.Annotation annotation : method.getAnnotations()) {
Loading