From dd5c6a9d606bcf9a6c3b7df612f5632cb9f4fc87 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 23 Feb 2015 09:10:11 +0100 Subject: [PATCH] Fix some quality flaws --- .../java/org/sonar/api/batch/fs/internal/DefaultInputDir.java | 2 +- .../java/org/sonar/api/batch/fs/internal/DefaultInputFile.java | 3 ++- .../src/main/java/org/sonar/api/config/Category.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputDir.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputDir.java index 88db382750f..ac48ea2b3b0 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputDir.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputDir.java @@ -83,7 +83,7 @@ public class DefaultInputDir implements InputDir { if (this == o) { return true; } - if (!(o instanceof DefaultInputDir)) { + if (!(this.getClass() == o.getClass())) { return false; } 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 69731c41492..b9cbedf6789 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 @@ -158,7 +158,8 @@ public class DefaultInputFile implements InputFile { if (this == o) { return true; } - if (!(o instanceof DefaultInputFile)) { + + if (!(this.getClass() == o.getClass())) { return false; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java index 114abe3fd27..690b2c99181 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java @@ -59,7 +59,7 @@ public class Category { @Override public boolean equals(Object obj) { - if (!(obj instanceof Category)) { + if (!(this.getClass() == obj.getClass())) { return false; } return StringUtils.equalsIgnoreCase(((Category) obj).originalKey, this.originalKey); -- 2.39.5