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

Bug 316627

Summary: [refactoring] Refactoring does not give warning about modifying derived resources
Product: [Eclipse Project] JDT Reporter: Lóránt Pintér <lptr>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r, Olivier_Thomann
Version: 3.7   
Target Milestone: 3.7 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Lóránt Pintér CLA 2010-06-11 11:18:30 EDT
Build Identifier: M20100211-1343

The first time I try to edit a derived resource, Eclipse gives a warning about the resource being derived. However, when some refactoring would change that same resource, no warning is issued.

Reproducible: Always

Steps to Reproduce:
1. Generate some Java classes with some tool like ANTLR
2. Mark the generated sources as derived
3. Create a normal class that refers to one of the generated classes
4. Rename the generated class by changing its name in the class that refers it
5. Eclipse will complete the refactor without any warning, but once you regenerate your ANTLR code, you will have compile errors
Comment 1 Olivier Thomann CLA 2010-06-11 11:38:54 EDT
Moving to JDT/UI
Comment 2 Markus Keller CLA 2010-06-14 09:20:08 EDT
Created attachment 171824 [details]
Fix

I would have expected a warning dialog in step 4. You already get that if the .java file itself is marked as derived, but you didn't get it when only an ancestor of the file was marked as derived.

The patch fixes this and also fixes the rendering on the refactoring preview page.
Comment 3 Markus Keller CLA 2010-06-14 09:20:56 EDT
Fixed in HEAD.