Skip to content

Commit b9aff1f

Browse files
author
zhourenjian@gmail.com
committed
Fixed bug that a comment block is missing in generated sources
1 parent e299104 commit b9aff1f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sources/net.sf.j2s.ajax/generator/net/sf/j2s/ajax/SimpleSource4Java.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,8 @@ public int compare(Class<?> c1, Class<?> c2) {
509509
}
510510
}
511511

512-
if (gotStaticFinalFields) {
513-
source.append("\r\n");
514-
SourceUtils.insertLineComment(source, "\t", index++, true);
515-
} else {
516-
index++;
517-
}
512+
source.append("\r\n");
513+
SourceUtils.insertLineComment(source, "\t", index++, true);
518514

519515
boolean firstField = true;
520516
for (Iterator<Field> itr = fields.iterator(); itr.hasNext();) {
@@ -542,7 +538,9 @@ public int compare(Class<?> c1, Class<?> c2) {
542538
}
543539
}
544540

545-
source.append("\r\n");
541+
if (!firstField) { // contains fields
542+
source.append("\r\n");
543+
} // else no blank line as previous comment block contains a blank line
546544
SourceUtils.insertLineComment(source, "\t", index++, true);
547545
boolean moreCodesAdded = false;
548546
if (fieldMappings != null && fieldMappings.size() > 0) {

0 commit comments

Comments
 (0)