When I perform refactoring "introduce variable" in a line that is long, the refactoring works properly, but the screen scrolls to the right, as if I have now gone past the edge of the screen. Before and after screen shots are included to show the jump.
In some cases, the screen would only jump if I selected the expression from
left to right, not when selected from right to left. I haven't found the
right scenario to reproduce, but I assume it has to do with line lengths,
and length of expression, etc.
Here is the code I performed this on:
quantitySpinner.addChangeListener(new ChangeListener()
{
public void stateChanged(ChangeEvent e)
{
len.setText(quantitySpinner.getField().getText().length() +
"");
// cursor is right here on the next line after selecting
text from left to right ---->|
System.out.println("This is a long string that says nothing
much. Happy days are here again!!!");
}
});
After refactoring (which is correct):
quantitySpinner.addChangeListener(new ChangeListener()
{
public void stateChanged(ChangeEvent e)
{
len.setText(quantitySpinner.getField().getText().length() +
"");
// cursor is right here on the next line after selecting
text from left to right ---->|
final String x = "This is a long string that says nothing
much. Happy days are here again!!!";
System.out.println(x);
}
});
Since all code is on-screen (and to the left of the right-margin line) I'd
say there is no reason for the jumping window.
Like I said, this is a minor issue...
-sms
--------------------------------------------------
DISCLAIMER
This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout
thereof.
E-mail transmission cannot be guaranteed to be secure or error-free. The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.
NOTICE REGARDING PRIVACY AND CONFIDENTIALITY
Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications.
before.gif
Description: GIF image
after.gif
Description: GIF image
