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 103830 - 6.0 M9 - "sense-making" line wrap
Summary: 6.0 M9 - "sense-making" line wrap
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-12 05:37 UTC by wqtnetbeans
Modified: 2007-10-08 09:15 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 wqtnetbeans 2007-05-12 05:37:12 UTC
public class MyClass { private String f1; private int f2;
....
}

should be formatted to

public class MyClass {
    private String f1;
    private int f2;
....
}

But it's not.

Similarly,

void myMethod() { doThing1(); doThing2(); if (someCondition) doThing3();}

should be formatted to

void myMethod() {
    doThing1();
    doThing2();
    if (someCondition) {
        doThing3();
    }
}

That'll help a lot because you can just type code away without thinking about
how to breaking up lines, and have the formatter take care of it for you
afterwards. Having to think about line breaking can be a distraction from the
train of thought of the code's business logic, and slows down your coding speed.
Comment 1 Vitezslav Stejskal 2007-05-14 05:19:45 UTC
Have you seen Tools-Options -> Java Code -> Formatting, Category == Wrapping,
...? I am sorry, but what exactly are you reporting? Are those settings broken?
Or insufficent, you need better control? Thanks.
Comment 2 wqtnetbeans 2007-05-14 15:19:09 UTC
This may fall in the category of "enhancement". Sorry for not being clear as I
am not sure myself.

Nevertheless, note that there is nothing in the "Tools-Options -> Java Code ->
Formatting, Category == Wrapping" that can provide the line wrapping described
here. 

I guess in terms of implementation it's trickier than just "always wrap after
semi-colomn". 

For things like

for (int i = 0; i < someMax; i++) {

should NOT be wrapped to

for (int i = 0;
    i < someMax;
    i++) {

But, things like

if (someCondition) { doThing1(); doThing2(); ....

SHOULD be wrapped into

if (someCondition) {
    doThing1();
    doThing2();
....

Also the examples metioned earlier. 


Comment 3 Vitezslav Stejskal 2007-05-15 04:11:03 UTC
I see, I'll passed this on to the java editor guys. Thanks.
Comment 4 Dusan Balek 2007-10-08 09:15:47 UTC
Fixed in the current dev build.