Browse Source

Java 5 code style

pull/23217/head
Juergen Hoeller 17 years ago
parent
commit
ce2c59ec84
  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 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,7 +18,7 @@ package org.springframework.web.servlet.handler;
import java.util.Collections; import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashSet;
import javax.servlet.Servlet; import javax.servlet.Servlet;
import javax.servlet.ServletConfig; import javax.servlet.ServletConfig;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
@ -149,8 +149,8 @@ public class SimpleServletPostProcessor implements
return null; return null;
} }
public Enumeration getInitParameterNames() { public Enumeration<String> getInitParameterNames() {
return Collections.enumeration(Collections.EMPTY_SET); 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 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@
package org.springframework.web.servlet.handler; package org.springframework.web.servlet.handler;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -49,8 +48,8 @@ public class UserRoleAuthorizationInterceptor extends HandlerInterceptorAdapter
throws ServletException, IOException { throws ServletException, IOException {
if (this.authorizedRoles != null) { if (this.authorizedRoles != null) {
for (int i = 0; i < this.authorizedRoles.length; i++) { for (String role : this.authorizedRoles) {
if (request.isUserInRole(this.authorizedRoles[i])) { if (request.isUserInRole(role)) {
return true; return true;
} }
} }

Loading…
Cancel
Save