You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/01/25 18:33:44 UTC

svn commit: r1235847 - /maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java

Author: rfscholte
Date: Wed Jan 25 17:33:44 2012
New Revision: 1235847

URL: http://svn.apache.org/viewvc?rev=1235847&view=rev
Log:
MEAR-141: Fix String.isEmpty() signature

Modified:
    maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java

Modified: maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java?rev=1235847&r1=1235846&r2=1235847&view=diff
==============================================================================
--- maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java (original)
+++ maven/plugins/trunk/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EnvEntry.java Wed Jan 25 17:33:44 2012
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.ear;
  * under the License.
  */
 
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.XMLWriter;
 
 /**
@@ -51,11 +52,11 @@ class EnvEntry
 
     public EnvEntry( String description, String name, String type, String value )
     {
-        if ( isNullOrEmpty( name ) )
+        if ( StringUtils.isEmpty( name ) )
         {
             throw new IllegalArgumentException( ENV_ENTRY_NAME + " in " + ENV_ENTRY + " element cannot be null." );
         }
-        else if ( isNullOrEmpty( type ) && isNullOrEmpty( value ) )
+        else if ( StringUtils.isEmpty( type ) && StringUtils.isEmpty( value ) )
         {
             throw new IllegalArgumentException(
                 ENV_ENTRY_TYPE + " in " + ENV_ENTRY + " element cannot be null if no " + ENV_ENTRY_VALUE +
@@ -131,15 +132,10 @@ class EnvEntry
         writer.endElement();
     }
 
-    private boolean isNullOrEmpty( String s )
-    {
-        return s == null || s.trim().isEmpty();
-    }
-
     public String toString()
     {
         return "env-entry [name=" + getName() + ", type=" + getType() + ", value=" + getValue() + "]";
     }
 
 
-}
+}
\ No newline at end of file