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 251944

Summary: Erroneous hint: Throwable method result is ignored
Product: java Reporter: achirizzi
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description achirizzi 2015-04-20 08:38:53 UTC
Bug 242212 is still present in version 8.0.2

Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Mac OS X version 10.10.2 running on x86_64
Java; VM; Vendor = 1.7.0_67
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.65-b04



  try {
    // ... throw new OrmException("example");
  } catch (OrmException maybeSqlTransactionRollbackException) {
   Throwable cause = maybeSqlTransactionRollbackException.getCause(); // <--- Erroneous hint here
   if (ChangesOnSlave.retryOnDeadlocks 
      && (cause instanceof SQLTransactionRollbackException)) {
      // ...
   } else {
     throw maybeSqlTransactionRollbackException;
   }
  }

NetBeans will still say that the cause is ignored even if it's used in the following if.
Comment 1 Jiri Prox 2015-05-14 09:58:00 UTC
reproducible
Comment 2 Svata Dedic 2015-05-15 14:25:23 UTC
Complex conditions involving the throwable var were not handled correctly. Fixed in jet-main#0238036e9b54
Comment 3 Quality Engineering 2015-05-23 08:01:34 UTC
Integrated into 'main-silver', will be available in build *201505230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0238036e9b54
User: Svata Dedic <sdedic@netbeans.org>
Log: #251944: accept Throwable use in complex conditions