harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r374380 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/lang/SecurityManager.java test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java
Date Thu, 02 Feb 2006 13:19:36 GMT
Author: tellison
Date: Thu Feb  2 05:19:30 2006
New Revision: 374380

URL: http://svn.apache.org/viewcvs?rev=374380&view=rev
Log:
Fix for HARMONY-66 (SecurityManager.checkAccess(Thread t) throws NullPointerException for
dead thread)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java?rev=374380&r1=374379&r2=374380&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
Thu Feb  2 05:19:30 2006
@@ -90,7 +90,7 @@
 	public void checkAccess(Thread thread) {
 		// Only worry about system threads. Dead threads have a null group.
 		ThreadGroup group = thread.getThreadGroup();
-		if (group == null || group.parent == null)
+		if ((group != null) && (group.parent == null))
 			checkPermission(RuntimePermission.permissionToModifyThread);
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java?rev=374380&r1=374379&r2=374380&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/SecurityManagerTest.java
Thu Feb  2 05:19:30 2006
@@ -15,8 +15,6 @@
 
 package org.apache.harmony.tests.java.lang;
 
-import java.security.AccessControlException;
-
 import junit.framework.TestCase;
 
 public class SecurityManagerTest extends TestCase {
@@ -27,14 +25,11 @@
 	public void test_checkAccessLjava_lang_Thread() throws InterruptedException {
 		// Regression for HARMONY-66
 		Thread t = new Thread() {
-			public void run() {	};
+			public void run() {
+			};
 		};
 		t.start();
 		t.join();
-		try {
-			new SecurityManager().checkAccess(t);
-		} catch (AccessControlException e) {
-			// expected
-		}
+		new SecurityManager().checkAccess(t);
 	}
 }



Mime
View raw message