Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
*/
public class ExternalMethodNotFoundWarning extends LJWarning {

private final String methodName;
private final String signature;
private final String className;
private final String[] overloads;

public ExternalMethodNotFoundWarning(SourcePosition position, String message, String methodName, String className,
public ExternalMethodNotFoundWarning(SourcePosition position, String message, String signature, String className,
String[] overloads) {
super(message, position);
this.methodName = methodName;
this.signature = signature;
this.className = className;
this.overloads = overloads;
}

public String getMethodName() {
return methodName;
public String getSignature() {
return signature;
}

public String getClassName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ public <R> void visitCtMethod(CtMethod<R> method) {
boolean isConstructor = method.getSimpleName().equals(targetType.getSimpleName());
if (isConstructor) {
if (!constructorExists(targetType, method)) {
String message = String.format("Could not find constructor '%s' for '%s'", method.getSignature(),
prefix);
String signature = method.getSignature();
String message = String.format("Could not find constructor '%s' for '%s'", signature, prefix);
String[] overloads = getOverloads(targetType, method);
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, signature,
prefix, overloads));
}
} else {
if (!methodExists(targetType, method)) {
String message = String.format("Could not find method '%s %s' for '%s'",
method.getType().getSimpleName(), method.getSignature(), prefix);
String signature = String.format("%s %s", method.getType().getSimpleName(), method.getSignature());
String message = String.format("Could not find method '%s' for '%s'", signature, prefix);
String[] overloads = getOverloads(targetType, method);
diagnostics.add(new ExternalMethodNotFoundWarning(method.getPosition(), message, method.getSignature(),
prefix, overloads));
diagnostics.add(
new ExternalMethodNotFoundWarning(method.getPosition(), message, signature, prefix, overloads));
return;
}
}
Expand Down
Loading