org.apache.bcel.classfile.Method.getExceptionTable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.bcel.classfile.Method.getExceptionTable()方法的一些代码示例,展示了Method.getExceptionTable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.getExceptionTable()方法的具体详情如下:
包路径:org.apache.bcel.classfile.Method
类名称:Method
方法名:getExceptionTable

Method.getExceptionTable介绍

暂无

代码示例

代码示例来源:origin: spotbugs/spotbugs

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) {

代码示例来源:origin: com.google.code.findbugs/findbugs

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) {

代码示例来源:origin: org.apache.excalibur.fortress.container/excalibur-fortress-container-impl

MethodDesc( Method meth )
{
  this(meth.getName(), meth.getReturnType(), meth.getArgumentTypes(),
      (null == meth.getExceptionTable() ) ? new String[0] : meth.getExceptionTable().getExceptionNames());
}

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

/**
 * 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;
}

代码示例来源:origin: mebigfatguy/fb-contrib

/**
 * 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;
}

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

/**
 * 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;
}

代码示例来源:origin: mebigfatguy/fb-contrib

/**
 * 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;
}

代码示例来源:origin: bcel/bcel

ExceptionTable e = getExceptionTable();
if(e != null) {
 String str = e.toString();

代码示例来源:origin: org.apache.bcel/bcel

final ExceptionTable e = getExceptionTable();
if (e != null) {
  final String str = e.toString();

代码示例来源:origin: mebigfatguy/fb-contrib

Map<String, Set<String>> constraintInfo = new HashMap<>();
Set<String> exs = new HashSet<>();
ExceptionTable et = m.getExceptionTable();
if (et != null) {
  int[] indexTable = et.getExceptionIndexTable();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

Map<String, Set<String>> constraintInfo = new HashMap<>();
Set<String> exs = new HashSet<>();
ExceptionTable et = m.getExceptionTable();
if (et != null) {
  int[] indexTable = et.getExceptionIndexTable();

代码示例来源:origin: mebigfatguy/fb-contrib

return;
ExceptionTable et = obj.getExceptionTable();
if (et != null) {
  String[] exNames = et.getExceptionNames();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

return;
ExceptionTable et = obj.getExceptionTable();
if (et != null) {
  String[] exNames = et.getExceptionNames();

代码示例来源:origin: mebigfatguy/fb-contrib

ExceptionTable et = m.getExceptionTable();
if (et != null) {
  String[] thrownExceptions = et.getExceptionNames();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

ExceptionTable et = m.getExceptionTable();
if (et != null) {
  String[] thrownExceptions = et.getExceptionNames();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

ExceptionTable et = m.getExceptionTable();

代码示例来源:origin: mebigfatguy/fb-contrib

ExceptionTable et = m.getExceptionTable();

代码示例来源:origin: mebigfatguy/fb-contrib

JavaClass thrownEx = Repository.lookupClass(ex);
ExceptionTable et = getMethod().getExceptionTable();
if (et != null) {
  String[] throwClauseExNames = et.getExceptionNames();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

JavaClass thrownEx = Repository.lookupClass(ex);
ExceptionTable et = getMethod().getExceptionTable();
if (et != null) {
  String[] throwClauseExNames = et.getExceptionNames();

代码示例来源:origin: com.mebigfatguy.fb-contrib/fb-contrib

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)

相关文章