From d1daf527473c7c8fe5208dbcee3f2543ecb297eb Mon Sep 17 00:00:00 2001 From: Andrei Solntsev Date: Sat, 2 Nov 2024 17:13:15 +0200 Subject: [PATCH] fix warning "Duplicate branches in 'switch'" --- .../src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flying-saucer-swt/src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java b/flying-saucer-swt/src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java index d4fd0da4c..79fe6d98b 100644 --- a/flying-saucer-swt/src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java +++ b/flying-saucer-swt/src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java @@ -299,7 +299,7 @@ public void setStroke(Stroke s) { case BasicStroke.CAP_BUTT -> SWT.CAP_FLAT; case BasicStroke.CAP_ROUND -> SWT.CAP_ROUND; case BasicStroke.CAP_SQUARE -> SWT.CAP_SQUARE; - default -> SWT.CAP_SQUARE; + default -> throw new IllegalArgumentException("Unsupported CAP value: " + bs.getEndCap()); }; _gc.setLineCap(gcCap); @@ -308,7 +308,7 @@ public void setStroke(Stroke s) { case BasicStroke.JOIN_BEVEL -> SWT.JOIN_BEVEL; case BasicStroke.JOIN_MITER -> SWT.JOIN_MITER; case BasicStroke.JOIN_ROUND -> SWT.JOIN_ROUND; - default -> SWT.JOIN_MITER; + default -> throw new IllegalArgumentException("Unsupported line join: " + bs.getLineJoin()); }; _gc.setLineJoin(gcJoin);