avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [GUMP] Build Failure - Excalibur
Date Wed, 20 Feb 2002 15:59:44 GMT
Leif Mortenson wrote:
> 
> I was able to fix the problem in TableIdGeneratorMultithreadedJdbcTestCase by making
> the following change to LatchedThreadGroup.  The problem seems to be that javac
> incorrectly compiles the reference to the getLogger() method from the inner class.
> Not sure what the specific problem is?? Maybe because it is final?  Anyway.  The fixed
> version is checked in, but if anyone has any idea as to why this happened, I would be
> interrested in hearing it.


Is the inner class static?

That can make a world of difference....

> 
> -----------
> RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/testcase/LatchedThreadGroup.java,v
> retrieving revision 1.1
> diff -r1.1 LatchedThreadGroup.java
> 14a15
> 
>>import org.apache.avalon.framework.logger.Logger;
>>
> 142a144,153
> 
>>    /**
>>     * Inner access method to getLogger() to work around a bug in the Javac compiler
>>     *  when getLogger() is called from the method of an inner class.  Jikes seems
to
>>     *  handle it Ok. :-/
>>     */
>>    private Logger getInnerLogger()
>>    {
>>        return getLogger();
>>    }
>>
>>
> 164c175
> <                     getLogger().debug( "Started " + m_startedCount + " test threads."
);
> ---
> 
>>                    getInnerLogger().debug( "Started " + m_startedCount + " test threads."
);
>>
> 188c199
> <                         getLogger().error( "Error in " + Thread.currentThread().getName(),
t );
> ---
> 
>>                        getInnerLogger().error( "Error in " + Thread.currentThread().getName(),
t );
>>
> 202c213
> <                     getLogger().debug( m_completedCount + " test threads completed."
);
> ---
> 
>>                    getInnerLogger().debug( m_completedCount + " test threads completed."
);
>>
> -----------
> 
> The first test PoolableComponentHandlerTestCase was also fixed with a similar workaround.
> Not sure quite why these aren't working in these specific cases though :-/
> 
> -----------
> RCS file: /home/cvs/jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/component/test/PoolableComponentHandlerTestCase.java,v
> retrieving revision 1.2
> diff -r1.2 PoolableComponentHandlerTestCase.java
> 13a14
> 
>>import org.apache.avalon.framework.component.ComponentManager;
>>
> 37a39,51
> 
>>     * 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;
>>    }
>>
>>    /*---------------------------------------------------------------
>>
> 299c313
> <                         (PoolableTestObject)manager.lookup( PoolableTestObject.ROLE
+ "_" + name );
> ---
> 
>>                        (PoolableTestObject)getInnerManager().lookup( PoolableTestObject.ROLE
+ "_" + name );
>>
> 309c323
> <                     manager.release( poolable );
> ---
> 
>>                    getInnerManager().release( poolable );
>>
> -----------
> 
> Anyway, the build should be fixed now...
> 
> Cheers,
> Leif
> 
> 
> Leif Mortenson wrote:
> 
> 
>>This is strange, I ran the entire test suite at work before heading home
>>and it worked fine.  I am using Jikes at work and the standard JDK1.3
>>javac at home.  javac has this problem. :-/
>>
>>I was able to fix this by making more specific references to class
>>fields from the methods of the inner class.
>>
>>Now I am making it past the compile-tests task, but the check task is
>>failing in two tests with similar problems.  The tests compile just
>>fine, but when they run they are kicking out
>>java.lang.NoSuchMethodErrors.  These are also cases where inner class
>>methods are referencing the fields of the parent methods...
>>The tests that are failing are:
>>org.apache.avalon.excalibur.component.test.PoolableComponentHandlerTestCase
>>and
>>org.apache.avalon.excalibur.datasource.ids.test.TableIdGeneratorMultithreadedJdbcTestCase
>>
>>I stared at these and don't see the problem.  Any ideas?  Here is the
>>current build output that I am seeing:
>>
>>
> 
> 
> <snip>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>
> 
> .
> 
> 



-- 

"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin


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


Mime
View raw message