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 245888

Summary: Specifying the same generic type twice results in compile error.
Product: java Reporter: CompufreakVultureX
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: Compilable source folder

Description CompufreakVultureX 2014-07-22 18:13:15 UTC
Created attachment 148214 [details]
Compilable source folder

For example make a new project and in the main class put the following code (I've also added this code as an attachment):

@FunctionalInterface
public interface Action2E<A, A, E extends Throwable> {
        void invoke(A arg1, A arg2) throws E;
}

Generic type A is specified twice. There is no compile error. When you try to run the project you get an error that the Main class is not found.

In my own project this function was in another class in another package. Somehow I managed to fix the Main class not found error by replacing the Main function, but it introduced a NoClassDefFoundError somewhere else. As soon as I found out that my code caused the error I deleted it, but the project is beyond repair. Auto-complete is broken, and it won't run anymore. Clean and Build results in an error that tells me I should file a bug.

I had to create an entirely new project without the erroneous code and now everything works fine again.
Comment 1 Dusan Balek 2014-07-23 08:19:04 UTC

*** This bug has been marked as a duplicate of bug 245859 ***