Skip to content

Commit

Permalink
fix IDEA warnings "Unnecessary call to 'toString()'"
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed Sep 17, 2023
1 parent bb8ebfc commit 5e3e11c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public FSColor asColor() {
public float getFloatProportionalTo(CSSName cssName,
float baseValue,
CssContext ctx) {
throw new XRRuntimeException("Ident value (" + toString() + ") is never a length; wrong class used for derived value.");
throw new XRRuntimeException("Ident value (" + this + ") is never a length; wrong class used for derived value.");
}

public String asString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public static final void main(String[] args) throws IOException {

buf.append(EOL);

System.out.println(buf.toString());
System.out.println(buf);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private static String capitalizeWords( String text ) {

//Uu.p("final = -"+sb.toString()+"-");
if ( sb.toString().length() != text.length() ) {
Uu.p( "error! to strings arent the same length = -" + sb.toString() + "-" + text + "-" );
Uu.p( "error! to strings arent the same length = -" + sb + "-" + text + "-" );
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ public void run() {
panel.setDocument(url.toExternalForm());

long el = System.currentTimeMillis() - st;
XRLog.general("loadDocument(" + url.toString() + ") in " + el + "ms, render may take longer");
HTMLTest.this.setTitle(BASE_TITLE + "- " +
panel.getDocumentTitle() + " " +
"(" + url.toString() + ")");
XRLog.general("loadDocument(" + url + ") in " + el + "ms, render may take longer");
HTMLTest.this.setTitle(String.format("%s- %s (%s)", BASE_TITLE, panel.getDocumentTitle(), url));
} catch (Exception ex) {
Uu.p(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private String getITextFontFamilyName(File selFile) {
selFile.getPath(),
BaseFont.IDENTITY_H,
BaseFont.EMBEDDED);
System.out.println("All family names reported by iText for " + selFile.getPath() + ": " + set.toString());
System.out.println("All family names reported by iText for " + selFile.getPath() + ": " + set);
return (String) set.iterator().next();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,14 @@ private String addLineBreaks(String _text, int maxLineLength) {

final char c = _text.charAt(i);
if (needBreak && Character.isWhitespace(c)) {
System.out.println("Breaking: " + broken.toString());
System.out.println("Breaking: " + broken);
needBreak = false;
broken.append('\n');
} else {
broken.append(c);
}
}
System.out.println("Broken! " + broken.toString());
System.out.println("Broken! " + broken);
return broken.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public FSFont resolveFont(SharedContext renderingContext, FontSpecification spec
return font;
}

XRLog.cascade(Level.WARNING, "Falling back to default system font. " + spec.toString());
XRLog.cascade(Level.WARNING, "Falling back to default system font. " + spec);

// last resort: use system font
return _system_font;
Expand Down

0 comments on commit 5e3e11c

Please sign in to comment.