Help on https://bugs.eclipse.org/bugs/show_bug.cgi?id=560392

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help on https://bugs.eclipse.org/bugs/show_bug.cgi?id=560392

Gayan Perera
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.


_______________________________________________
jdt-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jdt-dev