Summary: | [compiler][null]Bogus "Null comparison always yields false" | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | till toenges <tt> |
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | amj87.iitr, jarthana, paul |
Version: | 3.7 | ||
Target Milestone: | 3.7 M6 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
till toenges
2010-12-16 05:14:24 EST
I'll take a look. I have essentially the same problem, with essentially the same reproduction test case. If the initial line = "" is changed to line= null then the warning goes away. It does not change based on whether the initial doRead is set to true or false. package net.wagland.paul.test; import java.io.BufferedReader; import java.io.IOException; public class NullWarningTest { public void testNullWarning(BufferedReader bufReader) throws IOException { String line = ""; boolean doRead = false; while (true) { if (doRead) line = bufReader.readLine(); if (line == null) return; doRead = true; } } } Actually, this bug should be marked as a duplicate of bug 313870. Closing as dup *** This bug has been marked as a duplicate of bug 313870 *** Verified for 3.7 RC1 with build I20110514-0800. |