[lsc-changes] r505 - lsc/trunk/src/main/java/org/lsc/jndi

jclarke at lsc-project.org jclarke at lsc-project.org
Mon Nov 30 01:02:06 CET 2009


Author: jclarke
Date: 2009-11-30 01:02:05 +0100 (Mon, 30 Nov 2009)
New Revision: 505

Modified:
   lsc/trunk/src/main/java/org/lsc/jndi/JndiServices.java
Log:
Improve cache initialization

Modified: lsc/trunk/src/main/java/org/lsc/jndi/JndiServices.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/jndi/JndiServices.java	2009-11-29 23:52:23 UTC (rev 504)
+++ lsc/trunk/src/main/java/org/lsc/jndi/JndiServices.java	2009-11-30 00:02:05 UTC (rev 505)
@@ -109,7 +109,7 @@
 	private String contextDn;
 
 	/** The instances cache. */
-	private static Map<Properties, JndiServices> cache;
+	private static Map<Properties, JndiServices> cache = new HashMap<Properties, JndiServices>();
 
 	/** Number of results per page (through PagedResults extended control). */
 	private int pageSize;
@@ -263,9 +263,6 @@
 	 * @throws NamingException
 	 */
 	public static JndiServices getInstance(final Properties props) throws NamingException, IOException {
-		if (cache == null) {
-			cache = new HashMap<Properties, JndiServices>();
-		}
 		if (!cache.containsKey(props)) {
 			cache.put(props, new JndiServices(props));
 		}



More information about the lsc-changes mailing list