harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r427517 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src: main/java/javax/naming/InitialContext.java test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java
Date Tue, 01 Aug 2006 10:27:29 GMT
Author: mloenko
Date: Tue Aug  1 03:27:28 2006
New Revision: 427517

URL: http://svn.apache.org/viewvc?rev=427517&view=rev
Log:
fixes for HARMONY-1022
[classlib][jndi] unexpected NoInitialContextException for new InitialContext().close() method

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java?rev=427517&r1=427516&r2=427517&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/InitialContext.java
Tue Aug  1 03:27:28 2006
@@ -475,7 +475,9 @@
     }
 
     public void close() throws NamingException {
-        getDefaultInitCtx().close();
+        if (this.gotDefault) {
+        	getDefaultInitCtx().close();
+        }
     }
 
     public String getNameInNamespace() throws NamingException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java?rev=427517&r1=427516&r2=427517&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/InitialContextMockTest.java
Tue Aug  1 03:27:28 2006
@@ -640,6 +640,9 @@
 	public void testClose() throws NamingException {
 		gContext.close();
 		assertTrue(InvokeRecord.equals(null, "close"));
+		// regression test for HARMONY-1022
+		new InitialContext().close();
+		new InitialContext(null).close();
 	}
 }
 



Mime
View raw message