]> source.dussan.org Git - aspectj.git/commitdiff
design notes and initial test for "truly synthetic" members
authoracolyer <acolyer>
Fri, 23 Jun 2006 07:00:38 +0000 (07:00 +0000)
committeracolyer <acolyer>
Fri, 23 Jun 2006 07:00:38 +0000 (07:00 +0000)
tests/features152/synthetic/PerThisFieldsAreSynthetic.aj [new file with mode: 0644]
tests/features152/synthetic/design.txt [new file with mode: 0644]

diff --git a/tests/features152/synthetic/PerThisFieldsAreSynthetic.aj b/tests/features152/synthetic/PerThisFieldsAreSynthetic.aj
new file mode 100644 (file)
index 0000000..33c2ca1
--- /dev/null
@@ -0,0 +1,24 @@
+import java.lang.reflect.*;
+
+public class PerThisFieldsAreSynthetic {
+
+  public static void main(String[] args) throws Exception {
+    new PerThisFieldsAreSynthetic().foo();
+    Field[] fields = PerThisFieldsAreSynthetic.class.getDeclaredFields();
+    for (Field f : fields) {
+      if (!f.isSynthetic()) {
+         System.out.println("Found unexpected non-synthetic field: " + f.getName());
+         throw new IllegalStateException("non-synthetic field " + f.getName());
+      }
+    }
+  }
+
+  public void foo() {}
+
+}
+
+aspect PerThis perthis(execution(* PerThisFieldsAreSynthetic.*(..))) {
+
+   before() : execution(* *(..)) { System.out.println("before"); }
+
+}
\ No newline at end of file
diff --git a/tests/features152/synthetic/design.txt b/tests/features152/synthetic/design.txt
new file mode 100644 (file)
index 0000000..bfc7909
--- /dev/null
@@ -0,0 +1,63 @@
+This table shows the members we create as a result of aspect declarations and weaving,
+and whether they should be marked synthetic or not.
+
+Inside aspects:
+==================
+
+name                                           type            description                                                                     synthetic
+-----------------------------------------------------------------------------------------
+ajc$preClinit                          method          start of static initialization                                  yes
+ajc$postClinit                         method          end of static initialization                            yes
+ajc$perCflowPush                       method          start a cflow                                                                   yes
+ajc$perCflowStack              field           cflow stack                                                                             yes
+ajc$perSingletonInstance       field           singleton instance                                                              yes
+ajc$initFailureCause           field           exception during init                                                   yes
+ajc$withinType                         field           type for perwithin aspects                                              yes
+ajc$perObjectBind                      method          creation of perobject aspects                                   yes
+ajc$getInstance                                method          perwithin instance accessor                                     yes
+ajc$createAspectInstance       method          creates ptw aspect                                                              yes
+aspectOf                                       method          generated aspectOf method                                               yes?* (it has no matching source code)
+hasAspect                                      method          generated hasAspect method                                              yes?* (it has no matching source code)
+ajc$superDispatch$<STname>$name                super method accessor (for around advice)               yes
+ajc$inlineAccessMethod$<AName>$<TName>$<mname> accessor for around advice                      yes
+ajc$inlineAccessFieldGet$... method    for around advice                                                               yes
+ajc$inlineAccessFieldSet$... method    for around advice                                                               yes
+ajc$preInterConstructor$<AName>$<TName> method ITD cons                                                        yes
+ajc$postInterConstructor$<AName>$<TName> method        ITD cons                                                        yes
+ajc$interFieldInit$...                 method  initializer for ITD field                                               yes
+ajc$interFieldSetDispatch$...  method set of ITD field                                                         yes
+ajc$interFieldGetDispatch$...  method  get of ITD field                                                                yes
+ajc$interMethodDispatch1$...   method  dispatch for ITD method                                         yes
+ajc$interMethod$<AName>$<TName>$<name> method  body of ITD method                                              no
+ajc$before$...                                 method  before advice                                                                   no
+ajc$after$...                                  method  after advice                                                                    no
+ajc$around$...                                 method  around advice                                                                   no
+ajc$afterReturning$...                 method  after returning advice                                                  no
+ajc$afterThrowing$...                  method  after throwing  advice                                                  no
+ajc$declare...                                 method  declare statement                                                               yes
+ajc$if_...                                             method  if statement inside pointcut                                    yes
+ajc$pointcut$...                               method  pointcut declaration                                                    yes
+ajc$around$.....proceed                method  proceed method for around advice                                yes
+
+Inside classes:
+===================
+ajc$pointcut$...                               method  pointcut declaration                                                    yes
+
+
+Inside woven types:
+===================
+
+ajc$<TName>$perObjectField                                     field   holds per-object aspect instance                yes
+ajc$<TName>$ptwAspectInstance                          field   holds per-type-within aspect                    yes             
+<AName>$ajcMightHaveAspect                                     interface added to per-xxx aspects                              n/a
+ajc$<AName>$perObjectGet                                       method  on types with ajcMightHaveAspect                yes
+ajc$<AName>$perObjectSet                                       method  on types with ajcMightHaveAspect                yes
+ajc$<AName>$localAspectOf                                      method  get ptw aspect instance                         yes
+ajc$privMethod$<Tname>$<AName>$<mname>         method  privileged accessor                                             yes
+ajc$privFieldGet$<Tname>$<AName>$<fname>       method  privileged accessor                                             yes
+ajc$privFieldSet$<Tname>$<AName>$<fname>       method  privileged mutator                                              yes
+ajc$<AName>$<DPType>                                           field   @DeclareParents delegate                                yes
+ajc$interField$...                                                     field   ITD-field                                                               yes
+ajc$interFieldGet$...                                          method  on target of ITD-field                                  yes
+ajc$interFieldSet$...                                          method  on target of ITD-field                                  yes
+ajc$interMethodDispatch2$...                           method  on target of ITD-method                         yes