You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by il...@apache.org on 2011/09/16 16:56:23 UTC
svn commit: r1171608 -
/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
Author: ilgrosso
Date: Fri Sep 16 14:56:23 2011
New Revision: 1171608
URL: http://svn.apache.org/viewvc?rev=1171608&view=rev
Log:
Removing String.isEmpty() [Java 6]
Modified:
cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java?rev=1171608&r1=1171607&r2=1171608&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java Fri Sep 16 14:56:23 2011
@@ -729,7 +729,7 @@ public class I18nTransformer extends Abs
LOG.debug("Initializing with locale={}, bundle={}, untraslated={}",
new Object[]{locale, bundle, untranslated});
- if (bundle == null || bundle.isEmpty()) {
+ if (bundle == null || bundle.length() == 0) {
throw new SetupException("Empty or null resource bundle");
}
@@ -802,7 +802,7 @@ public class I18nTransformer extends Abs
result.addParameter("locale.variant", this.locale.getVariant());
// 2. bundle
- if (this.bundleName == null || this.bundleName.isEmpty()) {
+ if (this.bundleName == null || this.bundleName.length() == 0) {
throw new SetupException(
"Parameter " + PARAM_BUNDLE + " cannot be null or empty");
}
@@ -1209,7 +1209,7 @@ public class I18nTransformer extends Abs
case INSIDE_CHOOSE:
// No characters allowed. Send an exception ?
- if (LOG.isDebugEnabled() && !textValue.isEmpty()) {
+ if (LOG.isDebugEnabled() && textValue.length() > 0) {
LOG.debug("No characters allowed inside <i18n:choose> "
+ "tag. Received: {}", textValue);
}
@@ -1220,7 +1220,7 @@ public class I18nTransformer extends Abs
case INSIDE_TIME:
case INSIDE_NUMBER:
// Trim text values to avoid parsing errors.
- if (!textValue.isEmpty()
+ if (textValue.length() > 0
&& formattingParams.get(ATTR_VALUE) == null) {
formattingParams.put(ATTR_VALUE, textValue);
@@ -1829,7 +1829,7 @@ public class I18nTransformer extends Abs
public Locale parseLocale(final String localeString) {
Locale result;
- if (localeString == null || localeString.isEmpty()) {
+ if (localeString == null || localeString.length() == 0) {
result = this.locale == null ? Locale.getDefault() : this.locale;
} else {
final StringTokenizer tokenizer = new StringTokenizer(localeString,
@@ -1868,7 +1868,7 @@ public class I18nTransformer extends Abs
}
T buffer = null;
- if (message != null && !message.isEmpty()) {
+ if (message != null && message.length() > 0) {
try {
buffer = reference.newInstance();
buffer.characters(message.toCharArray(), 0, message.length());