Bug 235783 - [eval] CodeSnippetParser and some 'CodeSnippet*' ast node does not seem up to date
Summary: [eval] CodeSnippetParser and some 'CodeSnippet*' ast node does not seem up to...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 235774 235775 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-05 05:37 EDT by David Audel CLA
Modified: 2010-01-25 14:53 EST (History)
3 users (show)

See Also:


Attachments
Proposed fix + regression tests (16.67 KB, patch)
2009-12-15 11:32 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Audel CLA 2008-06-05 05:37:00 EDT
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.
Comment 1 David Audel CLA 2008-06-05 05:37:51 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.
Comment 2 David Audel CLA 2008-06-05 05:47:38 EDT
CodeSnippetAllocationExpression.resolveType(BlockScope scope) does not take into account parameterized allocation and type arguments like AllocationExpression.resolveType(BlockScope scope)
Comment 3 David Audel CLA 2008-06-05 06:09:20 EDT
CodeSnippetParser overrides 'consumeMethodInvocationName' and 'consumeMethodInvocationSuper' but does not override 'consumeMethodInvocationNameWithTypeArguments' and 'consumeMethodInvocationSuperWithTypeArguments'.
Comment 4 Olivier Thomann CLA 2009-12-15 10:55:52 EST
*** Bug 235774 has been marked as a duplicate of this bug. ***
Comment 5 Olivier Thomann CLA 2009-12-15 10:57:21 EST
*** Bug 235775 has been marked as a duplicate of this bug. ***
Comment 6 Olivier Thomann CLA 2009-12-15 10:58:35 EST
Adding the missing method seems to fix it.
Comment 7 Olivier Thomann CLA 2009-12-15 11:32:01 EST
Created attachment 154492 [details]
Proposed fix + regression tests

This patch fixes both problems reported in 235774 and 235775.
Comment 8 Olivier Thomann CLA 2010-01-04 10:13:49 EST
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
Comment 9 Ayushman Jain CLA 2010-01-25 02:49:53 EST
verified for 3.6M5 using build  I20100122-0800.
Comment 10 Ayushman Jain CLA 2010-01-25 02:53:09 EST
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().
Comment 11 Olivier Thomann CLA 2010-01-25 14:53:37 EST
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.