blank() -> isBlank().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1731 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -229,7 +229,7 @@ public class StaticConnectionProvider implements ConnectionProvider
|
||||
throws PersistenceException
|
||||
{
|
||||
String value = props.getProperty(name);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
// augment the error message
|
||||
errmsg = "Unable to get connection. " + errmsg;
|
||||
throw new PersistenceException(errmsg);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class UserManager
|
||||
|
||||
// look up any override to our user auth cookie
|
||||
String authCook = config.getProperty("auth_cookie.name");
|
||||
if (!StringUtil.blank(authCook)) {
|
||||
if (!StringUtil.isBlank(authCook)) {
|
||||
_userAuthCookie = authCook;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ParameterUtil
|
||||
String[] values = req.getParameterValues(name);
|
||||
if (values != null) {
|
||||
for (int ii = 0; ii < values.length; ii++) {
|
||||
if (!StringUtil.blank(values[ii])) {
|
||||
if (!StringUtil.isBlank(values[ii])) {
|
||||
ints.add(parseIntParameter(values[ii], invalidDataMessage));
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class ParameterUtil
|
||||
String[] values = req.getParameterValues(name);
|
||||
if (values != null) {
|
||||
for (int ii = 0; ii < values.length; ii++) {
|
||||
if (!StringUtil.blank(values[ii])) {
|
||||
if (!StringUtil.isBlank(values[ii])) {
|
||||
set.add(values[ii]);
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class ParameterUtil
|
||||
HttpServletRequest req, String name, String defval)
|
||||
{
|
||||
String value = req.getParameter(name);
|
||||
return StringUtil.blank(value) ? defval : value.trim();
|
||||
return StringUtil.isBlank(value) ? defval : value.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,7 +184,7 @@ public class ParameterUtil
|
||||
throws DataValidationException
|
||||
{
|
||||
String value = getParameter(req, name, false);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return defval;
|
||||
}
|
||||
return parseIntParameter(value, invalidDataMessage);
|
||||
@@ -202,7 +202,7 @@ public class ParameterUtil
|
||||
throws DataValidationException
|
||||
{
|
||||
String value = getParameter(req, name, false);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return defval;
|
||||
}
|
||||
return parseLongParameter(value, invalidDataMessage);
|
||||
@@ -218,7 +218,7 @@ public class ParameterUtil
|
||||
throws DataValidationException
|
||||
{
|
||||
String value = getParameter(req, name, true);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
throw new DataValidationException(missingDataMessage);
|
||||
}
|
||||
return value;
|
||||
@@ -271,7 +271,7 @@ public class ParameterUtil
|
||||
throws DataValidationException
|
||||
{
|
||||
String value = getParameter(req, name, false);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
return parseDateParameter(value, invalidDataMessage);
|
||||
@@ -302,7 +302,7 @@ public class ParameterUtil
|
||||
{
|
||||
String value = getParameter(req, name, true);
|
||||
return (value == null) ? defaultValue :
|
||||
!StringUtil.blank(req.getParameter(name));
|
||||
!StringUtil.isBlank(req.getParameter(name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,7 +75,7 @@ public class RequestUtils
|
||||
buf.insert(csidx, servername);
|
||||
}
|
||||
String query = req.getQueryString();
|
||||
if (!StringUtil.blank(query)) {
|
||||
if (!StringUtil.isBlank(query)) {
|
||||
buf.append("?").append(query);
|
||||
}
|
||||
return buf.toString();
|
||||
|
||||
@@ -118,7 +118,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
||||
// the Java text stuff freaks out in a variety of ways if it is
|
||||
// asked to deal with the empty string, so we fake blank labels by
|
||||
// just using a space
|
||||
if (StringUtil.blank(text)) {
|
||||
if (StringUtil.isBlank(text)) {
|
||||
_text = " ";
|
||||
} else if (!text.equals(_text)) {
|
||||
_text = text;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SimpleSlider extends JPanel
|
||||
public void setLabel (String label)
|
||||
{
|
||||
_label.setText(label);
|
||||
_label.setVisible(!StringUtil.blank(label));
|
||||
_label.setVisible(!StringUtil.isBlank(label));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -420,7 +420,7 @@ public class ConfigUtil
|
||||
}
|
||||
|
||||
// if the root extends another file, resolve that first
|
||||
if (!StringUtil.blank(root._extends)) {
|
||||
if (!StringUtil.isBlank(root._extends)) {
|
||||
try {
|
||||
loadInheritedProperties(root._extends, loader, target);
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
@@ -519,7 +519,7 @@ public class ConfigUtil
|
||||
protected static String[] parseValues (String line)
|
||||
{
|
||||
String value = parseValue(line);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -645,13 +645,13 @@ public class ConfigUtil
|
||||
public void validate ()
|
||||
throws IOException
|
||||
{
|
||||
if (StringUtil.blank(_package)) {
|
||||
if (StringUtil.isBlank(_package)) {
|
||||
throw new IOException(
|
||||
"Properties file missing '_package' identifier " + this);
|
||||
}
|
||||
|
||||
if ((_overrides != null && _overrides.length > 0) &&
|
||||
(!StringUtil.blank(_extends))) {
|
||||
(!StringUtil.isBlank(_extends))) {
|
||||
throw new IOException("Properties file cannot use both " +
|
||||
"'_overrides' and '_extends' " + this);
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ public class DefaultLogProvider implements LogProvider
|
||||
try {
|
||||
// enable vt100 escape codes if requested
|
||||
String pstr = System.getProperty("log_vt100");
|
||||
if (!StringUtil.blank(pstr)) {
|
||||
if (!StringUtil.isBlank(pstr)) {
|
||||
_useVT100 = pstr.equalsIgnoreCase("true");
|
||||
}
|
||||
String wstr = System.getProperty("wrap_log");
|
||||
if (!StringUtil.blank(wstr)) {
|
||||
if (!StringUtil.isBlank(wstr)) {
|
||||
_wrapLog = wstr.equalsIgnoreCase("true");
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class KeyUtil
|
||||
public static boolean verifyLuhn (String key)
|
||||
{
|
||||
// If there is a non digit, or it is all zeros.
|
||||
if (StringUtil.blank(key) || key.matches(".*\\D.*") ||
|
||||
if (StringUtil.isBlank(key) || key.matches(".*\\D.*") ||
|
||||
key.matches("^[0]+$")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public final class Log
|
||||
// try setting our default log level for this package
|
||||
try {
|
||||
String lstr = System.getProperty("log_level:" + moduleName);
|
||||
if (!StringUtil.blank(lstr)) {
|
||||
if (!StringUtil.isBlank(lstr)) {
|
||||
int level = levelFromString(lstr);
|
||||
if (level != -1) {
|
||||
_provider.setLevel(moduleName, level);
|
||||
@@ -230,7 +230,7 @@ public final class Log
|
||||
// now set our log level
|
||||
try {
|
||||
String lstr = System.getProperty("log_level");
|
||||
if (!StringUtil.blank(lstr)) {
|
||||
if (!StringUtil.isBlank(lstr)) {
|
||||
int level = levelFromString(lstr);
|
||||
if (level != -1) {
|
||||
_provider.setLevel(level);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class LoggingLogProvider
|
||||
protected final Logger getLogger (String moduleName)
|
||||
{
|
||||
Logger logger = Logger.global;
|
||||
if (!StringUtil.blank(moduleName)) {
|
||||
if (!StringUtil.isBlank(moduleName)) {
|
||||
logger = (Logger)_loggers.get(moduleName);
|
||||
if (logger == null) {
|
||||
_loggers.put(moduleName,
|
||||
|
||||
@@ -383,7 +383,7 @@ public class RuntimeAdjust
|
||||
protected void redisplay ()
|
||||
{
|
||||
if (_display != null) {
|
||||
_display.setText(StringUtil.blank(_value) ? "(unset)" : _value);
|
||||
_display.setText(StringUtil.isBlank(_value) ? "(unset)" : _value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class TermUtil
|
||||
/** Converts the string to an integer, returning -1 on any error. */
|
||||
protected static int safeToInt (String intstr)
|
||||
{
|
||||
if (!StringUtil.blank(intstr)) {
|
||||
if (!StringUtil.isBlank(intstr)) {
|
||||
try {
|
||||
return Integer.parseInt(intstr);
|
||||
} catch (NumberFormatException nfe) {
|
||||
|
||||
@@ -95,13 +95,13 @@ public class Application
|
||||
// create a site resource loader if the user set up the
|
||||
// site-specific jar file path
|
||||
String siteJarPath = getInitParameter(config, SITE_JAR_PATH_KEY);
|
||||
if (!StringUtil.blank(siteJarPath)) {
|
||||
if (!StringUtil.isBlank(siteJarPath)) {
|
||||
_siteLoader = new SiteResourceLoader(_siteIdent, siteJarPath);
|
||||
}
|
||||
|
||||
// instantiate our message manager if the application wants one
|
||||
String bundlePath = getInitParameter(config, MESSAGE_BUNDLE_PATH_KEY);
|
||||
if (!StringUtil.blank(bundlePath)) {
|
||||
if (!StringUtil.isBlank(bundlePath)) {
|
||||
_msgmgr = new MessageManager(bundlePath, null);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class Application
|
||||
if (_msgmgr != null && _siteLoader != null) {
|
||||
String siteBundlePath = getInitParameter(
|
||||
config, SITE_MESSAGE_BUNDLE_PATH_KEY);
|
||||
if (!StringUtil.blank(siteBundlePath)) {
|
||||
if (!StringUtil.isBlank(siteBundlePath)) {
|
||||
_msgmgr.activateSiteSpecificMessages(
|
||||
siteBundlePath, _siteLoader, _siteIdent);
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ public class DispatcherServlet extends VelocityServlet
|
||||
// load up our application configuration
|
||||
try {
|
||||
String appcl = config.getInitParameter(APP_CLASS_KEY);
|
||||
if (StringUtil.blank(appcl)) {
|
||||
if (StringUtil.isBlank(appcl)) {
|
||||
_app = new Application();
|
||||
} else {
|
||||
Class appclass = Class.forName(appcl);
|
||||
@@ -196,7 +196,7 @@ public class DispatcherServlet extends VelocityServlet
|
||||
// now initialize the applicaiton
|
||||
String logicPkg = config.getInitParameter(LOGIC_PKG_KEY);
|
||||
_app.init(config, getServletContext(),
|
||||
StringUtil.blank(logicPkg) ? "" : logicPkg);
|
||||
StringUtil.isBlank(logicPkg) ? "" : logicPkg);
|
||||
|
||||
} catch (Throwable t) {
|
||||
Log.warning("Error instantiating application.");
|
||||
|
||||
@@ -349,7 +349,7 @@ public class FormTool
|
||||
{
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("<textarea name=\"").append(name).append("\"");
|
||||
if (!StringUtil.blank(extra)) {
|
||||
if (!StringUtil.isBlank(extra)) {
|
||||
buf.append(" ").append(extra);
|
||||
}
|
||||
buf.append(">");
|
||||
@@ -382,7 +382,7 @@ public class FormTool
|
||||
buf.append("<input type=\"").append(type).append("\"");
|
||||
buf.append(" name=\"").append(name).append("\"");
|
||||
buf.append(" value=\"").append(value).append("\"");
|
||||
if (!StringUtil.blank(extra)) {
|
||||
if (!StringUtil.isBlank(extra)) {
|
||||
buf.append(" ").append(extra);
|
||||
}
|
||||
buf.append(">");
|
||||
@@ -396,7 +396,7 @@ public class FormTool
|
||||
protected String getValue (String name, Object defaultValue)
|
||||
{
|
||||
String value = ParameterUtil.getParameter(_req, name, true);
|
||||
if (StringUtil.blank(value)) {
|
||||
if (StringUtil.isBlank(value)) {
|
||||
if (defaultValue == null) {
|
||||
value = "";
|
||||
} else {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class StringTool
|
||||
*/
|
||||
public static boolean blank (String text)
|
||||
{
|
||||
return StringUtil.blank(text);
|
||||
return StringUtil.isBlank(text);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SetPropertyFieldsRule extends Rule
|
||||
// applicable
|
||||
for (int i = 0; i < attrs.getLength(); i++) {
|
||||
String lname = attrs.getLocalName(i);
|
||||
if (StringUtil.blank(lname)) {
|
||||
if (StringUtil.isBlank(lname)) {
|
||||
lname = attrs.getQName(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user