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 - Wrong exception hint while using LambdaExceptionUtil
Summary: Wrong exception hint while using LambdaExceptionUtil
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-09 11:56 UTC by js-java
Modified: 2016-11-14 15:13 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 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.