use of soot.SootMethod in project robovm by robovm.
the class SootClassType method getEnclosingMethod.
private SootMethodType getEnclosingMethod(boolean constructor) {
EnclosingMethodTag emTag = (EnclosingMethodTag) sootClass.getTag("EnclosingMethodTag");
if (emTag != null) {
String clsName = emTag.getEnclosingClass();
String name = emTag.getEnclosingMethod();
String desc = emTag.getEnclosingMethodSig();
if (clsName != null && name != null && desc != null) {
if ((constructor && name.equals("<init>")) || (!constructor && !name.equals("<init>") && !name.equals("<clinit>"))) {
SootClass cls = SootResolver.v().makeClassRef(clsName);
if (!cls.isPhantom()) {
for (SootMethod m : cls.getMethods()) {
String mDesc = org.robovm.compiler.Types.getDescriptor(m);
if (m.getName().equals(name) && desc.equals(mDesc)) {
return new SootMethodType(m);
}
}
}
}
}
}
return null;
}
use of soot.SootMethod in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsNoParams.
@Test
public void testCopyParameterAnnotationsNoParams() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src1");
SootMethod dest = sc.getMethodByName("dest1");
copyParameterAnnotations(src, dest, 0, 0, 0, Visibility.Any);
assertEquals("void dest1()", toString(dest));
}
use of soot.SootMethod in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsOnlyInvisibleNoShift.
@Test
public void testCopyParameterAnnotationsOnlyInvisibleNoShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src9");
SootMethod dest = sc.getMethodByName("dest9");
copyParameterAnnotations(src, dest, 0, 2, 0, Visibility.RuntimeVisible);
assertEquals("void dest9(int, @E int)", toString(dest));
}
use of soot.SootMethod in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsSingleAllNoShift.
@Test
public void testCopyParameterAnnotationsSingleAllNoShift() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src3");
SootMethod dest = sc.getMethodByName("dest3");
copyParameterAnnotations(src, dest, 0, 2, 0, Visibility.Any);
assertEquals("void dest3(@A int, @B int)", toString(dest));
}
use of soot.SootMethod in project robovm by robovm.
the class AnnotationsTest method testCopyParameterAnnotationsNoAnnotations.
@Test
public void testCopyParameterAnnotationsNoAnnotations() {
SootClass sc = toSootClass(getClass());
SootMethod src = sc.getMethodByName("src2");
SootMethod dest = sc.getMethodByName("dest2");
copyParameterAnnotations(src, dest, 0, 2, 0, Visibility.Any);
assertEquals("void dest2(int, int)", toString(dest));
}
Aggregations