Community
Participate
Working Groups
build I20080603-2000 Some part of CodeSnippetParser class and special ast nodes made by this parser does not seem up to date compared to Parser. CodeSnippetParser overrides 'classInstanceCreation(boolean)' but doesn't override 'consumeClassInstanceCreationExpressionQualifiedWithTypeArguments()' and 'consumeClassInstanceCreationExpressionWithTypeArguments()'. This is probably the cause of bug 235775. CodeSnippetParser overrides 'newMessageSend()' but does not override 'newMessageSendWithTypeArguments(). This is probably the cause of bug 235774.
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.