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 249376

Summary: Constructor generator does not include final members in class
Product: java Reporter: brettryan <brettryan>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Normal constructor generator
No constructor generator for all final
Constructor generator where at least one member is not final

Description brettryan 2014-12-16 04:58:16 UTC
Created attachment 151125 [details]
Normal constructor generator

Given a class with all members defined as final the constructor generator will not provide a template to generate a constructor for these members. If however one or more is not marked as final a constructor generator for all members is available, including the final members.

    // Provides only WidgetController()
    public class WidgetService {
        final WidgetService ws;
    }
    // Provides WidgetController(WidgetService)
    public class WidgetService {
        WidgetService ws;
    }
    // Provides WidgetController(WidgetService, FooService)
    public class WidgetService {
        final WidgetService ws;
        FooService fs;
    }
Comment 1 brettryan 2014-12-16 04:59:15 UTC
Created attachment 151126 [details]
No constructor generator for all final
Comment 2 brettryan 2014-12-16 04:59:55 UTC
Created attachment 151127 [details]
Constructor generator where at least one member is not final
Comment 3 Jiri Prox 2014-12-16 11:59:58 UTC

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