Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 490102 - [1.9] Test Failures after merge on BETA_JAVA9 branch
Summary: [1.9] Test Failures after merge on BETA_JAVA9 branch
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J9   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 457413
  Show dependency tree
 
Reported: 2016-03-21 11:38 EDT by Manoj N Palat CLA
Modified: 2016-03-22 03:44 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2016-03-21 11:38:04 EDT

    
Comment 1 Manoj N Palat CLA 2016-03-21 11:48:46 EDT
From commit 519d650af9092ca64ac5162b38afd9cc8962b11d 15 FormatterRegressionTests are failing..cause being an extra line addition -All the failures are in testBug370540.. series.
Comment 2 Jay Arthanareeswaran CLA 2016-03-21 12:45:49 EDT
(In reply to Manoj Palat from comment #1)
> From commit 519d650af9092ca64ac5162b38afd9cc8962b11d 15
> FormatterRegressionTests are failing..cause being an extra line addition
> -All the failures are in testBug370540.. series.

Interesting, when I rollback the merged commits, I see the tests passing. But just comparing the individual that were part of that commit or even the entire formatter source folder with master doesn't produce any differences.
Comment 3 Mateusz Matela CLA 2016-03-21 15:11:12 EDT
public class Example {
	java.util.function.BiConsumer<Example, String> lambda = (Example example, String text) -> {
	};
}

The root cause is that given the code above, the ASTParser returns an AST root with the following problem:
Pb(231) Syntax error on token "=", ( expected after this token

Instead of a single field declaration, the returned type declarations has three items:
- FieldDeclaration: java.util.function.BiConsumer<Example,String> lambda;
- FieldDeclaration: Example example, String;
- Initializer: {}
Comment 4 Jay Arthanareeswaran CLA 2016-03-22 02:42:06 EDT
Thanks for the example Mateusz. I can confirm that the recent merge has nothing to do with this. I also confirmed that the parser generated files are in sync with the grammar file. Interesting observation I made is the error happens only when one of the lambda argument has a name 'example'!

What could cause this? I have no clue at this point.
Comment 5 Jay Arthanareeswaran CLA 2016-03-22 02:51:03 EDT
(In reply to Jay Arthanareeswaran from comment #4)
> What could cause this? I have no clue at this point.

Now I do. There's an NPE caused here:

Scanner$VanguardParser(Parser).isParsingModuleDeclaration() line: 13001	
Scanner$VanguardScanner(Scanner).isInModuleDeclaration() line: 2534	
Scanner$VanguardScanner(Scanner).internalScanIdentifierOrKeyword(int, int, char[]) line: 3123

Looks like we should expect null compilation units in the parser. I will release a fix.
Comment 6 Jay Arthanareeswaran CLA 2016-03-22 03:44:03 EDT
Released the fix here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA9&id=88990523833d1a48a3fb93f8126737360efa4666

Sasi, let me know if you are fine with this fix.