Java 5 code style

This commit is contained in:
Juergen Hoeller 2009-01-14 09:27:51 +00:00
parent b05d800205
commit ce2c59ec84
2 changed files with 7 additions and 8 deletions

View File

@ -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;
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
return null;
}
public Enumeration getInitParameterNames() {
return Collections.enumeration(Collections.EMPTY_SET);
public Enumeration<String> getInitParameterNames() {
return Collections.enumeration(new HashSet<String>());
}
}

View File

@ -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 @@
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
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;
}
}