Given the following source with 1.5b3:
public final class HttpRequest
{
public enum Method
{
/** Data is encoded in the query. */
GET,
/** Data is encoded in the body. */
POST
}
}
and the command line:
jalopy.sh -d _new JalopyTest.java
I get back (also attached):
public final class HttpRequest {
public enum Method {/** Data is encoded in the
query. */
GET,
/** Data is encoded in the body. */
POST;
}
}
Note that there is now a trailing space after "GET," and
that the GET comment has been glued to the previous
line's {.
Processed source file
Logged In: YES
user_id=723231
The trailing space is correct (If you have specified 1 blank
line for javadoc comments (See blank lines))
All javadoc and sperator comments will now start on there
own line
Logged In: YES
user_id=152749
Just to clarify, is the following behavior intended:
"GET, " <-- Note the trailing space after the comma to end
of line
This is the only instance I have seen so far where Jalopy
will insert whitespace before the end of line. The
resulting regex of '[ \t]+$' causes tools such as
Checkstyle to complain.
Thanks.
Logged In: YES
user_id=723231
While printing the enumeration block the enum constant
printer now checks to see if a new line is being printed
after the enum constant. If this is true then no space is
printed following the commas (regardless of the white space
setting for commas).
Logged In: YES
user_id=152749
The same behavior occurs with 1.5b5:
public enum Method
{
/**
* Data is encoded in the query.
*/
GET,
/**
* Data is encoded in the body.
*/
POST;}
Note that the first "{" now retains its position, but the
trailing space following "GET," remains as does the "}"
immediately following "POST;".
Lastly, what is the policy for whitespace between enum
elements? The original source had a newline between "GET"
and "POST" which was removed by jalopy.
Jalopy-processed source attached. Thanks for the great tool
and support.
Logged In: YES
user_id=723231
ok the issue (now) is in your printer settings.
Goto printer->wrapping->misc. Change Enumerations->Left
brace starts new line wrap after (change to) "1" (the
default is 3).
This will supress the blank space. Of course all enums
constants will now start a new line also.
I will leave this open though since it should behave
properly without modifying that setting.
Z
Logged In: YES
user_id=152749
I have made the suggested printing change, which removes the
unwanted trailing space after the first enum element.
I still have "POST;}" on the last line, when I would prefer
that the closing "}" be on a separate line. Is there
another setting I can change?
Thanks.
Logged In: YES
user_id=723231
Fixed, There wont be any control on this setting for the
time being though.