test/compiler/compilercontrol/share/method/SignatureType.java

Print this page
rev 9056 : [mq]: existing-directives

*** 27,36 **** --- 27,37 ---- import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.Arrays; + import java.util.regex.Pattern; /** * This class represents a signature of the method */ public class SignatureType extends MethodElementType {
*** 64,74 **** @Override public void setElement(String element) { if (element.isEmpty()) { setPattern(MethodDescriptor.PatternType.ANY); } else { ! super.setElement(element); } } @Override public boolean isValid() { --- 65,76 ---- @Override public void setElement(String element) { if (element.isEmpty()) { setPattern(MethodDescriptor.PatternType.ANY); } else { ! this.element = element; ! this.regexp = element; } } @Override public boolean isValid() {
*** 146,151 **** --- 148,161 ---- default: throw new IllegalArgumentException("ERROR: wrong pattern type " + patternType); } } + + @Override + public String getRegexp() { + if ("\\(.*\\).*".equals(regexp)) { + return regexp; + } + return Pattern.quote(regexp); + } }