Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312605

Summary: [rename] Read-only files are not warned about in a specific case
Product: [Eclipse Project] JDT Reporter: David Witherspoon <psynoff>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Olivier_Thomann
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description David Witherspoon CLA 2010-05-12 08:54:30 EDT
Build Identifier: 20090920-1017

If I attempt to rename a method like  getID() to getId() [note the little 'd'], if some affected files are read-only, the refactor will silently fail.  The key here is that the new method name equalsIgnoreCase the old name.

If I attempt to rename the same method to getIdddd(), I will get warnings that some affected files are read-only, and an option to make them writable.

Reproducible: Always

Steps to Reproduce:
Create classes:
     class Foo { 
        public static void getID() {;} 
     }
     class FooUser {  // ensure this file is read-only
        public causeTrouble() {
           Foo.getID();
        }
     }

Refactor Foo, renaming getID to getId (little d).  Even though FooUser is read-only, it'll fail to recognize and will silently fail.  Now rename getID to getIdddddd, and you'll get the warning that FooUser is read-only.
Comment 1 Olivier Thomann CLA 2010-05-12 09:46:10 EDT
Move to JDT/UI
Comment 2 Dani Megert CLA 2010-05-12 10:46:44 EDT
I cannot reproduce this using 3.6 M7 or N20100511-2000.