Include class patterns into interceptor's toString

This commit is contained in:
Andrey Breslav
2013-05-12 11:09:41 +02:00
parent 8d22c038d5
commit 17ddfb6f59
2 changed files with 6 additions and 2 deletions
@@ -95,6 +95,7 @@ public class InterceptionInstrumenter {
String methodName = nameFromAnnotation.isEmpty() ? field.getName() : nameFromAnnotation;
MethodInstrumenterImpl instrumenter = new MethodInstrumenterImpl(
field.getDeclaringClass().getSimpleName() + "." + field.getName(),
classPattern,
compilePattern(methodName),
compilePattern(annotation.erasedSignature()),
annotation.allowMultipleMatches(),
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
class MethodInstrumenterImpl implements MethodInstrumenter {
private final String debugName;
private final Pattern classPattern;
private final Pattern namePattern;
private final Pattern descPattern;
private final boolean allowMultipleMatches;
@@ -29,7 +30,8 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
private final boolean logApplications;
public MethodInstrumenterImpl(
String debugName, Pattern namePattern,
String debugName,
Pattern classPattern, Pattern namePattern,
Pattern descPattern,
boolean allowMultipleMatches,
List<MethodData> enterData,
@@ -37,6 +39,7 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
boolean logApplications
) {
this.debugName = debugName;
this.classPattern = classPattern;
this.namePattern = namePattern;
this.descPattern = descPattern;
this.allowMultipleMatches = allowMultipleMatches;
@@ -74,6 +77,6 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
@Override
public String toString() {
return debugName + "[" + namePattern + " " + descPattern + (allowMultipleMatches ? " multiple" : "") + "]";
return debugName + "[" + classPattern + ":" + namePattern + " " + descPattern + (allowMultipleMatches ? " multiple" : "") + "]";
}
}