ClassVisitor { public static String removeParameterQualification(String _string) { final StringBuilder b = new StringBuilder(); final int i = _string.indexOf("("); final int j = _string.lastIndexOf(")"); if (i == -1 || j == -1) throw new IllegalArgumentException("Method has no round brackets: [" + _string + "]"); b.append(_string.substring(0, i + 1)); b.append(ClassVisitor.removePackageContext(_string.substring(i + 1, j))); b.append(_string.substring(j)); return b.toString(); } ClassVisitor(CtClass _c); Set<ConstructId> getConstructs(); synchronized boolean isInstrumented(); synchronized Set<ConstructId> visitMethods(boolean _instrument); synchronized Set<ConstructId> visitConstructors(boolean _instrument); synchronized void setOriginalArchiveDigest(String _sha1); synchronized void setAppContext(Application _ctx); synchronized void finalizeInstrumentation(); byte[] getBytecode(); synchronized void addBooleanMember(String _field_name, boolean _value, boolean _final); synchronized void addIntMember(String _field_name, boolean _final); String getUniqueMemberName(String _prefix, String _construct_name, boolean _random_part); static String removeParameterQualification(String _string); static String removePackageContext(String _string); JavaId getJavaId(); CtClass getCtClass(); String getArchiveDigest(); synchronized Application getAppContext(); String getQname(); synchronized String getOriginalArchiveDigest(); static final String prettyPrint(String _src);  }
@Test public void testFixQName() { assertTrue(ClassVisitor.removeParameterQualification("a.b.c.Class()").equals("a.b.c.Class()")); assertTrue( ClassVisitor.removeParameterQualification("a.b.c.Class(int)").equals("a.b.c.Class(int)")); assertTrue( ClassVisitor.removeParameterQualification("a.b.c.Class(int,a.b.C)") .equals("a.b.c.Class(int,C)")); assertTrue( ClassVisitor.removeParameterQualification("a.b.c.Class(int,C,boolean,a.b.c.ddd.Test)") .equals("a.b.c.Class(int,C,boolean,Test)")); }