Bug 160217 - [ast rewrite] ASTRewrite#getListRewrite does not fullfill spec
Summary: [ast rewrite] ASTRewrite#getListRewrite does not fullfill spec
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-09 10:43 EDT by Benno Baumgartner CLA
Modified: 2008-08-06 14:03 EDT (History)
1 user (show)

See Also:


Attachments
proposed fix (1.17 KB, patch)
2006-10-09 10:45 EDT, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2006-10-09 10:43:41 EDT
I20061003-0800

The doc for:

org.eclipse.jdt.core.dom.rewrite.ASTRewrite.getListRewrite(ASTNode, ChildListPropertyDescriptor)

states that

@throws IllegalArgumentException ...if the property is not a node property...

As I understand it an IAE should be thrown whenever 'node' does not have a StructuralProperty as descriped by 'property'. The implementation does not check that.

Also an IAE should be thrown ... if the node is not part of this rewriter's AST... The implementation does not check that either.

But it does check if 'property' is a list property. But 'property' is of type ChildListPropertyDescriptor and therefore always a list property.
Comment 1 Benno Baumgartner CLA 2006-10-09 10:45:51 EDT
Created attachment 51642 [details]
proposed fix
Comment 2 Martin Aeschlimann CLA 2008-07-01 11:38:27 EDT
fixed > 20080701
Comment 3 Olivier Thomann CLA 2008-08-06 14:03:50 EDT
Verified for 3.5M1 using I20080805-1307