Inject test now runs with all api methods found.

This commit is contained in:
Adam
2016-03-12 13:37:40 -05:00
parent 31dc462e55
commit 4651c30abc

View File

@@ -157,11 +157,7 @@ public class Inject
java.lang.Class targetApiClass = f.isStatic() ? clientClass : implementingClass; // target api class for getter java.lang.Class targetApiClass = f.isStatic() ? clientClass : implementingClass; // target api class for getter
java.lang.reflect.Method apiMethod = findImportMethodOnApi(targetApiClass, exportedName); java.lang.reflect.Method apiMethod = findImportMethodOnApi(targetApiClass, exportedName);
if (apiMethod == null) assert apiMethod != null;
{
System.out.println("no api method");
continue;
}
injectGetter(targetClass, apiMethod, otherf, getter); injectGetter(targetClass, apiMethod, otherf, getter);
} }
@@ -207,11 +203,7 @@ public class Inject
assert otherm != null; assert otherm != null;
java.lang.reflect.Method apiMethod = findImportMethodOnApi(implementingClass, exportedName); // api method to invoke 'otherm' java.lang.reflect.Method apiMethod = findImportMethodOnApi(implementingClass, exportedName); // api method to invoke 'otherm'
if (apiMethod == null) assert apiMethod != null;
{
System.out.println("no api method");
continue;
}
injectInvoker(other, apiMethod, m, otherm, garbage); injectInvoker(other, apiMethod, m, otherm, garbage);
} }
@@ -321,16 +313,24 @@ public class Inject
{ {
switch (field.getType().getType()) switch (field.getType().getType())
{ {
case "Z": case "B":
case "C":
case "I": case "I":
case "S":
case "Z":
returnType = InstructionType.IRETURN; returnType = InstructionType.IRETURN;
break; break;
case "D":
returnType = InstructionType.DRETURN;
break;
case "F":
returnType = InstructionType.FRETURN;
break;
case "J": case "J":
returnType = InstructionType.LRETURN; returnType = InstructionType.LRETURN;
break; break;
default: default:
assert false; throw new RuntimeException("Unknown type");
return;
} }
} }
else else