This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 134035

Summary: [Extract Superclass] Compiler Error when Extracted Method depends on non-extracted Methods
Product: java Reporter: zazeski2 <zazeski2>
Component: RefactoringAssignee: Jan Becicka <jbecicka>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description zazeski2 2008-04-26 21:50:01 UTC
Input Class:

public class simpleTest {

	public int value()
	{
		return 0;
	}
	
	public int callValue()
	{
		return value();
	}
}

Steps to Reproduce:

1. Use "Extract Superclass" on the method "callValue()" in the class "SimpleTest." Leave the "Make Abstract" option
unchecked.

Expected Output: Java code which compiles or a warning message which prevents the refactoring from proceeding.

Actual Output:

public class SimpleTest extends Destination {
	public int value()
	{
		return 0;
	}
}

public class Destination {

    public int callValue() {
        return value();
    }
}

The line "return value();" in Destination.callValue() produces the following Java compiler error:

"cannot find symbol
symbol : method value()
location: class Destination

incompatible types
found : value
required: int"
Comment 1 Jan Pokorsky 2008-05-15 18:08:43 UTC
Yes, this should be checked. Thanks for the report.
Comment 2 Martin Balin 2016-07-07 07:16:23 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss