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 238837 - [Change method parameter] Show waring if changing parameters in functional interface
Summary: [Change method parameter] Show waring if changing parameters in functional in...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-26 15:55 UTC by Jiri Prox
Modified: 2013-11-26 15:55 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2013-11-26 15:55:22 UTC
Changing parameters of method in functional interface may break the code if the interface is used as parameter of another method and a method reference is passed instead of instance.

Example:
    interface FIface {    
        boolean test(int a);
    }
                    
    public boolean anotherMethod(int x) {
        return true;
    }
    
    public void use() {
        method(this::anotherMethod);                
    }
    
    public void method(FIface in) {        
    }


adding parameter to method FIface.test() breaks line method(this::anotherMethod); 


Product Version: NetBeans IDE Dev (Build 20131125-d473cd33358e)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b49
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b107
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev