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 268907

Summary: Wrong exception hint while using LambdaExceptionUtil
Product: java Reporter: js-java
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description js-java 2016-11-09 11:56:15 UTC
The following code is compiling with Java 8 and was working with Netbeans 8.1 but gives a "unreported exception" hint:


public class nb82 {

    public List<Integer> getOwnerStoragesAsInt(int oid) {
        return new LinkedList<Integer>().stream().map(LambdaExceptionUtil.rethrowFunction(rs -> getInt("stid"))).collect(Collectors.toList());
    }

    private int getInt(String name) throws SQLException {
        return 0;
    }
}

This is using the LambdaExceptionUtil from http://stackoverflow.com/questions/27644361/how-can-i-throw-checked-exceptions-from-inside-java-8-streams.
Comment 1 js-java 2016-11-09 11:57:16 UTC
Just to make this clear: "unreported exception" hint is given in NB 8.2, but not 8.1.