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 250111 - Hint to generate unimplemented methods of an interface does not work -> java.lang.ClassCastException: com.sun.tools.javac.code.Type$ForAll cannot be cast to com.sun.tools.javac.code.Type$MethodType
Summary: Hint to generate unimplemented methods of an interface does not work -> java....
Status: RESOLVED INCOMPLETE
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-30 09:32 UTC by markiewb
Modified: 2015-03-01 14:48 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 markiewb 2015-01-30 09:32:24 UTC
*
{code}
public class My|Impl implements IFoo { //invoke Fix Code at caret |

}
{code}

ACTUAL: no hint which allows you to generate all methods which have to be implemented. There is an exception in the log

EXPECTED: hint which allows you to generate all methods which have to be implemented. 

SEVERE [org.openide.util.Exceptions]
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:692)
	at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:672)
	at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:511)
	at org.netbeans.modules.java.hints.errors.ImplementAllAbstractMethods.createMessage(ImplementAllAbstractMethods.java:131)
	at org.netbeans.modules.java.hints.infrastructure.ErrorHintsProvider.computeErrors(ErrorHintsProvider.java:197)
	at org.netbeans.modules.java.hints.infrastructure.ErrorHintsProvider.computeErrors(ErrorHintsProvider.java:137)
	at org.netbeans.modules.java.hints.infrastructure.ErrorHintsProvider.run(ErrorHintsProvider.java:608)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:573)
[catch] at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:744)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)



and 


SEVERE [org.openide.util.Exceptions]
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:692)
	at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:672)
	at org.netbeans.api.java.source.ElementUtilities.findUnimplementedMethods(ElementUtilities.java:511)
	at org.netbeans.modules.java.hints.suggestions.ImplementMethods.computeUnimplemented(ImplementMethods.java:120)
	at org.netbeans.modules.java.hints.suggestions.ImplementMethods.implementMethods(ImplementMethods.java:108)
	at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
[catch] at org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:336)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.runHint(HintsInvoker.java:798)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.access$400(HintsInvoker.java:111)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.runAndAdd(HintsInvoker.java:657)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker$ScannerImpl.scanDoNotGoDeeper(HintsInvoker.java:711)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeSuggestions(HintsInvoker.java:396)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:232)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:209)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:182)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsInvoker.computeHints(HintsInvoker.java:149)
	at org.netbeans.modules.java.hints.spiimpl.hints.HintsTask$SuggestionsPositionRefresherHelper.getErrorDescriptionsAt(HintsTask.java:232)
	at org.netbeans.modules.java.hints.spiimpl.JavaHintsPositionRefresher$RefreshTask.run(JavaHintsPositionRefresher.java:151)
	at org.netbeans.modules.java.hints.spiimpl.JavaHintsPositionRefresher$RefreshTask.run(JavaHintsPositionRefresher.java:121)
	at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:493)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:598)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:155)
	at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:139)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:206)
	at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:203)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
	at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:203)
	at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
	at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:443)
	at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:414)
	at org.netbeans.modules.java.hints.spiimpl.JavaHintsPositionRefresher$1.run(JavaHintsPositionRefresher.java:108)
	at org.netbeans.modules.progress.ui.RunOffEDTImpl$1.run(RunOffEDTImpl.java:169)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)


Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Java: 1.8.0_20; Java HotSpot(TM) 64-Bit Server VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b26
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
User directory: C:\Users\markiewb\AppData\Roaming\NetBeans\8.0.1
Comment 1 Svata Dedic 2015-02-27 09:22:16 UTC
Sorry I could not reproduce the defect using 8.0.2; the hint to implement all abstract methods appeared and its fix generated the method properly.

public class Bug implements Callable {
..

Could you attach the whole file, please ? Does the implemented interface exist ? if so, could you please attach the interface, too ?
Comment 2 markiewb 2015-03-01 14:48:53 UTC
(In reply to Svata Dedic from comment #1)
> Sorry I could not reproduce the defect using 8.0.2; the hint to implement
> all abstract methods appeared and its fix generated the method properly.
> 
> public class Bug implements Callable {
> ..
> 
> Could you attach the whole file, please ? Does the implemented interface
> exist ? if so, could you please attach the interface, too ?

I will give it a try, when I am back at work.