{
JavaClass javaClass = classContext.getJavaClass();
Method[] methodList = javaClass.getMethods();
CallGraph callGraph = selfCalls.getCallGraph();
// Initially, assume no methods are called from an
// unlocked context
Set<Method> lockedMethodSet = new HashSet<Method>();
lockedMethodSet.addAll(Arrays.asList(methodList));
// Assume all public methods are called from
// unlocked context
for (Method method : methodList) {
if (method.isPublic() && !isConstructor(method.getName())) {
lockedMethodSet.remove(method);
}
}
// Explore the self-call graph to find nonpublic methods
// that can be called from an unlocked context.
boolean change;
do {
change = false;
for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
CallGraphEdge edge = i.next();
CallSite callSite = edge.getCallSite();
// Ignore obviously locked edges
if (obviouslyLockedSites.contains(callSite)) {