Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 416340 - [1.8][quick fix] Change type of '*' to '*' does not work correctly with lambda expressions
Summary: [1.8][quick fix] Change type of '*' to '*' does not work correctly with lambd...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 405305
  Show dependency tree
 
Reported: 2013-09-02 05:44 EDT by Noopur Gupta CLA
Modified: 2020-02-15 09:13 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2013-09-02 05:44:19 EDT
@FunctionalInterface
interface I {
	int foo1(int a);
}

@FunctionalInterface
interface J {
	char foo2(int b);
}

class I_Test {
	I i1 = a-> {
		return Integer.parseInt(a); // "Change type of 'a' to 'String'"
	};
}

class J_Test {
	J j = (int b)-> {
		return Character.valueOf(b); // "Change type of 'b' to 'char'"
	};
}
--------------------------------------------
Apply the quick fix at the lines with comments.
In the 1st case, nothing happens and in the 2nd case, type of 'b' is changesd to 'char' in the lambda expr only which results in another compilation error.
Comment 1 Noopur Gupta CLA 2014-01-06 02:09:41 EST
The same issue also exists with anonymous classes.
Change the lambda expressions in the example to anonymous classes and apply the quick fix. The type would be changed for the parameter of the overridden method only which results in compilation error.
Comment 2 Eclipse Genie CLA 2020-02-15 09:13:22 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.