Bug 222054 - no detailed checks for nevermatching pointcuts
Summary: no detailed checks for nevermatching pointcuts
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-10 10:15 EDT by Thomas CLA
Modified: 2008-03-10 10:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas CLA 2008-03-10 10:15:28 EDT
During the evaluation of the aspectBench compiler (abc) [1] i collide with the following issue:

I compiled AJHotDrawg [2] with ajc and the abc.

The abc throws the following error:

---------------------------------------------
abc:
     [java] abc started on Sun Mar 09 20:53:43 GMT 2008
     [java] /home/thomas/workspace/java/abc-head/../abc-head-ajhotdraw/AJHotDraw/src/aspects/org/jhotdraw/ccconcerns/commands/undo/DeleteCommandUndo.aj:56:
     [java] Invalid application of around advice from aspect
     [java] org.jhotdraw.ccconcerns.commands.undo.UndoRedoActivity
     [java]
(/home/thomas/workspace/java/abc-head/../abc-head-ajhotdraw/AJHotDraw/src/aspects/org/jhotdraw/ccconcerns/commands/undo/UndoRedoActivity.aj,
     [java] line 138) : Can't apply around advice with non-object
non-void return type
     [java] to a void shadow (shadow type: void; advice return
type: boolean)
     [java] setRedoable(true);
     [java] ^---------------^
     [java]
     [java] 1 error.
     [java] Java Result: 5 
---------------------------------------------

The indicated pointcut looks like:
---------------------------------------------
pointcut callUndoableSetRedoable(Undoable undoable, boolean newIsRedoable) : 
		call(void Undoable.setRedoable(boolean)) &&
		args(newIsRedoable) &&
		target(undoable) &&
		if(false); //just to have no match for now

	boolean around(Undoable undoable, boolean newIsRedoable) : callUndoableSetRedoable(undoable, newIsRedoable) {
		return proceed(undoable, newIsRedoable);
	}

---------------------------------------------

The ajc compiles this source without errors. But as you can see the pointcut identifies calls to void methods but the advice return boolean.

My guess is that the compiler does no detailed check as it notices that the pointcut will never match as it include if(false). After I comment the if(false) out also the ajc throws errors during the compilation.

Is this issue known?

[1] http://abc.comlab.ox.ac.uk/introduction
[2] http://ajhotdraw.sourceforge.net/