[lsc-changes] r462 - lsc/trunk/src/main/java/org/lsc/service

jclarke at lsc-project.org jclarke at lsc-project.org
Sun Nov 29 13:08:47 CET 2009


Author: jclarke
Date: 2009-11-29 13:08:46 +0100 (Sun, 29 Nov 2009)
New Revision: 462

Modified:
   lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java
Log:
Some optimizations on variable declarations

Modified: lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java	2009-11-26 17:52:03 UTC (rev 461)
+++ lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java	2009-11-29 12:08:46 UTC (rev 462)
@@ -122,22 +122,25 @@
 		try {
 			List<HashMap<String, Object>> ids = (List<HashMap<String, Object>>) sqlMapper.queryForList(getRequestNameForList(), null);
 			Iterator<HashMap<String, Object>> idsIter = ids.iterator();
+			String key;
+			HashMap<String, Object> idMap;
+			LscAttributes la;
+			
 			for (int count = 1; idsIter.hasNext(); count++) {
-				HashMap<String, Object> idMap = idsIter.next();
+				idMap = idsIter.next();
 
-				// the key of the result Map is usally the DN
+				// the key of the result Map is usually the DN
 				// since we don't have a DN from a database, we use a concatenation of:
 				//     - all pivot attributes
 				//     - a count of all objects (to make sure the key is unique)
 				// unless there's only one pivot, to be backwards compatible
-				String key;
 				if (idMap.values().size() == 1) {
 					key = idMap.values().iterator().next().toString();
 				}
 				else {
 					key = StringUtils.join(idMap.values().iterator(), ", ") + " (" + count + ")";
 				}
-				LscAttributes la = new LscAttributes(idMap);
+				la = new LscAttributes(idMap);
 				ret.put(key, la);
 			}
 		} catch (SQLException e) {



More information about the lsc-changes mailing list