Jamie Doornbos points out that I made a booboo here.
Our getOr() will skip the first argument if it is "blank" (null, empty, or all whitespace), not just null. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2783 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -126,7 +126,6 @@ public class StringUtil
|
|||||||
/**
|
/**
|
||||||
* Returns the string if it is non-blank (see {@link #isBlank}), the default value otherwise.
|
* Returns the string if it is non-blank (see {@link #isBlank}), the default value otherwise.
|
||||||
*/
|
*/
|
||||||
@ReplacedBy("com.google.common.base.Object.firstNonNull()")
|
|
||||||
public static String getOr (String value, String defval)
|
public static String getOr (String value, String defval)
|
||||||
{
|
{
|
||||||
return isBlank(value) ? defval : value;
|
return isBlank(value) ? defval : value;
|
||||||
|
|||||||
Reference in New Issue
Block a user