History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-25008
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Dmitry Jemerov
Reporter: Bas Leijdekkers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Pull up static members can break code

Created: 22 Jan 08 18:03   Updated: 15 Jul 08 18:38
Component/s: Refactoring
Fix Version/s: Diana 8582, Selena 7.0.4

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,656
Fixed in build: 8,576
Severity: High


 Description  « Hide
Pulling up static members does not update references qualified with the class name correctly, which can break the code. Example:
public class X {}
public class Y extends X {
	
	private static int x = 0;

	public static int getX() {
		return x;
	}

	public static void setX(int x) {
		Y.x = x;
	}
}

Pulling up all (static) members produces:

public class X {

	private static int x = 0;


	public static int getX() {
		return x;
	}

	public static void setX(int x) {
		Y.x = x;  // does not compile, should be X.x = x;
	}
}
class Y extends X {}

This does not compile. To make matters worse the uncompilable code is green in the editor, see IDEA-16937. This issue may also be related to IDEABKL-4822



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.