Bug 381558 - [xbase][compiler] Unexpected compilation of catch(Throwable throwable)
Summary: [xbase][compiler] Unexpected compilation of catch(Throwable throwable)
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 07:20 EDT by Sebastian Zarnekow CLA
Modified: 2012-06-04 07:20 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2012-06-04 07:20:14 EDT
try {
  ..
} catch(Throwable t) {
  t.printStackTrace
}

will compile to 

try {
  ..
} catch (final Throwable _t) {
  if (_t instanceof Throwable) {
    final Throwable t = (Throwable)_t;
    t.printStackTrace();
  } else {
    throw Exceptions.sneakyThrow(_t);
  }
}

The instanceof check as well as the cast are unnecessary and reported by findbugs.