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 - Unnecessary compiler warning when lambda parameter is not used
Summary: Unnecessary compiler warning when lambda parameter is not used
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.1
Hardware: PC Windows 10
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 22:18 UTC by lukas.eder
Modified: 2016-11-25 10:03 UTC (History)
1 user (show)

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 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)