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 200613 - with "equals()&hashCode()" option for generating //<editor-fold...
Summary: with "equals()&hashCode()" option for generating //<editor-fold...
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 22:24 UTC by err
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2011-08-02 22:24:10 UTC
Use Case example: small classes used as map index or collection element. Like
        private static class FontSizeParams {
            private final ParamData family;
            private final ParamData size;
The generated code is much larger than the rest of the class.

If I generate equals() only using both fields, then option to create

    //<editor-fold defaultstate="collapsed" desc="equals(): family,size">
    //</editor-fold>

or if I generate both functions with both fields, could wrap both of them (this one would just be a bonus)

    //<editor-fold defaultstate="collapsed" desc="equals()&hashCode(): family,size">

I took a quick look at EqualsHashCodeGenerator.java, but my eyes glazed over.

For UI, on the "Generate xxx" dialog, an option checkBox, e.g. "X Generate Fold", (with a value persisted in Preferences) is a possibility.

There might be other generated code situations where this option would be useful.

(I'm tempted to make this a P2 enhancement request)