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 102718 - Formatting broken when using hint to add second catch block
Summary: Formatting broken when using hint to add second catch block
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-27 10:12 UTC by Jiri Prox
Modified: 2016-07-07 07:17 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 Jiri Prox 2007-04-27 10:13:05 UTC
NetBeans IDE Dev (Build 20070427-0545)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Linux version 2.6.5-1.358 running on i386
en_US (nb); UTF-8

Formatting of try-catch is broken when second catch block is added via surround
with try-catch hint.

Steps to reproduce:
1) have a method
    private void method(int x) {                
        if(x==1) throw new FileNotFoundException();
        if(x==2) throw new MalformedURLException();                        
    }

2) apply mentioned hint on both lines

->
    private void method(int x) {                
        try {
            if (x == 1) {
                throw new java.io.FileNotFoundException();
            }
            if (x == 2) {
                throw new java.net.MalformedURLException();
            }
        }
        catch (FileNotFoundException ex) {
    Logger.getLogger("global").log(Level.SEVERE, null, ex);
}
        catch (MalformedURLException ex) {
            Logger.getLogger("global").log(Level.SEVERE, null, ex);
        }
    }
Comment 1 Rastislav Komara 2009-02-03 10:55:41 UTC
Overtake.
Comment 2 Jan Lahoda 2009-08-20 09:59:47 UTC
Reassigning all moonko's java/source bugs to myself.
Comment 3 Martin Balin 2016-07-07 07:17:35 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss