Community
Participate
Working Groups
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.
Please provide an example. Thanks, Kai
Created attachment 8293 [details] saved code formatting profile This is the code formatter profile that creates the mentioned problems.
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); } }
do you also have the "preserve empty lines" preference enabled?
I have the perference 'number of empty lines to preserve' set to 1.
reopening
moving to jdt core for comments
The option "preserve existing line breaks" has been removed. So please try again with the latest integration build.
doesn't occur with I20040323
Reopening to mark as WORKSFORME.
Reporter said it now works.