Bug 406176 - [1.8][compiler][codegen] Investigate need for problem method generation for lambda expressions.
Summary: [1.8][compiler][codegen] Investigate need for problem method generation for l...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Sasikanth Bharadwaj CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-21 15:27 EDT by Srikanth Sankaran CLA
Modified: 2022-10-30 12:44 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-04-21 15:27:52 EDT
BETA_JAVA8:

    This ER will be used to track problem method generation for lambdas.
At the moment, these are not generated.

    I am not marking this bug as blocking bug 400875 since this is a second
order problem.
Comment 1 Srikanth Sankaran CLA 2013-08-30 01:53:33 EDT
Please use the test case from https://bugs.eclipse.org/bugs/show_bug.cgi?id=404657#c14.

Once this problem is fixed, we would expect to see two errors instead of
one in that test case.

For investigation, try compiling and running this code as well as studying
the bytecodes generated:

// -- illustrates 
public class X {
	void foo () {
		goo();
	}
	
	public static void main(String[] args) {
		System.out.println("Hello");
		new X().foo();
	}
} 

See ClassFile#addProblemMethod and AbortMethod
Comment 2 Martin Mathew CLA 2013-09-23 00:51:40 EDT
Multiple lambda expressions with different compiler issues when present in a compilation unit then only one error is shown and the rest are ignored.

Consider the below code snippet which shows only one compiler issues, whereas it should have shown 4 compiler errors:

@FunctionalInterface
interface I {
	 int foo(int x);	
}

public class D{	
	I i2= (int x) -> {
		x++;
		System.out.println(x);// Error 1: Should get a compiler error here as the return statement is missing
	};
	
	
	public int foo1() { // Error 2: Should get a compiler error here due to missing return type
		I i2= (int x) -> {
			return "String"; // Error 3: Compiler error due to return type mismatch 
		};
	}
	
	public String foo2() { // Error 4: Should get a compiler error here due to missing return type
		
	}
}
Comment 3 Srikanth Sankaran CLA 2014-01-06 09:48:38 EST
Retargetting to 4.4, will pull it up to Java 8 GA if time permits.
Comment 4 Jay Arthanareeswaran CLA 2014-07-15 05:11:11 EDT
Shankha, please take a look.
Comment 5 Manoj N Palat CLA 2018-05-16 12:49:53 EDT
Bulk move out of 4.8
Comment 6 Eclipse Genie CLA 2020-08-14 11:58:36 EDT
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 7 Eclipse Genie CLA 2022-10-30 12:44:47 EDT
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.

If you have further information on the current state of the bug, please add it. 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.