This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231287 - Editor issue with final variable (wrong hint, no compilation error in editor)
Summary: Editor issue with final variable (wrong hint, no compilation error in editor)
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.4
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-14 18:21 UTC by adithyank
Modified: 2013-06-14 19:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
"Make final" hint shown even without variable assignment (155.34 KB, image/png)
2013-06-14 18:22 UTC, adithyank
Details
screenshot showing "no compilation error" on 2 scenarios (149.64 KB, image/png)
2013-06-14 18:26 UTC, adithyank
Details
IDE log (74.70 KB, text/plain)
2013-06-14 18:26 UTC, adithyank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adithyank 2013-06-14 18:21:06 UTC
Product Version = NetBeans IDE 7.4 Beta (Build 201306132201)
Operating System = Linux version 2.6.32-358.11.1.el6.i686 running on i386
Java; VM; Vendor = 1.7.0_21
Runtime = Java HotSpot(TM) Client VM 23.21-b01

1. "make variable final" hint shown for variable declaration without the actual assignment
2. after clicking the hint, final is inserted in the code. but, compilation error is not shown since final keyword is there without actual assignment
3. inside constructor, this variable is assigned. but, no compilation error saying "cannot assign a value to final variable"

I am setting priority as P1, as I feel it is critical.
Comment 1 adithyank 2013-06-14 18:22:32 UTC
attached screenshot showing "make final" hint shown even without variable assignment
Comment 2 adithyank 2013-06-14 18:22:37 UTC
Created attachment 135811 [details]
"Make final" hint shown even without variable assignment
Comment 3 adithyank 2013-06-14 18:26:19 UTC
attached screenshot showing "no compilation error" on following 2 scenarios

1. final keyword during variable declaration without actual value assignment
2. during assigning value for a final variable in constructor
Comment 4 adithyank 2013-06-14 18:26:25 UTC
Created attachment 135812 [details]
screenshot showing "no compilation error" on 2 scenarios
Comment 5 adithyank 2013-06-14 18:26:29 UTC
Created attachment 135813 [details]
IDE log
Comment 6 adithyank 2013-06-14 19:02:09 UTC
I am marking this bug invalid as the behavior is right. I just read jls 3.0 again by trusting nb. got clarified