Upgrade Spring Framework and Spring Security

Spring Framework 3.1.1 -> 3.2.0
Spring Security  3.0.7 -> 3.1.3

Issue: SPR-1580, SPR-1581
This commit is contained in:
Rossen Stoyanchev
2012-12-21 16:17:47 -05:00
parent 508d6a7dfb
commit d6c0813b15
3 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@ integration-repo
ivy-cache
.gradle
build
target
# Eclipse metadata
.classpath

View File

@@ -56,8 +56,8 @@ configure(subprojects.findAll {it.name != 'spring-js-resources'}) { subproject -
}
subproject.ext {
springVersion = '3.1.1.RELEASE'
springSecurityVersion = '3.0.7.RELEASE'
springVersion = '3.2.0.RELEASE'
springSecurityVersion = '3.1.3.RELEASE'
slf4jVersion = '1.6.1'
log4jVersion = '1.2.15'
}

View File

@@ -134,7 +134,7 @@ public abstract class AbstractAuthorizeTag {
return false;
}
final Collection<GrantedAuthority> granted = getPrincipalAuthorities();
final Collection<? extends GrantedAuthority> granted = getPrincipalAuthorities();
if (hasTextAllGranted) {
if (!granted.containsAll(parseAuthoritiesString(getIfAllGranted()))) {
@@ -143,7 +143,7 @@ public abstract class AbstractAuthorizeTag {
}
if (hasTextAnyGranted) {
Set<GrantedAuthority> grantedCopy = retainAll(granted, parseAuthoritiesString(getIfAnyGranted()));
Set<? extends GrantedAuthority> grantedCopy = retainAll(granted, parseAuthoritiesString(getIfAnyGranted()));
if (grantedCopy.isEmpty()) {
return false;
}
@@ -258,7 +258,7 @@ public abstract class AbstractAuthorizeTag {
/*------------- Private helper methods -----------------*/
private Collection<GrantedAuthority> getPrincipalAuthorities() {
private Collection<? extends GrantedAuthority> getPrincipalAuthorities() {
Authentication currentUser = SecurityContextHolder.getContext().getAuthentication();
if (null == currentUser) {
return Collections.emptyList();
@@ -272,7 +272,7 @@ public abstract class AbstractAuthorizeTag {
return requiredAuthorities;
}
private Set<GrantedAuthority> retainAll(final Collection<GrantedAuthority> granted,
private Set<GrantedAuthority> retainAll(final Collection<? extends GrantedAuthority> granted,
final Set<GrantedAuthority> required) {
Set<String> grantedRoles = authoritiesToRoles(granted);
Set<String> requiredRoles = authoritiesToRoles(required);
@@ -281,7 +281,7 @@ public abstract class AbstractAuthorizeTag {
return rolesToAuthorities(grantedRoles, granted);
}
private Set<String> authoritiesToRoles(Collection<GrantedAuthority> c) {
private Set<String> authoritiesToRoles(Collection<? extends GrantedAuthority> c) {
Set<String> target = new HashSet<String>();
for (GrantedAuthority authority : c) {
if (null == authority.getAuthority()) {
@@ -294,7 +294,7 @@ public abstract class AbstractAuthorizeTag {
return target;
}
private Set<GrantedAuthority> rolesToAuthorities(Set<String> grantedRoles, Collection<GrantedAuthority> granted) {
private Set<GrantedAuthority> rolesToAuthorities(Set<String> grantedRoles, Collection<? extends GrantedAuthority> granted) {
Set<GrantedAuthority> target = new HashSet<GrantedAuthority>();
for (String role : grantedRoles) {
for (GrantedAuthority authority : granted) {