Skip to content

Commit 26310dd

Browse files
committed
Fix redundant specification warnings
Signed-off-by: Mark Thomas <[email protected]>
1 parent 5012adb commit 26310dd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/javax/servlet/ServletSecurityElement.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ServletSecurityElement extends HttpConstraintElement {
3636
* element and with no HTTP Method specific constraint elements.
3737
*/
3838
public ServletSecurityElement() {
39-
methodConstraints = new HashSet<HttpMethodConstraintElement>();
39+
methodConstraints = new HashSet<>();
4040
methodNames = Collections.emptySet();
4141
}
4242

@@ -52,7 +52,7 @@ public ServletSecurityElement(HttpConstraintElement constraint) {
5252
super(constraint.getEmptyRoleSemantic(),
5353
constraint.getTransportGuarantee(),
5454
constraint.getRolesAllowed());
55-
methodConstraints = new HashSet<HttpMethodConstraintElement>();
55+
methodConstraints = new HashSet<>();
5656
methodNames = Collections.emptySet();
5757
}
5858

@@ -71,7 +71,7 @@ public ServletSecurityElement(HttpConstraintElement constraint) {
7171
public ServletSecurityElement(
7272
Collection<HttpMethodConstraintElement> methodConstraints) {
7373
this.methodConstraints = (methodConstraints == null ?
74-
new HashSet<HttpMethodConstraintElement>() : methodConstraints);
74+
new HashSet<>() : methodConstraints);
7575
methodNames = checkMethodNames(this.methodConstraints);
7676
}
7777

@@ -94,7 +94,7 @@ public ServletSecurityElement(HttpConstraintElement constraint,
9494
constraint.getTransportGuarantee(),
9595
constraint.getRolesAllowed());
9696
this.methodConstraints = (methodConstraints == null ?
97-
new HashSet<HttpMethodConstraintElement>() : methodConstraints);
97+
new HashSet<>() : methodConstraints);
9898
methodNames = checkMethodNames(this.methodConstraints);
9999
}
100100

@@ -110,7 +110,7 @@ public ServletSecurityElement(ServletSecurity annotation) {
110110
super(annotation.value().value(),
111111
annotation.value().transportGuarantee(),
112112
annotation.value().rolesAllowed());
113-
this.methodConstraints = new HashSet<HttpMethodConstraintElement>();
113+
this.methodConstraints = new HashSet<>();
114114
for (HttpMethodConstraint constraint :
115115
annotation.httpMethodConstraints()) {
116116
this.methodConstraints.add(
@@ -164,7 +164,7 @@ public Collection<String> getMethodNames() {
164164
*/
165165
private Collection<String> checkMethodNames(
166166
Collection<HttpMethodConstraintElement> methodConstraints) {
167-
Collection<String> methodNames = new HashSet<String>();
167+
Collection<String> methodNames = new HashSet<>();
168168
for (HttpMethodConstraintElement methodConstraint :
169169
methodConstraints) {
170170
String methodName = methodConstraint.getMethodName();

src/main/java/javax/servlet/http/HttpUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static Hashtable<String, String[]> parseQueryString(String s) {
8181
throw new IllegalArgumentException();
8282
}
8383

84-
Hashtable<String, String[]> ht = new Hashtable<String, String[]>();
84+
Hashtable<String, String[]> ht = new Hashtable<>();
8585
StringBuilder sb = new StringBuilder();
8686
StringTokenizer st = new StringTokenizer(s, "&");
8787
while (st.hasMoreTokens()) {
@@ -154,7 +154,7 @@ public static Hashtable<String, String[]> parsePostData(int len,
154154

155155
if (len <=0) {
156156
// cheap hack to return an empty hash
157-
return new Hashtable<String, String[]>();
157+
return new Hashtable<>();
158158
}
159159

160160
if (in == null) {

0 commit comments

Comments
 (0)