Bug 248897 - [1.5][compiler] Wrong warning 'The local variable 'var' is never read'.
Summary: [1.5][compiler] Wrong warning 'The local variable 'var' is never read'.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-29 03:53 EDT by David Audel CLA
Modified: 2010-03-08 03:52 EST (History)
4 users (show)

See Also:


Attachments
Patch under consideration (3.88 KB, patch)
2010-02-25 05:54 EST, Srikanth Sankaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2008-09-29 03:53:13 EDT
build I20080923-0800

1) create Test.java
public class Test {
	void foo(int j) {
		final String var = "";
		@ZAnn(var)
		class X {}
	}
}
@interface ZAnn {
	String value();
}

2) compile
3) There is a warning is the problem view:
The local variable var is never read

The variable is used is the annotation and must not be marked as unread.
Comment 1 Mike Wilson CLA 2009-05-05 11:26:46 EDT
Changing Version tag to something more believable.
Comment 2 Srikanth Sankaran CLA 2010-02-24 04:37:45 EST
I will follow up on this.
Comment 3 Srikanth Sankaran CLA 2010-02-25 05:54:03 EST
Created attachment 160172 [details]
Patch under consideration
Comment 4 Jay Arthanareeswaran CLA 2010-03-01 01:46:54 EST
Patch looks good
Comment 5 Srikanth Sankaran CLA 2010-03-01 01:55:41 EST
Released in HEAD for 3.6M6
Comment 6 Ayushman Jain CLA 2010-03-08 03:49:12 EST
Verified for 3.6M6 using build I20100305-1011.
Comment 7 Jay Arthanareeswaran CLA 2010-03-08 03:52:55 EST
Verified.