From: Christian R. <lq...@us...> - 2002-08-20 15:26:04
|
User: lqd Date: 02/08/20 08:26:00 Modified: src/main/org/jboss/verifier/strategy AbstractVerifier.java Log: - don't check for java.lang.RuntimeException / java.lang.Error (or any of their subclasses, including javax.ejb.EJBException) on the bean interface methods Revision Changes Path 1.34 +28 -7 jboss/src/main/org/jboss/verifier/strategy/AbstractVerifier.java Index: AbstractVerifier.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/verifier/strategy/AbstractVerifier.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- AbstractVerifier.java 4 Jun 2002 15:18:10 -0000 1.33 +++ AbstractVerifier.java 20 Aug 2002 15:25:59 -0000 1.34 @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * This package and its source code is available at www.jboss.org - * $Id: AbstractVerifier.java,v 1.33 2002/06/04 15:18:10 lqd Exp $ + * $Id: AbstractVerifier.java,v 1.34 2002/08/20 15:25:59 lqd Exp $ */ package org.jboss.verifier.strategy; @@ -83,7 +83,7 @@ * </ul> * </p> * - * @version $Revision: 1.33 $ + * @version $Revision: 1.34 $ * @since JDK 1.3 */ public abstract class AbstractVerifier @@ -853,22 +853,43 @@ // target must be a superset of source Class[] a = source.getExceptionTypes(); Class[] b = target.getExceptionTypes(); + Class rteClass = null; + Class errorClass = null; - for (int i = 0; i < a.length; ++i) + try { - boolean found = false; + rteClass = classloader.loadClass( "java.lang.RuntimeException" ); + errorClass = classloader.loadClass( "java.lang.Error" ); + } + catch( ClassNotFoundException cnfe ) + { + // Ignored, if this happens we have more serious problems :) + } + + for( int i = 0; i < a.length; ++i ) + { + if( rteClass.isAssignableFrom(a[i]) + || errorClass.isAssignableFrom(a[i]) ) + { + // Skip over subclasses of java.lang.RuntimeException and + // java.lang.Error + continue; + } - for (int j = 0; j < b.length; ++j) + boolean found = false; + for( int j = 0; j < b.length; ++j ) { - if (b[j].isAssignableFrom (a[i]) ) + if( b[j].isAssignableFrom (a[i]) ) { found = true; break; } } - if (!found) + if ( !found ) + { return false; + } } return true; |