This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1. Create J2SE project. 2. Create package newpackage. 3. Create classes NewClass and NewClass1 in newpackage. 4. Add instances variables of others type in each of the above classes. 5. Create package newpackage1. 6. Invoke MOve Class reafctoring on NewClass1 to move it to newpackage1. 7. Look in the preview window diff views. The package statement looks scrambled (see attachment). 8. The refactoring seems to work though.
Created attachment 41220 [details] Move refactoring preview diff view showing scrambled package statement.
I use ModificationResult.getResultingSource() which returns scrambled source in this case.
I heard about it. Seems to be again platform specific.
Caused by hacky stuff when fixing #102292. Just preview is broken, resulting source should be ok.
If the preview appears to corrupt user's source code, they may not even attempt to go ahead with refactoring to find out it will work.
Yes. It will switch the user to panic mode, I think. I'm rather refactor without preview :-). (Just joking, I'm still working on it.) Generator is ok, if you put breakpoint in CasualDiff:90, there is a resulting source which is correct I think. Because of the history if development, there are two phases in commit, which I want to rewrite to just one. This should have positive performance impact. But for the time being, I'm looking for another terrible hacks.
It is caused by the same thing as it was in #88424. When diffing to temporary file, stream is read from disk where both cr/lf are in the source.
Created attachment 42049 [details] x
Hopefully fixed, please, verify. Needs some other improvements, it will be part of performance tuning. Checking in src/org/netbeans/api/java/source/ModificationResult.java; /cvs/java/source/src/org/netbeans/api/java/source/ModificationResult.java,v <-- ModificationResult.java new revision: 1.11; previous revision: 1.10 done