avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test PoolableComponentHandlerTestCase.java
Date Wed, 20 Feb 2002 15:40:55 GMT
leif        02/02/20 07:40:55

  Modified:    src/test/org/apache/avalon/excalibur/component/test
                        PoolableComponentHandlerTestCase.java
  Log:
  Workaround a strange compiler bug which shows its ugly head under
  javac (JDK 1.3) but not under jikes.
  
  Revision  Changes    Path
  1.3       +16 -2     jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test/PoolableComponentHandlerTestCase.java
  
  Index: PoolableComponentHandlerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test/PoolableComponentHandlerTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PoolableComponentHandlerTestCase.java	18 Feb 2002 20:48:09 -0000	1.2
  +++ PoolableComponentHandlerTestCase.java	20 Feb 2002 15:40:55 -0000	1.3
  @@ -11,6 +11,7 @@
   import org.apache.avalon.excalibur.testcase.BufferedLogger;
   import org.apache.avalon.excalibur.testcase.ExcaliburTestCase;
   
  +import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentSelector;
   
   /**
  @@ -35,6 +36,19 @@
       }
   
       /*---------------------------------------------------------------
  +     * Methods
  +     *-------------------------------------------------------------*/
  +    /**
  +     * Inner access method to manager to work around a bug in the Javac compiler
  +     *  when manager is referenced from the method of an inner class.  Jikes seems to
  +     *  handle it Ok. :-/
  +     */
  +    private ComponentManager getInnerManager()
  +    {
  +        return manager;
  +    }
  +    
  +    /*---------------------------------------------------------------
        * TestCase Methods
        *-------------------------------------------------------------*/
       public void setUp() throws Exception {
  @@ -296,7 +310,7 @@
                   {
                       logger.debug( "Lookup in second thread." );
                       PoolableTestObject poolable =
  -                        (PoolableTestObject)manager.lookup( PoolableTestObject.ROLE + "_"
+ name );
  +                        (PoolableTestObject)getInnerManager().lookup( PoolableTestObject.ROLE
+ "_" + name );
   
                       // Give the main thread a chance to block
                       try
  @@ -306,7 +320,7 @@
                       catch ( InterruptedException e ) {}
   
                       logger.debug( "Release in second thread." );
  -                    manager.release( poolable );
  +                    getInnerManager().release( poolable );
                   }
                   catch (Exception e)
                   {
  
  
  

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


Mime
View raw message