Bug 13558

Summary: move cu with ref update broken
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: UIAssignee: Adam Kiezun <akiezun>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P1    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2002-04-11 14:01:43 EDT
20020409
try moving a cu from 1 package to another - dnd of not - 
no not press 'preview' 

nothing happens - file is not moved!
it is moved if you do press 'preview'
Comment 1 Adam Kiezun CLA 2002-04-11 14:02:40 EDT
it is caused by this:

Caused by: java.lang.NullPointerException
	at 
org.eclipse.jdt.internal.corext.refactoring.reorg.MoveRefactoring.createChange
(MoveRefactoring.java:226)
	at org.eclipse.jdt.internal.ui.refactoring.CreateChangeOperation.run
(CreateChangeOperation.java:102)
	at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run
(PerformChangeOperation.java:118)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:296)
Comment 2 Adam Kiezun CLA 2002-04-11 14:09:08 EDT
preconditions are not checked in this scenatio
so fChangeManager is null
nasty - opt to fix asap
Comment 3 Adam Kiezun CLA 2002-04-11 14:19:18 EDT
it is a result of the recent validateEdit changes

some posibilities of fix - if it is to be fix quickly:

A. do not use validateEdit in this refactoring - go back to the old code 
(cons: known - clear case users are unhappy,
pros: easy to do)

B. do call validateEdit and quietly fail if there's a read-only file that is to 
be changed (just perform nothing in such a case)
(pros: we keep validateEdit in the 'preview' scenario 
and it mostly works in the non-preview one because read-only files are rare

cons: quietly failing)

C. force users to see the preview
pros: relatively easy to fix
cons: non-preview ui in dnd is desirable

D. remove the update reference smartness

The Real Fix would be to be able to show the error page after problems 
with dnd as well

i guess i opt for B
Comment 4 Erich Gamma CLA 2002-04-12 09:49:01 EDT
This refactoring is an important function of Eclipse. We propose to fix it for 
M5. Given that this drop should enable clear case users we should do option B.
Comment 5 Adam Kiezun CLA 2002-04-12 10:04:36 EDT
i can do better than B - if there are read-only files, simply no references 
will be updated, but the file will be moved nonetheless
Comment 6 Erich Gamma CLA 2002-04-13 12:00:07 EDT
was partially fixed for 20020412, should fully fix for M6
Comment 7 Adam Kiezun CLA 2002-04-29 06:34:53 EDT
done