Browse Source

Let Project.toBoolean(String) handle null as argument.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275179 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 22 years ago
parent
commit
70ba81f024
2 changed files with 8 additions and 6 deletions
  1. +4
    -1
      WHATSNEW
  2. +4
    -5
      src/main/org/apache/tools/ant/Project.java

+ 4
- 1
WHATSNEW View File

@@ -233,6 +233,9 @@ Fixed bugs:
or in the top package. or in the top package.
Bugzilla Report 21915. Bugzilla Report 21915.


* Project.toBoolean(String) now handles null as argument and does not throw a
NullPointerException any more.

Other changes: Other changes:
-------------- --------------
* All tasks can be used outside of <target>s. Note that some tasks * All tasks can be used outside of <target>s. Note that some tasks
@@ -586,7 +589,7 @@ Other changes:
Bugzilla Report 22533. Bugzilla Report 22533.


* additional shortcuts for ant options (-d --> -debug, -e --> -emacs, * additional shortcuts for ant options (-d --> -debug, -e --> -emacs,
-h --> -help, -p --> -projecthelp, -s --> -find)
-h --> -help, -p --> -projecthelp, -s --> -find).


Changes from Ant 1.5.3 to Ant 1.5.4 Changes from Ant 1.5.3 to Ant 1.5.4
=================================== ===================================


+ 4
- 5
src/main/org/apache/tools/ant/Project.java View File

@@ -1569,16 +1569,15 @@ public class Project {
* or <code>"yes"</code> is found, ignoring case. * or <code>"yes"</code> is found, ignoring case.
* *
* @param s The string to convert to a boolean value. * @param s The string to convert to a boolean value.
* Must not be <code>null</code>.
* *
* @return <code>true</code> if the given string is <code>"on"</code>, * @return <code>true</code> if the given string is <code>"on"</code>,
* <code>"true"</code> or <code>"yes"</code>, or * <code>"true"</code> or <code>"yes"</code>, or
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public static boolean toBoolean(String s) { public static boolean toBoolean(String s) {
return (s.equalsIgnoreCase("on")
|| s.equalsIgnoreCase("true")
|| s.equalsIgnoreCase("yes"));
return ("on".equalsIgnoreCase(s)
|| "true".equalsIgnoreCase(s)
|| "yes".equalsIgnoreCase(s));
} }


/** /**
@@ -2097,4 +2096,4 @@ public class Project {
// is private/protected. // is private/protected.
} }
} }
}
}

Loading…
Cancel
Save