Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4601978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:54:37+00:00 2026-05-21T23:54:37+00:00

I know where to change the preferences for the Formatter and change the options

  • 0

I know where to change the preferences for the Formatter and change the options there. I’m unable to figure out how to get it to format the way I want it to, and would like some assistance, if possible, to format this ‘my’ way. 🙂

It is currently set to “Wrap where necessary”, and this seems like the closest to what I want. And yet, it’s is producing results that aren’t quite what I want.
An example of the current formatting looks something like

LOG.error(
    String.format(
        "Creating JSON Object from event array @ line number %d failed",
        key.get()), e);

This is much better than what was there. I re-formatted this code. Before it looked like

        LOG
                .error(
                        String
                                .format(
                                        "Creating JSON Object from event array @ line number %d failed",
                                        key.get()), e);

And that formatting is all over the code. And yes, the tabbing is accurately reflected as what is in the code. Previous dev must of had different settings… It looking like this is what prompted me to write the code. Doing my investigation and checking showed my settings (default) to produce the first snippet. If that was representative of all the code, I probably would be fine. But since I started writing, I’m justy continuing.

So, onto what I would like. I would like this to end up as

LOG.error(String.format(
        "Creating JSON Object from event array @ line number %d failed",
        key.get()), e);

The string gets broken out because it extends over the line length and the key.get... get broken because it’s past the line length. The string itself (as positioned) is over the line length which is why the key.get... is dropped a line.

I’m not familiar enough with the settings in eclipse that deal with this (found them today thanks to google) and randomly changing things hoping to find what I’m looking for isn’t that appealing of an option.

Obviously the length of the components are going to affect the results as is the starting white space.
In the two examples of how the formatting is operating LOG.error(String.Format( is not longer than the line length. I don’t want it broken into two lines. What do I change to correct that? (man that was a long post for that simple of a question… hehe)

UPDATE:
I tried to do the // as suggested below and I got the following result

LOG.error(
        String.format(
                //
                "Creating JSON Object from event array @ line number %d failed",
                key.get()), e);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:54:38+00:00Added an answer on May 21, 2026 at 11:54 pm

    Thanks for the input. It doesn’t seem that I’ll be able to get it exactly how I want. The flexibility just doesn’t seem to be there.

    I have a few other lines which helped guide how the settings I’ve settled on.

    For Arguments I have Wrap where necessary and Indent on column.
    For Qualified invocations I set it to Do not wrap.

    The rest are less frequent occurrences. I set them to Wrap where necessary and Indent by one. The few instances I looked at for these, it looked to set them up the way I like.

    The result I end up with for the specified line, is the same as Digitalxero shows. And if I use the // as Jean-Philippe Pellet mentions, it will now do as he shows.
    I’m not going to use the // (while I like the suggestion) since I don’t care enough about the formatting to scatter // throughout the code.

    Overall, these settings get it to a point where everything tends to work close enough to where I would like it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to know what is the best way to use shared preferences for
Here I have a sample of code. I would like to know other way
I would like to know how to change the colour of the equality sign
I know you previously change the font size of a cell like so: cell.font
I know how to change the value of attributes with SlowCheetah, but how would
I love how SharedPreferences work in android and I would like to know if
I would like to know how I can start an Activity from a Preference
I would like to know if it is possible to for some application other
I know I can change the background, standard out and standard error colors in
I know how to change the font of Java editor in Eclipse in menu

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.