| Summary: | [compiler] syntax error in role file may cause NPE in RoleModel.getTeamModel() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 0.7 | ||||||
| Target Milestone: | 0.7.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
I filed bug 325690 against JDT/Core for that part that causes entry into the parser with garbled source (Parser.parseMemberValue(..)) Created attachment 179196 [details] test and fix OK, here is what happened: after bug 325690 struck the parser would be called with garbage and on hitting a syntax error, it would wipe out the package declaration from the CU to start over, yet the current source would contain only a small fragment of the file (supposedly an annotation, but it was off). Later, that CU without a package declaration would fail in RoleFileHelper.getTeamOfRoleFile(..) thus the role file didn't get enclosingType set. Still later RoleModel.getTeamModel would dereference _ast.enclosingType and throw NPE. Fixed by making Parser.buildInitialRecoveryState() sensitive to what initial goal we are parsing for. Only when going for compilation unit or package declaration do we reset the package declaration now. Patch has been committed as r826 / r827. Verified using I201009211735 |