[jboss-cvs] JBossAS SVN: r79090 - in branches/JBoss_AOP_1_5_5_GA_CP/aop: src/main/org/jboss/aop/annotation and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 3 09:52:27 EDT 2008


Author: jhowell at redhat.com
Date: 2008-10-03 09:52:27 -0400 (Fri, 03 Oct 2008)
New Revision: 79090

Modified:
   branches/JBoss_AOP_1_5_5_GA_CP/aop/build.xml
   branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/AnnotationCreator.java
   branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/introduction/AnnotationIntroduction.java
Log:
[JBPAPP-1199] - Merge changes from Branch_1_5 for JBAOP-633 - system properties replacement in jboss-aop.xml annotation introductions and overrides

Modified: branches/JBoss_AOP_1_5_5_GA_CP/aop/build.xml
===================================================================
--- branches/JBoss_AOP_1_5_5_GA_CP/aop/build.xml	2008-10-03 13:47:42 UTC (rev 79089)
+++ branches/JBoss_AOP_1_5_5_GA_CP/aop/build.xml	2008-10-03 13:52:27 UTC (rev 79090)
@@ -1172,6 +1172,16 @@
 		   <formatter type="plain" extension="-jdk50.txt"/>
 	      <test name="org.jboss.test.aop.container.ContainerTestCase" todir="${build.reports}"/>
 	   </junit>
+   	   <junit printsummary="yes" fork="no" haltonfailure="no" >
+   	         <classpath>
+   	            <path refid="test.classpath"/>
+   	            <pathelement location="${build.tests.classes}"/>
+   	            <pathelement location="docs"/>
+   	         </classpath>
+   	         <formatter type="plain"/>
+   	         <formatter type="xml"/>
+   	         <test fork="yes" name="org.jboss.test.aop.annotationproperty.AnnotationPropertyReplacementTestCase" todir="${build.reports}"/>
+   	   </junit>
    </target>
 
    <!-- ==================================================================================== -->

Modified: branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/AnnotationCreator.java
===================================================================
--- branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/AnnotationCreator.java	2008-10-03 13:47:42 UTC (rev 79089)
+++ branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/annotation/AnnotationCreator.java	2008-10-03 13:52:27 UTC (rev 79090)
@@ -34,6 +34,7 @@
 import org.jboss.aop.annotation.ast.AnnotationParserVisitor;
 import org.jboss.aop.annotation.ast.Node;
 import org.jboss.aop.annotation.ast.SimpleNode;
+import org.jboss.util.StringPropertyReplacer;
 
 import java.io.StringReader;
 import java.lang.reflect.Array;
@@ -301,7 +302,8 @@
 
    public static Object createAnnotation(String annotationExpr, Class annotation) throws Exception
    {
-      AnnotationParser parser = new AnnotationParser(new StringReader(annotationExpr));
+      String expr = StringPropertyReplacer.replaceProperties(annotationExpr);
+      AnnotationParser parser = new AnnotationParser(new StringReader(expr));
       org.jboss.aop.annotation.ast.ASTStart start = parser.Start();
       ASTAnnotation node = (ASTAnnotation) start.jjtGetChild(0);
       return createAnnotation(node, annotation);

Modified: branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/introduction/AnnotationIntroduction.java
===================================================================
--- branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/introduction/AnnotationIntroduction.java	2008-10-03 13:47:42 UTC (rev 79089)
+++ branches/JBoss_AOP_1_5_5_GA_CP/aop/src/main/org/jboss/aop/introduction/AnnotationIntroduction.java	2008-10-03 13:52:27 UTC (rev 79090)
@@ -26,12 +26,14 @@
 import javassist.CtField;
 import javassist.CtMethod;
 import org.jboss.aop.Advisor;
+import org.jboss.aop.AspectManager;
 import org.jboss.aop.annotation.ast.ASTAnnotation;
 import org.jboss.aop.annotation.ast.AnnotationParser;
 import org.jboss.aop.annotation.ast.ParseException;
 import org.jboss.aop.pointcut.AnnotationMatcher;
 import org.jboss.aop.pointcut.ast.ASTStart;
 import org.jboss.aop.pointcut.ast.TypeExpressionParser;
+import org.jboss.util.StringPropertyReplacer;
 
 import java.io.StringReader;
 import java.lang.reflect.Constructor;
@@ -85,11 +87,15 @@
    private AnnotationIntroduction(String expr, String annotationExpr, boolean invisible)
    {
       this.invisible = invisible;
-      originalAnnotationExpr = annotationExpr;
+      originalAnnotationExpr = StringPropertyReplacer.replaceProperties(annotationExpr);
       originalExpression = expr;
       try
       {
-         AnnotationParser parser = new AnnotationParser(new StringReader(annotationExpr));
+         if (AspectManager.verbose)
+         {
+            System.out.println("Creating annotation from " + originalAnnotationExpr);
+         }
+         AnnotationParser parser = new AnnotationParser(new StringReader(originalAnnotationExpr));
          org.jboss.aop.annotation.ast.ASTStart start = parser.Start();
          annotation = (ASTAnnotation) start.jjtGetChild(0);
       }




More information about the jboss-cvs-commits mailing list