diff --git a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java index d9842e832..0e3979353 100644 --- a/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.java +++ b/src/net/sourceforge/plantuml/acearth/PSystemXearthFactory.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.acearth; @@ -50,7 +50,7 @@ import net.sourceforge.plantuml.core.UmlSource; public class PSystemXearthFactory extends PSystemBasicFactory { - private final Map config = new LinkedHashMap(); + private final Map config = new LinkedHashMap<>(); private final List markers = new ArrayList<>(); private int width; private int height; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java b/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java index a14a24d5f..1de8f4634 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/MonoSwimable.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 @@ -50,7 +50,7 @@ abstract class MonoSwimable extends WithNote implements Swimable { } final public Set getSwimlanes() { - return swimlane == null ? Collections.emptySet() : Collections.singleton(swimlane); + return swimlane == null ? Collections.emptySet() : Collections.singleton(swimlane); } final public Swimlane getSwimlaneIn() { diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java index a67b60ceb..3f7776823 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/TextBlockInterceptorUDrawable.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.activitydiagram3.ftile; @@ -42,7 +42,6 @@ import net.sourceforge.plantuml.graphic.AbstractTextBlock; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UTranslate; public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements TextBlock { @@ -53,7 +52,7 @@ public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements } public void drawU(UGraphic ug) { - new UGraphicInterceptorUDrawable2(ug, new HashMap()).draw(textBlock); + new UGraphicInterceptorUDrawable2(ug, new HashMap<>()).draw(textBlock); ug.flushUg(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java index bf785bba7..90a7bc94d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/UGraphicInterceptorUDrawable2.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.activitydiagram3.ftile; @@ -38,7 +38,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile; import java.awt.geom.Point2D; import java.util.Map; -import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection; import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile; import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UGraphicDelegator; diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java index 01d2bb292..fd59374b7 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.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 @@ -62,7 +62,7 @@ import net.sourceforge.plantuml.ugraphic.comp.CompressionMode; public class Worm implements Iterable { - private final List points = new ArrayList(); + private final List points = new ArrayList<>(); private final Style style; public Worm(Style style) { @@ -230,7 +230,7 @@ public class Worm implements Iterable { public String toString() { final StringBuilder result = new StringBuilder(); for (int i = 0; i < points.size() - 1; i++) - result.append(getDirectionAtPoint(i) + " "); + result.append(getDirectionAtPoint(i)).append(" "); return result + points.toString(); } diff --git a/src/net/sourceforge/plantuml/board/BArray.java b/src/net/sourceforge/plantuml/board/BArray.java index 44834e8ab..320bdc2a1 100644 --- a/src/net/sourceforge/plantuml/board/BArray.java +++ b/src/net/sourceforge/plantuml/board/BArray.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 @@ -42,7 +42,7 @@ import java.util.Map; public class BArray implements Iterable { - private final Map data = new HashMap(); + private final Map data = new HashMap<>(); private int maxX; private int maxY; diff --git a/src/net/sourceforge/plantuml/bpm/Grid.java b/src/net/sourceforge/plantuml/bpm/Grid.java index b52f0c703..dcfcf7d5b 100644 --- a/src/net/sourceforge/plantuml/bpm/Grid.java +++ b/src/net/sourceforge/plantuml/bpm/Grid.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 @@ -311,7 +311,7 @@ public class Grid { // } public void addConnections() { - for (Map.Entry ent : new HashMap(cells).entrySet()) { + for (Map.Entry ent : new HashMap<>(cells).entrySet()) { final List dests2 = ent.getValue().getDestinations2(); final Coord src = ent.getKey(); for (int i = 0; i < dests2.size(); i++) { diff --git a/src/net/sourceforge/plantuml/core/UmlSource.java b/src/net/sourceforge/plantuml/core/UmlSource.java index f26b1c7f0..7c4a883ed 100755 --- a/src/net/sourceforge/plantuml/core/UmlSource.java +++ b/src/net/sourceforge/plantuml/core/UmlSource.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 @@ -57,9 +57,9 @@ import net.sourceforge.plantuml.version.IteratorCounter2Impl; * @startfoo and end with @endfoo. *

* So the diagram does not have to be a UML one. - * + * * @author Arnaud Roques - * + * */ final public class UmlSource { @@ -96,7 +96,7 @@ final public class UmlSource { } public static UmlSource create(List source, boolean checkEndingBackslash) { - return createWithRaw(source, checkEndingBackslash, new ArrayList()); + return createWithRaw(source, checkEndingBackslash, new ArrayList<>()); } /** @@ -120,7 +120,7 @@ final public class UmlSource { for (StringLocated cs : source) { final String s = cs.getString(); if (StringUtils.endsWithBackslash(s)) { - pending.append(s.substring(0, s.length() - 1)); + pending.append(s, 0, s.length() - 1); } else { pending.append(s); this.source.add(new StringLocated(pending.toString(), cs.getLocation())); @@ -135,7 +135,7 @@ final public class UmlSource { /** * Retrieve the type of the diagram. This is based on the first line * @startfoo. - * + * * @return the type of the diagram. */ public DiagramType getDiagramType() { @@ -144,7 +144,7 @@ final public class UmlSource { /** * Allows to iterator over the source. - * + * * @return a iterator that allow counting line number. */ public IteratorCounter2 iterator2() { @@ -157,7 +157,7 @@ final public class UmlSource { /** * Return the source as a single String with \n as line separator. - * + * * @return the whole diagram source */ public String getPlainString() { @@ -206,7 +206,7 @@ final public class UmlSource { /** * Check if a source diagram description is empty. Does not take comment line * into account. - * + * * @return true if the diagram does not contain information. */ public boolean isEmpty() { diff --git a/src/net/sourceforge/plantuml/creole/SheetBlock1.java b/src/net/sourceforge/plantuml/creole/SheetBlock1.java index f6daf7e40..032f37ef3 100644 --- a/src/net/sourceforge/plantuml/creole/SheetBlock1.java +++ b/src/net/sourceforge/plantuml/creole/SheetBlock1.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.creole; @@ -111,9 +111,9 @@ public class SheetBlock1 extends AbstractTextBlock implements TextBlock, Atom, S for (Stripe stripe : sheet) { stripes.addAll(new Fission(stripe, maxWidth).getSplitted(stringBounder)); } - positions = new LinkedHashMap(); - widths = new LinkedHashMap(); - heights = new LinkedHashMap(); + positions = new LinkedHashMap<>(); + widths = new LinkedHashMap<>(); + heights = new LinkedHashMap<>(); minMax = MinMax.getEmpty(true); double y = 0; for (Stripe stripe : stripes) { diff --git a/src/net/sourceforge/plantuml/cucadiagram/Stereostyles.java b/src/net/sourceforge/plantuml/cucadiagram/Stereostyles.java index 2cc05d58f..4da6fd1e9 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/Stereostyles.java +++ b/src/net/sourceforge/plantuml/cucadiagram/Stereostyles.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.cucadiagram; @@ -48,7 +48,7 @@ public class Stereostyles { public static final Stereostyles NONE = new Stereostyles(); - private final Set names = new LinkedHashSet(); + private final Set names = new LinkedHashSet<>(); private Stereostyles() { } diff --git a/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java b/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java index 9dc659273..16b44ad4a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java +++ b/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.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.cucadiagram; @@ -65,7 +65,7 @@ public class TextBlockMap extends AbstractTextBlock implements WithPorts { private final FontParam fontParam; private final ISkinParam skinParam; private final FontConfiguration fontConfiguration; - private final Map blocksMap = new LinkedHashMap(); + private final Map blocksMap = new LinkedHashMap<>(); private final List keys = new ArrayList<>(); private double totalWidth;