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 242283

Summary: Remove catch cause removes finally block
Product: java Reporter: Jiri Prox <jiriprox>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Jiri Prox 2014-02-24 14:34:56 UTC
Remove catch clause hint (provided for 'Exception is never thrown in body of  corresponding try statement) removes also finally clause


Steps to reproduce:
1)  have a code
 
        try {
            openSourceFile("org.netbeans.test.java.editor.breadcrumbs", TEST_FILE);
            oper = new EditorOperator(TEST_FILE);
                        
        } catch (IOException ioe) {
            fail(ioe);
        } finally {
            if(oper!=null) oper.closeDiscard();
        }

2) use hint

->

        openSourceFile("org.netbeans.test.java.editor.breadcrumbs", TEST_FILE);
        oper = new EditorOperator(TEST_FILE);

the body of finally is removed



Product Version: NetBeans IDE 8.0 RC1 (Build 201402202300)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b123
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\8.0rc1
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\8.0rc1
Comment 1 Svata Dedic 2014-08-14 14:38:41 UTC
Nice catch; preservation of finally block added in jet-main#744028f91cee
Comment 2 Quality Engineering 2014-08-16 04:54:38 UTC
Integrated into 'main-silver', will be available in build *201408160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/744028f91cee
User: Svata Dedic <sdedic@netbeans.org>
Log: #242283: finally block contents preserved when last catch is removed