From 4dafe048cb1f5bf9a30fcfac58011fe425141b91 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 23 Jun 2006 07:00:38 +0000 Subject: design notes and initial test for "truly synthetic" members --- .../synthetic/PerThisFieldsAreSynthetic.aj | 24 +++++++++ tests/features152/synthetic/design.txt | 63 ++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 tests/features152/synthetic/PerThisFieldsAreSynthetic.aj create mode 100644 tests/features152/synthetic/design.txt 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$$name super method accessor (for around advice) yes +ajc$inlineAccessMethod$$$ accessor for around advice yes +ajc$inlineAccessFieldGet$... method for around advice yes +ajc$inlineAccessFieldSet$... method for around advice yes +ajc$preInterConstructor$$ method ITD cons yes +ajc$postInterConstructor$$ 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$$$ 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$$perObjectField field holds per-object aspect instance yes +ajc$$ptwAspectInstance field holds per-type-within aspect yes +$ajcMightHaveAspect interface added to per-xxx aspects n/a +ajc$$perObjectGet method on types with ajcMightHaveAspect yes +ajc$$perObjectSet method on types with ajcMightHaveAspect yes +ajc$$localAspectOf method get ptw aspect instance yes +ajc$privMethod$$$ method privileged accessor yes +ajc$privFieldGet$$$ method privileged accessor yes +ajc$privFieldSet$$$ method privileged mutator yes +ajc$$ 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 -- cgit v1.2.3