Bug 128943 - Null reference should be silenced by assert just as it is by direct check
Summary: Null reference should be silenced by assert just as it is by direct check
Status: RESOLVED DUPLICATE of bug 127244
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-22 03:45 EST by Max Gilead CLA
Modified: 2006-02-22 04:05 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Gilead CLA 2006-02-22 03:45:59 EST
I believe null reference warning/error should be silenced by assert just as it is by direct check:

public class Test {
  boolean bar() { return false; }
  void foo(Test t) {
    assert t != null;
//  if (t == null) { return; } // Uncomment this line to silence warning below
    if (t.bar()) { // Warning: The variable t may be null
      return;
}}}
Comment 1 Maxime Daniel CLA 2006-02-22 04:05:19 EST
Agreed. See bug 127244.

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