Browse Source

Java 5 code style

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@537 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Juergen Hoeller 17 years ago
parent
commit
02c2e1795d
  1. 8
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java
  2. 7
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/UserRoleAuthorizationInterceptor.java

8
org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,7 +18,7 @@ package org.springframework.web.servlet.handler; @@ -18,7 +18,7 @@ package org.springframework.web.servlet.handler;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@ -149,8 +149,8 @@ public class SimpleServletPostProcessor implements @@ -149,8 +149,8 @@ public class SimpleServletPostProcessor implements
return null;
}
public Enumeration getInitParameterNames() {
return Collections.enumeration(Collections.EMPTY_SET);
public Enumeration<String> getInitParameterNames() {
return Collections.enumeration(new HashSet<String>());
}
}

7
org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/handler/UserRoleAuthorizationInterceptor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.web.servlet.handler;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -49,8 +48,8 @@ public class UserRoleAuthorizationInterceptor extends HandlerInterceptorAdapter @@ -49,8 +48,8 @@ public class UserRoleAuthorizationInterceptor extends HandlerInterceptorAdapter
throws ServletException, IOException {
if (this.authorizedRoles != null) {
for (int i = 0; i < this.authorizedRoles.length; i++) {
if (request.isUserInRole(this.authorizedRoles[i])) {
for (String role : this.authorizedRoles) {
if (request.isUserInRole(role)) {
return true;
}
}

Loading…
Cancel
Save