Share

Jalopy Java Source Code Formatter

Tracker: Bugs

1 Duplicate Comment - ID: 604065
Last Update: Settings changed ( marcohu )

A bit of an odd case, but when you have a comment
following a left-brace but on the same line, jalopy inserts
a blank line. Further, and perhaps more of a problem,
when the brace-comment is follwed by another line with
a comment then jalopy inserts a duplicate of the
comment lines. I have attached my prefs as used, and
here is an example:

This source:

if (this.someVar)
{ // this.someVar is true
// Sum the external costs of all of the actions
Iterator it = this.actionList.iterator();

while (it.hasNext())
{ // each EventAction
EventAction a = (EventAction) it.next();

becomes:

if (this.someVar)
{ // this.someVar is true
// Sum the external costs of all of the actions

// this.someVar is true
// Sum the external costs of all of the actions
Iterator it = this.actionList.iterator();

while (it.hasNext())
{ // each EventAction

EventAction a = (EventAction) it.next();


David Cooper ( noobar ) - 2002-09-03 17:10

1

Closed

Fixed

Marco Hunsicker

None

None

Public


Comments ( 2 )

Date: 2002-09-03 18:50
Sender: marcohuProject Admin

Logged In: YES
user_id=44430

For the comment duplication: this is an ANTLR related bug
(in my patched code) I've already fixed. CVS repository
should be online soon.

The brace handling is fine, though. You should take a look at
Preferences->Printer->Braces->Misc->Blank lines after
left/right curly brace. Setting both to '0' should do the trick.

Thanks.


Date: 2002-09-03 17:31
Sender: noobar

Logged In: YES
user_id=605186

Just found another case, when the comment is a right-brace-
comment, jalopy removes a blank line above. Perhaps this is
just a setting or expected side-effect - I am aware that there
is 'one-line-before' on single line comments, but that should
only apply when the comment is by itself on the line I would
expect. Example:

}

} // this.someVar

becomes:

}
} // this.someVar



Attached File ( 1 )

Filename Description Download
jalopy-prefs2.xml Preferences file Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2002-11-13 00:02 marcohu
close_date - 2002-11-13 00:02 marcohu
resolution_id None 2002-09-15 21:56 marcohu
priority 5 2002-09-03 18:50 marcohu
assigned_to nobody 2002-09-03 18:50 marcohu
File Added 30362: jalopy-prefs2.xml 2002-09-03 17:10 noobar