jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1364616 - in /jackrabbit/oak/trunk/oak-mk/src: main/java/org/apache/jackrabbit/mk/blobs/ test/java/org/apache/jackrabbit/mk/json/ test/java/org/apache/jackrabbit/mk/util/
Date Mon, 23 Jul 2012 12:58:30 GMT
Author: thomasm
Date: Mon Jul 23 12:58:30 2012
New Revision: 1364616

URL: http://svn.apache.org/viewvc?rev=1364616&view=rev
Log:
OAK-202 Simplify the code when possible

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/IOUtilsTest.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/MicroKernelInputStreamTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java?rev=1364616&r1=1364615&r2=1364616&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
Mon Jul 23 12:58:30 2012
@@ -331,7 +331,7 @@ public abstract class AbstractBlobStore 
                 return;
             } else if (type == TYPE_DATA) {
                 int len = IOUtils.readVarInt(idStream);
-                IOUtils.skipFully(idStream, (int) len);
+                IOUtils.skipFully(idStream, len);
             } else if (type == TYPE_HASH) {
                 int level = IOUtils.readVarInt(idStream);
                 // totalLength

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java?rev=1364616&r1=1364615&r2=1364616&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
Mon Jul 23 12:58:30 2012
@@ -19,8 +19,6 @@ package org.apache.jackrabbit.mk.json;
 import junit.framework.TestCase;
 import org.apache.jackrabbit.mk.util.StopWatch;
 
-import java.io.IOException;
-
 public class JsopStreamTest extends TestCase {
 
     // run the micro-benchmark
@@ -57,7 +55,7 @@ public class JsopStreamTest extends Test
         testRawValue(new JsopTokenizer(s.toString()));
     }
 
-    private void testRawValue(JsopReader s) {
+    private static void testRawValue(JsopReader s) {
         for (int i = 0; i < 3; i++) {
             assertFalse(s.matches('-'));
             assertTrue(s.matches('+'));
@@ -193,7 +191,7 @@ public class JsopStreamTest extends Test
         }
     }
 
-    public void testBuilder() throws IOException {
+    public static void testBuilder() {
 
         JsopWriter buff = new JsopStream();
         buff.tag('+').object().

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java?rev=1364616&r1=1364615&r2=1364616&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
Mon Jul 23 12:58:30 2012
@@ -19,8 +19,6 @@ package org.apache.jackrabbit.mk.json;
 import junit.framework.TestCase;
 import org.apache.jackrabbit.mk.util.StopWatch;
 
-import java.io.IOException;
-
 /**
  * Test the Jsop tokenizer and builder.
  */
@@ -36,7 +34,7 @@ public class JsopTest extends TestCase {
             for (int i = 0; i < 10000000; i++) {
                 t2 += JsopBuilder.encode(s).length();
             }
-            System.out.println(timer.seconds());
+            System.out.println(timer.seconds() + " dummy: " + t2);
         }
         // old: not escaped: 5691 ms; escaped: 10609 ms
         // new: not escaped: 3931 ms; escaped: 11001 ms
@@ -290,7 +288,7 @@ public class JsopTest extends TestCase {
         }
     }
 
-    public void testBuilder() throws IOException {
+    public void testBuilder() {
 
         JsopBuilder buff = new JsopBuilder();
         buff.tag('+').object().
@@ -334,7 +332,7 @@ public class JsopTest extends TestCase {
 
     }
 
-    public void testEscape() throws IOException {
+    public void testEscape() {
         assertEquals("null", JsopBuilder.encode(null));
         JsopBuilder buff = new JsopBuilder().
                 key("back\\slash").value("\\").

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/IOUtilsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/IOUtilsTest.java?rev=1364616&r1=1364615&r2=1364616&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/IOUtilsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/IOUtilsTest.java
Mon Jul 23 12:58:30 2012
@@ -212,7 +212,7 @@ public class IOUtilsTest extends TestCas
         }
     }
 
-    private void testVarInt(int x, int expectedLen) throws IOException {
+    private static void testVarInt(int x, int expectedLen) throws IOException {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         IOUtils.writeVarInt(out, x);
         byte[] data = out.toByteArray();
@@ -226,7 +226,7 @@ public class IOUtilsTest extends TestCas
         assertEquals(-1, in.read());
     }
 
-    private void testVarLong(long x, int expectedLen) throws IOException {
+    private static void testVarLong(long x, int expectedLen) throws IOException {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         IOUtils.writeVarLong(out, x);
         byte[] data = out.toByteArray();

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/MicroKernelInputStreamTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/MicroKernelInputStreamTest.java?rev=1364616&r1=1364615&r2=1364616&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/MicroKernelInputStreamTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/util/MicroKernelInputStreamTest.java
Mon Jul 23 12:58:30 2012
@@ -77,7 +77,7 @@ public class MicroKernelInputStreamTest 
         assertByteArrayEquals(expectedData, expectedLen, got);
     }
 
-    private void assertByteArrayEquals(byte[] expected, int expectedLen, byte[] got) {
+    private static void assertByteArrayEquals(byte[] expected, int expectedLen, byte[] got)
{
         assertEquals(expectedLen, got.length);
         for (int j = 0; j < expectedLen; j++) {
             if (expected[j] != got[j]) {



Mime
View raw message