Skip to content

Commit

Permalink
Fix test after node traversal was improved
Browse files Browse the repository at this point in the history
Due to the latest improvements, an error which was previously not thrown
unexpectedly according to a source code comment in test aspect
ParameterizedTypesInAnnotationPatterns.aj is now thrown for this kind
of pointcut:

  staticinitialization(@(Foo || List<String>) String)

Now the compiler correctly says:

  no static initialization join points for parameterized types,
  use raw type instead

Relates to #221.

Signed-off-by: Alexander Kriegisch <[email protected]>
  • Loading branch information
kriegaex committed Apr 12, 2024
1 parent 59fef88 commit cb13d8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import java.util.List;
public aspect ParameterizedTypesInAnnotationPatterns {
// CE - not an annotation type
pointcut simple() : staticinitialization(@List<String> String);
// no CE, good enough for now? may improve error reporting for this later

// CE - no static initialization join points for parameterized types, use raw type instead
pointcut combined() : staticinitialization(@(Foo || List<String>) String);

}

@interface Foo {}
@interface Foo {}
Original file line number Diff line number Diff line change
Expand Up @@ -5017,6 +5017,7 @@
<ajc-test dir="java5/generics/pointcuts" title="annotation patterns with parameterized types">
<compile files="ParameterizedTypesInAnnotationPatterns.aj" options="-1.5">
<message kind="error" line="5" text="is not an annotation type"/>
<message kind="error" line="8" text="no static initialization join points for parameterized types, use raw type instead"/>
</compile>
</ajc-test>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5017,6 +5017,7 @@
<ajc-test dir="java5/generics/pointcuts" title="annotation patterns with parameterized types">
<compile files="ParameterizedTypesInAnnotationPatterns.aj" options="-1.9">
<message kind="error" line="5" text="is not an annotation type"/>
<message kind="error" line="8" text="no static initialization join points for parameterized types, use raw type instead"/>
</compile>
</ajc-test>

Expand Down

0 comments on commit cb13d8b

Please sign in to comment.