Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Declare error

All,

I am trying to enforce a standard that disallows calls to the exception
logging mechanism in our framework.  The reasoning is that in the packages
listed below, I already have a handler aspect that takes care of the logging
for us.  So I created the following aspect:

public aspect DefaultExceptionHandlerAspect
{
	pointcut classList() : 
		within(com.capitalone.risk.service.xml..*) ||
		within(com.capitalone.risk.service.data..*);
	
	/**
        * ILogger is an interface class that all clients reference.
        */	
	declare error
		: call(ILogger.logException(..)) && classList()
		: "Illegal Call to logException";
	
	/**
        * ILogger is an interface class that all clients reference.
        */	
	declare error
		: call(ILogger.logErrorMessage(..)) && classList()
		: "Illegal Call to logErrorMessage";
}

When I apply the aspects I get the following error:

     [iajc]
C:\view$\rdifrang_aspectjUpgrade_NT\discovery\dev\src\com\capitalone
\aop\DefaultExceptionHandlerAspect.aj:35 Syntax error on token ".",
"expected na
me pattern" expected
     [iajc] : call(ILogger.logException(..)) && classList()
     [iajc]                             ^
     [iajc]
C:\view$\rdifrang_aspectjUpgrade_NT\discovery\dev\src\com\capitalone
\aop\DefaultExceptionHandlerAspect.aj:39 Syntax error on token ".",
"expected na
me pattern" expected
     [iajc] : call(ILogger.logErrorMessage(..)) && classList()
     [iajc]                                ^

I have tried different variation but to no avail.  What am I doing wrong?

Thanks in advance,

Ron 
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.


Back to the top