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 - Erroneous hint: Throwable method result is ignored
Summary: Erroneous hint: Throwable method result is ignored
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 08:38 UTC by achirizzi
Modified: 2015-05-23 08:01 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 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