Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 578147

Summary: Evaluations for lambda variables are not working when using generic type arguments on lambda
Product: [Eclipse Project] JDT Reporter: Jinbo Wang <jinbwan>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: gayanper, sarika.sinha
Version: 4.23   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Jinbo Wang CLA 2022-01-11 01:35:30 EST
Sample:
```
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

public class InspectLambda {
	static class OwnerController<E> {
		List<E> elements = new ArrayList<>();
		
		public void addOwner(E owner) {
			this.elements.add(owner);
		}
		
		public <T> List<T> map(Function<E, ? extends T> action) {
			List<T> list = new ArrayList<>();
			for (int i = 0; i < this.elements.size(); i++) {
				list.add(action.apply(this.elements.get(i)));
			}
			
			return list;
		}
	}

	public static void main(String[] args) {
		OwnerController controller = new OwnerController();
		controller.addOwner("Hello");

		controller.map((owner) -> {
			long timestamp = System.currentTimeMillis();
			return owner;  // Add a breakpoint here
		});
	}
}
```

Stop at the line "// Add a breakpoint here", it fails to evaluate local variables such as 'owner', 'timestamp', 'controller'. Hovering at the those variables, it can display their values well.
Comment 1 Sarika Sinha CLA 2022-01-11 01:59:14 EST
@Gayan,
Can you check this?
Comment 2 Jinbo Wang CLA 2022-04-06 04:24:07 EDT
Close it since I cannot reproduce this issue again after the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=578145.

*** This bug has been marked as a duplicate of bug 578145 ***