HashSet<String> thrownExceptions(Method m) { HashSet<String> result = new HashSet<>(); ExceptionTable exceptionTable = m.getExceptionTable(); if (exceptionTable != null) { for (String e : exceptionTable.getExceptionNames()) { result.add(e); } } return result; } private boolean differentAttributes(Method m1, Method m2) {
HashSet<String> thrownExceptions(Method m) { HashSet<String> result = new HashSet<String>(); ExceptionTable exceptionTable = m.getExceptionTable(); if (exceptionTable != null) { for (String e : exceptionTable.getExceptionNames()) { result.add(e); } } return result; } private boolean differentAttributes(Method m1, Method m2) {
MethodDesc( Method meth ) { this(meth.getName(), meth.getReturnType(), meth.getArgumentTypes(), (null == meth.getExceptionTable() ) ? new String[0] : meth.getExceptionTable().getExceptionNames()); }
/** * retrieves the set of non-runtime exceptions that are declared to be thrown by the method * * @param method * the currently parsed method * * @return the set of exceptions thrown * * @throws ClassNotFoundException * if an exception class is not found */ private Set<JavaClass> getDeclaredExceptions(Method method) throws ClassNotFoundException { ExceptionTable et = method.getExceptionTable(); if ((et == null) || (et.getLength() == 0)) { return Collections.<JavaClass> emptySet(); } Set<JavaClass> exceptions = new HashSet<>(); for (String en : et.getExceptionNames()) { JavaClass exCls = Repository.lookupClass(en); if (!exCls.instanceOf(runtimeExceptionClass)) { exceptions.add(exCls); } } return exceptions; }
/** * retrieves the set of non-runtime exceptions that are declared to be thrown by the method * * @param method * the currently parsed method * * @return the set of exceptions thrown * * @throws ClassNotFoundException * if an exception class is not found */ private Set<JavaClass> getDeclaredExceptions(Method method) throws ClassNotFoundException { ExceptionTable et = method.getExceptionTable(); if ((et == null) || (et.getLength() == 0)) { return Collections.<JavaClass> emptySet(); } Set<JavaClass> exceptions = new HashSet<>(); for (String en : et.getExceptionNames()) { JavaClass exCls = Repository.lookupClass(en); if (!exCls.instanceOf(runtimeExceptionClass)) { exceptions.add(exCls); } } return exceptions; }
/** * returns a list of method information of all public or protected methods in this class * * @param cls * the class to look for methods * @return a map of (method name)(method signature) */ private static List<MethodInfo> getPublicMethodInfos(final JavaClass cls) { List<MethodInfo> methodInfos = new ArrayList<>(); Method[] methods = cls.getMethods(); for (Method m : methods) { if ((m.getAccessFlags() & (Constants.ACC_PUBLIC | Constants.ACC_PROTECTED)) != 0) { ExceptionTable et = m.getExceptionTable(); methodInfos.add(new MethodInfo(m.getName(), m.getSignature(), et == null ? null : et.getExceptionNames())); } } return methodInfos; }
/** * returns a list of method information of all public or protected methods in * this class * * @param cls the class to look for methods * @return a map of (method name)(method signature) */ private static List<MethodInfo> getPublicMethodInfos(final JavaClass cls) { List<MethodInfo> methodInfos = new ArrayList<>(); Method[] methods = cls.getMethods(); for (Method m : methods) { if ((m.getAccessFlags() & (Const.ACC_PUBLIC | Const.ACC_PROTECTED)) != 0) { ExceptionTable et = m.getExceptionTable(); methodInfos .add(new MethodInfo(m.getName(), m.getSignature(), et == null ? null : et.getExceptionNames())); } } return methodInfos; }
ExceptionTable e = getExceptionTable(); if(e != null) { String str = e.toString();
final ExceptionTable e = getExceptionTable(); if (e != null) { final String str = e.toString();
Map<String, Set<String>> constraintInfo = new HashMap<>(); Set<String> exs = new HashSet<>(); ExceptionTable et = m.getExceptionTable(); if (et != null) { int[] indexTable = et.getExceptionIndexTable();
Map<String, Set<String>> constraintInfo = new HashMap<>(); Set<String> exs = new HashSet<>(); ExceptionTable et = m.getExceptionTable(); if (et != null) { int[] indexTable = et.getExceptionIndexTable();
return; ExceptionTable et = obj.getExceptionTable(); if (et != null) { String[] exNames = et.getExceptionNames();
return; ExceptionTable et = obj.getExceptionTable(); if (et != null) { String[] exNames = et.getExceptionNames();
ExceptionTable et = m.getExceptionTable(); if (et != null) { String[] thrownExceptions = et.getExceptionNames();
ExceptionTable et = m.getExceptionTable(); if (et != null) { String[] thrownExceptions = et.getExceptionNames();
ExceptionTable et = m.getExceptionTable();
ExceptionTable et = m.getExceptionTable();
JavaClass thrownEx = Repository.lookupClass(ex); ExceptionTable et = getMethod().getExceptionTable(); if (et != null) { String[] throwClauseExNames = et.getExceptionNames();
JavaClass thrownEx = Repository.lookupClass(ex); ExceptionTable et = getMethod().getExceptionTable(); if (et != null) { String[] throwClauseExNames = et.getExceptionNames();
Method m = findMethod(cls, getNameConstantOperand(), getSigConstantOperand()); if (m != null) { ExceptionTable et = m.getExceptionTable(); if ((et != null) && (et.getLength() > 0) && !catchBlockInFinally(fbi)) { bugReporter.reportBug(new BugInstance(this, BugType.AFBR_ABNORMAL_FINALLY_BLOCK_RETURN.name(), LOW_PRIORITY).addClass(this)