Skip to content

Commit 1d0a755

Browse files
authored
Fix External Method Not Found (#228)
1 parent a52518d commit 1d0a755

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

liquidjava-verifier/src/main/java/liquidjava/diagnostics/warnings/ExternalMethodNotFoundWarning.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
*/
1010
public class ExternalMethodNotFoundWarning extends LJWarning {
1111

12-
private final String methodName;
12+
private final String signature;
1313
private final String className;
1414
private final String[] overloads;
1515

16-
public ExternalMethodNotFoundWarning(SourcePosition position, String message, String methodName, String className,
16+
public ExternalMethodNotFoundWarning(SourcePosition position, String message, String signature, String className,
1717
String[] overloads) {
1818
super(message, position);
19-
this.methodName = methodName;
19+
this.signature = signature;
2020
this.className = className;
2121
this.overloads = overloads;
2222
}
2323

24-
public String getMethodName() {
25-
return methodName;
24+
public String getSignature() {
25+
return signature;
2626
}
2727

2828
public String getClassName() {

liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/ExternalRefinementTypeChecker.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ public <R> void visitCtMethod(CtMethod<R> method) {
7272
boolean isConstructor = method.getSimpleName().equals(targetType.getSimpleName());
7373
if (isConstructor) {
7474
if (!constructorExists(targetType, method)) {
75-
String message = String.format("Could not find constructor '%s' for '%s'", method.getSignature(),
76-
prefix);
75+
String signature = method.getSignature();
76+
String message = String.format("Could not find constructor '%s' for '%s'", signature, prefix);
7777
String[] overloads = getOverloads(targetType, method);
78-
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
78+
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, signature,
7979
prefix, overloads));
8080
}
8181
} else {
8282
if (!methodExists(targetType, method)) {
83-
String message = String.format("Could not find method '%s %s' for '%s'",
84-
method.getType().getSimpleName(), method.getSignature(), prefix);
83+
String signature = String.format("%s %s", method.getType().getSimpleName(), method.getSignature());
84+
String message = String.format("Could not find method '%s' for '%s'", signature, prefix);
8585
String[] overloads = getOverloads(targetType, method);
86-
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
87-
prefix, overloads));
86+
diagnostics.add(
87+
new ExternalMethodNotFoundWarning(method.getPosition(), message, signature, prefix, overloads));
8888
return;
8989
}
9090
}

0 commit comments

Comments
 (0)