Bug 146375 - Surround with Try/Catch block generates incorrect code
Surround with Try/Catch block generates incorrect code
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Tromey
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-27 13:00 EST by Andrew Overholt
Modified: 2014-08-11 01:46 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-02-02 09:38:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Eclipse Project 84104 None None None Never

  None (edit)
Description Andrew Overholt 2005-01-27 13:00:08 EST
Description of problem:
Using the "Surround with try/catch block" quick fix puts the 

Version-Release number of selected component (if applicable):
libgcj4-devel-4.0.0-0.22
eclipse-jdt-3.0.1_fc-9

How reproducible:


Steps to Reproduce:
1. follow the Java-GNOME demo here: 
http://people.redhat.com/overholt/nativeeclipse
2. rather than surrounding the s = new Simple() in a try block
manually, just enter the line and use the Quick Fix -> Surround with
try/catch
3. watch as it puts the try and original statement at the end of the block
  
Actual results:
        }// TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (GladeXMLException e) {
            s = new Simple();try {

Expected results:
        try {
            s = new Simple();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (GladeXMLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

Additional info:
This does not happen with the IBM JVM (same bytecode) but does happen
with both natively-compiled and interpreted gcj4/gij4.  I'm pretty
sure this is a libgcj bug and I'm trying to track it down.
Comment 1 Ben Konrath 2005-02-01 10:32:44 EST
I've tracked this down to an upstream problem. A patch is attached to the
upstream bug report.
Comment 2 Andrew Overholt 2005-02-02 09:38:13 EST
Ben's patch is now included in our RPMs (from -14 onwards) and I can
verify that it's fixed for me.

Resolving.

Note You need to log in before you can comment on or make changes to this bug.