Community
Participate
Working Groups
In LambdaExpressions, parameters of type VariableDeclarationFragment are missing a source range. The AST view shows such nodes with a red background color. Example: package jsr335; public class SpecExamples335 { public static interface StringToInt { int stoi(String s); } public static interface ReduceInt { int reduce(int a, int b); } void foo(StringToInt s) { } void bar(ReduceInt r) { } void bar() { foo(s -> s.length()); foo((s) -> s.length()); foo((String s) -> s.length()); //SingleVariableDeclaration is OK bar((x, y) -> x+y); bar((int x, int y) -> x+y); //SingleVariableDeclarations are OK } }
Manoj, please follow up. Bug fixes to LE should get top priority to enable UI work.
Jay & Manoj, let us start using the ASTView plugin ourselves so these sort of problems can be caught upfront without relying on downstream components to report them, TIA.
(In reply to comment #2) > Jay & Manoj, let us start using the ASTView plugin ourselves so these sort > of problems can be caught upfront without relying on downstream components > to report them, TIA. Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=391890#c7
Created attachment 228122 [details] Proposed Patch - WIP Work in Progress Patch
Created attachment 228130 [details] Proposed Patch
In the tests, it's better to use checkSourceRange(..) rather than doing manual "getStartPosition() > 0" tests.
Created attachment 228134 [details] Proposed Patch >>> In the tests, it's better to use checkSourceRange(..) rather than doing manual "getStartPosition() > 0" tests. Modified as per the review comment.
Fix and test released here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=d7b968f8074ad4e44b5a08309dcb414a4be941a4 Thanks Manoj.