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.
See couple of examples for hint "Create class" which tries to solve unresolved name. 1) Superclass not taken into account import java.util.ArrayList; public class Test<T> { ArrayList<? extends Number> l = new MyList<Number>(); } Actual result: class MyList<T> { public MyList() { } } Result I would expect: import java.util.ArrayList; class MyList<T> extends ArrayList<T> { public MyList() { } } 2) Superinterface taken into account but wildcard is used as a type argument for a generic supertype which is not possible. import java.util.List; public class Test<T> { List<? extends Number> l = new MyList<Number>(); } Actual result: import java.util.List; class MyList implements List<? extends Number> { public MyList() { } } Result I would expect: import java.util.List; class MyList<T> implements List<T> { public MyList() { } } 3) Superclass taken into account but wildcard is used as a type argument for a generic supertype which is not possible. import java.util.ArrayList; public class Test<T> { ArrayList<? extends Number> l = new MyList(); } Actual result: import java.util.ArrayList; class MyList extends ArrayList<? extends Number> { public MyList() { } } Result I would expect: import java.util.ArrayList; class MyList extends ArrayList<Number> { public MyList() { } } 4) Superinterface taken into account but wildcard is used as a type argument for a generic supertype which is not possible. import java.util.List; public class Test<T> { List<? extends Number> l = new MyList(); } Actual result: import java.util.List; class MyList implements List<? extends Number> { public MyList() { } } Result I would expect: import java.util.List; class MyList implements List<Number> { public MyList() { } }
One additional curious example: 5) import java.util.HashMap; public class Test<T> { HashMap<?, ?> m = new MyMap(); } Actual result: import java.util.HashMap; class MyMap extends HashMap<?, ?> { public MyMap() { } } Result I would expect: Hmm, hard to say.
6) Unsolvable example: public class Test2<T extends Number> { T myNumber = new MyNumber(); } Actual result: class MyNumber { public MyNumber() { } } Result I would expect: I do not see any valid solution for this case.
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
Checked in NetBeans IDE Dev (Build 201607110002). Still needs to be fixed.