commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bali...@apache.org
Subject cvs commit: jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/tools Enhancer.java
Date Sun, 03 Mar 2002 20:23:17 GMT
baliuka     02/03/03 12:23:17

  Modified:    simplestore/src/java/org/apache/commons/simplestore/tools
                        Enhancer.java
  Log:
  Fixed bug in generated Exception handler
  
  Revision  Changes    Path
  1.2       +10 -13    jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/tools/Enhancer.java
  
  Index: Enhancer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/tools/Enhancer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Enhancer.java	3 Mar 2002 19:35:57 -0000	1.1
  +++ Enhancer.java	3 Mar 2002 20:23:17 -0000	1.2
  @@ -64,7 +64,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Enhancer.java,v 1.1 2002/03/03 19:35:57 baliuka Exp $
  + *@version    $Id: Enhancer.java,v 1.2 2002/03/03 20:23:17 baliuka Exp $
    */
   public class Enhancer implements org.apache.bcel.Constants{
       
  @@ -100,7 +100,7 @@
           "(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
           
       }
  -   
  +    
       
       /** Creates a new instance of Enchancer */
       private Enhancer() {
  @@ -516,14 +516,12 @@
           }
           
           InstructionHandle ehEnd = il.append( new ASTORE(resultFromSuper) );
  -        //  GOTO gotoHandled = new GOTO(null);
  -        //   il.append( gotoHandled );
  -        //      InstructionHandle ehHandled =  il.append( new ASTORE(error + 1) );
  -        //     il.append( new ALOAD(error + 1) );
  -        //     il.append( new ALOAD(error));
  +        GOTO gotoHandled = new GOTO(null);
  +        il.append( gotoHandled );
  +        InstructionHandle ehHandled =  il.append( new ASTORE(error ) );
           InstructionHandle endif = il.append( new ALOAD(0) );//this
           ifInvoke.setTarget(endif);
  -        //     gotoHandled.setTarget(endif);
  +        gotoHandled.setTarget(endif);
           il.append(factory.createFieldAccess(cg.getClassName(),FIELD_NAME,new ObjectType(INTERCEPTOR_CLASS),GETFIELD));
           il.append( new ALOAD(0) );//this
           il.append( factory.createGetStatic(cg.getClassName(),fieldName,METHOD_OBJECT )
);
  @@ -536,16 +534,15 @@
           
           
           InstructionHandle exitMethod =  generateReturnValue(il,factory,cp,mg.getReturnType(),++loaded);
  -        // bug in BCEL ?
  -        // mg.addExceptionHandler(ehStart,ehEnd,ehHandled,Type.THROWABLE);
  +        mg.addExceptionHandler(ehStart,ehEnd,ehHandled,Type.THROWABLE);
           
           mg.setMaxStack();
           mg.setMaxLocals();
           Method result = getMethod(mg);
           if( DEBUG ){
  -         System.err.println(mg.getMethod());
  -         System.err.println(mg.getMethod().getCode());
  -         System.err.flush();
  +            System.err.println(mg.getMethod());
  +            System.err.println(mg.getMethod().getCode());
  +            System.err.flush();
           }
           
           return result;
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message