Community
Participate
Working Groups
Build Identified: I20111207-2118 When one of the participants of the CodingSpectator study <http://codingspectator.cs.illinois.edu/> made a selection of form "new MyCla" from a statement like "MyClass myClass = new MyClass();" and invoked the Extract Method refactoring, the refactoring tool reported the message below: >The end of the selection contains characters that do not belong to a statement. Similarly, when one of our participants tried to invoke the Extract Method refactoring tool on a selection whose structure was similar to the one in the code snippet below, the refactoring tool reported the above error message. ---- public class C { void m1() { { //[ { } } //] } } ---- Isn't the following message more appropriate in the above two cases? >The selection does not cover a set of statements or an expression. Extend selection to a valid range using the 'Expand Selection To' actions from the 'Edit' menu. What are the refactoring tool's criteria for reporting each of the above messages? The Eclipse refactoring tool sometimes reports the following message, which is similar to the above messages: >The beginning of the selection contains characters that do not belong to a statement None of our participants ran into the following problem. However, if a programmer tries to invoke the Extract Method refactoring tool on the selection in the code snippet below, the refactoring tool will report the above error message. ---- public class C { void m1() { //[ { { } //] } } } ---- Isn't the following error message more appropriate in the above example? >The selection does not cover a set of statements or an expression. Extend selection to a valid range using the 'Expand Selection To' actions from the 'Edit' menu.
I guess one of the main reasons for these sort of issues is the fact that our tests just test is the selection is invalid or not, the exact cause of invalid selection is not tested.
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. If you have further information on the current state of the bug, please add it. 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.