From 522564f8128cdb4e9174994e2a3fb8f649306792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georg=20Gra=C3=9Fnick?= <georg.grassnick@mailbox.tu-dresden.de> Date: Thu, 22 Aug 2019 15:02:58 +0200 Subject: [PATCH] Explain unsafe cast safety --- .../inf/mci/brailleplot/svgexporter/AbstractSvgExporter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/tudresden/inf/mci/brailleplot/svgexporter/AbstractSvgExporter.java b/src/main/java/de/tudresden/inf/mci/brailleplot/svgexporter/AbstractSvgExporter.java index bdcfc8d5..ed9e16d9 100644 --- a/src/main/java/de/tudresden/inf/mci/brailleplot/svgexporter/AbstractSvgExporter.java +++ b/src/main/java/de/tudresden/inf/mci/brailleplot/svgexporter/AbstractSvgExporter.java @@ -41,6 +41,8 @@ abstract class AbstractSvgExporter<T extends AbstractCanvas, U extends Printable } @Override + // As long as the implementing class uses the correct generic type, + // the cast for the first parameter of renderPage() is safe. @SuppressWarnings("unchecked") public void render() { final int docWidth = (int) Math.ceil(mCanvas.getPageWidth()); -- GitLab