@@ -42,8 +42,8 @@ public void testDefaults() throws Exception
42
42
"9:13: Declaring variables, return values or parameters of type "
43
43
+ "'com.puppycrawl.tools.checkstyle.coding.InputIllegalType.AbstractClass'"
44
44
+ " is not allowed." ,
45
- "16:13: Declaring variables, return values or parameters of type 'java.util.Hashtable ' is not allowed." ,
46
- "17:13: Declaring variables, return values or parameters of type 'Hashtable ' is not allowed." ,
45
+ "16:13: Declaring variables, return values or parameters of type 'java.util.TreeSet ' is not allowed." ,
46
+ "17:13: Declaring variables, return values or parameters of type 'TreeSet ' is not allowed." ,
47
47
};
48
48
49
49
verify (checkConfig , getPath ("coding" + File .separator + "InputIllegalType.java" ), expected );
@@ -59,7 +59,7 @@ public void testIgnoreMethodNames() throws Exception
59
59
"9:13: Declaring variables, return values or parameters of type "
60
60
+ "'com.puppycrawl.tools.checkstyle.coding.InputIllegalType.AbstractClass'"
61
61
+ " is not allowed." ,
62
- "16:13: Declaring variables, return values or parameters of type 'java.util.Hashtable ' is not allowed." ,
62
+ "16:13: Declaring variables, return values or parameters of type 'java.util.TreeSet ' is not allowed." ,
63
63
};
64
64
65
65
verify (checkConfig , getPath ("coding" + File .separator + "InputIllegalType.java" ), expected );
@@ -71,8 +71,8 @@ public void testFormat() throws Exception
71
71
checkConfig .addAttribute ("format" , "^$" );
72
72
73
73
String [] expected = {
74
- "16:13: Declaring variables, return values or parameters of type 'java.util.Hashtable ' is not allowed." ,
75
- "17:13: Declaring variables, return values or parameters of type 'Hashtable ' is not allowed." ,
74
+ "16:13: Declaring variables, return values or parameters of type 'java.util.TreeSet ' is not allowed." ,
75
+ "17:13: Declaring variables, return values or parameters of type 'TreeSet ' is not allowed." ,
76
76
};
77
77
78
78
verify (checkConfig , getPath ("coding" + File .separator + "InputIllegalType.java" ), expected );
@@ -87,8 +87,8 @@ public void testLegalAbstractClassNames() throws Exception
87
87
"9:13: Declaring variables, return values or parameters of type "
88
88
+ "'com.puppycrawl.tools.checkstyle.coding.InputIllegalType.AbstractClass'"
89
89
+ " is not allowed." ,
90
- "16:13: Declaring variables, return values or parameters of type 'java.util.Hashtable ' is not allowed." ,
91
- "17:13: Declaring variables, return values or parameters of type 'Hashtable ' is not allowed." ,
90
+ "16:13: Declaring variables, return values or parameters of type 'java.util.TreeSet ' is not allowed." ,
91
+ "17:13: Declaring variables, return values or parameters of type 'TreeSet ' is not allowed." ,
92
92
};
93
93
94
94
verify (checkConfig , getPath ("coding" + File .separator + "InputIllegalType.java" ), expected );
@@ -152,4 +152,27 @@ public void testStaticImports() throws Exception
152
152
verify (checkConfig , getPath ("coding" + File .separator
153
153
+ "InputIllegalTypeStaticImports.java" ), expected );
154
154
}
155
+
156
+ @ Test
157
+ public void testMemberModifiers () throws Exception
158
+ {
159
+ checkConfig .addAttribute ("memberModifiers" , "LITERAL_PRIVATE, LITERAL_PROTECTED,"
160
+ + " LITERAL_STATIC" );
161
+ String [] expected = {
162
+ "6:13: Declaring variables, return values or parameters of type 'AbstractClass' is not allowed." ,
163
+ "9:13: Declaring variables, return values or parameters of type "
164
+ + "'com.puppycrawl.tools.checkstyle.coding.InputIllegalTypeMemberModifiers.AbstractClass'"
165
+ + " is not allowed." ,
166
+ "16:13: Declaring variables, return values or parameters of type 'java.util.TreeSet' is not allowed." ,
167
+ "17:13: Declaring variables, return values or parameters of type 'TreeSet' is not allowed." ,
168
+ "23:15: Declaring variables, return values or parameters of type "
169
+ + "'com.puppycrawl.tools.checkstyle.coding.InputIllegalTypeMemberModifiers.AbstractClass'"
170
+ + " is not allowed." ,
171
+ "25:25: Declaring variables, return values or parameters of type 'java.util.TreeSet' is not allowed." ,
172
+ "33:15: Declaring variables, return values or parameters of type 'AbstractClass' is not allowed." ,
173
+ };
174
+
175
+ verify (checkConfig , getPath ("coding" + File .separator
176
+ + "InputIllegalTypeMemberModifiers.java" ), expected );
177
+ }
155
178
}
0 commit comments