Watch, Follow, &
Connect with Us
Public Report
Report From: JBuilder/Editor/Options    [ Add a report in this area ]  
Report #:  7426   Status: Closed
Format ALL failure - Preserve existing line breaks
Project:  JBuilder Build #:  10.0.176.0
Version:    12 Submitted By:   Petar Banicevic
Report Type:  Basic functionality failure Date Reported:  2/25/2004 3:39:29 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   227719
Resolution: Retest (Resolution Comments) Resolved in Build: : 012.000.173.000
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 5
Description
Format all fails if "Preserve existing line breaks option is off !
Steps to Reproduce:
Goto to (Default) Project Properties. Goto Formatting. Goto tab Wrapping.
Uncheck option "Preserve existing line breaks".

Open any project, open any class and insert following code:

  public void test() {
    Object x=new Object();
    /* i
   am
   stuipd
   */
    if (x instanceof Object) {
      System.out.println("hello");
    }
  }

Now do right mouse click and select format all. Watch carefully to your
test2 method. Watch the comments and the line below. Do you get something
like this ?

First format all:
public void test2() {
    Object x=new Object();
    /*
     I am
         stupid
     */if (x instanceof Object) {
      System.out.println("hello");
    }
  }

Even more but I can't reproduce, sometimes it happens following:

public void test2() {
    Object x=new Object();
    /*
     I am
         stupid
     if*/ (x instanceof Object) {
      System.out.println("hello");
    }
  }

Whish is TERRIBLE !!!
Workarounds
Never use Unchecked option "Preserve existing line breaks".
Attachment
None
Comments

None

Server Response from: ETNACODE01