@Test public void should_make_signature_for_TestClass_constructor_int() throws Exception { MethodSignature3 signature = makeConstructorSignature(TestClass.class, findTestConstructor("TestClass(int)")); assertThat(signature, notNullValue()); assertThat( signature.getAspectjString(), is("protected io.codekvast.javaagent.util.SignatureUtilsTest.TestClass(int)")); assertThat( signature.getDeclaringType(), is("io.codekvast.javaagent.util.SignatureUtilsTest$TestClass")); assertThat(signature.getExceptionTypes(), is("")); assertThat(signature.getMethodName(), is("<init>")); assertThat(signature.getModifiers(), is("protected")); assertThat(signature.getPackageName(), is("io.codekvast.javaagent.util")); assertThat(signature.getParameterTypes(), is("int")); assertThat(signature.getReturnType(), is("")); assertThat(signature.getLocation(), matchesPattern(LOCATION_PATTERN)); }
public static MethodSignature3 makeConstructorSignature( Class<?> clazz, Constructor<?> constructor) { org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(clazz, constructor); if (aspectjSignature == null) { return null; } MethodLocation3 methodLocation = makeMethodLocation(aspectjSignature, makeLocation(clazz)); return MethodSignature3.builder() .aspectjString(stripModifiersAndReturnType(methodLocation.getSignature())) .bridge(false) .declaringType(aspectjSignature.getDeclaringTypeName()) .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes())) .methodName(aspectjSignature.getName()) .modifiers(Modifier.toString(aspectjSignature.getModifiers())) .packageName(aspectjSignature.getDeclaringType().getPackage().getName()) .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())) .returnType("") .synthetic(constructor.isSynthetic()) .location(methodLocation.getLocation()) .build(); }
SignatureUtils { public static MethodSignature3 makeConstructorSignature( Class<?> clazz, Constructor<?> constructor) { org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(clazz, constructor); if (aspectjSignature == null) { return null; } MethodLocation3 methodLocation = makeMethodLocation(aspectjSignature, makeLocation(clazz)); return MethodSignature3.builder() .aspectjString(stripModifiersAndReturnType(methodLocation.getSignature())) .bridge(false) .declaringType(aspectjSignature.getDeclaringTypeName()) .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes())) .methodName(aspectjSignature.getName()) .modifiers(Modifier.toString(aspectjSignature.getModifiers())) .packageName(aspectjSignature.getDeclaringType().getPackage().getName()) .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())) .returnType("") .synthetic(constructor.isSynthetic()) .location(methodLocation.getLocation()) .build(); } }
SignatureUtils { public static MethodSignature3 makeConstructorSignature( Class<?> clazz, Constructor<?> constructor) { org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(clazz, constructor); if (aspectjSignature == null) { return null; } MethodLocation3 methodLocation = makeMethodLocation(aspectjSignature, makeLocation(clazz)); return MethodSignature3.builder() .aspectjString(stripModifiersAndReturnType(methodLocation.getSignature())) .bridge(false) .declaringType(aspectjSignature.getDeclaringTypeName()) .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes())) .methodName(aspectjSignature.getName()) .modifiers(Modifier.toString(aspectjSignature.getModifiers())) .packageName(aspectjSignature.getDeclaringType().getPackage().getName()) .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())) .returnType("") .synthetic(constructor.isSynthetic()) .location(methodLocation.getLocation()) .build(); }  }
SignatureUtils { public static MethodSignature3 makeConstructorSignature( Class<?> clazz, Constructor<?> constructor) { org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(clazz, constructor); if (aspectjSignature == null) { return null; } MethodLocation3 methodLocation = makeMethodLocation(aspectjSignature, makeLocation(clazz)); return MethodSignature3.builder() .aspectjString(stripModifiersAndReturnType(methodLocation.getSignature())) .bridge(false) .declaringType(aspectjSignature.getDeclaringTypeName()) .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes())) .methodName(aspectjSignature.getName()) .modifiers(Modifier.toString(aspectjSignature.getModifiers())) .packageName(aspectjSignature.getDeclaringType().getPackage().getName()) .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())) .returnType("") .synthetic(constructor.isSynthetic()) .location(methodLocation.getLocation()) .build(); }  static String normalizeSignature(MethodSignature3 methodSignature); static String normalizeSignature(String signature); static MethodLocation3 makeMethodLocation(Signature signature, String location); static String signatureToString(Signature signature); static String stripModifiers(String signature); static String getVisibility(String modifiers); static Signature makeSignature(Class<?> clazz, Method method); static MethodSignature3 makeMethodSignature(Class<?> clazz, Method method); static MethodSignature3 makeConstructorSignature(
      Class<?> clazz, Constructor<?> constructor); }
SignatureUtils { public static MethodSignature3 makeConstructorSignature( Class<?> clazz, Constructor<?> constructor) { org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(clazz, constructor); if (aspectjSignature == null) { return null; } MethodLocation3 methodLocation = makeMethodLocation(aspectjSignature, makeLocation(clazz)); return MethodSignature3.builder() .aspectjString(stripModifiersAndReturnType(methodLocation.getSignature())) .bridge(false) .declaringType(aspectjSignature.getDeclaringTypeName()) .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes())) .methodName(aspectjSignature.getName()) .modifiers(Modifier.toString(aspectjSignature.getModifiers())) .packageName(aspectjSignature.getDeclaringType().getPackage().getName()) .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())) .returnType("") .synthetic(constructor.isSynthetic()) .location(methodLocation.getLocation()) .build(); }  static String normalizeSignature(MethodSignature3 methodSignature); static String normalizeSignature(String signature); static MethodLocation3 makeMethodLocation(Signature signature, String location); static String signatureToString(Signature signature); static String stripModifiers(String signature); static String getVisibility(String modifiers); static Signature makeSignature(Class<?> clazz, Method method); static MethodSignature3 makeMethodSignature(Class<?> clazz, Method method); static MethodSignature3 makeConstructorSignature(
      Class<?> clazz, Constructor<?> constructor); static final String PUBLIC; static final String PROTECTED; static final String PACKAGE_PRIVATE; static final String PRIVATE; }