Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 201367 - [formatter] Java source formatter fails to format long method calls correctly
Summary: [formatter] Java source formatter fails to format long method calls correctly
Status: RESOLVED DUPLICATE of bug 303519
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: 4.5 M6   Edit
Assignee: Mateusz Matela CLA
QA Contact:
URL:
Whiteboard: To be verified for 4.8 M2
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-28 02:07 EDT by Mohsen Saboorian CLA
Modified: 2017-09-06 14:58 EDT (History)
6 users (show)

See Also:


Attachments
My formatter properties (27.77 KB, application/xml)
2007-08-28 02:09 EDT, Mohsen Saboorian CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mohsen Saboorian CLA 2007-08-28 02:07:33 EDT
From time to time I tried to have long method calls format correctly but cannot do it with current Eclipse formatter. Line wrapping doesn't work correctly for long method calls like the one I put here. I used a number of different combinations of options available for method calls, but non of them work for these kind of calls. I'll attach my formatter config file.
_______________________
		loop1
				.addTest(new RepeatedTest(
						pageLocalhost_commission_Pages_loginPage_jsp_jsessionid_GT3sVrFNkxPjY7hfzr1tpHZLDnZJvzJGYy8QXh18fywQQQZZqhQg__1106627577,
						1));
_______________________

I believe a correct formatting should be like this:
		loop1.addTest(new RepeatedTest(
						pageLocalhost_commission_Pages_loginPage_jsp_jsessionid_GT3sVrFNkxPjY7hfzr1tpHZLDnZJvzJGYy8QXh18fywQQQZZqhQg__1106627577,
						1));
Comment 1 Mohsen Saboorian CLA 2007-08-28 02:09:31 EDT
Created attachment 77093 [details]
My formatter properties
Comment 2 Dani Megert CLA 2007-08-28 02:24:02 EDT
Which build ID?
Comment 3 Mohsen Saboorian CLA 2007-08-28 02:31:26 EDT
No difference, I've had problems from 3.0Mx up to 3.3 equropa concurrent release (Build id: I20070625-1500)
Comment 4 Mohsen Saboorian CLA 2008-06-26 12:18:45 EDT
It's still there in 3.4.0 release. Is there any plan to fix this bug?
Comment 5 Olivier Thomann CLA 2008-07-10 14:49:52 EDT
Any plan to provide a patch?
Comment 6 Frederic Fusier CLA 2008-08-18 07:02:20 EDT
(In reply to comment #4)
> It's still there in 3.4.0 release. Is there any plan to fix this bug?
> 
Not yet
Comment 7 Frederic Fusier CLA 2008-08-20 11:58:57 EDT
I surely will not have enough time to fix your bug during the 3.5 development
process, hence set its priority to P5.
Please provide a patch if you definitely need this issue to be fixed in this version and I'll have a look at it...
TIA
Comment 8 daniel.hellsson CLA 2011-11-17 09:00:45 EST
This is still a problem. Setting "Wrap all elements, every element on a new line" has no effect. The argument is not wrapped, in fact, if you manually wrap it, it is unwrapped by the formatter. Breaking the code formatting!
Comment 9 daniel.hellsson CLA 2011-11-17 09:03:29 EST
Eclipse Build used: Indigo Service Release 1, 20110916-0149
Comment 10 Mateusz Matela CLA 2017-09-06 14:48:40 EDT
This problem no longer occurs after the formatter redesign (or maybe even earlier, but I'm too lazy to check).

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