ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1516408 - /ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java
Date Thu, 22 Aug 2013 10:15:11 GMT
Author: bramk
Date: Thu Aug 22 10:15:11 2013
New Revision: 1516408

URL: http://svn.apache.org/r1516408
Log:
ACE-347 Removed redundant null checking

Modified:
    ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java

Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java?rev=1516408&r1=1516407&r2=1516408&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java
(original)
+++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/ConfigurationHandlerImpl.java
Thu Aug 22 10:15:11 2013
@@ -74,8 +74,6 @@ public class ConfigurationHandlerImpl ex
 
     @Override
     public void put(String key, String value) {
-        ensureNotEmpty(key);
-        ensureNotEmpty(value);
         synchronized (this) {
             ensureLoadConfig();
             String previous = (String) m_configProps.put(key, value);
@@ -87,7 +85,6 @@ public class ConfigurationHandlerImpl ex
 
     @Override
     public void remove(String key) {
-        ensureNotEmpty(key);
         synchronized (this) {
             ensureLoadConfig();
             Object value = m_configProps.remove(key);
@@ -99,7 +96,6 @@ public class ConfigurationHandlerImpl ex
 
     @Override
     public String get(String key, String defaultValue) {
-        ensureNotEmpty(key);
         synchronized (this) {
             ensureLoadConfig();
             String value = (String) m_configProps.get(key);
@@ -215,9 +211,4 @@ public class ConfigurationHandlerImpl ex
             throw new IOException("Unable to acces configuration directory: " + dir.getAbsolutePath());
         return dir;
     }
-
-    private static void ensureNotEmpty(String value) {
-        if (value == null || value.equals(""))
-            throw new IllegalArgumentException("Can not pass null as an argument");
-    }
 }



Mime
View raw message