Upgrade to Spring M2 and correct expression classes and pom files to match changes
This commit is contained in:
		
							parent
							
								
									98593b7c78
								
							
						
					
					
						commit
						591681c180
					
				
							
								
								
									
										10
									
								
								core/pom.xml
								
								
								
								
							
							
						
						
									
										10
									
								
								core/pom.xml
								
								
								
								
							|  | @ -14,12 +14,8 @@ | ||||||
|             <groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
|             <artifactId>org.springframework.expression</artifactId> |             <artifactId>org.springframework.expression</artifactId> | ||||||
|         </dependency> |         </dependency> | ||||||
|         <dependency> |  | ||||||
|             <groupId>org.antlr</groupId> |  | ||||||
|             <artifactId>antlr</artifactId> |  | ||||||
|         </dependency> |  | ||||||
|         <dependency> |  | ||||||
|             <!-- Used by SPEL --> |             <!-- Used by SPEL --> | ||||||
|  |         <dependency> | ||||||
|             <groupId>asm</groupId> |             <groupId>asm</groupId> | ||||||
|             <artifactId>asm-all</artifactId> |             <artifactId>asm-all</artifactId> | ||||||
|         </dependency> |         </dependency> | ||||||
|  | @ -31,6 +27,10 @@ | ||||||
|             <groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
|             <artifactId>org.springframework.context</artifactId> |             <artifactId>org.springframework.context</artifactId> | ||||||
|         </dependency> |         </dependency> | ||||||
|  |         <dependency> | ||||||
|  |             <groupId>org.springframework</groupId> | ||||||
|  |             <artifactId>org.springframework.transaction</artifactId> | ||||||
|  |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.springframework</groupId> |             <groupId>org.springframework</groupId> | ||||||
|             <artifactId>org.springframework.aop</artifactId> |             <artifactId>org.springframework.aop</artifactId> | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ package org.springframework.security.expression.method; | ||||||
| 
 | 
 | ||||||
| import org.springframework.expression.Expression; | import org.springframework.expression.Expression; | ||||||
| import org.springframework.expression.ParseException; | import org.springframework.expression.ParseException; | ||||||
| import org.springframework.expression.spel.SpelExpressionParser; | import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser; | ||||||
| import org.springframework.security.ConfigAttribute; | import org.springframework.security.ConfigAttribute; | ||||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||||
| 
 | 
 | ||||||
|  | @ -26,7 +26,7 @@ abstract class AbstractExpressionBasedMethodConfigAttribute implements ConfigAtt | ||||||
|      */ |      */ | ||||||
|     AbstractExpressionBasedMethodConfigAttribute(String filterExpression, String authorizeExpression) throws ParseException { |     AbstractExpressionBasedMethodConfigAttribute(String filterExpression, String authorizeExpression) throws ParseException { | ||||||
|         Assert.isTrue(filterExpression != null || authorizeExpression != null, "Filter and authorization Expressions cannot both be null"); |         Assert.isTrue(filterExpression != null || authorizeExpression != null, "Filter and authorization Expressions cannot both be null"); | ||||||
|         SpelExpressionParser parser = new SpelExpressionParser(); |         SpelAntlrExpressionParser parser = new SpelAntlrExpressionParser(); | ||||||
|         this.filterExpression = filterExpression == null ? null : parser.parseExpression(filterExpression); |         this.filterExpression = filterExpression == null ? null : parser.parseExpression(filterExpression); | ||||||
|         this.authorizeExpression = authorizeExpression == null ? null : parser.parseExpression(authorizeExpression); |         this.authorizeExpression = authorizeExpression == null ? null : parser.parseExpression(authorizeExpression); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ import org.springframework.core.annotation.AnnotationUtils; | ||||||
| import org.springframework.expression.Expression; | import org.springframework.expression.Expression; | ||||||
| import org.springframework.expression.ExpressionParser; | import org.springframework.expression.ExpressionParser; | ||||||
| import org.springframework.expression.ParseException; | import org.springframework.expression.ParseException; | ||||||
| import org.springframework.expression.spel.SpelExpressionParser; | import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser; | ||||||
| import org.springframework.security.ConfigAttribute; | import org.springframework.security.ConfigAttribute; | ||||||
| import org.springframework.security.config.SecurityConfigurationException; | import org.springframework.security.config.SecurityConfigurationException; | ||||||
| import org.springframework.security.expression.SecurityExpressionHandler; | import org.springframework.security.expression.SecurityExpressionHandler; | ||||||
|  | @ -42,7 +42,7 @@ public class ExpressionAnnotationMethodDefinitionSource extends AbstractMethodDe | ||||||
|     private ExpressionParser parser; |     private ExpressionParser parser; | ||||||
| 
 | 
 | ||||||
|     public ExpressionAnnotationMethodDefinitionSource() { |     public ExpressionAnnotationMethodDefinitionSource() { | ||||||
|         parser = new SpelExpressionParser(); |         parser = new SpelAntlrExpressionParser(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  |  | ||||||
|  | @ -13,8 +13,8 @@ import org.springframework.core.ParameterNameDiscoverer; | ||||||
| import org.springframework.expression.EvaluationContext; | import org.springframework.expression.EvaluationContext; | ||||||
| import org.springframework.expression.Expression; | import org.springframework.expression.Expression; | ||||||
| import org.springframework.expression.ExpressionParser; | import org.springframework.expression.ExpressionParser; | ||||||
| import org.springframework.expression.spel.SpelExpressionParser; | import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser; | ||||||
| import org.springframework.expression.spel.standard.StandardEvaluationContext; | import org.springframework.expression.spel.support.StandardEvaluationContext; | ||||||
| import org.springframework.security.Authentication; | import org.springframework.security.Authentication; | ||||||
| import org.springframework.security.AuthenticationTrustResolver; | import org.springframework.security.AuthenticationTrustResolver; | ||||||
| import org.springframework.security.AuthenticationTrustResolverImpl; | import org.springframework.security.AuthenticationTrustResolverImpl; | ||||||
|  | @ -39,7 +39,7 @@ public class DefaultSecurityExpressionHandler implements SecurityExpressionHandl | ||||||
|     private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer(); |     private ParameterNameDiscoverer parameterNameDiscoverer = new LocalVariableTableParameterNameDiscoverer(); | ||||||
|     private PermissionEvaluator permissionEvaluator = new DenyAllPermissionEvaluator(); |     private PermissionEvaluator permissionEvaluator = new DenyAllPermissionEvaluator(); | ||||||
|     private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); |     private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); | ||||||
|     private ExpressionParser expressionParser = new SpelExpressionParser(); |     private ExpressionParser expressionParser = new SpelAntlrExpressionParser(); | ||||||
| 
 | 
 | ||||||
|     public DefaultSecurityExpressionHandler() { |     public DefaultSecurityExpressionHandler() { | ||||||
|     } |     } | ||||||
|  | @ -69,7 +69,7 @@ public class DefaultSecurityExpressionHandler implements SecurityExpressionHandl | ||||||
| 
 | 
 | ||||||
|     @SuppressWarnings("unchecked") |     @SuppressWarnings("unchecked") | ||||||
|     public Object filter(Object filterTarget, Expression filterExpression, EvaluationContext ctx) { |     public Object filter(Object filterTarget, Expression filterExpression, EvaluationContext ctx) { | ||||||
|         MethodSecurityExpressionRoot rootObject = (MethodSecurityExpressionRoot) ctx.getRootContextObject(); |         MethodSecurityExpressionRoot rootObject = (MethodSecurityExpressionRoot) ctx.getRootObject(); | ||||||
|         List retainList; |         List retainList; | ||||||
| 
 | 
 | ||||||
|         if (logger.isDebugEnabled()) { |         if (logger.isDebugEnabled()) { | ||||||
|  | @ -150,7 +150,7 @@ public class DefaultSecurityExpressionHandler implements SecurityExpressionHandl | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void setReturnObject(Object returnObject, EvaluationContext ctx) { |     public void setReturnObject(Object returnObject, EvaluationContext ctx) { | ||||||
|         ((MethodSecurityExpressionRoot)ctx.getRootContextObject()).setReturnObject(returnObject); |         ((MethodSecurityExpressionRoot)ctx.getRootObject()).setReturnObject(returnObject); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ import java.lang.reflect.Method; | ||||||
| import org.aopalliance.intercept.MethodInvocation; | import org.aopalliance.intercept.MethodInvocation; | ||||||
| import org.springframework.core.LocalVariableTableParameterNameDiscoverer; | import org.springframework.core.LocalVariableTableParameterNameDiscoverer; | ||||||
| import org.springframework.core.ParameterNameDiscoverer; | import org.springframework.core.ParameterNameDiscoverer; | ||||||
| import org.springframework.expression.spel.standard.StandardEvaluationContext; | import org.springframework.expression.spel.support.StandardEvaluationContext; | ||||||
| import org.springframework.security.Authentication; | import org.springframework.security.Authentication; | ||||||
| import org.springframework.util.ClassUtils; | import org.springframework.util.ClassUtils; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,8 +7,8 @@ import org.jmock.Mockery; | ||||||
| import org.junit.Before; | import org.junit.Before; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| import org.springframework.expression.Expression; | import org.springframework.expression.Expression; | ||||||
| import org.springframework.expression.spel.SpelExpressionParser; | import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser; | ||||||
| import org.springframework.expression.spel.standard.StandardEvaluationContext; | import org.springframework.expression.spel.support.StandardEvaluationContext; | ||||||
| import org.springframework.security.Authentication; | import org.springframework.security.Authentication; | ||||||
| import org.springframework.security.AuthenticationTrustResolver; | import org.springframework.security.AuthenticationTrustResolver; | ||||||
| import org.springframework.security.expression.ExpressionUtils; | import org.springframework.security.expression.ExpressionUtils; | ||||||
|  | @ -21,7 +21,7 @@ import org.springframework.security.expression.PermissionEvaluator; | ||||||
|  * @version $Id$ |  * @version $Id$ | ||||||
|  */ |  */ | ||||||
| public class MethodSecurityExpressionRootTests { | public class MethodSecurityExpressionRootTests { | ||||||
|     SpelExpressionParser parser = new SpelExpressionParser(); |     SpelAntlrExpressionParser parser = new SpelAntlrExpressionParser(); | ||||||
|     MethodSecurityExpressionRoot root; |     MethodSecurityExpressionRoot root; | ||||||
|     StandardEvaluationContext ctx; |     StandardEvaluationContext ctx; | ||||||
|     Mockery jmock = new Mockery(); |     Mockery jmock = new Mockery(); | ||||||
|  |  | ||||||
|  | @ -44,14 +44,16 @@ | ||||||
|         </dependency> |         </dependency> | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.mortbay.jetty</groupId> |             <groupId>org.mortbay.jetty</groupId> | ||||||
|             <artifactId>jsp-2.1</artifactId> |             <artifactId>jsp-2.1-jetty</artifactId> | ||||||
|             <version>${jetty.version}</version> |             <version>${jetty.version}</version> | ||||||
|             <scope>test</scope> |             <scope>test</scope> | ||||||
|         </dependency> |         </dependency> | ||||||
|  | <!--         | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.mortbay.jetty</groupId> |             <groupId>org.mortbay.jetty</groupId> | ||||||
|             <artifactId>jsp-api-2.1</artifactId> |             <artifactId>jsp-api-2.1</artifactId> | ||||||
|             <version>${jetty.version}</version> |             <version>${jetty.version}</version> | ||||||
|         </dependency> |         </dependency> | ||||||
|  | -->         | ||||||
|     </dependencies> |     </dependencies> | ||||||
| </project> | </project> | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								pom.xml
								
								
								
								
							
							
						
						
									
										17
									
								
								pom.xml
								
								
								
								
							|  | @ -9,7 +9,7 @@ | ||||||
| 
 | 
 | ||||||
|     <modules> |     <modules> | ||||||
|         <module>core</module> |         <module>core</module> | ||||||
|         <module>portlet</module> |         <!-- module>portlet</module --> | ||||||
|         <module>ntlm</module> |         <module>ntlm</module> | ||||||
|         <module>openid</module> |         <module>openid</module> | ||||||
|         <module>samples</module> |         <module>samples</module> | ||||||
|  | @ -633,10 +633,12 @@ | ||||||
|                         <groupId>org.apache.commons</groupId> |                         <groupId>org.apache.commons</groupId> | ||||||
|                         <artifactId>com.springsource.org.apache.commons.logging</artifactId> |                         <artifactId>com.springsource.org.apache.commons.logging</artifactId> | ||||||
|                     </exclusion> |                     </exclusion> | ||||||
|  | <!-- | ||||||
|                     <exclusion> |                     <exclusion> | ||||||
|                         <groupId>org.antlr</groupId> |                         <groupId>org.antlr</groupId> | ||||||
|                         <artifactId>com.springsource.org.antlr</artifactId> |                         <artifactId>com.springsource.org.antlr</artifactId> | ||||||
|                     </exclusion> |                     </exclusion> | ||||||
|  | --> | ||||||
|                 </exclusions> |                 </exclusions> | ||||||
|                 <optional>true</optional> |                 <optional>true</optional> | ||||||
|             </dependency> |             </dependency> | ||||||
|  | @ -731,7 +733,7 @@ | ||||||
|             <dependency> |             <dependency> | ||||||
|                 <groupId>org.springframework.ldap</groupId> |                 <groupId>org.springframework.ldap</groupId> | ||||||
|                 <artifactId>spring-ldap-core</artifactId> |                 <artifactId>spring-ldap-core</artifactId> | ||||||
|                 <version>1.3.0.RC1</version> |                 <version>1.3.0.RELEASE</version> | ||||||
|                 <exclusions> |                 <exclusions> | ||||||
|                     <exclusion> |                     <exclusion> | ||||||
|                         <groupId>org.springframework</groupId> |                         <groupId>org.springframework</groupId> | ||||||
|  | @ -757,16 +759,19 @@ | ||||||
|                 <artifactId>com.springsource.org.aspectj.weaver</artifactId> |                 <artifactId>com.springsource.org.aspectj.weaver</artifactId> | ||||||
|                 <version>1.6.2.RELEASE</version> |                 <version>1.6.2.RELEASE</version> | ||||||
|             </dependency> |             </dependency> | ||||||
|  |              | ||||||
|  | <!-- Used by SPEL      | ||||||
|             <dependency> |             <dependency> | ||||||
|                 <!-- Used by SPEL --> | 
 | ||||||
|                 <groupId>org.antlr</groupId> |                 <groupId>org.antlr</groupId> | ||||||
|                 <artifactId>antlr</artifactId> |                 <artifactId>antlr</artifactId> | ||||||
|                 <version>3.0.1</version> |                 <version>3.0.1</version> | ||||||
|                 <optional>true</optional> |                 <optional>true</optional> | ||||||
|                 <scope>runtime</scope> |                 <scope>runtime</scope> | ||||||
|             </dependency> |             </dependency> | ||||||
|  | -->               | ||||||
|             <dependency> |             <dependency> | ||||||
|                 <!-- Used by SPEL --> |                 <!-- Required by SPEL --> | ||||||
|                 <groupId>asm</groupId> |                 <groupId>asm</groupId> | ||||||
|                 <artifactId>asm-all</artifactId> |                 <artifactId>asm-all</artifactId> | ||||||
|                 <version>2.2.3</version> |                 <version>2.2.3</version> | ||||||
|  | @ -841,9 +846,9 @@ | ||||||
|         </dependencies> |         </dependencies> | ||||||
|     </dependencyManagement> |     </dependencyManagement> | ||||||
|     <properties> |     <properties> | ||||||
|         <spring.version>3.0.0.M1</spring.version> |         <spring.version>3.0.0.M2</spring.version> | ||||||
|         <jstl.version>1.1.2</jstl.version> |         <jstl.version>1.1.2</jstl.version> | ||||||
|         <jetty.version>6.1.14</jetty.version> |         <jetty.version>6.1.15</jetty.version> | ||||||
| 
 | 
 | ||||||
|         <docbook.source>${basedir}/src/docbkx</docbook.source> |         <docbook.source>${basedir}/src/docbkx</docbook.source> | ||||||
|         <docbook.target>${basedir}/target/site/guide</docbook.target> |         <docbook.target>${basedir}/target/site/guide</docbook.target> | ||||||
|  |  | ||||||
|  | @ -55,6 +55,7 @@ | ||||||
|         <dependency> |         <dependency> | ||||||
|             <groupId>org.springframework.ldap</groupId> |             <groupId>org.springframework.ldap</groupId> | ||||||
|             <artifactId>spring-ldap-core</artifactId> |             <artifactId>spring-ldap-core</artifactId> | ||||||
|  |             <scope>runtime</scope> | ||||||
|         </dependency> |         </dependency> | ||||||
|     </dependencies> |     </dependencies> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue