Bug 113032 - [messages] compiler should warn on wrong return type in signature
Summary: [messages] compiler should warn on wrong return type in signature
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-18 23:14 EDT by Ron Bodkin CLA
Modified: 2007-10-23 11:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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);
    }
}