[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Pointcut with array type patterns


In the The AspectJTM Programming Guide we have see that is possible to do a pointcut with array type patterns like this Object+[].

The AspectJTM Programming Guide
      - Pointcuts
             -Appendix B. Language Semantics

Array type patterns

A type name pattern or subtype pattern can be followed by one or more sets of square brackets to make array type patterns. So Object[] is an array type pattern, and so is com.xerox..*[][], and so is Object+[].

We have tried a simple test but don't work
Can you help me?

public aspect Test {

    private pointcut none();
    private pointcut all() : !none();
    protected pointcut scope() : all();
    private pointcut exclusions() :
    private pointcut setObjectArray() : set(Object+[] *);       //  Error is here
    declare error : scope() && exclusions() && setObjectArray() : "This is an array of Object or subclass" ;

Eclipse SDK
Version: 3.3.2
Build id: M20080221-1800

AJDT Version:
AspectJ version: