jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330526 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: namepath/AbstractNameMapper.java util/CoreValueUtil.java
Date Wed, 25 Apr 2012 20:09:00 GMT
Author: mduerig
Date: Wed Apr 25 20:09:00 2012
New Revision: 1330526

URL: http://svn.apache.org/viewvc?rev=1330526&view=rev
Log:
minor cleanup
- sort modifiers
- use char instead of single character string
- private constructor for utility class

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/CoreValueUtil.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java?rev=1330526&r1=1330525&r2=1330526&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/AbstractNameMapper.java
Wed Apr 25 20:09:00 2012
@@ -18,16 +18,16 @@ package org.apache.jackrabbit.oak.namepa
 
 public abstract class AbstractNameMapper implements NameMapper {
 
-    abstract protected String getJcrPrefix(String oakPrefix);
+    protected abstract String getJcrPrefix(String oakPrefix);
 
-    abstract protected String getOakPrefix(String jcrPrefix);
+    protected abstract String getOakPrefix(String jcrPrefix);
 
-    abstract protected String getOakPrefixFromURI(String uri);
+    protected abstract String getOakPrefixFromURI(String uri);
 
     @Override
     public String getOakName(String jcrName) {
 
-        int pos = jcrName.indexOf(":");
+        int pos = jcrName.indexOf(':');
 
         if (pos < 0) {
             // no colon
@@ -46,7 +46,7 @@ public abstract class AbstractNameMapper
                         // TODO
                         return null;
                     } else {
-                        return oakPref + ":" + name;
+                        return oakPref + ':' + name;
                     }
                 }
             }
@@ -59,14 +59,14 @@ public abstract class AbstractNameMapper
             if (oakPrefix == null) {
                 throw new IllegalArgumentException("prefix '" + pref + "' is not mapped"
);
             } else {
-                return oakPrefix + ":" + name;
+                return oakPrefix + ':' + name;
             }
         }
     }
 
     @Override
     public String getJcrName(String oakName) {
-        int pos = oakName.indexOf(":");
+        int pos = oakName.indexOf(':');
         if (pos < 0) {
             // non-prefixed
             return oakName;
@@ -84,7 +84,7 @@ public abstract class AbstractNameMapper
             if (jcrPrefix == null) {
                 throw new IllegalStateException("invalid oak name: " + oakName);
             } else {
-                return jcrPrefix + ":" + name;
+                return jcrPrefix + ':' + name;
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/CoreValueUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/CoreValueUtil.java?rev=1330526&r1=1330525&r2=1330526&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/CoreValueUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/CoreValueUtil.java
Wed Apr 25 20:09:00 2012
@@ -45,6 +45,10 @@ public class CoreValueUtil {
 
     private static final Map<Integer, String> TYPE2HINT = new HashMap<Integer, String>();
     private static final Map<String, Integer> HINT2TYPE = new HashMap<String, Integer>();
+
+    private CoreValueUtil() {
+    }
+
     static {
         for (int type = PropertyType.UNDEFINED; type <= PropertyType.DECIMAL; type++)
{
             String hint = PropertyType.nameFromValue(type).substring(0,3).toLowerCase();



Mime
View raw message