onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1428026 - in /incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration: configuration/ConfigurationModule.java configuration/PropertiesURLReader.java variables/VariablesMap.java
Date Wed, 02 Jan 2013 20:53:01 GMT
Author: simonetripodi
Date: Wed Jan  2 20:53:01 2013
New Revision: 1428026

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

Modified:
    incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/ConfigurationModule.java
    incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/PropertiesURLReader.java
    incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/variables/VariablesMap.java

Modified: incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/ConfigurationModule.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/ConfigurationModule.java?rev=1428026&r1=1428025&r2=1428026&view=diff
==============================================================================
--- incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/ConfigurationModule.java
(original)
+++ incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/ConfigurationModule.java
Wed Jan  2 20:53:01 2013
@@ -19,8 +19,6 @@ package org.apache.onami.configuration.c
  * under the License.
  */
 
-import static com.google.inject.internal.util.$Preconditions.checkNotNull;
-import static com.google.inject.internal.util.$Preconditions.checkState;
 import static com.google.inject.name.Names.named;
 import static java.lang.String.format;
 import static org.apache.onami.configuration.configuration.PropertiesIterator.newPropertiesIterator;
@@ -64,7 +62,10 @@ public abstract class ConfigurationModul
     @Override
     protected final void configure()
     {
-        checkState( readers == null, "Re-entry not allowed" );
+        if ( readers != null )
+        {
+            throw new IllegalStateException( "Re-entry not allowed" );
+        }
 
         readers = new LinkedList<PropertiesURLReader>();
 
@@ -278,4 +279,12 @@ public abstract class ConfigurationModul
         return reader;
     }
 
+    private static void checkNotNull( Object object, String messageFormat, Object...args
)
+    {
+        if ( object == null )
+        {
+            throw new IllegalArgumentException( format( messageFormat, args ) );
+        }
+    }
+
 }

Modified: incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/PropertiesURLReader.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/PropertiesURLReader.java?rev=1428026&r1=1428025&r2=1428026&view=diff
==============================================================================
--- incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/PropertiesURLReader.java
(original)
+++ incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/configuration/PropertiesURLReader.java
Wed Jan  2 20:53:01 2013
@@ -19,7 +19,6 @@ package org.apache.onami.configuration.c
  * under the License.
  */
 
-import static com.google.inject.internal.util.$Preconditions.checkNotNull;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.HttpURLConnection;
@@ -56,7 +55,10 @@ public final class PropertiesURLReader
      */
     public PropertiesURLReader( URL url )
     {
-        checkNotNull( url, "'url' argument can't be null" );
+        if ( url == null)
+        {
+            throw new IllegalArgumentException( "'url' argument can't be null" );
+        }
 
         this.url = url;
     }

Modified: incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/variables/VariablesMap.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/variables/VariablesMap.java?rev=1428026&r1=1428025&r2=1428026&view=diff
==============================================================================
--- incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/variables/VariablesMap.java
(original)
+++ incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/variables/VariablesMap.java
Wed Jan  2 20:53:01 2013
@@ -19,8 +19,6 @@ package org.apache.onami.configuration.v
  * under the License.
  */
 
-import static com.google.inject.internal.util.$Preconditions.checkArgument;
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -47,7 +45,10 @@ public final class VariablesMap implemen
 
     public VariablesMap( Parser parser )
     {
-        checkArgument( parser != null, "Parser used to resolve input variables cannot be
null." );
+        if ( parser == null )
+        {
+            throw new IllegalArgumentException( "Parser used to resolve input variables cannot
be null." );
+        }
         this.parser = parser;
     }
 



Mime
View raw message