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

Bug 354060

Summary: Java formatter line width setting is ignored
Product: [Eclipse Project] JDT Reporter: Marcel <eclipse>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Marcel CLA 2011-08-05 18:17:31 EDT
Build Identifier: 20110218-0911

The line width settings are all set to 132 characters, but the formatter assumes 80 characters in quite a few instances. Example:

    public void x() {
        xxxxxxxxxxxxx xxxxx = xxxxxxxxxxxxxxxxxxxxxxxxxx(3,
                new int[] { 3, 4, 3 }, 2);
        xxx xxxxx = xxxxxxxxx(3, new int[] { 3, 4, 3 }, 2);
    }

wraps the first assignment even though it is far from 132 chars wide. A similar assignment, but <80 characters wide, will not wrap.

Reproducible: Always

Steps to Reproduce:
1. Create formatter profile with Maximum Line Width set to 132
2. format some code with length >80 <132
3. See it wrap unnecessary
Comment 1 Ayushman Jain CLA 2011-08-08 01:23:07 EDT
Can you please attach your formatter profile? (Export from the formatter settings and attach here). Thanks!
Comment 2 Marcel CLA 2011-08-08 14:03:08 EDT
Nevermind. Probaly user error. There was a strangly named ("-") local project preference that overrode the global settings.