-1

So I'm building a URL as below:

final URL url = new URLBuilder().withPath("/basePath/servicePath/")
                                .withQueryParam("param", "paramValue")
                                .buildURL();

After Ctrl + Shift + F, the formatting changes to:

final URL url = new URLBuilder().withPath("/basePath/servicePath/")
        .withQueryParam("param", "paramValue")
        .buildURL();

Would really appreciate if someone could help me out with the appropriate eclipse settings in preferences so that this doesn't happen.

Thanks!

argo
  • 381
  • 1
  • 5
  • 15
  • 1
    You will probably find relevant options in Window>Preferences>Java>Code Style>Formatter>Edit... , then the "Line Wrapping" tab, and finally look at the "Function Calls" section . Note that the "Never join already wrapped lines" from this tab may also help. – Arnaud Jun 16 '16 at 14:35

1 Answers1

0

Here's what I found to get this done. Go To:

Window -> Preferences -> Java -> Formatter -> Edit -> Line Wrapping -> Function Calls

Line wrapping policy -> Wrap all elements, except first element if not necessary (5 of 5)

Indentation Policy: Indent on column (5 of 5)

argo
  • 381
  • 1
  • 5
  • 15