Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 150123 - [compiler][null] var correlation - variant
Summary: [compiler][null] var correlation - variant
Status: RESOLVED DUPLICATE of bug 136676
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 150125 150133 150134 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-10 07:36 EDT by Felis Cattus CLA
Modified: 2006-07-10 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felis Cattus CLA 2006-07-10 07:36:29 EDT
I have the following option set to warning: Java -> Compiler -> Errors/Warnings -> Null references. 
A null reference warning appears in the following code, saying "The variable text may be null":

    boolean hasText = text != null && text.trim().length() != 0;
    boolean saveEnabled = hasText && !text.equals(savedText); // Warning here
Comment 1 Olivier Thomann CLA 2006-07-10 09:16:46 EDT
*** Bug 150125 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Thomann CLA 2006-07-10 09:44:31 EDT
*** Bug 150133 has been marked as a duplicate of this bug. ***
Comment 3 Olivier Thomann CLA 2006-07-10 09:44:55 EDT
*** Bug 150134 has been marked as a duplicate of this bug. ***
Comment 4 Maxime Daniel CLA 2006-07-10 11:10:58 EDT
This is a variant of the case reported into bug 136676, with a slight complication (the boolean expression is composite). Will need to add this test case when addressing 136676.

*** This bug has been marked as a duplicate of 136676 ***