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 235024

Summary: Keep short one-liner methods on one line
Product: editor Reporter: assylias <assylias>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description assylias 2013-08-26 11:45:39 UTC
It would be great in the formatting settings, to be able to have the option to format short methods (in Java) on one line.

Typically, when creating a simple mock of an interface, you end up with something like:

    ToMock tm = new ToMock() {
        @Override public boolean m() {
            return true;
        }
    }

When I would like to get this result:

    ToMock tm = new ToMock() {
        @Override public boolean m() { return true; }
    }
Comment 1 assylias 2013-10-16 09:01:25 UTC
This would also be useful to write compact getters/setters:

    class Pojo {
        Object o;
        public void setO(Object o) { this.o = o; }
        public Object getO() { return this.o; }
    }
Comment 2 assylias 2014-11-12 15:12:33 UTC
Will this request be considered for inclusion?

Many thanks