File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
main/java/org/seasar/doma/internal/util
test/java/org/seasar/doma/internal/util Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public static String fromCamelCaseToSnakeCase(String text) {
104104 buf .mark ();
105105 if (buf .hasRemaining ()) {
106106 char c2 = buf .get ();
107- if (Character .isLowerCase (c ) && Character .isUpperCase (c2 )) {
107+ if (( Character .isLowerCase (c ) || Character . isDigit ( c ) ) && Character .isUpperCase (c2 )) {
108108 result .append ("_" );
109109 }
110110 buf .reset ();
Original file line number Diff line number Diff line change 1919
2020/**
2121 * @author taedium
22- *
22+ *
2323 */
2424public class StringUtilTest extends TestCase {
2525
@@ -44,6 +44,7 @@ public void testFromCamelCaseToSnakeCase() throws Exception {
4444 assertEquals ("aaa_bbb_ccc" ,
4545 StringUtil .fromCamelCaseToSnakeCase ("aaaBbbCcc" ));
4646 assertEquals ("abc" , StringUtil .fromCamelCaseToSnakeCase ("abc" ));
47+ assertEquals ("aa1_bbb_ccc" , StringUtil .fromCamelCaseToSnakeCase ("aa1BbbCcc" ));
4748 }
4849
4950 public void testIsWhitespace () throws Exception {
You can’t perform that action at this time.
0 commit comments