/** * Find the declared exceptions for the method called by given instruction. * * @param inv * the InvokeInstruction * @param cpg * the ConstantPoolGen used by the class the InvokeInstruction * belongs to * @return array of ObjectTypes of thrown exceptions, or null if we can't * find the method implementation */ public static @CheckForNull ObjectType[] findDeclaredExceptions(InvokeInstruction inv, ConstantPoolGen cpg) { XMethod method = findInvocationLeastUpperBound(inv, cpg, inv instanceof INVOKESTATIC ? Hierarchy.STATIC_METHOD : Hierarchy.INSTANCE_METHOD); if (method == null) { return null; } String[] exceptions = method.getThrownExceptions(); if (exceptions == null) { return new ObjectType[0]; } ObjectType[] result = new ObjectType[exceptions.length]; for (int i = 0; i < exceptions.length; ++i) { result[i] = ObjectTypeFactory.getInstance(ClassName.toDottedClassName(exceptions[i])); } return result; }
break; String[] exceptions = m.getThrownExceptions(); if (exceptions != null) { for (String name : exceptions) {
status = SideEffectStatus.OBJECT_ONLY; } else { String[] thrownExceptions = getXMethod().getThrownExceptions(); if(thrownExceptions != null && thrownExceptions.length > 0) { status = SideEffectStatus.SIDE_EFFECT;
/** * Find the declared exceptions for the method called by given instruction. * * @param inv * the InvokeInstruction * @param cpg * the ConstantPoolGen used by the class the InvokeInstruction * belongs to * @return array of ObjectTypes of thrown exceptions, or null if we can't * find the method implementation */ public static @CheckForNull ObjectType[] findDeclaredExceptions(InvokeInstruction inv, ConstantPoolGen cpg) { XMethod method = findInvocationLeastUpperBound(inv, cpg, inv instanceof INVOKESTATIC ? Hierarchy.STATIC_METHOD : Hierarchy.INSTANCE_METHOD); if (method == null) { return null; } String[] exceptions = method.getThrownExceptions(); if (exceptions == null) { return new ObjectType[0]; } ObjectType[] result = new ObjectType[exceptions.length]; for (int i = 0; i < exceptions.length; ++i) { result[i] = ObjectTypeFactory.getInstance(ClassName.toDottedClassName(exceptions[i])); } return result; }
XMethod xMethod = getXMethod(); if (xMethod != null) { String[] tes = xMethod.getThrownExceptions(); Set<String> thrownExceptions = new HashSet<>(Arrays.<String> asList((tes == null) ? new String[0] : tes));
XMethod xMethod = getXMethod(); if (xMethod != null) { String[] tes = xMethod.getThrownExceptions(); Set<String> thrownExceptions = new HashSet<>(Arrays.<String> asList((tes == null) ? new String[0] : tes));
break; String[] exceptions = m.getThrownExceptions(); if (exceptions != null) { for (String name : exceptions) {
status = SideEffectStatus.OBJECT_ONLY; } else { String[] thrownExceptions = getXMethod().getThrownExceptions(); if(thrownExceptions != null && thrownExceptions.length > 0) { status = SideEffectStatus.SIDE_EFFECT;