Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 255105

Summary: [typing] Correct Indentation doesn't use Java Formatter settings
Product: [Eclipse Project] JDT Reporter: Daniel B. <dsb>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, frederic_fusier
Version: 3.4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
my current preferences none

Description Daniel B. CLA 2008-11-12 16:06:34 EST
Created attachment 117711 [details]
my current preferences

Build ID: M20080911-1700

The Source . Correct Indentation command doesn't seem to
follow the Java . Code Style . Formatter settings at all.


When invoking Format on the following lines it indents them 
as follows:

:    public void test1()
:	throws Exception,
:	    Exception
:    {
:	InputStream testInput = this
:			.getClass()
:			.getResourceAsStream(
:					      "/dsb/accump3/submain/yEncTest1Input.yenc" );

invoking Correct Indentation changes the indentation to 
this:

:    public void test1()
:    throws Exception,
:    Exception
:    {
:	InputStream testInput = this
:	.getClass()
:	.getResourceAsStream(
:	                     "/dsb/accump3/submain/yEncTest1Input.yenc" );


Steps To Reproduce:
1. Have a formatter configuration and code that show the 
   problem (e.g., my attached preferences and the above 
   code nested in a class declaration).
2. Select the code and invoke Source . Format.
3. Invoked Correct Indentation.
4. Notice that the indentation changes (and changes to 
   something other than what is specified in the 
   formatter configuration). 

More information:

(If somehow the Correct Indentation command is not intended 
to follow the formatter preferences, then 
1) that needs to be make much clearer in the documentation 
   (and probably in the GUI), and
2) the indenter needs to be configurable too.
Comment 1 Jerome Lanneluc CLA 2008-11-13 04:52:10 EST
Move to JDT/UI to investigate
Comment 2 Dani Megert CLA 2008-11-13 05:06:00 EST

*** This bug has been marked as a duplicate of bug 75573 ***