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 241499 - [Change method parameter] Add parameter to lambda
Summary: [Change method parameter] Add parameter to lambda
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 15:56 UTC by Jiri Prox
Modified: 2014-02-14 02:53 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 2014-02-06 15:56:24 UTC
Changing method parameter adds parameter to the lambda expression but is adds always also the type, even when shorter lambda declaration is used.

Example:

1) have a code:
public class ClassA {

    interface Iface {
	public String getName(String a);
    }

    public static void main(String[] args) {
	Iface i1 = (String a)-> {return "";};
	Iface i2 = a-> {return "";};
	Iface i3 = (String a)-> "";
	Iface i4 = (a)-> "";

    }
}
2) add parameter to getName


-> 
public class ClassA {

    interface Iface {
	public String getName(String a, Object par1);
    }

    public static void main(String[] args) {
	Iface i1 = (String a, Object par1)-> {return "";};
	Iface i2 = a, Object par1-> {return "";};  //<=== error
	Iface i3 = (String a, Object par1)-> "";
	Iface i4 = (a, Object par1)-> ""; //<=== error

    }
}


Product Version: NetBeans IDE Dev (Build 201402040001)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b123
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
Comment 1 Ralph Ruijs 2014-02-12 16:28:38 UTC
changeset   : f064638ef4c0
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Wed Feb 12 17:26:33 CET 2014
summary     : #241499 - [Change method parameter] Add parameter to lambda
Comment 2 Quality Engineering 2014-02-14 02:53:11 UTC
Integrated into 'main-silver', will be available in build *201402140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f064638ef4c0
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #241499 - [Change method parameter] Add parameter to lambda