Summary: | Variable not initialized warning | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Pascal Rapicault <pascal> |
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
Status: | VERIFIED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, satyam.kandula, stephan.herrmann |
Version: | 3.7 | ||
Target Milestone: | 3.7 RC1 | ||
Hardware: | PC | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
Pascal Rapicault
2011-05-10 16:10:30 EDT
I'm using I20110507-0800 The variable not initialized warning is legal here, and is also given by javac. This is in accordance with rules of definite and indefinite assignment (See chapter 16 of JLS 3.0 - http://java.sun.com/docs/books/jls/). > I thought that by default the handler variable would be set to null. An unassigned variable is not assigned by default and the user is expected to assign it in all possible branches of the code, or a compile time error occurs. I intend to close as INVALID. (In reply to comment #0) > [...] I thought that by default the handler variable would be set to null This would be true only for fields, never for local variables. I agree with Ayushman that this bug is invalid. Yes, only fields get a default value. Local variables need to be initialized in all possible paths. Closing as INVALID. Verified for 3.7 RC1 |