Bug 194643 - [change method signature] does not persist types with whitespaces correctly in Scriptable Refactoring
Summary: [change method signature] does not persist types with whitespaces correctly ...
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-06-27 13:13 EDT by Karsten Becker CLA
Modified: 2007-06-28 11:52 EDT (History)
1 user (show)

See Also:


Attachments
Better testing (14.18 KB, patch)
2007-06-28 11:26 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 Karsten Becker CLA 2007-06-27 13:13:24 EDT
In class:
package p;
public class ScriptTest {
	public void foo(){
	}
}
1. Add a new Parameter String ... s with default "Hallo"
2. Apply refactoring
3. Create a refactoring script
4. Undo refactoring
5. Apply refactoring script
6. It fails because the string tokenizer does not recognize the whitespace in the type correctly

You need to have applied the Patch of bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=194636
Comment 1 Karsten Becker CLA 2007-06-27 13:32:46 EDT
A solution would be to use ; instead of whitepaces. But this would break already persisted refactorings. If there are any users of scriptable refactoring it would be bad if CSR would not be backward compatible as this might be a major use of scriptable refactorings.
The main problem addressed here is that properties are not persisted in an independant manner. Which means, writing arguments into an attribute of a xml file that are seperated by whitespaces or any other seperator removes the logical context which hinders other humans to understand the XML.
Comment 2 Martin Aeschlimann CLA 2007-06-28 06:29:35 EDT
As discussed, the types should be stored in a 'normalized' format, without any white spaces.
If the user entered 'String    []', the refactorings don't need to follow this format, but can reformat that with the project's formatter settings.
Comment 3 Karsten Becker CLA 2007-06-28 11:26:06 EDT
Created attachment 72694 [details]
Better testing

Does no longer perform checks of deleted ParameterInfo
Gives added/deleted parameters special names
Testing is improved
Returntype is set correctly
Comment 4 Martin Aeschlimann CLA 2007-06-28 11:52:43 EDT
patch released > 20070628