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

Summary: dispensable warning hint
Product: java Reporter: Foolfire
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 249320    

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.