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 229213 - Convert lambda to anonymous class does not add throws statement
Summary: Convert lambda to anonymous class does not add throws statement
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 13: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 2013-04-30 13:12:32 UTC
Convert lambda to anonymous class does not add throws statement.

Steps to reproduce:
1) have a code:
    interface MyIface {        
        void run() throws FileNotFoundException;
    }

    public void test() {       
            MyIface r = () -> {
                FileReader fileReader = new FileReader("");
            };                
    }

2) use hint to convert it to anonymous class
->

   public void test() {       
            MyIface r = new MyIface() {
                public void run() {// <---- missing "throws FileNotFoundException"
                    FileReader fileReader = new FileReader("");
                }
            };                
    }



Product Version: NetBeans IDE Dev (Build 201304282301)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b28
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b86
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 1 Svata Dedic 2013-12-13 17:30:28 UTC
I guess the code is uncompilable -> increasing priority.
Comment 2 Martin Balin 2016-07-07 07:17:07 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