Bug 113032

Summary: [messages] compiler should warn on wrong return type in signature
Product: [Tools] AspectJ Reporter: Ron Bodkin <rbodkin+LISTS>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 CC: holger
Version: DEVELOPMENT   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ron Bodkin CLA 2005-10-18 23:14:44 EDT
If a signature specifies a known method with a wrong return type for the 
signature that's definitely worth an Xlint warning. E.g., this program compiles 
without a complaint then produces no output. Change the void to boolean for the 
signature in the call pointcut and it works. This should produce a compiler 
warning by default...

public aspect WarnOnWrongReturn {
    before(Thread hook) : call(void Runtime.removeShutdownHook(*)) && args
(hook) {
         System.out.println("removing");
    }

    public static void main(String args[]) {
	Thread thread = new Thread();
	Runtime.getRuntime().addShutdownHook(thread);
	Runtime.getRuntime().removeShutdownHook(thread);
    }
}