Permalink
Browse files

Merge branch '2.2.x' of github.com:grails/grails-core into 2.2.x

  • Loading branch information...
2 parents 1dac43f + 2a6955f commit 065478fdc62c4a8f73fa2a88a142fd0f21440e37 @graemerocher graemerocher committed Oct 10, 2012
View
@@ -208,7 +208,7 @@ Grails 2.2.0 includes a number of subcomponents with
separate copyright notices and license terms. The product that
includes this file does not necessarily use all the open source
subcomponents referred to below. Your use of the source
-code for the these subcomponents is subject to the terms and
+code for these subcomponents is subject to the terms and
conditions of the following licenses.
View
@@ -1,177 +0,0 @@
-The following libraries are included in Grails because they are required either for building the framework or for running the command line tools or for running Grails applications themselves.
-
-* ant.jar, ant-junit.jar, ant-launcher.jar, ant-trax.jar
-- Ant 1.8.2 (http://ant.apache.org) Apache 2.0 License
-- used to build the framework and for the command line tools (Gant)
-- required for running Grails applications when using AntBuilder
-
-* antlr-2.7.7.jar
-- ANTLR 2.7.7 (http://www.antlr.org) BSD License
-- required for running Grails applications (Hibernate)
-
-* aspectjrt-1.6.8.jar, aspectjweaver-1.6.8.jar
-- AspectJ 1.6.8 (http://www.eclipse.org/aspectj/) Eclipse Public License (EPL)
-- required for running Grails applications
-
-* cglib-nodep-2.1_3.jar
-- CGLIB 2.1_3 with ObjectWeb ASM 1.5.3 (http://cglib.sourceforge.net) Apache 1.1 License
-- required for running Grails applications (Spring AOP & Hibernate)
-
-* concurrentlinkedhashmap-lru-1.0_jdk5.jar
-- ConcurrentLinkedHashMap policy: least-recently-used, jdk: 5 (https://code.google.com/p/concurrentlinkedhashmap) Apache License 2.0
-- required for building Grails core
-- required for running Grails applications
-
-* commons-beanutils-1.8.0.jar
-- Commons BeanUtils 1.8.0 (http://commons.apache.org/beanutils/) Apache 2.0 License
-- required for running Grails applications
-
-* commons-codec-1.4.jar
-- Commons Codec 1.4 (http://commons.apache.org/codec/) Apache 2.0 License
-- required for running Grails applications
-
-* commons-cli-1.0.jar
-- Commons CLI 1.0 (http://commons.apache.org/cli/) Apache 2.0 License
-- required for the command line tools (Gant)
-
-* commons-collections-3.2.1.jar
-- Commons Collections 3.2.1 (http://commons.apache.org/collections/) Apache 2.0 License
-- required for building Grails core
-- required for running Grails applications
-
-* commons-dbcp-1.3.jar
-- Commons DBCP 1.3 (http://commons.apache.org/dbcp/) Apache 2.0 License
-- required for building Grails core
-- required for running Grails applications
-
-* commons-el-1.0.jar
-- Commons Expression Language 1.0 (http://commons.apache.org/el/) Apache 2.0 License
-- required for running Grails applications
-
-* commons-fileupload-1.2.1.jar
-- Commons File Upload 1.2.1 (http://commons.apache.org/fileupload/) Apache 2.0 License
-- required for running Grails applications (When using file uploads)
-
-* commons-io-1.4.jar
-- Commons I/O 1.4 (http://commons.apache.org/io/) Apache 2.0 License
-- required for running Grails applications
-
-* commons-lang-2.4.jar
-- Commons Lang 2.4 (http://commons.apache.org/lang/) Apache 2.0 License
-- required for building Grails core
-- required for running Grails application
-
-* commons-pool-1.5.5.jar
-- Commons Pool 1.5.5 (http://commons.apache.org/pool/) Apache 2.0 License
-- required for running Grails applications
-
-* commons-validator-1.3.1.jar
-- Commons Validator 1.3.1 (http://commons.apache.org/validator/) Apache 2.0 License
-- required for building Grails core
-- required for running Grails applications
-
-* dom4j-1.6.1.jar
-- Dom4J 1.6.1 (http://dom4j.org/) BSD Style License (see http://www.dom4j.org/license.html)
-- required for building Grails core
-- required for running Grails applications
-
-* ejb3-persistence-1.0.2.GA.jar
-- EJB 3.0 Final Release
-- required for running Grails applications (When using Hibernate EJB3 annotations)
-
-* ehcache-1.5.0.jar
-- EHCache 1.5.0 (http://ehcache.sourceforge.net/) Apache 2.0 License
-- required if you want to use EHCache as your second-level cache
-- optional otherwise
-
-* gant_groovy1.8-1.9.5.jar
-- Gant 1.9.5 (http://gant.codehaus.org) Apache 2.0 License
-- required for the command line tools (Gant)
-
-* groovy-all-2.0.5.jar
-- Groovy 2.0.5 (http://groovy.codehaus.org) Apache 2.0 License
-- required for the command line tools (Gant)
-- required for building Grails core
-- required for running Grails applications
-
-* hibernate-commons-annotations-3.2.0.Final.jar
-- Hibernate Annotations 3.2.0 GA (http://annotations.hibernate.org) LGPL License
-- required for running Grails applications (When using Hibernate EJB3 annotations)
-
-* hibernate-core-3.6.10.Final.jar
-- Hibernate 3.6.8 GA (http://www.hibernate.org) LGPL License
-- required for building Grails core
-- required for running Grails applications
-
-* hsqldb-1.8.0.10.jar
-- HSQLDB 1.8.0.10 (http://hsqldb.org/) HSQLDB License (see http://hsqldb.org/web/hsqlLicense.html)
-- required for building Grails core
-- required for running Grails applications (With an in-memory database)
-
-* h2-1.3.164.jar
-- H2 1.3.164 (http://www.h2database.com/) H2 License (see http://www.h2database.com/html/license.html)
-- required for building Grails core
-- required for running Grails applications (With an in-memory database)
-
-* javassist-3.12.0.GA.jar
-- Javassist 3.12.0 (http://www.jboss.org/javassist/) MPL or LGPL License
-- required for running Grails applications
-
-* jline-0.9.94.jar
-- JLine 0.9.94 (http://jline.sourceforge.net/)
-- required for the Grails shell
-
-* jsp-api-2.1.jar
-- Java Server Pages 2.1 Spec
-- required for building Grails core
-- required for running Grails applications
-
-* jta-1.1.jar
-- Java Transaction API
-- required for running Grails applications
-
-* junit-4.8.1.jar
-- JUnit 4.8.1 (http://junit.org) CPL 1.0 License
-- required for building Grails core
-- required for the command line tools (Gant)
-
-* log4j-1.2.16.jar
-- Log4J 1.2.16 (http://logging.apache.org/log4j/) Apache 2.0 License
-- required for running Grails applications
-
-* ognl-2.7.3.jar
-- OGNL 2.7.3 (http://www.ognl.org/) OGNL License (http://www.ognl.org/copyright.html)
-- required for running Grails applications (When using Web Flows)
-
-* oro-2.0.8.jar
-- Jakarta ORO 2.0.8 (http://jakarta.apache.org/oro/) Apache 2.0 License
-- required for running Grails applications
-
-* protobuf-java-2.4.1.jar
-- Google's language-neutral, platform-neutral, extensible mechanism or serializing structured data
-
-* sitemesh-2.4.jar
-- Sitemesh 2.4 (http://www.opensymphony.com/sitemesh) OpenSymphony Software License (see http://www.opensymphony.com/sitemesh/license.action)
-- required for building Grails core
-- required for running Grails applications
-
-* slf4j-api-1.5.6.jar, slf4j-log4j12-1.5.6.jar
-- Simple Logging Facade for Java 1.5.6 (http://www.slf4j.org/) MIT License (http://www.slf4j.org/license.html)
-- required for building Grails core
-- required for running Grails applications
-
-* org.springframework.*.jar
-- Spring Framework 3.1.2.RELEASE (http://www.springframework.org) Apache 2.0 License
-- required for building Grails core
-- required for the command line tools (Gant)
-- required for running Grails applications
-
-* org.springframework.webflow-2.0.8.RELEASE.jar, org.springframework.binding-2.0.8.RELEASE.jar, org.springframework.js-2.0.8.RELEASE.jar
-- Spring Web Flow 2.0.8 (http://www.springframework.org) Apache 2.0 License
-- required for building Grails core
-- required for running Grails applications (When using Web flows)
-
-* xpp3_min-1.1.3.4.O.jar
-- XML Pull Parser (XPP) 1.1.3.4.O (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) Indiana University Extreme! Lab Software License (see http://www.extreme.indiana.edu/viewcvs/~checkout~/XPP3/java/LICENSE.txt)
-- required for running Grails applications (dependency of XStream 1.2.1)
-
View
@@ -187,7 +187,7 @@ task zipDist(type: Zip, dependsOn: [sourcesJars, install]) {
into("grails-$grailsVersion") {
from(projectDir) {
- include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'build.gradle', 'build.properties', 'dependencies.txt',
+ include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'build.gradle', 'build.properties',
'LICENSE', 'INSTALL', "src/", "gradlew.bat","gradle.properties"
exclude 'ant/bin', 'src/grails', 'src/war'
}
@@ -241,6 +241,7 @@ private MethodNode convertToMethodAction(ClassNode classNode, MethodNode methodN
EMPTY_CLASS_ARRAY,
addOriginalMethodCall(methodNode, initializeActionParameters(
classNode, methodNode, methodNode.getName(), parameters, source, context)));
+ copyAnnotations(methodNode, method);
annotateActionMethod(parameters, method);
} else {
annotateActionMethod(parameters, methodNode);
@@ -249,6 +250,18 @@ private MethodNode convertToMethodAction(ClassNode classNode, MethodNode methodN
return method;
}
+ protected void copyAnnotations(final MethodNode from, final MethodNode to) {
+ final List<AnnotationNode> annotationsToCopy = from.getAnnotations();
+ for(final AnnotationNode node : annotationsToCopy) {
+ final AnnotationNode copyOfAnnotationNode = new AnnotationNode(node.getClassNode());
+ final Map<String, Expression> members = node.getMembers();
+ for(final Map.Entry<String, Expression> entry : members.entrySet()) {
+ copyOfAnnotationNode.addMember(entry.getKey(), entry.getValue());
+ }
+ to.addAnnotation(copyOfAnnotationNode);
+ }
+ }
+
private Statement addOriginalMethodCall(MethodNode methodNode, BlockStatement blockStatement) {
if (blockStatement == null) {
@@ -2,6 +2,7 @@ package org.codehaus.groovy.grails.compiler.web
import grails.util.BuildSettings
import grails.util.GrailsWebUtil
+import grails.web.Action
import org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext
import org.codehaus.groovy.grails.compiler.injection.ClassInjector
@@ -57,6 +58,39 @@ class ControllerActionTransformerSpec extends Specification {
controller.getClass().getMethod("action", [] as Class[]) != null
}
+ void 'Test that user applied annotations are applied to generated action methods'() {
+ given:
+ def cls = gcl.parseClass('''
+ class SomeController {
+ @Deprecated
+ def action1(){}
+ @Deprecated
+ def action2(String paramName){}
+}
+''')
+
+ when:
+ def action1NoArgMethod = cls.getMethod('action1')
+
+ then:
+ action1NoArgMethod.getAnnotation(Action)
+ action1NoArgMethod.getAnnotation(Deprecated)
+
+ when:
+ def action2MethodWithStringArg = cls.getMethod('action2', [String] as Class[])
+
+ then:
+ !action2MethodWithStringArg.getAnnotation(Action)
+ action2MethodWithStringArg.getAnnotation(Deprecated)
+
+ when:
+ def action2NoArgMethod = cls.getMethod('action2')
+
+ then:
+ action2NoArgMethod.getAnnotation(Action)
+ action2NoArgMethod.getAnnotation(Deprecated)
+ }
+
void 'Test action overiding'() {
given:
def superControllerClass = gcl.parseClass('''

0 comments on commit 065478f

Please sign in to comment.