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.
Build: NetBeans IDE 8.1 Beta (Build 201508041349) VM: Java HotSpot(TM) 64-Bit Server VM, 25.51-b03, Java(TM) SE Runtime Environment, 1.8.0_51-b16 OS: Windows 7 User Comments: GUEST: Opening projects Lolo_101: Edited a java file in the editor. Lolo_101: Opened the Navigator pane. GUEST: viewing class in editor GUEST: implementing Spring JpaRepository Lolo_101: Pressed Alt-Enter on an anonymous class, hopefully to pop-up the "implement all methods" menu, but this exception showed up instead. code looks like : public interface Page<T> {...} public Page<U> load(...) { return new Page<>() { // Here i clicked on Page to auto-implement all methods. } } Stacktrace: java.lang.ClassCastException: com.sun.tools.javac.code.Type$ForAll cannot be cast to com.sun.tools.javac.code.Type$MethodType at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:812) at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:792) at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:574) at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods.createMessage(ImplementAllAbstractMethods.java:138) at org.netbeans.modules.java.hints.infrastructure.ErrorHintsProvider.computeErrors(ErrorHintsProvider.java:197) at org.netbeans.modules.java.hints.infrastructure.ErrorPositionRefresherHelper.getErrorDescriptionsAt(ErrorPositionRefresherHelper.java:84)
Created attachment 155581 [details] stacktrace
Lolo_101: could you provide a more complete example ? I've tried a simple source file using your code: public class Foo<U> { public interface Page<T> { public T whatever(T x); } public Page<U> load(int a) { return new Page<>() { // Here i clicked on Page to auto-implement all methods. } } } but the IDE does not even offer the 'implement all methods', since the compiler is unable to infer the type argument for the anonymous class
(In reply to Svata Dedic from comment #2) > Lolo_101: could you provide a more complete example ? I've tried a simple > source file using your code: > > public class Foo<U> { > public interface Page<T> { > public T whatever(T x); > } > > public Page<U> load(int a) { > return new Page<>() { // Here i clicked on Page to auto-implement all > methods. > } > } > } > > > but the IDE does not even offer the 'implement all methods', since the > compiler is unable to infer the type argument for the anonymous class I just pressed Alt-Enter with the cursor on "Page" on the specified line. I dont know what hints were suggested. I just hoped for 'implement all' to be present to save me some key strokes.
Cannot reproduce, as noted in comment #2. If the error happens again, please save the exact source for further investigation;