Author: cziegeler
Date: Tue Feb 16 15:04:34 2010
New Revision: 910548

URL: http://svn.apache.org/viewvc?rev=910548&view=rev
Log:
clean up code.

Modified:
    
sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/test/JSONAssert.java

Modified: 
sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/test/JSONAssert.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/test/JSONAssert.java?rev=910548&r1=910547&r2=910548&view=diff
==============================================================================
--- 
sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/test/JSONAssert.java
 (original)
+++ 
sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/test/JSONAssert.java
 Tue Feb 16 15:04:34 2010
@@ -26,7 +26,7 @@
 
 /**
  * Provides assertions on equality for JSON Arrays and Objects.
- * 
+ *
  * Based on code written by Andres Almiray <[email protected]> as
  * part of the json-lib project - http://json-lib.sourceforge.net/
  */
@@ -76,10 +76,9 @@
                        if (JSONObject.NULL.equals(o1)) {
                                if (JSONObject.NULL.equals(o2)) {
                                        continue;
-                               } else {
-                                       fail(header + "arrays first differed at 
element [" + i
-                                                       + "];");
-                               }
+                }
+                               fail(header + "arrays first differed at element 
[" + i
+                                               + "];");
                        } else {
                                if (JSONObject.NULL.equals(o2)) {
                                        fail(header + "arrays first differed at 
element [" + i
@@ -134,7 +133,7 @@
                if (expectedNames == null) {
                    expectedNames = new JSONArray();
                }
-               
+
                if (actualNames == null) {
                    actualNames = new JSONArray();
                }
@@ -145,16 +144,15 @@
                                + actualNames.length(), expectedNames.length(), 
actualNames
                                .length());
                for (Iterator<String> keys = expected.keys(); keys.hasNext();) {
-                       String key = (String) keys.next();
+                       String key = keys.next();
                        Object o1 = expected.opt(key);
                        Object o2 = actual.opt(key);
 
                        if (JSONObject.NULL.equals(o1)) {
                                if (JSONObject.NULL.equals(o2)) {
                                        continue;
-                               } else {
-                                       fail(header + "objects differed at key 
[" + key + "];");
-                               }
+                }
+                               fail(header + "objects differed at key [" + key 
+ "];");
                        } else {
                                if (JSONObject.NULL.equals(o2)) {
                                        fail(header + "objects differed at key 
[" + key + "];");


Reply via email to