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 131266

Summary: Wrong formatting when hint applied in switch statement
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Max Sauer <msauer>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2008-03-27 10:14:53 UTC
Product Version: NetBeans IDE Dev (Build 20080326053408)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
System: Linux version 2.6.5-1.358 running on i386; UTF-8; en_US (nb)

Formatting is wrong when "Surround statement with try-catch" is applied in switch statement. Reformat code helps.

Steps to reproduce:
1) have a code:
    public void method() {
        int a = 0;        
        switch (a) {
            case 1:            
                FileReader fr = new FileReader("");
                    
        }
    }

2) apply hint
->
    public void method() {
        int a = 0;        
        switch (a) {
            case 1:            
        try {
            FileReader fr = new FileReader("");
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Beans.class.getName()).log(Level.SEVERE, null, ex);
        }
                    
        }
    }
Comment 1 Jan Becicka 2008-05-15 13:25:49 UTC
Max volunteered :)
Comment 2 Max Sauer 2008-11-24 14:43:54 UTC
Will be resolved LATER.
Comment 3 Quality Engineering 2009-11-02 11:03:01 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX