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 72346 - Nonoptimal code generated by form designer
Summary: Nonoptimal code generated by form designer
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2006-02-07 14:18 UTC by _ rkubacki
Modified: 2006-10-23 16:40 UTC (History)
1 user (show)

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 _ rkubacki 2006-02-07 14:18:39 UTC
NB5.0 allows to generate event handlers into one private inner class. This is
nice as it reduces number of generated classes but still there is another
special sythetic inner class created to make the cunstructor of inner class
accessible from outer class. To generate smaller and more efficient code the
listener should contain package private constructor. It means rather than creating:


    private class FormListener implements java.awt.event.ActionListener {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (evt.getSource() == ...

we should create:


    private class FormListener implements java.awt.event.ActionListener {
        FormListener () {}
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            if (evt.getSource() == ...

Once this is fixed we can regenerate many of forms in the existing NetBeans
codebase to save certain space in module JARs and also in perm generation area
once these classes are loaded.
Comment 1 Jan Stola 2006-02-17 09:20:38 UTC
Fixed.

/cvs/form/src/org/netbeans/modules/form/JavaCodeGenerator.java,v
new revision: 1.171; previous revision: 1.170