Skip to content

Commit a79cb7e

Browse files
authored
Merge pull request alibaba#252 from LQZYC/master
修改提示信息
2 parents cb27677 + a759051 commit a79cb7e

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

p3c-pmd/src/main/resources/messages.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<![CDATA[变量名【%s】不符合lowerCamelCase命名风格]]>
3131
</entry>
3232
<entry key="java.naming.PackageNamingRule.violation.msg">
33-
<![CDATA[包名【%s】应全部小写]]>
33+
<![CDATA[包名【%s】应全部为小写字母和数字组成]]>
3434
</entry>
3535
<entry key="java.naming.ServiceOrDaoClassShouldEndWithImplRule.violation.msg">
3636
<![CDATA[类名【%s】应以Impl结尾]]>

p3c-pmd/src/test/resources/com/alibaba/p3c/pmd/lang/java/rule/naming/xml/ArrayNamingShouldHaveBracketRule.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,30 @@
3333
<expected-problems>0</expected-problems>
3434
<code-ref id="ArrayTypeStyleTest1" />
3535
</test-code>
36+
37+
<code-fragment id="ArrayTypeStyleTest2">
38+
<![CDATA[
39+
public class ArrayTypeStyleTest{
40+
public void ConfParse(String str){
41+
TreeMap<String, String> mapConfKeyValue = new TreeMap<>();
42+
String[] params = str.split("&");
43+
for (String param : params) {
44+
String fields[] = param.split("=");
45+
if (fields.length != 2) {
46+
continue;
47+
}
48+
String key = fields[0].trim();
49+
String value = fields[1].trim();
50+
mapConfKeyValue.put(key, value);
51+
}
52+
}
53+
}
54+
]]>
55+
</code-fragment>
56+
<test-code>
57+
<description>array should be array[]</description>
58+
<expected-problems>1</expected-problems>
59+
<expected-linenumbers>6</expected-linenumbers>
60+
<code-ref id="ArrayTypeStyleTest2" />
61+
</test-code>
3662
</test-data>

0 commit comments

Comments
 (0)