From 21ae6a09b7d5972ffffe3f77b8339592900c4a7f Mon Sep 17 00:00:00 2001 From: PlantUML Date: Thu, 3 Feb 2022 10:37:29 +0100 Subject: [PATCH] Revert "improve java17, intellij compatibility" --- build.gradle.kts | 15 +++++--- .../plantuml/emoji/data/.editorconfig | 5 +-- .../plantuml/openiconic/data/.editorconfig | 5 +-- .../sourceforge/plantuml/posimo/DotPath.java | 36 +++++++++---------- src/smetana/core/CArray.java | 18 +++++----- src/smetana/core/CString.java | 28 +++++++-------- src/smetana/core/debug/Purify.java | 16 ++++----- 7 files changed, 62 insertions(+), 61 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f67ed9728..d93c4ef3b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,7 +28,14 @@ java { sourceSets { main { java { - srcDirs("src") + srcDirs("src/ext") + srcDirs("src/gen") + srcDirs("src/h") + srcDirs("src/jcckit") + srcDirs("src/net") + srcDirs("src/org") + srcDirs("src/smetana") + srcDirs("src/sprites") } resources { srcDirs("src") @@ -40,7 +47,8 @@ sourceSets { } test { java { - srcDirs("test") + srcDirs("test/net") + srcDirs("test/nonreg") } resources { srcDirs(".") @@ -63,9 +71,8 @@ tasks.withType { configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) } }) - // source sets for java and resources are on "src", only put once into the jar - duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.EXCLUDE from("skin") { into("skin") } + from("sprites/archimate") { into("sprites/archimate") } from("stdlib") { into("stdlib") } from("svg") { into("svg") } from("themes") { into("themes") } diff --git a/src/net/sourceforge/plantuml/emoji/data/.editorconfig b/src/net/sourceforge/plantuml/emoji/data/.editorconfig index 05f5c11ad..a418c5fea 100644 --- a/src/net/sourceforge/plantuml/emoji/data/.editorconfig +++ b/src/net/sourceforge/plantuml/emoji/data/.editorconfig @@ -1,6 +1,3 @@ # Editor configuration, see http://editorconfig.org root = true - -[*] -# no reformat with intellij -ij_formatter_enabled = false +# no reformat diff --git a/src/net/sourceforge/plantuml/openiconic/data/.editorconfig b/src/net/sourceforge/plantuml/openiconic/data/.editorconfig index 05f5c11ad..a418c5fea 100644 --- a/src/net/sourceforge/plantuml/openiconic/data/.editorconfig +++ b/src/net/sourceforge/plantuml/openiconic/data/.editorconfig @@ -1,6 +1,3 @@ # Editor configuration, see http://editorconfig.org root = true - -[*] -# no reformat with intellij -ij_formatter_enabled = false +# no reformat diff --git a/src/net/sourceforge/plantuml/posimo/DotPath.java b/src/net/sourceforge/plantuml/posimo/DotPath.java index d710d2007..3572716f8 100644 --- a/src/net/sourceforge/plantuml/posimo/DotPath.java +++ b/src/net/sourceforge/plantuml/posimo/DotPath.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 @@ -32,7 +32,7 @@ * Original Author: Arnaud Roques * Contribution: Miguel Esteves * - * + * */ package net.sourceforge.plantuml.posimo; @@ -92,16 +92,16 @@ public class DotPath implements UShape, Moveable { // } } - private final List beziers = new ArrayList<>(); + private final List beziers = new ArrayList(); private String comment; private String codeLine; public DotPath() { - this(new ArrayList<>()); + this(new ArrayList()); } public DotPath(DotPath other) { - this(new ArrayList<>()); + this(new ArrayList()); for (CubicCurve2D.Double c : other.beziers) { this.beziers.add(new CubicCurve2D.Double(c.x1, c.y1, c.ctrlx1, c.ctrly1, c.ctrlx2, c.ctrly2, c.x2, c.y2)); } @@ -112,7 +112,7 @@ public class DotPath implements UShape, Moveable { } public DotPath addCurve(Point2D pt1, Point2D pt2, Point2D pt3, Point2D pt4) { - final List beziersNew = new ArrayList<>(beziers); + final List beziersNew = new ArrayList(beziers); beziersNew.add(new CubicCurve2D.Double(pt1.getX(), pt1.getY(), pt2.getX(), pt2.getY(), pt3.getX(), pt3.getY(), pt4.getX(), pt4.getY())); return new DotPath(beziersNew); @@ -337,31 +337,31 @@ public class DotPath implements UShape, Moveable { } public DotPath addBefore(CubicCurve2D.Double before) { - final List copy = new ArrayList<>(beziers); + final List copy = new ArrayList(beziers); copy.add(0, before); return new DotPath(copy); } private DotPath addBefore(DotPath other) { - final List copy = new ArrayList<>(beziers); + final List copy = new ArrayList(beziers); copy.addAll(0, other.beziers); return new DotPath(copy); } public DotPath addAfter(CubicCurve2D.Double after) { - final List copy = new ArrayList<>(beziers); + final List copy = new ArrayList(beziers); copy.add(after); return new DotPath(copy); } public DotPath addAfter(DotPath other) { - final List copy = new ArrayList<>(beziers); + final List copy = new ArrayList(beziers); copy.addAll(other.beziers); return new DotPath(copy); } public Map somePoints() { - final Map result = new HashMap<>(); + final Map result = new HashMap(); for (CubicCurve2D.Double bez : beziers) { final CubicCurve2D.Double left = new CubicCurve2D.Double(); final CubicCurve2D.Double right = new CubicCurve2D.Double(); @@ -443,7 +443,7 @@ public class DotPath implements UShape, Moveable { } private Point2D getFrontierIntersection(Shape shape, Rectangle2D... notIn) { - final List all = new ArrayList<>(beziers); + final List all = new ArrayList(beziers); for (int i = 0; i < 8; i++) { for (CubicCurve2D.Double immutable : all) { if (contains(immutable, notIn)) { @@ -467,7 +467,7 @@ public class DotPath implements UShape, Moveable { } private void cutAllCubic(List all) { - final List tmp = new ArrayList<>(all); + final List tmp = new ArrayList(all); all.clear(); for (CubicCurve2D.Double bez : tmp) { final CubicCurve2D.Double left = new CubicCurve2D.Double(); @@ -497,7 +497,7 @@ public class DotPath implements UShape, Moveable { } private DotPath manageRect(Rectangle2D start, Rectangle2D end) { - final List list = new ArrayList<>(this.beziers); + final List list = new ArrayList(this.beziers); while (true) { if (BezierUtils.isCutting(list.get(0), start) == false) { throw new IllegalStateException(); @@ -557,9 +557,9 @@ public class DotPath implements UShape, Moveable { } public DotPath reverse() { - final List reverse = new ArrayList<>(beziers); + final List reverse = new ArrayList(beziers); Collections.reverse(reverse); - final List copy = new ArrayList<>(); + final List copy = new ArrayList(); for (CubicCurve2D.Double cub : reverse) { copy.add(reverse(cub)); } diff --git a/src/smetana/core/CArray.java b/src/smetana/core/CArray.java index 1a6f3f51b..425a0ed2a 100644 --- a/src/smetana/core/CArray.java +++ b/src/smetana/core/CArray.java @@ -3,29 +3,29 @@ * ======================================================================== * * 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 Smetana. * Smetana is a partial translation of Graphviz/Dot sources from C to Java. * * (C) Copyright 2009-2020, Arnaud Roques * * This translation is distributed under the same Licence as the original C program. - * + * * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] - * + * * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - * + * * You may obtain a copy of the License at - * + * * http://www.eclipse.org/legal/epl-v10.html - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +94,7 @@ public class CArray extends UnsupportedC { } try { for (int i = 0; i < size; i++) { - data.add(cl.getDeclaredConstructor().newInstance()); + data.add((O) cl.newInstance()); } } catch (Exception e) { e.printStackTrace(); diff --git a/src/smetana/core/CString.java b/src/smetana/core/CString.java index 613428f69..f7f45cb52 100644 --- a/src/smetana/core/CString.java +++ b/src/smetana/core/CString.java @@ -3,29 +3,29 @@ * ======================================================================== * * 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 Smetana. * Smetana is a partial translation of Graphviz/Dot sources from C to Java. * * (C) Copyright 2009-2020, Arnaud Roques * * This translation is distributed under the same Licence as the original C program. - * + * * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0] - * + * * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - * + * * You may obtain a copy of the License at - * + * * http://www.eclipse.org/legal/epl-v10.html - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,7 +60,7 @@ public class CString extends UnsupportedC implements __ptr__ { } public CString(String string) { - this(new ArrayList<>(), 0); + this(new ArrayList(), 0); for (int i = 0; i < string.length(); i++) { data2.add(string.charAt(i)); } @@ -70,7 +70,7 @@ public class CString extends UnsupportedC implements __ptr__ { public CString duplicate() { // return this; - return new CString(new ArrayList<>(this.data2), currentStart); + return new CString(new ArrayList(this.data2), currentStart); // final CString result = new CString(this.data.size()); // for (int i = 0; i < result.data.size(); i++) { @@ -82,14 +82,14 @@ public class CString extends UnsupportedC implements __ptr__ { public CString strdup() { return duplicate(); } - + public static CString gmalloc(int nbytes) { return new CString(nbytes); } public CString(int size) { - this(new ArrayList<>(), 0); + this(new ArrayList(), 0); for (int i = 0; i < size; i++) { data2.add('\0'); } @@ -131,7 +131,7 @@ public class CString extends UnsupportedC implements __ptr__ { public CString plus_(int pointerMove) { return new CString(data2, currentStart + pointerMove); } - + public int comparePointer(__ptr__ other) { final CString this2 = (CString) other; if (this.data2 != this2.data2) { @@ -225,7 +225,7 @@ public class CString extends UnsupportedC implements __ptr__ { public CString strchr(char c) { for (int i = currentStart; i < data2.size(); i++) { - if (data2.get(i) == c) { + if (data2.get(i).charValue() == c) { return new CString(data2, i); } } diff --git a/src/smetana/core/debug/Purify.java b/src/smetana/core/debug/Purify.java index c5a1a491f..2703624be 100644 --- a/src/smetana/core/debug/Purify.java +++ b/src/smetana/core/debug/Purify.java @@ -5,12 +5,12 @@ * (C) Copyright 2009-2020, 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 smetana.core.debug; @@ -51,7 +51,7 @@ import gen.annotation.Reviewed; public class Purify { - private final Map methods = new LinkedHashMap<>(); + private final Map methods = new LinkedHashMap(); private final File out2 = new File("../out-smetana", "smetana.txt"); private PrintWriter pw2; private int currentLevel; @@ -161,7 +161,7 @@ public class Purify { } public void printMe() { - final List> reverse = new ArrayList<>(methods.entrySet()); + final List> reverse = new ArrayList>(methods.entrySet()); Collections.reverse(reverse); for (Entry ent : reverse) { final String signature = ent.getKey(); @@ -170,8 +170,8 @@ public class Purify { final String version = getVersion(m); final String path = getPath(m); final String hasND_Rank = hasND_Rank(m) ? "*" : " "; - System.err.printf("%-8s %-26s %-12s %s %-30s %s%n", version, signature, reviewedWhen, - hasND_Rank, m.getName(), path); + System.err.println(String.format("%-8s %-26s %-12s %s %-30s %s", version, signature, reviewedWhen, + hasND_Rank, m.getName(), path)); } }