Skip to content

Commit

Permalink
add back violations.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Feb 12, 2023
1 parent 88ab15c commit 9992b40
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@
<version>2.5.0</version>
<configuration>
<violationsFiles>
<violationsFile>${project.parent.basedir}/.mvn/modernizer/violations.xml</violationsFile>
<violationsFile>${maven.multiModuleProjectDirectory}/src/violations.xml</violationsFile>
</violationsFiles>
</configuration>
</plugin>
Expand Down
63 changes: 63 additions & 0 deletions src/violations.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<modernizer>
<violation>
<name>java/lang/Class.newInstance:()Ljava/lang/Object;</name>
<version>1.1</version>
<comment>Prefer Class.getConstructor().newInstance()</comment>
</violation>

<violation>
<name>java/lang/String."&lt;init&gt;":([B)V</name>
<version>1.1</version>
<comment>Prefer new String(byte[], Charset)</comment>
</violation>

<violation>
<name>java/lang/String.getBytes:()[B</name>
<version>1.1</version>
<comment>Prefer String.getBytes(Charset)</comment>
</violation>

<violation>
<!-- File.getPath() is the canonical way to convert File to its String representation suitable for passing to new File() -->
<name>java/io/File.toString:()Ljava/lang/String;</name>
<version>1.1</version>
<comment>Prefer File.getPath()</comment>
</violation>

<violation>
<name>org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;)V</name>
<version>1.8</version>
<comment>Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
</violation>

<violation>
<name>org/testng/Assert.assertEquals:(Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/String;)V</name>
<version>1.8</version>
<comment>Use io.trino.testing.assertions.Assert.assertEquals due to TestNG #543</comment>
</violation>

<violation>
<name>org/testng/Assert.assertThrows:(Lorg/testng/Assert$ThrowingRunnable;)V</name>
<version>1.8</version>
<comment>Use AssertJ's assertThatThrownBy, see https://github.com/trinodb/trino/issues/5320 for rationale</comment>
</violation>

<violation>
<name>org/testng/Assert.assertThrows:(Ljava/lang/Class;Lorg/testng/Assert$ThrowingRunnable;)V</name>
<version>1.8</version>
<comment>Use AssertJ's assertThatThrownBy, see https://github.com/trinodb/trino/issues/5320 for rationale</comment>
</violation>

<violation>
<name>java/util/TimeZone.getTimeZone:(Ljava/lang/String;)Ljava/util/TimeZone;</name>
<version>1.8</version>
<comment>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).</comment>
</violation>

<violation>
<name>org/joda/time/DateTimeZone.toTimeZone:()Ljava/util/TimeZone;</name>
<version>1.8</version>
<comment>Avoid DateTimeZone.toTimeZone as it returns GMT for a zone not supported by the JVM. Use TimeZone.getTimeZone(ZoneId.of(dtz.getId())) instead.</comment>
</violation>
</modernizer>

0 comments on commit 9992b40

Please sign in to comment.