Bug 198392 - [extract class] IAE when extracting class
Summary: [extract class] IAE when extracting class
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Karsten Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-07-31 09:33 EDT by Martin Aeschlimann CLA
Modified: 2007-07-31 11:16 EDT (History)
0 users

See Also:


Attachments
Patch (4.42 KB, patch)
2007-07-31 10:30 EDT, Karsten Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2007-07-31 09:33:02 EDT
20070731

- checkout org.eclipse.compare in source
- invoke extract class on 'hunk' and select all fields (with getter and setter)


java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.dom.ASTNode$NodeList.add(ASTNode.java:1247)
	at java.util.AbstractList.add(AbstractList.java:91)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ParameterObjectFactory.createFieldWriteAccess(ParameterObjectFactory.java:366)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractClassRefactoring.replaceReferences(ExtractClassRefactoring.java:567)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractClassRefactoring.updateReferences(ExtractClassRefactoring.java:512)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractClassRefactoring.checkFinalConditions(ExtractClassRefactoring.java:338)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:119)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Comment 1 Karsten Becker CLA 2007-07-31 10:18:49 EDT
The patch of bug 197923 did not consider that there are normal blocks as well. It now checks for special bodies only.
Comment 2 Karsten Becker CLA 2007-07-31 10:30:55 EDT
Created attachment 75036 [details]
Patch

Updated Tests
Comment 3 Martin Aeschlimann CLA 2007-07-31 11:16:22 EDT
patch released > 20070731