From 1885f4b21cb5edc20277a0e0027bfff42978625b Mon Sep 17 00:00:00 2001 From: soloturn Date: Tue, 8 Feb 2022 23:22:48 +0100 Subject: [PATCH] remove exceptions not thrown --- .../plantuml/dedication/TinyHashableString.java | 14 ++++++-------- .../sourceforge/plantuml/eggs/PSystemWelcome.java | 10 +++++----- .../plantuml/eggs/SentenceProducer.java | 12 +++++------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/net/sourceforge/plantuml/dedication/TinyHashableString.java b/src/net/sourceforge/plantuml/dedication/TinyHashableString.java index 3ad0fd359..6b10fc349 100644 --- a/src/net/sourceforge/plantuml/dedication/TinyHashableString.java +++ b/src/net/sourceforge/plantuml/dedication/TinyHashableString.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,15 +30,13 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.dedication; import static java.nio.charset.StandardCharsets.UTF_8; -import java.io.UnsupportedEncodingException; - public final class TinyHashableString { private final String sentence; @@ -48,11 +46,11 @@ public final class TinyHashableString { this.sentence = sentence; } - public final String getSentence() { + public String getSentence() { return sentence; } - public final synchronized int tinyHash() throws UnsupportedEncodingException { + public synchronized int tinyHash() { if (cachedTinyHash == -1) { cachedTinyHash = Noise.shortHash(sentence.getBytes(UTF_8), Dedication.N.toByteArray()); } diff --git a/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java b/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java index 8e3b7e993..91e2663e2 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemWelcome.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemWelcome.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.eggs; @@ -85,7 +85,7 @@ public class PSystemWelcome extends PlainDiagram { return getGraphicStrings(); } - public TextBlockBackcolored getGraphicStrings() throws IOException { + public TextBlockBackcolored getGraphicStrings() { if (position != null) { return GraphicStrings.createBlackOnWhite(strings, PSystemVersion.getPlantumlImage(), position); } diff --git a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java b/src/net/sourceforge/plantuml/eggs/SentenceProducer.java index d40aaf987..75e5d9f03 100644 --- a/src/net/sourceforge/plantuml/eggs/SentenceProducer.java +++ b/src/net/sourceforge/plantuml/eggs/SentenceProducer.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,20 +30,18 @@ * * * Original Author: Arnaud Roques - * + * * */ package net.sourceforge.plantuml.eggs; import static java.nio.charset.StandardCharsets.UTF_8; -import java.io.UnsupportedEncodingException; - public class SentenceProducer { private final String secret; - public SentenceProducer(String sentence1, String sentence2) throws UnsupportedEncodingException { + public SentenceProducer(String sentence1, String sentence2) { final byte[] key = EggUtils.fromSecretSentence(sentence1).toByteArray(); final byte[] sen2 = sentence2.getBytes(UTF_8); final byte[] crypted = EggUtils.xor(sen2, key);