Bug 53478 - Problem in Code Formatter
Summary: Problem in Code Formatter
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-02 04:42 EST by Klaus Dicks CLA
Modified: 2004-03-26 07:39 EST (History)
1 user (show)

See Also:


Attachments
saved code formatting profile (18.43 KB, text/plain)
2004-03-03 03:02 EST, Klaus Dicks CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Dicks CLA 2004-03-02 04:42:39 EST
I've created a new profile. In this profile the 'preserve existing line breaks'
property is enabled. But if I foramt my code with this profile all blank lines
are deleted and all preformatted code is stuck together.
Comment 1 Kai-Uwe Maetzel CLA 2004-03-02 05:02:29 EST
Please provide an example. Thanks, Kai
Comment 2 Klaus Dicks CLA 2004-03-03 03:02:09 EST
Created attachment 8293 [details]
saved code formatting profile

This is the code formatter profile that creates the mentioned problems.
Comment 3 Klaus Dicks CLA 2004-03-03 03:04:49 EST
whith the submitted format the following happens: 
 
### code unformatted 
 
/* 
 * user: kd date: 03.03.2004 time: 08:33:03 
 */ 
package de.shd.util.idb.tools; 
 
public class DBTools 
{ 
   public static void main(String[] args) 
   { 
      String driver = null; 
      String url = null; 
      String method = null; 
       
      for (int i = 0; i < args.length; i = i + 2) 
      { 
         if (args[i].equals("-driver")) 
         { 
            driver = args[i + 1]; 
         } 
         else if (args[i].equals("-url")) 
         { 
            url = args[i + 1]; 
         } 
         else if (args[i].equals("-method")) 
         { 
            method = args[i + 1]; 
         } 
      } 
       
      Command com = new Command(); 
       
      com.m_driver = driver; 
      com.m_url = url; 
       
      Tool tool = ToolFactory.createTool(method); 
      tool.doJob(com); 
   } 
} 
 
 
### code formatted (the blank lines are removed although the option preserve 
blank lines is checked) 
 
/* 
 * user: kd date: 03.03.2004 time: 08:33:03 
 */ 
package de.shd.util.idb.tools; 
 
public class DBTools 
{ 
   public static void main(String[] args) 
   { 
      String driver = null; 
      String url = null; 
      String method = null; 
      for (int i = 0; i < args.length; i = i + 2) 
      { 
         if (args[i].equals("-driver")) 
         { 
            driver = args[i + 1]; 
         } 
         else if (args[i].equals("-url")) 
         { 
            url = args[i + 1]; 
         } 
         else if (args[i].equals("-method")) 
         { 
            method = args[i + 1]; 
         } 
      } 
      Command com = new Command(); 
      com.m_driver = driver; 
      com.m_url = url; 
      Tool tool = ToolFactory.createTool(method); 
      tool.doJob(com); 
   } 
} 
 
 
Comment 4 Tom Hofmann CLA 2004-03-03 03:26:58 EST
do you also have the "preserve empty lines" preference enabled?
Comment 5 Klaus Dicks CLA 2004-03-03 04:00:17 EST
I have the perference 'number of empty lines to preserve' set to 1. 
Comment 6 Tom Hofmann CLA 2004-03-03 06:51:50 EST
reopening 
Comment 7 Tom Hofmann CLA 2004-03-03 06:52:44 EST
moving to jdt core for comments
Comment 8 Olivier Thomann CLA 2004-03-03 08:44:01 EST
The option "preserve existing line breaks" has been removed.
So please try again with the latest integration build.
Comment 9 Klaus Dicks CLA 2004-03-23 07:52:03 EST
doesn't occur with I20040323 
Comment 10 Jerome Lanneluc CLA 2004-03-26 07:38:30 EST
Reopening to mark as WORKSFORME.
Comment 11 Jerome Lanneluc CLA 2004-03-26 07:39:10 EST
Reporter said it now works.