onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1432617 - /incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java
Date Sun, 13 Jan 2013 13:50:37 GMT
Author: simonetripodi
Date: Sun Jan 13 13:50:37 2013
New Revision: 1432617

URL: http://svn.apache.org/viewvc?rev=1432617&view=rev
Log:
[ONAMI-28] Do not use code from com.google.inject.internal

Modified:
    incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java

Modified: incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java?rev=1432617&r1=1432616&r2=1432617&view=diff
==============================================================================
--- incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java (original)
+++ incubator/onami/trunk/spi/src/main/java/org/apache/onami/spi/ServiceLoader.java Sun Jan
13 13:50:37 2013
@@ -20,7 +20,6 @@ package org.apache.onami.spi;
  */
 
 import static java.lang.System.getProperty;
-import static com.google.inject.internal.util.$Preconditions.checkArgument;
 import static java.lang.ClassLoader.getSystemClassLoader;
 import static java.lang.String.format;
 import static java.lang.Thread.currentThread;
@@ -66,8 +65,14 @@ final class ServiceLoader<S>
      */
     public static <S> ServiceLoader<S> load( Class<S> service, ClassLoader
classLoader )
     {
-        checkArgument( service != null, "Parameter 'service' must not be null" );
-        checkArgument( classLoader != null, "Parameter 'classLoader' must not be null" );
+        if ( service == null )
+        {
+            throw new IllegalArgumentException( "Parameter 'service' must not be null" );
+        }
+        if ( classLoader == null )
+        {
+            throw new IllegalArgumentException( "Parameter 'classLoader' must not be null"
);
+        }
 
         return new ServiceLoader<S>( service, classLoader );
     }



Mime
View raw message