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 257855

Summary: Unnecessary compiler warning when lambda parameter is not used
Product: java Reporter: lukas.eder
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: hmichel
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Windows 10   
Issue Type: DEFECT Exception Reporter:

Description lukas.eder 2016-02-04 22:18:38 UTC
The following code produces a warning on the parameter "a":

----------------------------------------------------------------
Stream.of(1, 2).filter(a -> true);
Stream.of(1, 2).filter((Integer a) -> true);
----------------------------------------------------------------

The following code, however, doesn't:

----------------------------------------------------------------
Stream.of(1, 2).filter(new Predicate<Integer>() {
    @Override
    public boolean test(Integer a) {
        return true;
    }
});
----------------------------------------------------------------

The warning is not really necessary. It would be better not to report it (or at least make reporting it an option, and not report it by default)