当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionTable.getExceptionNames方法代码示例

本文整理汇总了Java中org.apache.bcel.classfile.ExceptionTable.getExceptionNames方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionTable.getExceptionNames方法的具体用法?Java ExceptionTable.getExceptionNames怎么用?Java ExceptionTable.getExceptionNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.bcel.classfile.ExceptionTable的用法示例。


在下文中一共展示了ExceptionTable.getExceptionNames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
public void visit(ExceptionTable obj) {
	if (DEBUG) {
		String names[] = obj.getExceptionNames();
		for (int i = 0; i < names.length; i++)
			if (names[i].equals("java.lang.Exception")
			        || names[i].equals("java.lang.Throwable"))
				System.out.println(names[i] + " thrown by " + getFullyQualifiedMethodName());
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:DontCatchIllegalMonitorStateException.java

示例2: findDeclaredExceptions

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
/**
 * 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 list of declared exceptions
 */
public static ObjectType[] findDeclaredExceptions(InvokeInstruction inv, ConstantPoolGen cpg)
        throws ClassNotFoundException {
	Method m = findPrototypeMethod(inv, cpg);

	if (m == null)
		return null;

	ExceptionTable exTable = m.getExceptionTable();
	if (exTable == null)
		return new ObjectType[0];

	String[] exNameList = exTable.getExceptionNames();
	ObjectType[] result = new ObjectType[exNameList.length];
	for (int i = 0; i < exNameList.length; ++i) {
		result[i] = new ObjectType(exNameList[i]);
	}
	return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:Hierarchy.java

示例3: visitMethod

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
/**
 * @see org.apache.bcel.classfile.Visitor#visitMethod(org.apache.bcel.classfile.Method)
 */
public void visitMethod(Method m) {
	log("      method=" + m.getName(), Project.MSG_VERBOSE);
	String retType = Utility.methodSignatureReturnType(m.getSignature());
	log("         method ret type=" + retType, Project.MSG_VERBOSE);
	if (!"void".equals(retType))
		design.checkClass(retType);

	String[] types = Utility.methodSignatureArgumentTypes(m.getSignature());
	for (int i = 0; i < types.length; i++) {
		log("         method param[" + i + "]=" + types[i], Project.MSG_VERBOSE);
		design.checkClass(types[i]);
	}

	ExceptionTable excs = m.getExceptionTable();
	if (excs != null) {
		types = excs.getExceptionNames();
		for (int i = 0; i < types.length; i++) {
			log("         exc=" + types[i], Project.MSG_VERBOSE);
			design.checkClass(types[i]);
		}
	}

	processInstructions(m);
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:28,代码来源:VisitorImpl.java

示例4: visitExceptionTable

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
public void visitExceptionTable(ExceptionTable e) {
  String[] names = e.getExceptionNames();
  for(int i=0; i < names.length; i++)
    out.println(".throws " + names[i].replace('.', '/'));

  printEndMethod(e);
}
 
开发者ID:diana-hep,项目名称:root4j,代码行数:8,代码来源:JasminVisitor.java

示例5: visit

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
@Override
public void visit(ExceptionTable obj) {
    if (DEBUG) {
        String names[] = obj.getExceptionNames();
        for (String name : names)
            if (name.equals("java.lang.Exception") || name.equals("java.lang.Throwable"))
                System.out.println(name + " thrown by " + getFullyQualifiedMethodName());
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:10,代码来源:DontCatchIllegalMonitorStateException.java

示例6: thrownExceptions

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
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;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:9,代码来源:UselessSubclassMethod.java

示例7: visitExceptionTable

import org.apache.bcel.classfile.ExceptionTable; //导入方法依赖的package包/类
public void visitExceptionTable(ExceptionTable e) {
	String[] names = e.getExceptionNames();
	for (int i = 0; i < names.length; i++)
		out.println("    throws " + names[i].replace('.', '/'));
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:6,代码来源:DecompilingVisitor.java


注:本文中的org.apache.bcel.classfile.ExceptionTable.getExceptionNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。