|
73 | 73 | */ |
74 | 74 | public class DebuggerTransformer implements ClassFileTransformer { |
75 | 75 | private static final Logger log = LoggerFactory.getLogger(DebuggerTransformer.class); |
76 | | - private static final String CANNOT_FIND_METHOD = "Cannot find method %s::%s"; |
| 76 | + private static final String CANNOT_FIND_METHOD = "Cannot find method %s::%s%s"; |
77 | 77 | private static final String INSTRUMENTATION_FAILS = "Instrumentation fails for %s"; |
78 | 78 | private static final String CANNOT_FIND_LINE = "No executable code was found at %s:L%s"; |
79 | 79 | private static final Pattern COMMA_PATTERN = Pattern.compile(","); |
@@ -536,20 +536,22 @@ private void handleInstrumentationResult( |
536 | 536 | private void reportLocationNotFound( |
537 | 537 | ProbeDefinition definition, String className, String methodName) { |
538 | 538 | if (methodName != null) { |
539 | | - reportErrorForAllProbes(singletonList(definition), CANNOT_FIND_METHOD, className, methodName); |
| 539 | + String signature = definition.getWhere().getSignature(); |
| 540 | + signature = signature == null ? "" : signature; |
| 541 | + String msg = String.format(CANNOT_FIND_METHOD, className, methodName, signature); |
| 542 | + reportErrorForAllProbes(singletonList(definition), msg); |
540 | 543 | return; |
541 | 544 | } |
542 | 545 | // This is a line probe, so we don't report line not found because the line may be found later |
543 | 546 | // on a separate class files because probe was set on an inner/top-level class |
544 | 547 | } |
545 | 548 |
|
546 | 549 | private void reportInstrumentationFails(List<ProbeDefinition> definitions, String className) { |
547 | | - reportErrorForAllProbes(definitions, INSTRUMENTATION_FAILS, className, null); |
| 550 | + String msg = String.format(INSTRUMENTATION_FAILS, className); |
| 551 | + reportErrorForAllProbes(definitions, msg); |
548 | 552 | } |
549 | 553 |
|
550 | | - private void reportErrorForAllProbes( |
551 | | - List<ProbeDefinition> definitions, String format, String className, String location) { |
552 | | - String msg = String.format(format, className, location); |
| 554 | + private void reportErrorForAllProbes(List<ProbeDefinition> definitions, String msg) { |
553 | 555 | DiagnosticMessage diagnosticMessage = new DiagnosticMessage(DiagnosticMessage.Kind.ERROR, msg); |
554 | 556 | for (ProbeDefinition definition : definitions) { |
555 | 557 | addDiagnostics(definition, singletonList(diagnosticMessage)); |
|
0 commit comments