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