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

Bug 575551

Summary: [evaluation] Evaluations are not working on intermediate frames for lambda variables
Product: [Eclipse Project] JDT Reporter: Gayan Perera <gayanper>
Component: DebugAssignee: Gayan Perera <gayanper>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sarika.sinha
Version: 4.21   
Target Milestone: 4.23 M2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/189357
https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/189415
https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=0a20bdb9a62333eb8cde7b16e801fbb5246da79d
https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=530846db516280ca88dbc80e098107ce37501477
Whiteboard:
Bug Depends on:    
Bug Blocks: 578069    

Description Gayan Perera CLA 2021-08-21 13:12:05 EDT
Take 

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Inspect {
	public void hoverOverLocal(String[] names) throws InterruptedException, ExecutionException {
		CompletableFuture<List<String>> future = CompletableFuture.supplyAsync(() -> {
			return Stream.of(names).filter(s -> {
				try {
					return CompletableFuture.supplyAsync(() -> {
						return containsDigit(s.codePointAt(0), names.length);
					}).get();
				} catch (Exception e) {
					return false;
				}
			}).collect(Collectors.toList());
		});
		future.get();
	}
	
	private boolean containsDigit(int c, int length) {
		return Character.isDigit(c) && c == length;
	}
	
	public static void main(String[] args) throws InterruptedException, ExecutionException {
		new Inspect().hoverOverLocal(new String[] {"name"});
	}
}


Place a line breakpoing at java.lang.CharacterDataLatin1.isDigit(int) and debug the code.

Now move debug frame selection to Inspect.lambda$2(String, String[]) in the debug view. And try to evaluate "names" variable in the editor or in Debug shell. It says name cannot be resolved.

But hovering over the names variable works. probably it is fixed by Bug 573547.
Comment 1 Sarika Sinha CLA 2021-10-08 06:28:28 EDT
Any plans for M2?
Comment 2 Gayan Perera CLA 2021-10-08 12:35:07 EDT
Working on some completions issues Sarika, I will try if i can work on this for M3, otherwise we have to push this into next release.
Comment 3 Eclipse Genie CLA 2022-01-06 14:06:13 EST
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/189357
Comment 4 Eclipse Genie CLA 2022-01-09 06:02:49 EST
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/189415
Comment 7 Sarika Sinha CLA 2022-01-10 14:04:50 EST
Thanks Gayan.
Comment 8 Sarika Sinha CLA 2022-01-27 05:20:33 EST
I20220126-1800