Skip to content

Commit a652a75

Browse files
committed
CheckStyle rules upgrade
- minor correction
1 parent 9f8dceb commit a652a75

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

openpdf/src/main/java/com/lowagie/text/pdf/PdfGraphics2D.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -687,19 +687,19 @@ private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
687687
if (newStroke == oldStroke) {
688688
return;
689689
}
690-
if (!(newStroke instanceof BasicStroke nStroke)) {
690+
if (!(newStroke instanceof BasicStroke basicStroke)) {
691691
return;
692692
}
693693
boolean oldOk = (oldStroke instanceof BasicStroke);
694694
BasicStroke oStroke = null;
695695
if (oldOk) {
696696
oStroke = (BasicStroke) oldStroke;
697697
}
698-
if (!oldOk || nStroke.getLineWidth() != oStroke.getLineWidth()) {
699-
cb.setLineWidth(nStroke.getLineWidth());
698+
if (!oldOk || basicStroke.getLineWidth() != oStroke.getLineWidth()) {
699+
cb.setLineWidth(basicStroke.getLineWidth());
700700
}
701-
if (!oldOk || nStroke.getEndCap() != oStroke.getEndCap()) {
702-
switch (nStroke.getEndCap()) {
701+
if (!oldOk || basicStroke.getEndCap() != oStroke.getEndCap()) {
702+
switch (basicStroke.getEndCap()) {
703703
case BasicStroke.CAP_BUTT:
704704
cb.setLineCap(0);
705705
break;
@@ -710,8 +710,8 @@ private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
710710
cb.setLineCap(1);
711711
}
712712
}
713-
if (!oldOk || nStroke.getLineJoin() != oStroke.getLineJoin()) {
714-
switch (nStroke.getLineJoin()) {
713+
if (!oldOk || basicStroke.getLineJoin() != oStroke.getLineJoin()) {
714+
switch (basicStroke.getLineJoin()) {
715715
case BasicStroke.JOIN_MITER:
716716
cb.setLineJoin(0);
717717
break;
@@ -722,16 +722,16 @@ private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
722722
cb.setLineJoin(1);
723723
}
724724
}
725-
if (!oldOk || nStroke.getMiterLimit() != oStroke.getMiterLimit()) {
726-
cb.setMiterLimit(nStroke.getMiterLimit());
725+
if (!oldOk || basicStroke.getMiterLimit() != oStroke.getMiterLimit()) {
726+
cb.setMiterLimit(basicStroke.getMiterLimit());
727727
}
728728
boolean makeDash;
729729
if (oldOk) {
730-
if (nStroke.getDashArray() != null) {
731-
if (nStroke.getDashPhase() != oStroke.getDashPhase()) {
730+
if (basicStroke.getDashArray() != null) {
731+
if (basicStroke.getDashPhase() != oStroke.getDashPhase()) {
732732
makeDash = true;
733733
} else {
734-
makeDash = !java.util.Arrays.equals(nStroke.getDashArray(), oStroke.getDashArray());
734+
makeDash = !java.util.Arrays.equals(basicStroke.getDashArray(), oStroke.getDashArray());
735735
}
736736
} else {
737737
makeDash = oStroke.getDashArray() != null;
@@ -740,7 +740,7 @@ private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
740740
makeDash = true;
741741
}
742742
if (makeDash) {
743-
float[] dash = nStroke.getDashArray();
743+
float[] dash = basicStroke.getDashArray();
744744
if (dash == null) {
745745
cb.setLiteral("[]0 d\n");
746746
} else {
@@ -751,7 +751,7 @@ private void setStrokeDiff(Stroke newStroke, Stroke oldStroke) {
751751
cb.setLiteral(' ');
752752
}
753753
cb.setLiteral(']');
754-
cb.setLiteral(nStroke.getDashPhase());
754+
cb.setLiteral(basicStroke.getDashPhase());
755755
cb.setLiteral(" d\n");
756756
}
757757
}

0 commit comments

Comments
 (0)