About the ‘throws (!Ex)’ issue again.

It seems my understanding of the intended AspectJ semantics was wrong,
and so I asked for (and you implemented) a slightly incorrect set of rules.

According to Appendix B of the AspectJ documentation, a ‘throws pattern’
is a comma-separated list of ExceptionPatterns, and an ExceptionPattern
is either (“!” ClassNamePattern) or simply (ClassNamePattern), using
aspectj-front’s terminology.

This means that if the first character is a ‘!’, all the rest is parsed
as a single ClassNamePattern and has one set of rules for matching, and
if the first character is anything else (including ‘(’), then the thing
is simply parsed as a ClassNamePattern.

Thus, ‘!Ex && ..’ is equivalent to ‘!(Ex && ..)’, which is NOT
equivalent to ‘(!Ex && ..)’.

Submitted on 10 July 2006 at 16:40

Log in to post comments