From 9992b405480e9d44d6a40c2e0e9af8770e7801a7 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sun, 12 Feb 2023 18:31:29 +0800 Subject: [PATCH] add back `violations.xml` --- pom.xml | 2 +- src/violations.xml | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/violations.xml diff --git a/pom.xml b/pom.xml index f3335af1d..a13b25be0 100644 --- a/pom.xml +++ b/pom.xml @@ -622,7 +622,7 @@ 2.5.0 - ${project.parent.basedir}/.mvn/modernizer/violations.xml + ${maven.multiModuleProjectDirectory}/src/violations.xml diff --git a/src/violations.xml b/src/violations.xml new file mode 100644 index 000000000..54ec65c81 --- /dev/null +++ b/src/violations.xml @@ -0,0 +1,63 @@ + + + + java/lang/Class.newInstance:()Ljava/lang/Object; + 1.1 + Prefer Class.getConstructor().newInstance() + + + + java/lang/String."<init>":([B)V + 1.1 + Prefer new String(byte[], Charset) + + + + java/lang/String.getBytes:()[B + 1.1 + Prefer String.getBytes(Charset) + + + + + java/io/File.toString:()Ljava/lang/String; + 1.1 + Prefer File.getPath() + + + + org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;)V + 1.8 + Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543 + + + + org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/String;)V + 1.8 + Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543 + + + + org/testng/Assert.assertThrows:(Lorg/testng/Assert$ThrowingRunnable;)V + 1.8 + Use AssertJ's assertThatThrownBy, see https://github.com/trinodb/trino/issues/5320 for rationale + + + + org/testng/Assert.assertThrows:(Ljava/lang/Class;Lorg/testng/Assert$ThrowingRunnable;)V + 1.8 + Use AssertJ's assertThatThrownBy, see https://github.com/trinodb/trino/issues/5320 for rationale + + + + java/util/TimeZone.getTimeZone:(Ljava/lang/String;)Ljava/util/TimeZone; + 1.8 + Avoid TimeZone.getTimeZone as it returns GMT for a zone not supported by the JVM. Use TimeZone.getTimeZone(ZoneId.of(..)) instead, or TimeZone.getTimeZone(..., false). + + + + org/joda/time/DateTimeZone.toTimeZone:()Ljava/util/TimeZone; + 1.8 + Avoid DateTimeZone.toTimeZone as it returns GMT for a zone not supported by the JVM. Use TimeZone.getTimeZone(ZoneId.of(dtz.getId())) instead. + +