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

Bug 495568

Summary: Java Code Style Formatter Problem in windows and macos
Product: [Eclipse Project] JDT Reporter: jiang yubao <438762904>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: mateusz.matela
Version: 4.4.2   
Target Milestone: 4.7 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard: needinfo
Attachments:
Description Flags
java code format problem none

Description jiang yubao CLA 2016-06-06 22:36:16 EDT
Created attachment 262264 [details]
java code format problem

I use eclipse in macbookpro, and another programmer use eclipse in windows. Both Maximum line width is set to 80;

And I find than the format result is different.


This cause a big problem. I checkout source code from SVN server, format the code and submit to SVN server, and another programmer make perform  synchronize from SVN server, He will find a lot of unnecessary changes。
Comment 1 Mateusz Matela CLA 2016-06-08 14:22:09 EDT
The screenshot suggests that you use "Eclipse [built-in]" profile on Windows and "Eclipse 2.1 [built-in]" profile on Mac. These are different profiles, no wonder they result in different formatting.
What happens when you use the same profile on both machines?
Comment 2 jiang yubao CLA 2016-06-10 07:47:28 EDT
Yes, the format result is different.
And I am sorry that I send you the wrong screenshot.

You can test in both machines.

Thanks a lot for your replay!
Comment 3 Mateusz Matela CLA 2016-06-10 17:40:28 EDT
I'm sorry if I ask stupid questions, but I want to rule out all possibilities before testing this myself, as it's a bit problematic (I don't have direct access to a Mac) and existence of such a bug seems very improbable.

So are you sure you use the same version of Eclipse on both machines?
In Eclipse 4.5 we fixed a bug that caused 82 character long lines to sometimes not get wrapped, so maybe you have a newer version on the Mac.
Comment 4 jiang yubao CLA 2016-06-10 23:14:59 EDT
I have downloaded the newest version of 4.5.2 to test in both MacOS and Windows7,and found that the format result is different.
Comment 5 Mateusz Matela CLA 2016-06-15 13:56:02 EDT
I did a quick test on a MacOS in a virtual machine and I don't see any difference compared to Windows. So please specify which formatter profile you're using and paste a sample code that shows the difference.
Comment 6 Mateusz Matela CLA 2016-07-09 18:13:12 EDT
No further feedback, closing. Please reopen if you can confirm the problem and provide reproducible examples.