harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-3952) [drlvm[kernel_class] java.lang.ThreadGroup should check if a thread is NULL before calling its method
Date Thu, 24 May 2007 01:36:16 GMT
[drlvm[kernel_class] java.lang.ThreadGroup should check if a thread is NULL before calling
its method
-----------------------------------------------------------------------------------------------------

                 Key: HARMONY-3952
                 URL: https://issues.apache.org/jira/browse/HARMONY-3952
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: all
            Reporter: Xiao-Feng Li


java.lang.ThreadTest.testGetAllStackTraces failed with a NullPointerException. The following
is the log:

Test: testGetAllStackTraces
Class: java.lang.ThreadTest

java.lang.NullPointerException
 at java.lang.ThreadGroup.activeCount(ThreadGroup.java:130)
 at java.lang.ThreadGroup.activeCount(ThreadGroup.java:136)
 at java.lang.Thread.getAllStackTraces(Thread.java:447)
 at java.lang.ThreadTest.testGetAllStackTraces(ThreadTest.java:1011)
 at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
 at java.lang.reflect.Method.invoke(Method.java:382)
 at junit.framework.TestCase.runTest(TestCase.java:164)
 at junit.framework.TestCase.runBare(TestCase.java:130)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:120)
 at junit.framework.TestSuite.runTest(TestSuite.java:230)
 at junit.framework.TestSuite.run(TestSuite.java:225)
 at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
 at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
 at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:546)

The reason is, the thread object enumerated from WeakhashMap might be null. We should have
a null check before invoking its method. This is the conclusion we made in the discussion
of HARMONY-3883.

I found there are more than one place in ThreadGroup that have the similar code needing examination.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message