jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1389865 - in /jackrabbit/oak/trunk: oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java oak-it/mk/pom.xml oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
Date Tue, 25 Sep 2012 13:53:56 GMT
Author: mduerig
Date: Tue Sep 25 13:53:56 2012
New Revision: 1389865

URL: http://svn.apache.org/viewvc?rev=1389865&view=rev
Log:
OAK-341: Use Guava preconditions instead of asserts to enforce contract

Modified:
    jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java
    jackrabbit/oak/trunk/oak-it/mk/pom.xml
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java

Modified: jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java?rev=1389865&r1=1389864&r2=1389865&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java
(original)
+++ jackrabbit/oak/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/AcceptHeader.java
Tue Sep 25 13:53:56 2012
@@ -22,6 +22,8 @@ import java.util.List;
 import org.apache.tika.mime.MediaType;
 import org.apache.tika.mime.MediaTypeRegistry;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 public class AcceptHeader {
 
     private static final MediaTypeRegistry registry =
@@ -44,7 +46,7 @@ public class AcceptHeader {
     }
 
     public Representation resolve(Representation... representations) {
-        assert representations != null && representations.length > 0;
+        checkArgument(representations != null && representations.length > 0);
         int maxIndex = 0;
         double maxQ = 0.0;
         for (int i = 0; i < representations.length; i++) {

Modified: jackrabbit/oak/trunk/oak-it/mk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/pom.xml?rev=1389865&r1=1389864&r2=1389865&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-it/mk/pom.xml Tue Sep 25 13:53:56 2012
@@ -77,6 +77,11 @@
       <version>1.0.1</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+    </dependency>
   </dependencies>
 
 </project>

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java?rev=1389865&r1=1389864&r2=1389865&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/AbstractMicroKernelIT.java
Tue Sep 25 13:53:56 2012
@@ -32,6 +32,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.runners.Parameterized.Parameters;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -94,7 +95,7 @@ public abstract class AbstractMicroKerne
      * @param nodeCount number of nodes that the test cluster should contain
      */
     protected AbstractMicroKernelIT(MicroKernelFixture fixture, int nodeCount) {
-        assert nodeCount > 0;
+        checkArgument(nodeCount > 0);
         this.fixture = fixture;
         this.mks = new MicroKernel[nodeCount];
     }



Mime
View raw message