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 257892 - Use member reference does not work in static context
Summary: Use member reference does not work in static context
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-08 14:04 UTC by Jiri Prox
Modified: 2016-05-25 01:51 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 2016-02-08 14:04:08 UTC
Use member reference hint does not work when invoked for static method

Steps to reproduce:
1) have a class:
public class Test  {
    public static void neco() {        
    }            
    public void akce() {
        Runnable r = () -> {
            neco();
        };       
    }    
}

2) in lambda body apply hint "Use member reference"
-> the method is changed to:

    public void akce() {
        Runnable r = this::neco;       
    }

but expected is 

    public void akce() {
        Runnable r = Test::neco;       
    }


Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_73; Java HotSpot(TM) 64-Bit Server VM 25.73-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_73-b02
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\8.1
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\8.1
Comment 1 Svata Dedic 2016-05-20 09:05:12 UTC
Fixed in jet-main#8b9321485f63
Comment 2 Quality Engineering 2016-05-25 01:51:13 UTC
Integrated into 'main-silver', will be available in build *201605250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8b9321485f63
User: Svata Dedic <sdedic@netbeans.org>
Log: #257892: Fixed member reference in static context. Added new Fix to create constructor reference.