针对issue#I4X9TT修复

This commit is contained in:
jiazhengquan 2022-03-11 09:50:37 +08:00
parent 88a9fc4a37
commit 04ae795ce6
2 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,7 @@ public class NamingCase {
// 后一个为大写按照专有名词对待如aBC -> a_BC
} else {
//前一个为大写
if (null == nextChar || Character.isLowerCase(nextChar)) {
if (null != nextChar && Character.isLowerCase(nextChar)) {
// 普通首字母大写如ABcc -> A_bcc
sb.append(symbol);
c = Character.toLowerCase(c);

View File

@ -422,6 +422,7 @@ public class StrUtilTest {
.set("H2", "H2")
.set("H#case", "H#case")
.set("PNLabel", "PN_label")
.set("DEPT_NAME","DEPT_NAME")
.forEach((key, value) -> Assert.assertEquals(value, StrUtil.toUnderlineCase(key)));
}