jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r631552 - in /jackrabbit/trunk/jackrabbit-core/src/main: java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java java/org/apache/jackrabbit/core/value/InternalValue.java javacc/fulltext/QueryParser.jjt
Date Wed, 27 Feb 2008 11:03:20 GMT
Author: stefan
Date: Wed Feb 27 03:03:04 2008
New Revision: 631552

URL: http://svn.apache.org/viewvc?rev=631552&view=rev
Log:
JCR-1424: [PATCH] simplify conversion of strings to primitives by using parseXXX, not valueOf(xxx).xxxValue()

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
    jackrabbit/trunk/jackrabbit-core/src/main/javacc/fulltext/QueryParser.jjt

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java?rev=631552&r1=631551&r2=631552&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
Wed Feb 27 03:03:04 2008
@@ -116,7 +116,7 @@
     }
 
     public void setInitialCapacity(String initialCapacity) {
-        this.initialCapacity = Integer.valueOf(initialCapacity).intValue();
+        this.initialCapacity = Integer.parseInt(initialCapacity);
     }
 
     public String getInitialCapacity() {
@@ -128,7 +128,7 @@
     }
 
     public void setLoadFactor(String loadFactor) {
-        this.loadFactor = Float.valueOf(loadFactor).floatValue();
+        this.loadFactor = Float.parseFloat(loadFactor);
     }
 
     public String getLoadFactor() {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java?rev=631552&r1=631551&r2=631552&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
Wed Feb 27 03:03:04 2008
@@ -501,9 +501,9 @@
             case PropertyType.DATE:
                 return create(ISO8601.parse(s));
             case PropertyType.DOUBLE:
-                return create(Double.valueOf(s).doubleValue());
+                return create(Double.parseDouble(s));
             case PropertyType.LONG:
-                return create(Long.valueOf(s).longValue());
+                return create(Long.parseLong(s));
             case PropertyType.REFERENCE:
                 return create(new UUID(s));
             case PropertyType.PATH:

Modified: jackrabbit/trunk/jackrabbit-core/src/main/javacc/fulltext/QueryParser.jjt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/javacc/fulltext/QueryParser.jjt?rev=631552&r1=631551&r2=631552&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/javacc/fulltext/QueryParser.jjt (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/javacc/fulltext/QueryParser.jjt Wed Feb 27 03:03:04
2008
@@ -795,7 +795,7 @@
       if (boost != null) {
         float f = (float)1.0;
   try {
-    f = Float.valueOf(boost.image).floatValue();
+    f = Float.parseFloat(boost.image);
           q.setBoost(f);
   } catch (Exception ignored) { }
       }
@@ -838,7 +838,7 @@
        } else if (fuzzy) {
        	  float fms = fuzzyMinSim;
        	  try {
-            fms = Float.valueOf(fuzzySlop.image.substring(1)).floatValue();
+            fms = Float.parseFloat(fuzzySlop.image.substring(1));
        	  } catch (Exception ignored) { }
        	 if(fms < 0.0f || fms > 1.0f){
        	   throw new ParseException("Minimum similarity for a FuzzyQuery has to be between
0.0f and 1.0f !");



Mime
View raw message