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 252948 - Convert to lambda is provided for project with source format < 1.8
Summary: Convert to lambda is provided for project with source format < 1.8
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-12 10:44 UTC by Jiri Prox
Modified: 2017-04-14 19:15 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 2015-06-12 10:44:24 UTC
Convert to lambda hint is provided in project with source level < 1.8 

Sample code:
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new Anagrams().setVisible(true);
            }
        });


Product Version: NetBeans Dev JDK9 branch (Build 201506120405)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev-jdk9-branch
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev-jdk9-branch
Comment 1 Svata Dedic 2015-07-29 06:19:31 UTC
The hint is driven by compiler's lambda warning; cannot reproduce in trunk, I suspect a change in compiler on JDK9 branch.
Comment 2 Rahul.khandelwal 2016-08-11 07:04:25 UTC
Can't we do anything about such hints ?
I am running netbeans nightly build of 11th august 2016.
Netbeans is running on JDK8.
Project is configured on source level 7.
In project library settings, I have configured JRE 7.
Ideally IDE shouldn't give this hint.

Hints should be based on project source level.
Comment 3 Sahuagin 2017-04-14 19:15:17 UTC
I'm getting this in 8.2 using JDK 1.8 with source level 1.7. I've even turned off all lambda related hints and I still am getting ~500 "You should convert this anonymous inner class into a lambda expression" warnings.

For me, the warnings don't show up in code, they appear in the Action Items list.