diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-23 09:55:37 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-23 10:12:09 +0100 |
commit | 18241ecfcac41c79414c83f359aa4c5aab24c56d (patch) | |
tree | abc85120d61d172295617ba5c04d4b5ec0d891f1 | |
parent | 6268463090776ec564f58bfd3f4f6f5f13f1b1ba (diff) | |
download | sonarqube-18241ecfcac41c79414c83f359aa4c5aab24c56d.tar.gz sonarqube-18241ecfcac41c79414c83f359aa4c5aab24c56d.zip |
Fix some quality flaws
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java | 3 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java index b9cbedf6789..a24060a5df1 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java @@ -159,7 +159,8 @@ public class DefaultInputFile implements InputFile { return true; } - if (!(this.getClass() == o.getClass())) { + // Use instanceof to support DeprecatedDefaultInputFile + if (!(o instanceof DefaultInputFile)) { return false; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java index c1b53b68a40..93d865d1711 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java @@ -66,7 +66,7 @@ public abstract class PathPattern { public boolean match(InputFile inputFile, boolean caseSensitiveFileExtension) { String path = inputFile.absolutePath(); if (!caseSensitiveFileExtension) { - String extension = sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName())); + String extension = super.sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName())); if (StringUtils.isNotBlank(extension)) { path = StringUtils.removeEndIgnoreCase(path, extension); path = path + extension; @@ -98,7 +98,7 @@ public abstract class PathPattern { public boolean match(InputFile inputFile, boolean caseSensitiveFileExtension) { String path = inputFile.relativePath(); if (!caseSensitiveFileExtension) { - String extension = sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName())); + String extension = super.sanitizeExtension(FilenameUtils.getExtension(inputFile.file().getName())); if (StringUtils.isNotBlank(extension)) { path = StringUtils.removeEndIgnoreCase(path, extension); path = path + extension; |