Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Inconsistent spacing for method arguments #22

Open
apjanke opened this issue May 25, 2015 · 1 comment
Open

Inconsistent spacing for method arguments #22

apjanke opened this issue May 25, 2015 · 1 comment

Comments

@apjanke
Copy link
Contributor

apjanke commented May 25, 2015

There's a small inconsistency in the formatting of example code with respect to spacing between parentheses and arguments for method invocation. About 75% of the time, there are spaces between the parentheses and the first and last arguments, like this.

    assertEquals( "NY", weather.getRegion() );
    assertEquals( "US", weather.getCountry() );
    assertEquals( "39", weather.getTemp() );

And some times there are not spaces.

URLConnection conn = new URL(url).openConnection();
InputStream nyData = getClass().getClassLoader()
  .getResourceAsStream("ny-weather.xml");
weather.setRegion(
  doc.valueOf("/rss/channel/y:location/@region") );
weather.setCountry(
  doc.valueOf("/rss/channel/y:location/@country") );

Is there a preferred way you'd like to settle on? Or a rule for when there is or isn't space?

This is just a small cosmetic issue, but it's bothering me. And it means that I can't throw the source code in an IDE like NetBeans and do the full auto-formatting and have it match the book's formatting.

@mosabua
Copy link
Contributor

mosabua commented Sep 22, 2015

There Maven code style requires these spaces but it is not consistent in the book sources. This is a minor cosmetic issue that I might fix later by reformatting all code in the examples and listing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants