Bug 157466 - [quick fix] 'Rename in File' in does not perform the required checks
Summary: [quick fix] 'Rename in File' in does not perform the required checks
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.3 M4   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-15 09:27 EDT by Markus Keller CLA
Modified: 2006-11-14 03:05 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-09-15 09:27:04 EDT
I20060912-0800

- Set the derived flag on a compilation unit
- Open the CU and select the type name
- Press Ctrl+2, R
=> Linked mode is entered, no dialog

- Type a character
=> Characted is inserted into document, then a 'Derived File Encountered' dialog appears. If you click 'No', you end up with a dirty editor whose status line says 'Writable' but which is not editable any more.
Comment 1 Dani Megert CLA 2006-09-15 09:45:16 EDT
This is a bug of the direct quick fix. It does not do the needed checks as done when invoking Ctrl+1. Same problem in R3.2 in combination with a read-only file.

I guess this affects all direct quick fixes.
Comment 2 Markus Keller CLA 2006-09-15 10:13:53 EDT
This problem also affects other actions that are started from an editor, e.g. Extract Local Variable. There, we already use Checks.validateModifiesFiles(IFile[], Object), which deals with read-only files, but not with the derived bit. 

For consistency, we should also add a check for derived files when the refactoring is started from an editor. I guess we need to make a difference based on the declaration of the element to be refactored. When I e.g. rename a type, I should get a dialog only when the declaring type is in a derived file, but not when there's just a reference in a derived file. See also bug 147516.
Comment 3 Markus Keller CLA 2006-11-14 03:05:11 EST
Fixed in HEAD with fix for bug 147516.