InstanceKey ik = filter.getInstance(); if (ik instanceof ScopeMappingInstanceKey) { ik = ((ScopeMappingInstanceKey) ik).getBase();
InstanceKey ik = filter.getInstance(); if (ik instanceof ScopeMappingInstanceKey) { ik = ((ScopeMappingInstanceKey) ik).getBase();
private boolean exceedsRecursionBound(Context baseContext, int curLevel) { if (curLevel > recursionBound) { return true; } // we just do a case analysis here. we might have to add cases later to // account for new types of context / recursion. CGNode callerNode = (CGNode) baseContext.get(ContextKey.CALLER); if (callerNode != null && exceedsRecursionBound(callerNode.getContext(), curLevel + 1)) { return true; } for (int i = 0; i < MAX_INTERESTING_PARAM; i++) { FilteredPointerKey.SingleInstanceFilter filter = (SingleInstanceFilter) baseContext.get(ContextKey.PARAMETERS[i]); if (filter != null) { InstanceKey ik = filter.getInstance(); if (ik instanceof ScopeMappingInstanceKey) { ik = ((ScopeMappingInstanceKey) ik).getBase(); } if (ik instanceof InstanceKeyWithNode) { if (exceedsRecursionBound(((InstanceKeyWithNode) ik).getNode().getContext(), curLevel + 1)) { return true; } } } } return false; }
private boolean exceedsRecursionBound(Context baseContext, int curLevel) { if (curLevel > recursionBound) { return true; } // we just do a case analysis here. we might have to add cases later to // account for new types of context / recursion. CGNode callerNode = (CGNode) baseContext.get(ContextKey.CALLER); if (callerNode != null && exceedsRecursionBound(callerNode.getContext(), curLevel + 1)) { return true; } for (int i = 0; i < MAX_INTERESTING_PARAM; i++) { FilteredPointerKey.SingleInstanceFilter filter = (SingleInstanceFilter) baseContext.get(ContextKey.PARAMETERS[i]); if (filter != null) { InstanceKey ik = filter.getInstance(); if (ik instanceof ScopeMappingInstanceKey) { ik = ((ScopeMappingInstanceKey) ik).getBase(); } if (ik instanceof InstanceKeyWithNode) { if (exceedsRecursionBound(((InstanceKeyWithNode) ik).getNode().getContext(), curLevel + 1)) { return true; } } } } return false; }