[jboss-cvs] JBossAS SVN: r59530 - in projects/aop/trunk/aop: src/main/org/jboss/aop and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 11 10:46:57 EST 2007


Author: flavia.rainone at jboss.com
Date: 2007-01-11 10:46:39 -0500 (Thu, 11 Jan 2007)
New Revision: 59530

Modified:
   projects/aop/trunk/aop/docs/reference/reference/en/modules/annotated.xml
   projects/aop/trunk/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/Instrumentor.java
   projects/aop/trunk/aop/src/main/org/jboss/aop/introduction/InterfaceIntroduction.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/AnnotatedTestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/ComparableMixin.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/IntroductionAspect.java
Log:
[JBAOP-317] Task done

Modified: projects/aop/trunk/aop/docs/reference/reference/en/modules/annotated.xml
===================================================================
--- projects/aop/trunk/aop/docs/reference/reference/en/modules/annotated.xml	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/docs/reference/reference/en/modules/annotated.xml	2007-01-11 15:46:39 UTC (rev 59530)
@@ -595,6 +595,7 @@
          <itemizedlist>
             <listitem>be public</listitem>
             <listitem>be static</listitem>
+            <listitem>have an empty parameter list, or receive the target of introduction as parameter</listitem>
             <listitem>contain the logic to create the mixin class</listitem>
             <listitem>return an instance of the mixin class</listitem>
          </itemizedlist>

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/AspectAnnotationLoader.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -618,11 +618,12 @@
          {
             case 0:
                construction += "()";
+               intro = createIntroduction(name, target, typeExpression, null, null, null);//cf.getName(), minfo.getName());
                break;
             case 1:
                construction += "(this)";
-               
-/*               
+               intro = createIntroduction(name, target, typeExpression, null, cf.getName(), minfo.getName());               
+  
                String parameter = Descriptor.getParamDescriptor(minfo.getDescriptor());
                
                if (parameter.charAt(1) != 'L')
@@ -669,14 +670,13 @@
                   errorMessage += ".\n   It should have the introduction target type as parameter, or have no parameter at all.";
                   throw new RuntimeException(errorMessage);
 
-               }*/
+               }
                break;
             default:
                throw new RuntimeException("Mixin creator method '" + name +
                      "' should not have more than one parameter.");
          }
          
-         intro = createIntroduction(name, target, typeExpression, null, null, null);//cf.getName(), minfo.getName());         
          if (!Modifier.isStatic(minfo.getAccessFlags()) ||
                !Modifier.isPublic(minfo.getAccessFlags()))
          {

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/Instrumentor.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/Instrumentor.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/instrument/Instrumentor.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -315,7 +315,8 @@
             }
             // If another interface of this mixin has a duplicate method, then its ok, but don't re-add
             if (addedMethods.contains(hash)) continue;
-            try{
+            try
+            {
                createMixinInvokeMethod(clazz, mixinClass, initializer, method, hash.longValue());
             }
             catch (CannotCompileException e)

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/introduction/InterfaceIntroduction.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/introduction/InterfaceIntroduction.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/introduction/InterfaceIntroduction.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -121,6 +121,8 @@
       this.classExpr = new ClassExpression(exp);
    }
    
+   // call this constructor only when constructor method receives the mixin target
+   // as parameter, for posterior validation of constructor method signature
    public InterfaceIntroduction(String name, String exp, String[] interfaces,
          String constructorClass, String constructorMethod)
    {
@@ -136,7 +138,8 @@
       this.interfaces = interfaces;
    }
 
-   
+   // call this constructor only when constructor method receives the mixin target
+   // as parameter, for posterior validation of constructor method signature
    public InterfaceIntroduction(String name, ASTStart ast, String[] interfaces,
          String constructorClass, String constructorMethod)
    {
@@ -197,13 +200,15 @@
       return mixins;
    }
 
-   // this value is set only when there is a mixin constructor class and this
+   // this value is set only when there is a mixin constructor method and this
    // method receives the target as parameter
    public String getConstructorClass()
    {
       return this.constructorClass;
    }
 
+   // this value is set only when there is a mixin constructor method and this
+   // method receives the target as parameter
    public String getConstructorMethod()
    {
       return this.constructorMethod;

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/AnnotatedTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/AnnotatedTestCase.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/AnnotatedTestCase.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -185,7 +185,7 @@
       assertTrue("readExternal was not called for pojo2", ExternalizableMixin.read);
       
       ComparableMixin.COMPARED = false;
-      ((Comparable) pojo2).compareTo(null);
+      ((Comparable<Object>) pojo2).compareTo(null);
       assertTrue("mixin method was not called", ComparableMixin.COMPARED);
    }
 

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/ComparableMixin.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/ComparableMixin.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/ComparableMixin.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -26,7 +26,7 @@
  * 
  * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
  */
-public class ComparableMixin implements Comparable
+public class ComparableMixin implements Comparable<Object>
 {
    static boolean COMPARED = false;
    

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/IntroductionAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/IntroductionAspect.java	2007-01-11 14:21:28 UTC (rev 59529)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/jdk15annotated/IntroductionAspect.java	2007-01-11 15:46:39 UTC (rev 59530)
@@ -38,7 +38,7 @@
    }
    
    @Mixin (target=org.jboss.test.aop.jdk15annotated.NoInterfacesPOJO2.class, interfaces={Comparable.class})
-   public static ComparableMixin createComparableMixin(/*NoInterfacesPOJO2 pojo*/) {
+   public static ComparableMixin createComparableMixin() {
        return new ComparableMixin();
    }
    




More information about the jboss-cvs-commits mailing list