Ref: add new static analyser rule: category/java/bestpractices.xml/LiteralsFirstInComparisons

This commit is contained in:
Laurent Clouet
2024-06-07 14:35:47 +00:00
parent 824dfe4ef6
commit 0a7f1f9f1b
14 changed files with 29 additions and 28 deletions

View File

@@ -278,7 +278,7 @@ import lombok.Data;
try {
String extension = file.getName().substring(file.getName().lastIndexOf('.')).toLowerCase();
String name = file.getName().substring(0, file.getName().length() - 1 * extension.length());
if (extension.equals(".zip") || extension.equals(".wool")) {
if (".zip".equals(extension) || ".wool".equals(extension)) {
// check if the md5 of the file is ok
String md5_local = Utils.md5(file.getAbsolutePath());
@@ -344,7 +344,7 @@ import lombok.Data;
try {
String extension = file.getName().substring(file.getName().lastIndexOf('.')).toLowerCase();
String name = file.getName().substring(0, file.getName().length() - 1 * extension.length());
if (extension.equals(".zip") || extension.equals(".wool")) {
if (".zip".equals(extension) || ".wool".equals(extension)) {
// check if the md5 of the file is ok
String md5_local = Utils.md5(file.getAbsolutePath());