Summary: | [eval] CodeSnippetParser and some 'CodeSnippet*' ast node does not seem up to date | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | David Audel <david_audel> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, srikanth_sankaran | ||||
Version: | 3.4 | ||||||
Target Milestone: | 3.6 M5 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
David Audel
2008-06-05 05:37:00 EDT
CodeSnippetParser overrides 'consumeClassHeaderName1' and 'consumeInterfaceHeaderName1' but doesn't override 'consumeEnumHeaderName' and 'consumeAnnotationTypeDeclarationHeaderName'. I do not understand why 'consumeInterfaceHeaderName1' is overridden because a snippet contain only one top level class and no top level interface. So 'consumeInterfaceHeaderName1' seems useless in CodeSnippetParser. CodeSnippetAllocationExpression.resolveType(BlockScope scope) does not take into account parameterized allocation and type arguments like AllocationExpression.resolveType(BlockScope scope) CodeSnippetParser overrides 'consumeMethodInvocationName' and 'consumeMethodInvocationSuper' but does not override 'consumeMethodInvocationNameWithTypeArguments' and 'consumeMethodInvocationSuperWithTypeArguments'. *** Bug 235774 has been marked as a duplicate of this bug. *** *** Bug 235775 has been marked as a duplicate of this bug. *** Adding the missing method seems to fix it. Created attachment 154492 [details]
Proposed fix + regression tests
This patch fixes both problems reported in 235774 and 235775.
Released for 3.6M5. Added regression tests: org.eclipse.jdt.core.tests.eval.DebugEvaluationTest#test065 org.eclipse.jdt.core.tests.eval.DebugEvaluationTest#test066 org.eclipse.jdt.core.tests.eval.DebugEvaluationTest#test067 verified for 3.6M5 using build I20100122-0800. A few observations though: 1) CodeSnippetParser still doesnt implement (a) consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() as per description (b) consumeEnumHeaderName() and consumeAnnotationTypeDeclarationHeaderName() as per comment 1. Is this intentional? 2) There's no separate regression test added to verify the new method consumeMethodInvocationSuperWithTypeArguments(). You are right. Some methods are still missing. See bug 300723. The methods reported in comment 0 have been added. This is why I am closing as VERIFIED. |