You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2003/05/30 17:39:14 UTC

cvs commit: avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/factory BCELCodeGenerator.java BCELWrapperGenerator.java

bloritsch    2003/05/30 08:39:14

  Modified:    fortress/src/java/org/apache/avalon/fortress/impl/factory
                        BCELCodeGenerator.java BCELWrapperGenerator.java
  Log:
  Future proof the BCEL classes--the CVS BCEL throws a new ClassNotFoundException for the affected method.
  
  Revision  Changes    Path
  1.4       +11 -11    avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/factory/BCELCodeGenerator.java
  
  Index: BCELCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/factory/BCELCodeGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BCELCodeGenerator.java	14 May 2003 15:54:45 -0000	1.3
  +++ BCELCodeGenerator.java	30 May 2003 15:39:13 -0000	1.4
  @@ -256,7 +256,7 @@
                   m_constPoolGenerator );
   
           m_instructionList.append(
  -            m_instructionFactory.createLoad( Type.OBJECT, 0 ) );
  +                InstructionFactory.createLoad( Type.OBJECT, 0 ) );
           m_instructionList.append(
               m_instructionFactory.createInvoke(
                   m_wrapperSuperclassName,
  @@ -265,16 +265,16 @@
                   Type.NO_ARGS,
                   Constants.INVOKESPECIAL ) );
           m_instructionList.append(
  -            m_instructionFactory.createLoad( Type.OBJECT, 0 ) );
  +                InstructionFactory.createLoad( Type.OBJECT, 0 ) );
           m_instructionList.append(
  -            m_instructionFactory.createLoad( Type.OBJECT, 1 ) );
  +                InstructionFactory.createLoad( Type.OBJECT, 1 ) );
           m_instructionList.append(
               m_instructionFactory.createFieldAccess(
                   m_wrapperClassName,
                   WRAPPED_CLASS_FN,
                   m_classToWrapType,
                   Constants.PUTFIELD ) );
  -        m_instructionList.append( m_instructionFactory.createReturn( Type.VOID ) );
  +        m_instructionList.append( InstructionFactory.createReturn( Type.VOID ) );
           mg.setMaxStack();
           mg.setMaxLocals();
   
  @@ -316,7 +316,7 @@
                   m_constPoolGenerator );
   
           m_instructionList.append(
  -            m_instructionFactory.createLoad( Type.OBJECT, 0 ) );
  +                InstructionFactory.createLoad( Type.OBJECT, 0 ) );
           m_instructionList.append(
               m_instructionFactory.createFieldAccess(
                   m_wrapperClassName,
  @@ -324,7 +324,7 @@
                   m_classToWrapType,
                   Constants.GETFIELD ) );
           m_instructionList.append(
  -            m_instructionFactory.createReturn( Type.OBJECT ) );
  +                InstructionFactory.createReturn( Type.OBJECT ) );
   
           mg.setMaxStack();
           mg.setMaxLocals();
  @@ -397,7 +397,7 @@
   
           // Loading the wrapped class instance onto the stack ...
           m_instructionList.append(
  -            m_instructionFactory.createLoad( Type.OBJECT, 0 ) );
  +                InstructionFactory.createLoad( Type.OBJECT, 0 ) );
           m_instructionList.append(
               m_instructionFactory.createFieldAccess(
                   m_wrapperClassName,
  @@ -411,7 +411,7 @@
           for ( int i = 0; i < parameterTypes.length; ++i )
           {
               m_instructionList.append(
  -                m_instructionFactory.createLoad( parameterTypes[i], stackIndex ) );
  +                    InstructionFactory.createLoad( parameterTypes[i], stackIndex ) );
               stackIndex += parameterTypes[i].getSize();
           }
   
  @@ -426,7 +426,7 @@
                   Constants.INVOKEVIRTUAL ) );
   
           // Creating return statement ...
  -        m_instructionList.append( m_instructionFactory.createReturn( returnType ) );
  +        m_instructionList.append( InstructionFactory.createReturn( returnType ) );
   
           mg.setMaxStack();
           mg.setMaxLocals();
  @@ -481,7 +481,7 @@
        * @throws IllegalStateException    If this instance has not been initialized
        */
       public Method[] createImplementation( final JavaClass interfaceToImplement )
  -        throws IllegalArgumentException, IllegalStateException
  +        throws Exception
       {
           if ( interfaceToImplement == null )
           {
  @@ -573,7 +573,7 @@
        * @throws NullPointerException if the <code>interfaceToImplement</code> is <code>null</code>
        */
       static Method[] extractMethods( final JavaClass interfaceToImplement )
  -        throws IllegalArgumentException, NullPointerException
  +        throws Exception
       {
           if ( interfaceToImplement == null )
           {
  
  
  
  1.5       +1 -1      avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/factory/BCELWrapperGenerator.java
  
  Index: BCELWrapperGenerator.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/factory/BCELWrapperGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BCELWrapperGenerator.java	29 May 2003 16:42:45 -0000	1.4
  +++ BCELWrapperGenerator.java	30 May 2003 15:39:13 -0000	1.5
  @@ -327,7 +327,7 @@
        *                               byte code for
        * @return byte[] The generated byte code
        */
  -    private byte[] buildWrapper( final JavaClass[] interfacesToImplement )
  +    private byte[] buildWrapper( final JavaClass[] interfacesToImplement ) throws Exception
       {
           // Create field for the wrapped class
           m_classGenerator.addField( m_codeGenerator.createWrappedClassField() );
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org