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 - [Extract Superclass] Compiler Error when Extracted Method depends on non-extracted Methods
Summary: [Extract Superclass] Compiler Error when Extracted Method depends on non-extr...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-26 21:50 UTC by zazeski2
Modified: 2016-07-07 07:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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