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 - Keep short one-liner methods on one line
Summary: Keep short one-liner methods on one line
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal with 3 votes (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-26 11:45 UTC by assylias
Modified: 2016-01-04 17:17 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 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