Skip to content

Commit

Permalink
Slight polish
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Sep 18, 2024
1 parent 71167ee commit 182ce8f
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ private J.Literal toTextBlock(J.Binary binary, String content, List<J.Literal> s

StringBuilder sb = new StringBuilder();
StringBuilder originalContent = new StringBuilder();
stringLiterals = stringLiterals.stream().filter(s -> s.getValue() != null
&& !s.getValue().toString().isEmpty()).collect(Collectors.toList());

stringLiterals = stringLiterals.stream()
.filter(s -> s.getValue() != null && !s.getValue().toString().isEmpty())
.collect(Collectors.toList());
for (int i = 0; i < stringLiterals.size(); i++) {
String s = requireNonNull(stringLiterals.get(i).getValue()).toString();
sb.append(s);
Expand Down Expand Up @@ -178,14 +178,10 @@ private J.Literal toTextBlock(J.Binary binary, String content, List<J.Literal> s
}

private boolean isEndsWithSpecialCharacters(String content) {
boolean isEndsWithQuotationMark = content.endsWith("\"");
boolean isEndsWithEqual = content.endsWith("=");
boolean isEndsWithCurlyBrackets = content.endsWith("}");
boolean isEndsWithSemicolon = content.endsWith(";");
return isEndsWithQuotationMark
|| isEndsWithEqual
|| isEndsWithCurlyBrackets
|| isEndsWithSemicolon;
return content.endsWith("\"") ||
content.endsWith("=") ||
content.endsWith("}") ||
content.endsWith(";");
}
});
}
Expand Down

0 comments on commit 182ce8f

Please sign in to comment.