File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 60
60
import com .ibm .wala .ssa .SSAInvokeInstruction ;
61
61
import com .ibm .wala .ssa .SSAPhiInstruction ;
62
62
import com .ibm .wala .ssa .Value ;
63
+ import com .ibm .wala .types .ClassLoaderReference ;
63
64
import com .ibm .wala .types .MethodReference ;
64
65
import com .ibm .wala .types .TypeName ;
65
66
import com .ibm .wala .types .TypeReference ;
@@ -688,4 +689,24 @@ public static TypeReference getEvaluationType(IMethod method) {
688
689
// use the return type.
689
690
return method .getReturnType ();
690
691
}
692
+
693
+ /**
694
+ * Returns the index of the first {@link IMethod} in methods that is client
695
+ * code.
696
+ *
697
+ * @param methods
698
+ * The {@link IMethod}s in question.
699
+ * @return The index of the first {@link IMethod} that is client code and -1 if
700
+ * none found.
701
+ */
702
+ public static int findIndexOfFirstClientMethod (IMethod [] methods ) {
703
+ for (int i = 0 ; i < methods .length ; i ++) {
704
+ IMethod meth = methods [i ];
705
+
706
+ if (meth .getDeclaringClass ().getClassLoader ().getReference ().equals (ClassLoaderReference .Application ))
707
+ return i ;
708
+ }
709
+
710
+ return -1 ; // not found.
711
+ }
691
712
}
You can’t perform that action at this time.
0 commit comments