[jboss-cvs] javassist/src/main/javassist/expr ...
Shigeru Chiba
chiba at is.titech.ac.jp
Tue Jun 9 04:50:06 EDT 2009
User: chiba
Date: 09/06/09 04:50:06
Modified: src/main/javassist/expr Handler.java
Log:
fixed JIRA JASSIST-83
Revision Changes Path
1.10 +17 -4 javassist/src/main/javassist/expr/Handler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Handler.java
===================================================================
RCS file: /cvsroot/jboss/javassist/src/main/javassist/expr/Handler.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- Handler.java 4 Jul 2008 09:17:49 -0000 1.9
+++ Handler.java 9 Jun 2009 08:50:05 -0000 1.10
@@ -20,7 +20,7 @@
import javassist.compiler.*;
/**
- * Catch clause.
+ * A <code>catch</code> clause or a <code>finally</code> block.
*/
public class Handler extends Expr {
private static String EXCEPTION_NAME = "$1";
@@ -69,12 +69,25 @@
/**
* Returns the type handled by the catch clause.
+ * If this is a <code>finally</code> block, <code>null</code> is returned.
*/
public CtClass getType() throws NotFoundException {
+ int type = etable.catchType(index);
+ if (type == 0)
+ return null;
+ else {
ConstPool cp = getConstPool();
- String name = cp.getClassInfo(etable.catchType(index));
+ String name = cp.getClassInfo(type);
return thisClass.getClassPool().getCtClass(name);
}
+ }
+
+ /**
+ * Returns true if this is a <code>finally</code> block.
+ */
+ public boolean isFinally() {
+ return etable.catchType(index) == 0;
+ }
/**
* This method has not been implemented yet.
More information about the jboss-cvs-commits
mailing list