This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255025 - dispensable warning hint
Summary: dispensable warning hint
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 249320
  Show dependency tree
 
Reported: 2015-09-05 18:47 UTC by Foolfire
Modified: 2015-11-13 11:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Foolfire 2015-09-05 18:47:25 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.7.0_79
Runtime = Java HotSpot(TM) Client VM 24.79-b02

Somewhy dispensable warning hint "dereferencing possible null pointer" displays for "res" variable at try...catch block in following part of code:

  boolean okay = false;
//...
  int r = 0;
  okay = res != null && res.text != null;
  if (okay) {
    try {r = Integer.parseInt(res.text);} catch (Exception ex) {}
    //...
  }
//...

Is it possible to correct code analyzer to avoid appearance of such hints?
Comment 1 Svata Dedic 2015-11-13 11:40:06 UTC
Fixed in the experimental impl; wait for the umbrella issue to close.