| Summary: | ASTParser ignores call to super() in K_STATEMENTS mode | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mateusz Matela <mateusz.matela> | ||||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | manoj.palat, markus.kell.r, Olivier_Thomann, shankhba | ||||||
| Version: | 4.5 | ||||||||
| Target Milestone: | 4.5 M5 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Indeed, this is an oversight. Created attachment 249597 [details]
Proposed patch
Created attachment 249598 [details]
Proposed regression test
Thanks for patches Olivier. Ran the tests and committed via: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=1bf86fe4326efd3891490b85eefffb1c336ab872 Verified for Eclipse Mars 4.5 M5 Build id: I20150126-2000 |
Run this code snippet: ASTParser parser = ASTParser.newParser(AST.JLS8); parser.setKind(ASTParser.K_STATEMENTS); parser.setSource("super();".toCharArray()); ASTNode astNode = parser.createAST(null); The resulting astNode is a Block without any statements, but it should contain a SuperConstructorInvocation. I've looked into ASTParser code and around line 1350 it seems that constructorDeclaration is converted using only its statements field, but constructorCall field should be used as well.