From 789ff2309b16bab3a5c5eb59e763b8c0d35367f5 Mon Sep 17 00:00:00 2001 From: soloturn Date: Tue, 8 Feb 2022 21:34:55 +0100 Subject: [PATCH] <> operator --- .../acearth/PSystemXearthFactory.java | 10 +++---- .../activitydiagram3/MonoSwimable.java | 8 +++--- .../ftile/TextBlockInterceptorUDrawable.java | 11 ++++---- .../ftile/UGraphicInterceptorUDrawable2.java | 9 +++---- .../plantuml/activitydiagram3/ftile/Worm.java | 10 +++---- .../sourceforge/plantuml/board/BArray.java | 8 +++--- src/net/sourceforge/plantuml/bpm/Grid.java | 8 +++--- .../sourceforge/plantuml/core/UmlSource.java | 26 +++++++++---------- .../plantuml/creole/SheetBlock1.java | 14 +++++----- .../plantuml/cucadiagram/Stereostyles.java | 10 +++---- .../plantuml/cucadiagram/TextBlockMap.java | 10 +++---- 11 files changed, 61 insertions(+), 63 deletions(-) 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 670b522ba..db52dbb98 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 { @@ -97,26 +97,26 @@ final public class UmlSource { } public UmlSource(List data, boolean checkEndingBackslash) { - this(data, checkEndingBackslash, new ArrayList()); + this(data, checkEndingBackslash, new ArrayList<>()); } /** * Build the source from a text. - * + * * @param data the source of the diagram * @param checkEndingBackslash true if an ending backslash means * that a line has to be collapsed with the * following one. */ public UmlSource(List data, boolean checkEndingBackslash, List rawSource) { - this(new ArrayList(), rawSource); + this(new ArrayList<>(), rawSource); if (checkEndingBackslash) { final StringBuilder pending = new StringBuilder(); for (StringLocated cs : data) { 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())); @@ -131,7 +131,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() { @@ -140,7 +140,7 @@ final public class UmlSource { /** * Allows to iterator over the source. - * + * * @return a iterator that allow counting line number. */ public IteratorCounter2 iterator2() { @@ -153,7 +153,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() { @@ -203,7 +203,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 04a0ff5c7..52dc738c5 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; @@ -109,9 +109,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 7df289860..e9814307d 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;