/** * What are the exception types which s may throw? */ private static TypeReference[] computeExceptions(IClassHierarchy cha, IR ir, SSAInstruction s) throws InvalidClassFileException { Collection<TypeReference> c = null; Language l = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); if (s instanceof SSAInvokeInstruction) { SSAInvokeInstruction call = (SSAInvokeInstruction) s; c = l.inferInvokeExceptions(call.getDeclaredTarget(), cha); } else { c = s.getExceptionTypes(); } if (c == null) { return null; } else { TypeReference[] exceptions = new TypeReference[c.size()]; Iterator<TypeReference> it = c.iterator(); for (int i = 0; i < exceptions.length; i++) { exceptions[i] = it.next(); } return exceptions; } }
/** * What are the exception types which s may throw? */ private static TypeReference[] computeExceptions(IClassHierarchy cha, IR ir, SSAInstruction s) throws InvalidClassFileException { Collection<TypeReference> c = null; Language l = ir.getMethod().getDeclaringClass().getClassLoader().getLanguage(); if (s instanceof SSAInvokeInstruction) { SSAInvokeInstruction call = (SSAInvokeInstruction) s; c = l.inferInvokeExceptions(call.getDeclaredTarget(), cha); } else { c = s.getExceptionTypes(); } if (c == null) { return null; } else { TypeReference[] exceptions = new TypeReference[c.size()]; Iterator<TypeReference> it = c.iterator(); for (int i = 0; i < exceptions.length; i++) { exceptions[i] = it.next(); } return exceptions; } }