class SampleClass<VWXZ> {
private String sampleField;
- public Generic<Integer,String,Double,Short,Float> setSampleField(Class<?> clazz, List<String> listString, Map<Integer,String> mapString,
- Generic<Integer,String,Double,Short,Float> test,
- String sampleField, int one, short two, double three, Object obj) {
- this.sampleField = sampleField;
- return test;
+ public Class<?> setSampleField(Class<?> clazz,
+ List<String> listString, Map<Integer,String> mapString,
+ Generic<Integer,String,Double,Short,Float> test,
+ String sampleField, int one, short two, double three, Object obj) {
+
+ this.sampleField = sampleField;
+ return clazz;
}
System.out.println(interfaces[i]);
}*/
- Method[] methods = Class.class.getMethods();
+ Method[] methods = SampleClass.class.getMethods();
Method method = null;
for(Method mth : methods) {
- if (mth.getName().equals("isAssignableFrom")) {
+ if (mth.getName().equals("setSampleField")) {
method = mth;
}
}
for (Type bound : bounds) {
System.out.println(bound);
}
- System.out.println();
- Type returnType = methods[0].getGenericReturnType();
+ System.out.println();*/
+ Type returnType = method.getGenericReturnType();
System.out.println(returnType);
- */
+
}
}
// TODO: Fix for Groovy's model-checking
public String[] getGenericTypeVariableNames () {
- // TODO: We need to double check but for some reason Groovy has a type of generic signature with "<*>"
- // TODO: in the class file.
- if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
+ if (genericSignature == null || genericSignature.equals(""))
return new String[0];
if (!genericSignature.contains(":"))
return new String[0];
// TODO: Fix for Groovy's model-checking
public String[] getArgumentGenericTypeNames () {
- // TODO: We need to double check but for some reason Groovy has a type of generic signature with "<*>"
- // TODO: in the class file.
if (genericSignature == null || genericSignature.equals(""))
return getArgumentTypeNames();
// We need to first find the start of the method parameters in the signature
}
public String getGenericReturnTypeName () {
- // TODO: We need to double check but for some reason Groovy has a type of generic signature with "<*>"
- // TODO: in the class file.
- if (genericSignature == null || genericSignature.equals("") || genericSignature.contains("<*>"))
+ if (genericSignature == null || genericSignature.equals(""))
return Types.getReturnTypeName(signature);
return Types.getGenericReturnTypeName(genericSignature);
}