Subversion Repository Public Repository

litesoft

Diff Revisions 421 vs 422 for /trunk/Java/ScarPlus/src/com/esotericsoftware/scar/support/Arguments.java

Diff revisions: vs.
  @@ -2,6 +2,7 @@
2 2
3 3 import java.util.*;
4 4
5 + import com.esotericsoftware.scar.*;
5 6 import com.esotericsoftware.utils.*;
6 7
7 8 /**
  @@ -42,14 +43,17 @@
42 43 {
43 44 for ( String zArg : pArgs )
44 45 {
45 - int at = zArg.indexOf( '=' );
46 - if ( at == -1 )
46 + if ( null != (zArg = Utils.noEmpty( zArg )) )
47 47 {
48 - set( zArg, "" );
49 - }
50 - else
51 - {
52 - set( zArg.substring( 0, at ), zArg.substring( at + 1 ).trim() );
48 + int at = zArg.indexOf( '=' );
49 + if ( at == -1 )
50 + {
51 + set( zArg, "" );
52 + }
53 + else
54 + {
55 + set( zArg.substring( 0, at ), zArg.substring( at + 1 ).trim() );
56 + }
53 57 }
54 58 }
55 59 }
  @@ -61,7 +65,7 @@
61 65
62 66 /**
63 67 * Get (and remove if there) the 'Next' Name/Value.
64 - *
68 + * <p/>
65 69 * Returns null means no more.
66 70 */
67 71 public NameValuePair getNext()
  @@ -76,10 +80,10 @@
76 80
77 81 /**
78 82 * Get (and remove if there) the value assocciated w/ pName.
79 - *
83 + * <p/>
80 84 * Returns the value of the argument with the specified Name,
81 - * or "" if the argument was specified without a value,
82 - * or null if it was not specified.
85 + * or "" if the argument was specified without a value,
86 + * or null if it was not specified.
83 87 */
84 88 public String get( String pName )
85 89 {
  @@ -88,10 +92,10 @@
88 92
89 93 /**
90 94 * Get (and remove if there) the value assocciated w/ pName.
91 - *
95 + * <p/>
92 96 * Returns the value of the argument with the specified Name,
93 - * or "" if the argument was specified without a value,
94 - * or pDefaultValue if it was not specified.
97 + * or "" if the argument was specified without a value,
98 + * or pDefaultValue if it was not specified.
95 99 */
96 100 public String get( String pName, String pDefaultValue )
97 101 {