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 256520 - Error when trying to pull up with Generics
Summary: Error when trying to pull up with Generics
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-11 16:07 UTC by ma.schroed
Modified: 2015-11-11 16:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Pull Up Dialog with error (21.47 KB, image/png)
2015-11-11 16:07 UTC, ma.schroed
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ma.schroed 2015-11-11 16:07:11 UTC
Created attachment 157278 [details]
Pull Up Dialog with error

I have the following class hierarchy with Generics:

public class Bar<T> {
    private T item;

    public T getItem() {
        return item;
    }

    public void setItem(final T item) {
        this.item = item;
    }
}

public class Foo extends Bar<String> {
    public void foo() {
    }
}

When I select the method foo() in the class Foo and want to pull it up to Bar then the Pull Up dialog does not show any member to select. Instead there is an error: "No members are selected to be pulled up."

However when I avoid Generics it works.

public class Bar {
    private Object item;

    public Object getItem() {
        return item;
    }

    public void setItem(final Object item) {
        this.item = item;
    }
}

public class Foo extends Bar {
    public void foo() {
    }
}

The selected method foo() is visible in the dialog and can be moved.