Skip to content

Commit

Permalink
Fix SonarLint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jfree committed Jun 22, 2024
1 parent 2708f34 commit a555d44
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions src/main/java/org/jfree/svg/SVGGraphics2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -1085,9 +1085,9 @@ public void draw(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append("/>");
} else if (s instanceof Rectangle2D) {
Expand All @@ -1105,9 +1105,9 @@ public void draw(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append("/>");
} else if (s instanceof Ellipse2D) {
Expand All @@ -1125,9 +1125,9 @@ public void draw(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append("/>");
} else if (s instanceof Path2D) {
Expand All @@ -1140,9 +1140,9 @@ public void draw(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append(">");
this.sb.append("<path ").append(getSVGPathData(path)).append("/>");
Expand Down Expand Up @@ -1181,9 +1181,9 @@ public void fill(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append("/>");
} else if (s instanceof Ellipse2D) {
Expand All @@ -1200,9 +1200,9 @@ public void fill(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append("/>");
} else if (s instanceof Path2D) {
Expand All @@ -1215,9 +1215,9 @@ public void fill(Shape s) {
this.sb.append(" transform='").append(getSVGTransform(
this.transform)).append('\'');
}
String clip = getClipPathRef();
if (!clip.isEmpty()) {
this.sb.append(' ').append(clip);
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(clipPathRef);
}
this.sb.append('>');
this.sb.append("<path ").append(getSVGPathData(path)).append("/>");
Expand Down Expand Up @@ -2377,8 +2377,8 @@ public boolean drawImage(Image img, int x, int y, int w, int h,
appendOptionalElementIDFromHint(this.sb);
this.sb.append(" xlink:href='");
this.sb.append(href).append('\'');
String clip = getClipPathRef();
if (!clip.isEmpty()) {
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(getClipPathRef());
}
if (!this.transform.isIdentity()) {
Expand All @@ -2399,8 +2399,8 @@ public boolean drawImage(Image img, int x, int y, int w, int h,
this.sb.append(Base64.getEncoder().encodeToString(getPNGBytes(
img)));
this.sb.append('\'');
String clip = getClipPathRef();
if (!clip.isEmpty()) {
String clipPathRef = getClipPathRef();
if (!clipPathRef.isEmpty()) {
this.sb.append(' ').append(getClipPathRef());
}
if (!this.transform.isIdentity()) {
Expand Down

0 comments on commit a555d44

Please sign in to comment.