diff options
author | acolyer <acolyer> | 2006-06-23 07:00:38 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2006-06-23 07:00:38 +0000 |
commit | 4dafe048cb1f5bf9a30fcfac58011fe425141b91 (patch) | |
tree | 090ed647a16053e286947a56240520265112098d /tests | |
parent | 76d1bc7bdfe7665c6d4fd04c852b92f17d255ddb (diff) | |
download | aspectj-4dafe048cb1f5bf9a30fcfac58011fe425141b91.tar.gz aspectj-4dafe048cb1f5bf9a30fcfac58011fe425141b91.zip |
design notes and initial test for "truly synthetic" members
Diffstat (limited to 'tests')
-rw-r--r-- | tests/features152/synthetic/PerThisFieldsAreSynthetic.aj | 24 | ||||
-rw-r--r-- | tests/features152/synthetic/design.txt | 63 |
2 files changed, 87 insertions, 0 deletions
diff --git a/tests/features152/synthetic/PerThisFieldsAreSynthetic.aj b/tests/features152/synthetic/PerThisFieldsAreSynthetic.aj new file mode 100644 index 000000000..33c2ca1c1 --- /dev/null +++ b/tests/features152/synthetic/PerThisFieldsAreSynthetic.aj @@ -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 index 000000000..bfc7909ff --- /dev/null +++ b/tests/features152/synthetic/design.txt @@ -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 |