[lsc-changes] r296 - lsc/branches/v1.1/src/main/java/org/lsc/beans

jclarke at lsc-project.org jclarke at lsc-project.org
Mon Jul 20 12:23:32 CEST 2009


Author: jclarke
Date: 2009-07-20 12:23:32 +0200 (Mon, 20 Jul 2009)
New Revision: 296

Modified:
   lsc/branches/v1.1/src/main/java/org/lsc/beans/BeanComparator.java
Log:
Rename variable to be a bit more useful

Modified: lsc/branches/v1.1/src/main/java/org/lsc/beans/BeanComparator.java
===================================================================
--- lsc/branches/v1.1/src/main/java/org/lsc/beans/BeanComparator.java	2009-07-19 22:34:07 UTC (rev 295)
+++ lsc/branches/v1.1/src/main/java/org/lsc/beans/BeanComparator.java	2009-07-20 10:23:32 UTC (rev 296)
@@ -543,14 +543,14 @@
         Attribute toReplaceAttr = new BasicAttribute(srcAttr.getID());
         NamingEnumeration<?> srcNe = srcAttr.getAll();
         while (srcNe.hasMore()) {
-        	Object value = srcNe.next();
+        	Object srcValue = srcNe.next();
 
-        	if (value != null) {
-        		toReplaceAttr.add(value);
+        	if (srcValue != null) {
+        		toReplaceAttr.add(srcValue);
 
         		// Handle binary attribute specifically
-        		if (value.getClass().isAssignableFrom(byte[].class)) {
-        			ByteBuffer srcBuff = ByteBuffer.wrap((byte[]) value);
+        		if (srcValue.getClass().isAssignableFrom(byte[].class)) {
+        			ByteBuffer srcBuff = ByteBuffer.wrap((byte[]) srcValue);
         			for (Object dstValue : dstAttrValues) {
         				// make sure destination value is a byte[] too
         				if (dstValue.getClass().isAssignableFrom(String.class)) {
@@ -568,7 +568,7 @@
         				}
         			}
         		} else {
-        			if (!dstAttrValues.contains(value)) {
+        			if (!dstAttrValues.contains(srcValue)) {
         				differs = true;
         			}
         		}
@@ -578,11 +578,11 @@
         // check if there are any values in dstAttr not in srcAttr
         Iterator<Object> dstIt = dstAttrValues.iterator(); 
         while (dstIt.hasNext()) {
-        	Object value = dstIt.next();
+        	Object dstValue = dstIt.next();
 
         	// Handle binary attribute specifically
-        	if (value.getClass().isAssignableFrom(byte[].class)) {
-        		ByteBuffer destBuff = ByteBuffer.wrap((byte[]) value);
+        	if (dstValue.getClass().isAssignableFrom(byte[].class)) {
+        		ByteBuffer destBuff = ByteBuffer.wrap((byte[]) dstValue);
 
         		NamingEnumeration<?> toReplaceAttrValues = toReplaceAttr.getAll();      
 
@@ -605,7 +605,7 @@
         			}
         		}
         	} else {
-        		if (!toReplaceAttr.contains(value)) {
+        		if (!toReplaceAttr.contains(dstValue)) {
         			differs = true;
         			break;
         		}
@@ -613,6 +613,7 @@
         }
 
         if (differs) {
+            LOGGER.debug("Attribute " + dstAttr.getID() + ": source values are " + srcAttr + ", old values were " + dstAttr + ", new values are " + toReplaceAttr);
             return new ModificationItem(DirContext.REPLACE_ATTRIBUTE, toReplaceAttr);
         } else {
             return null;



More information about the lsc-changes mailing list