jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1522612 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
Date Thu, 12 Sep 2013 15:17:33 GMT
Author: angela
Date: Thu Sep 12 15:17:32 2013
New Revision: 1522612

URL: http://svn.apache.org/r1522612
Log:
fix indention and coding style

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java?rev=1522612&r1=1522611&r2=1522612&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/ConflictValidator.java
Thu Sep 12 15:17:32 2013
@@ -87,8 +87,8 @@ public class ConflictValidator extends D
                     //Conflict details are not made part of ExceptionMessage instead they
are
                     //logged. This to avoid exposing property details to the caller as it
might not have
                     //permission to access it
-                    if(log.isDebugEnabled()){
-                        log.debug(getConflictMessage(),ex);
+                    if (log.isDebugEnabled()) {
+                        log.debug(getConflictMessage(), ex);
                     }
                     throw ex;
                 }
@@ -96,20 +96,20 @@ public class ConflictValidator extends D
         }
     }
 
-    private String getConflictMessage(){
+    private String getConflictMessage() {
         StringBuilder sb = new StringBuilder("Commit failed due to unresolved conflicts in
");
         sb.append(parentAfter.getPath());
         sb.append(" = {");
-        for(Tree conflict : parentAfter.getChild(NodeTypeConstants.REP_OURS).getChildren()){
+        for (Tree conflict : parentAfter.getChild(NodeTypeConstants.REP_OURS).getChildren())
{
             ConflictType ct = ConflictType.fromName(conflict.getName());
 
             sb.append(ct.getName()).append(" = {");
-            if(ct.effectsNode()){
+            if (ct.effectsNode()) {
                 sb.append(getChildNodeNamesAsString(conflict));
             } else {
-                for(PropertyState ps : conflict.getProperties()){
+                for (PropertyState ps : conflict.getProperties()) {
                     PropertyState ours = null, theirs = null;
-                    switch(ct){
+                    switch (ct) {
                         case DELETE_CHANGED_PROPERTY:
                             ours = null;
                             theirs = ps;
@@ -126,47 +126,47 @@ public class ConflictValidator extends D
                     }
 
                     sb.append(ps.getName())
-                      .append(" = {")
-                      .append(toString(ours))
-                      .append(',')
-                      .append(toString(theirs))
-                      .append("}");
+                            .append(" = {")
+                            .append(toString(ours))
+                            .append(',')
+                            .append(toString(theirs))
+                            .append('}');
 
-                    sb.append(",");
+                    sb.append(',');
                 }
-                sb.deleteCharAt(sb.length()-1);
+                sb.deleteCharAt(sb.length() - 1);
             }
 
             sb.append("},");
         }
 
         sb.deleteCharAt(sb.length() - 1);
-        sb.append("}");
+        sb.append('}');
         return sb.toString();
     }
 
-    private static String getChildNodeNamesAsString(Tree t){
+    private static String getChildNodeNamesAsString(Tree t) {
         return Joiner.on(',').join(transform(t.getChildren(), Tree.GET_NAME));
     }
 
-    private static String toString(PropertyState ps){
-        if(ps == null){
+    private static String toString(PropertyState ps) {
+        if (ps == null) {
             return "<N/A>";
         }
 
         final Type type = ps.getType();
-        if(type.isArray()){
+        if (type.isArray()) {
             return "<ARRAY>";
         }
-        if(Type.BINARY == type){
+        if (Type.BINARY == type) {
             return "<BINARY>";
         }
 
         String value = ps.getValue(Type.STRING);
 
         //Trim the value so as to not blowup diff message
-        if(Type.STRING == type && value.length() > 10){
-            value = value.substring(0,10) + "...";
+        if (Type.STRING == type && value.length() > 10) {
+            value = value.substring(0, 10) + "...";
         }
 
         return value;



Mime
View raw message