Skip to content

Commit

Permalink
Update CobolGenerator.java
Browse files Browse the repository at this point in the history
Signed-off-by: Søren Andersen <[email protected]>
  • Loading branch information
SMoRG75 committed Apr 17, 2024
1 parent 14f5165 commit 5feb40e
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,28 @@ static void addStartAndEndTags(List<String> lines){
lines.add(getInjectEndTagComment());
}

static List<String> generateWhenOtherLines(String identifier, String type, List<String> commentLines, List<String> bodyLines){
static List<String> generateWhenOtherLines(String identifier, String type, List<String> commentLines, List<String> bodyLines) {
List<String> lines = new ArrayList<>();
if(type.equals(Constants.SECTION_TOKEN))
if (type.equals(Constants.SECTION_TOKEN))
lines.add(String.format(WHEN_OTHER_SECTION_HEADER_FORMAT, identifier));
else lines.add(String.format(PARAGRAPH_HEADER_FORMAT, identifier));
else
lines.add(String.format(PARAGRAPH_HEADER_FORMAT, identifier));

if (commentLines != null)
lines.addAll(commentLines);
if (bodyLines != null)

if (bodyLines != null) {
lines.addAll(bodyLines);
lines.add(ENDING_PERIOD);
// Check if the last line in bodyLines ends with a period
if (!bodyLines.get(bodyLines.size() - 1).endsWith(".")) {
lines.add(ENDING_PERIOD);
}
} else {
// If bodyLines is null, add ENDING_PERIOD
lines.add(ENDING_PERIOD);
}
return lines;
}


}

0 comments on commit 5feb40e

Please sign in to comment.