Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Help on https://bugs.eclipse.org/bugs/show_bug.cgi?id=560392

Hi All,
My sample code isĀ 

package workbench;

import java.net.MalformedURLException;
import java.util.Arrays;
import java.util.function.Predicate;

public class Application {
	public static void main(String[] args) throws MalformedURLException {
		long count = Arrays.asList("a", "b", "c").stream().filter(stringsOnly("ac")).count();
	}

	private static Predicate<String> stringsOnly(String pattern) {
		return s -> {
			return pattern.equals(s);
		};
	}
}

Now if i put a break point at "return pattern.equals(s);" i see in the variable view a variable called Lambda and inside that i see a nested field called "val$pattern" which is the parameter of "stringsOnly" method. This is the behavior in 4.14 and i think it was same in 4.15 until recent.

But now on 4.15 the "val$pattern" variableĀ name is replaced with "arg$1". Now the fix i'm working on i cannot map the pattern variable in the _expression_ snippet to this "arg$1" variable since the names do not match.

Please help me to understand this change which caused the nested variable name change and if it is not a bug, how i should move on with my fix.

Br,
Gayan.


Back to the top