Bug 20627 - "Organize Imports" and "Format" format long import lines inconsistently. [code manipulation]
Summary: "Organize Imports" and "Format" format long import lines inconsistently. [cod...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 trivial (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2002-06-19 05:28 EDT by Andreas Krüger CLA
Modified: 2002-09-30 13:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Krüger CLA 2002-06-19 05:28:00 EDT
Given individual import statements that are longer than the allowed source code
line length, "Format" breaks those up into multiple lines at the "." characters
in the package/class names. "Source/Organize Imports" undoes those changes.
Comment 1 Andreas Krüger CLA 2002-06-19 06:45:39 EDT
This is related to bug 7224.
Comment 2 Jerome Lanneluc CLA 2002-06-19 07:56:54 EDT
Should "Organize imports" use the formatter? Maybe this should be considered 
post 2.0.
Comment 3 Andreas Krüger CLA 2002-06-19 08:14:50 EDT
Consider this situation:

You imported source code from somewhere and want to be able
to exchange reasonably small patch files with that somewhere.

In this situation, you don't "own" the source code format
and must not change it.

Contributors to open source projects frequently encounter this situation.

If "organize imports" would format the entire file, that'd be a bug.
You'll have to use the formater on part of the file only,
namely, only the import statements.
Comment 4 Kai-Uwe Maetzel CLA 2002-06-19 16:25:55 EDT
Organize import recreates the whole import statement section according to your 
settings. Formatting options are not considered. Post 2.0
Comment 5 Dirk Baeumer CLA 2002-07-17 09:24:54 EDT
We should only format the new import statements. All already existing import 
statements should be left untouched.

Comment 6 Martin Aeschlimann CLA 2002-09-30 13:11:49 EDT
fixed > 20020924

import structure (add import / org.import) now uses the formatter for newly 
added imports.