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

Bug 363242

Summary: [rename][refactoring] Warning messages of refactoring tools for compilation problems are too generic
Product: [Eclipse Project] JDT Reporter: Mohsen Vakilian <reprogrammer>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: deepakazad, nchen, reprogrammer, snegara2
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Mohsen Vakilian CLA 2011-11-08 18:53:50 EST
Build Identifier: 20100617-1415

Sometimes, refactorings such as rename report the following warning message to the user:

"Code modification may not be accurate as affected resource ‘resource name’ has compile errors."

However, programmers often ignore the above warning message. We have recently conducted an empirical study on the use of Eclipse refactoring tool using our custom data collector called CodingSpectator <http://codingspectator.cs.illinois.edu/>. Our participants received the above warning message for a total of 79 times and performed the refactoring 94% of the time. The warning message is so frequent and provides so little information that our participants did not find it useful and ignored it most of the time. See the technical report of our study for more information <http://hdl.handle.net/2142/27730>.

Is there a way to reduce the number of false alarms, i.e. is it possible to reduce the number of times the above warning is presented to the user even though the refactoring was performed correctly? Is it possible to make the message more specific? For example, is it possible to list the methods, compilation units, or packages that the refactoring might have changed incorrectly because of their compilation problems?

Reproducible: Always

Steps to Reproduce:
If you use the rename refactoring to rename field "a" to "c" in the following program, the refactoring tool will report the warning message: "Code modification may not be accurate as affected resource ‘resource name’ has compile errors."

class C {

	int a;
	
	void m() {
		a = 1;
	}

	void n() {
		b = 0; //compilation problem: b is not declared.
	}
	
}
Comment 1 Deepak Azad CLA 2011-11-08 20:45:22 EST
(In reply to comment #0)
> However, programmers often ignore the above warning message. 
Me too :)
Comment 2 Deepak Azad CLA 2011-11-08 22:51:44 EST
Currently we just do a dumb check to see if a modified file has a compiler error or not. This can probably be improved by checking if a modified method or a type has a compile error or not, rather than checking the whole file.
Comment 3 Eclipse Genie CLA 2020-01-18 14:32:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.