From 8e7c39ebac365e4256adecefbb600f055a2660c1 Mon Sep 17 00:00:00 2001 From: soloturn Date: Tue, 8 Feb 2022 23:26:55 +0100 Subject: [PATCH] clazz.newInstance deprecated with java17, PsystemDedication --- .../plantuml/dedication/PSystemDedication.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java index b7ad6cbe9..9c6daebdd 100644 --- a/src/net/sourceforge/plantuml/dedication/PSystemDedication.java +++ b/src/net/sourceforge/plantuml/dedication/PSystemDedication.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2023, Arnaud Roques * * Project Info: http://plantuml.com - * + * * If you like this project or if you find it useful, you can support us at: - * + * * http://plantuml.com/patreon (only 1$ per month!) * http://plantuml.com/paypal - * + * * This file is part of PlantUML. * * PlantUML is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.dedication; @@ -50,7 +50,6 @@ import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.PixelImage; -import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UImage; public class PSystemDedication extends PlainDiagram { @@ -64,17 +63,13 @@ public class PSystemDedication extends PlainDiagram { @Override protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) { - return new UDrawable() { - public void drawU(UGraphic ug) { - ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); - } - }; + return ug -> ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); } public static BufferedImage getBufferedImage(InputStream is) { try { final Class clVP8Decoder = Class.forName("net.sourceforge.plantuml.webp.VP8Decoder"); - final Object vp8Decoder = clVP8Decoder.newInstance(); + final Object vp8Decoder = clVP8Decoder.getDeclaredConstructor().newInstance(); // final VP8Decoder vp8Decoder = new VP8Decoder(); final Method decodeFrame = clVP8Decoder.getMethod("decodeFrame", ImageInputStream.class); final ImageInputStream iis = SImageIO.createImageInputStream(is);