Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] declare error & hasmethod

it *is* user error strictly speaking, but you can blame me for the
unhelpful message you are getting :)

You are missing a leading 'paren' ahead of the first hasmethod.

Instead of:

declare error : hasmethod(@javax.validation.constraints..* static *
*(..)) || hasmethod(static * *(.., @javax.validation.constraints..*
(*), ..))) :

It should be:

declare error : (hasmethod(@javax.validation.constraints..* static *
*(..)) || hasmethod(static * *(.., @javax.validation.constraints..*
(*), ..))) :

Andy

On 11 September 2012 09:10, Matthew Adams <matthew@xxxxxxxxxxxxxxx> wrote:
> In light of the fact that bean validation still doesn't support static
> methods, I'd like to add a declare error statement that makes it a
> compiler error to try to do that.  I'm doing something wrong here.
> The following fails to compile:
>
> /* 95 */        declare error :
> /* 96 */                hasmethod(@javax.validation.constraints..* static * *(..))
> /* 97 */                || hasmethod(static * *(.., @javax.validation.constraints..*
> (*), ..))) :
> /* 98 */                        "can't validate static methods";
>
> Compiler error is:
> [ERROR] Failed to execute goal
> org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default-compile)
> on project foundation-domain: Compiler errors:
> [ERROR] error at hasmethod(@javax.validation.constraints..* static * *(..))
> [ERROR]
> [ERROR] /Users/matthew/Documents/bitbucket/scispike-foundation/foundation/domain/src/main/aspect/com/scispike/foundation/domain/aspectj/validation/ApacheBvalMethodValidationAspect.aj:96:0::0
> Syntax error on token "*", ")" expected
>
> It's complaining about the star following "static" on line 96 above.
> Any tips here?
>
> -matthew
>
> --
> mailto:matthew@xxxxxxxxxxxxxxx
> skype:matthewadams12
> googletalk:matthew@xxxxxxxxxxxxxxx
> http://matthewadams.me
> http://www.linkedin.com/in/matthewadams
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top