| Summary: | [compiler][null][correlation] Invalid null reference with ternary operator | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | NoName <utilisateur_182> |
| Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | stephan.herrmann |
| Version: | 3.3 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 128806 *** *** This bug has been marked as a duplicate of bug 538421 *** |
Build ID: I20070323-1616 Steps To Reproduce: Pasting the following code: public class Test { public static void main(String[] args) { if (args.length >= 1) { String value = System.getProperty(args[0]); String s = value != null ? value.trim() : null; if (s != null) System.err.println("s.length() = " + value.length()); // warning on value // warning is "Potential null pointer access: The variable value may be null at this location" } } } More information: if s is not null, value cannot be null