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; String methodName = nameFromAnnotation.isEmpty() ? field.getName() : nameFromAnnotation;
MethodInstrumenterImpl instrumenter = new MethodInstrumenterImpl( MethodInstrumenterImpl instrumenter = new MethodInstrumenterImpl(
field.getDeclaringClass().getSimpleName() + "." + field.getName(), field.getDeclaringClass().getSimpleName() + "." + field.getName(),
classPattern,
compilePattern(methodName), compilePattern(methodName),
compilePattern(annotation.erasedSignature()), compilePattern(annotation.erasedSignature()),
annotation.allowMultipleMatches(), annotation.allowMultipleMatches(),
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
class MethodInstrumenterImpl implements MethodInstrumenter { class MethodInstrumenterImpl implements MethodInstrumenter {
private final String debugName; private final String debugName;
private final Pattern classPattern;
private final Pattern namePattern; private final Pattern namePattern;
private final Pattern descPattern; private final Pattern descPattern;
private final boolean allowMultipleMatches; private final boolean allowMultipleMatches;
@@ -29,7 +30,8 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
private final boolean logApplications; private final boolean logApplications;
public MethodInstrumenterImpl( public MethodInstrumenterImpl(
String debugName, Pattern namePattern, String debugName,
Pattern classPattern, Pattern namePattern,
Pattern descPattern, Pattern descPattern,
boolean allowMultipleMatches, boolean allowMultipleMatches,
List<MethodData> enterData, List<MethodData> enterData,
@@ -37,6 +39,7 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
boolean logApplications boolean logApplications
) { ) {
this.debugName = debugName; this.debugName = debugName;
this.classPattern = classPattern;
this.namePattern = namePattern; this.namePattern = namePattern;
this.descPattern = descPattern; this.descPattern = descPattern;
this.allowMultipleMatches = allowMultipleMatches; this.allowMultipleMatches = allowMultipleMatches;
@@ -74,6 +77,6 @@ class MethodInstrumenterImpl implements MethodInstrumenter {
@Override @Override
public String toString() { public String toString() {
return debugName + "[" + namePattern + " " + descPattern + (allowMultipleMatches ? " multiple" : "") + "]"; return debugName + "[" + classPattern + ":" + namePattern + " " + descPattern + (allowMultipleMatches ? " multiple" : "") + "]";
} }
} }