Author: rhauch
Date: 2009-04-23 12:25:30 -0400 (Thu, 23 Apr 2009)
New Revision: 847
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java
Log:
DNA-380 The inflector is not lowercasing the first character in the
'camelCase(...)' method
Corrected the camelCase(...) method to lowercase the first character per the JavaDoc.
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java 2009-04-22
14:05:41 UTC (rev 846)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/text/Inflector.java 2009-04-23
16:25:30 UTC (rev 847)
@@ -297,14 +297,13 @@
return replaceAllWithUppercase(result, "(^|_)(.)", 2);
}
if (lowerCaseAndUnderscoredWord.length() < 2) return
lowerCaseAndUnderscoredWord;
- return "" + lowerCaseAndUnderscoredWord.charAt(0)
+ return "" +
Character.toLowerCase(lowerCaseAndUnderscoredWord.charAt(0))
+ camelCase(lowerCaseAndUnderscoredWord, true,
delimiterChars).substring(1);
}
/**
- * Makes an underscored form from the expression in the string (the reverse of the
- * {@link #camelCase(String, boolean, char[]) camelCase} method. Also changes any
characters that match the supplied
- * delimiters into underscore.
+ * Makes an underscored form from the expression in the string (the reverse of the
{@link #camelCase(String, boolean, char[])
+ * camelCase} method. Also changes any characters that match the supplied delimiters
into underscore.
* <p>
* Examples:
*
@@ -491,9 +490,9 @@
* other backreferences.
* <p>
* The Java {@link Pattern regular expression processing} does not use the
preprocessing directives <code>\l</code>,
- * <code>\u</code>, <code>\L</code>, and
<code>\U</code>. If so, such directives could be used in the replacement
- * string to uppercase or lowercase the backreferences. For example,
<code>\L1</code> would lowercase the first
- * backreference, and <code>\u3</code> would uppercase the 3rd
backreference.
+ * <code>\u</code>, <code>\L</code>, and
<code>\U</code>. If so, such directives could be used in the replacement
string
+ * to uppercase or lowercase the backreferences. For example,
<code>\L1</code> would lowercase the first backreference, and
+ * <code>\u3</code> would uppercase the 3rd backreference.
* </p>
*
* @param input
Show replies by date