Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 88539 invoked from network); 5 Dec 2008 04:53:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2008 04:53:35 -0000 Received: (qmail 94116 invoked by uid 500); 5 Dec 2008 04:53:47 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 94093 invoked by uid 500); 5 Dec 2008 04:53:47 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 94084 invoked by uid 99); 5 Dec 2008 04:53:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 20:53:47 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Dec 2008 04:52:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 77C1B234C309 for ; Thu, 4 Dec 2008 20:52:44 -0800 (PST) Message-ID: <420714399.1228452764489.JavaMail.jira@brutus> Date: Thu, 4 Dec 2008 20:52:44 -0800 (PST) From: "Kevin Zhou (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-6035) [classlib][luni-kernel] ThreadGroup does not destory dead Thread and ThreadGroup correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [classlib][luni-kernel] ThreadGroup does not destory dead Thread and ThreadGroup correctly ------------------------------------------------------------------------------------------ Key: HARMONY-6035 URL: https://issues.apache.org/jira/browse/HARMONY-6035 Project: Harmony Issue Type: Bug Components: DRLVM Affects Versions: 5.0M8 Reporter: Kevin Zhou Fix For: 5.0M9 Conduct a test case [1] on RI and HARMONY. RI works well while HARMONY fails on both of them. As to the 1st test, HARMONY uses "equals" method during destroying while RI doesn't. I think this may be the root cause for the second test. [1] public void test_destroy_OverrideEquals() { class MockThreadGroup extends ThreadGroup { private boolean isCalled = false; public void reset() { isCalled = false; } public boolean isCallEqauls() { return isCalled; } public MockThreadGroup(String name) { super(name); reset(); } public MockThreadGroup(ThreadGroup parent, String name) { super(parent, name); reset(); } public boolean equals(Object obj) { isCalled = true; return false; } } MockThreadGroup ptg = new MockThreadGroup("Parent"); MockThreadGroup ctg = new MockThreadGroup(ptg, "Child"); MockThreadGroup dtg = new MockThreadGroup(ptg, "Daemon"); dtg.setDaemon(true); assertEquals(2, ptg.activeGroupCount()); ptg.destroy(); assertFalse(ptg.isCallEqauls()); assertFalse(ctg.isCallEqauls()); assertFalse(dtg.isCallEqauls()); assertEquals(0, ptg.activeGroupCount()); } public void test_setDaemonZ_Destory() throws InterruptedException { ThreadGroup daemonGroup = new ThreadGroup("daemon"); Thread myThread = new Thread(daemonGroup, new Runnable() { public void run() { } }); ThreadGroup childGroup = new ThreadGroup(daemonGroup, "child"); daemonGroup.setDaemon(true); assertEquals(0, daemonGroup.activeCount()); childGroup.destroy(); assertTrue(childGroup.isDestroyed()); assertFalse(daemonGroup.isDestroyed()); myThread.start(); myThread.join(); assertTrue(daemonGroup.isDestroyed()); } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.