maven-example-en icon indicating copy to clipboard operation
maven-example-en copied to clipboard

Inconsistent spacing for method arguments

Open apjanke opened this issue 9 years ago • 1 comments

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.

apjanke avatar May 25 '15 02:05 apjanke

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.

mosabua avatar Sep 22 '15 23:09 mosabua