db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r552323 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
Date Sun, 01 Jul 2007 15:11:32 GMT
Author: kahatlen
Date: Sun Jul  1 08:11:31 2007
New Revision: 552323

URL: http://svn.apache.org/viewvc?view=rev&rev=552323
Log:
DERBY-2884: CtxStack should only create unmodifiable view once per instance

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java?view=diff&rev=552323&r1=552322&r2=552323
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextManager.java
Sun Jul  1 08:11:31 2007
@@ -65,7 +65,10 @@
 	 * synchronized).
 	 */
 	private static final class CtxStack {
-		private ArrayList stack_ = new ArrayList();
+		/** Internal list with all the elements of the stack. */
+		private final ArrayList stack_ = new ArrayList();
+		/** Read-only view of the internal list. */
+		private final List view_ = Collections.unmodifiableList(stack_);
 
 		// Keeping a reference to the top element on the stack
 		// optimizes the frequent accesses to this element. The
@@ -94,7 +97,7 @@
 		}
 		boolean isEmpty() { return stack_.isEmpty(); }
 		List getUnmodifiableList() { 
-		    return Collections.unmodifiableList(stack_); 
+			return view_;
 		}
 	}
 



Mime
View raw message