Bug 160217

Summary: [ast rewrite] ASTRewrite#getListRewrite does not fullfill spec
Product: [Eclipse Project] JDT Reporter: Benno Baumgartner <benno.baumgartner>
Component: CoreAssignee: Martin Aeschlimann <martinae>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.3   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed fix none

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