You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2015/06/08 23:29:07 UTC

svn commit: r1684282 - /uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java

Author: burn
Date: Mon Jun  8 21:29:07 2015
New Revision: 1684282

URL: http://svn.apache.org/r1684282
Log:
UIMA-4293 Fix bug with key-only entries in a specification by accepting an empty value as boolean 'true'

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java?rev=1684282&r1=1684281&r2=1684282&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/CommandLine.java Mon Jun  8 21:29:07 2015
@@ -176,9 +176,10 @@ public class CommandLine
         //   Any capitilaztion of true, t, yes, y, 1  --------> true
         //   Any capitilaztion of false, f, no, n, 0  --------> false
 
-        if ( k.noargs() && get(k) == null ) return true;
+    	String v = get(k);
+        if ( v == null || v.isEmpty()) return true;
 
-        String v = get(k).toUpperCase();
+        v = v.toUpperCase();
         if ( v.equals("TRUE")  || v.equals("T") || v.equals("YES") || v.equals("Y") || v.equals("1") ) return true;
         if ( v.equals("FALSE") || v.equals("F") || v.equals("NO")  || v.equals("N") || v.equals("0") ) return false;
         throw new IllegalArgumentException("Value is not true | false for argument " + k.pname());