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.
041004 custom. I have a j2seproject using JDK 1.5. Make a class public class MyList extends AbstractList<String> {} and press Ctrl-I and click Abstract Methods only. Offers - String get(int) - Object[] toArray(Object[]) - int size() get and size are in fact abstract. But toArray is not - AbstractCollection defines public <T> T[] toArray(T[] a) {...} and in fact if I comment out the generated toArray method, leaving only impls of get and size, the class still compiles. Also note that the generated toArray method is marked with an override annotation, not an implements annotation as for get and size. So I guess it should not have been listed as an "abstract" method to begin with?
Similarly for public class MyList<E> extends AbstractList<E> {...}
...except in that case the generated toArray has signature public Object[] toArray(Object[] a) {...} whereas I suppose it should be public <E> E[] toArray(E[] a) {...} (right?) and furthermore using either of the two above signatures, I get no annotation at all next to the toArray method, unlike in the original case when I was extending AbstractList<String>.
...and after implementing public <E> E[] toArray(E[] a) {...} Ctrl-I still offers toArray(java.lang.Object[]) : java.lang.Object[] as a possible method to override/implement ("Show Abstract Methods Only" either checked or unchecked).
old target milestone, please re-evaluate
jglick wrote: >Similarly for > >public class MyList<E> extends AbstractList<E> {...} > >...except in that case the generated toArray has signature > >public Object[] toArray(Object[] a) {...} > >whereas I suppose it should be > >public <E> E[] toArray(E[] a) {...} > >(right?) The method has its own parameter unrelated to the type parameter defined in the class. So: public <T> T[] toArray(T[] a) {...} is equivalent to : public <E> E[] toArray(E[] a) {...} no matter what the name of the type parameter in the parent class is.
/cvs/java/javacore/src/org/netbeans/modules/javacore/jmiimpl/javamodel/ClassDefinitionImpl.java,v <-- ClassDefinitionImpl.java new revision: 1.19; previous revision: 1.18 /cvs/java/src/org/netbeans/modules/java/tools/JMIInheritanceSupport.java,v <-- JMIInheritanceSupport.java new revision: 1.14; previous revision: 1.13
Reorganization of java component