aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-21 22:35:43 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-21 23:00:50 +0200
commit71e022071f6b244422f74580ec3c04179695a3ea (patch)
treea40a03e941f1e30ab3cc1a39e30c3c4f8990f79d /sonar-plugin-api/src
parent44447ed6b69b1497ed60cc4d610742a5d9987873 (diff)
downloadsonarqube-71e022071f6b244422f74580ec3c04179695a3ea.tar.gz
sonarqube-71e022071f6b244422f74580ec3c04179695a3ea.zip
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java11
2 files changed, 6 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java
index 10989371fe3..945f463721e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectDefinition.java
@@ -621,7 +621,7 @@ public class ProjectDefinition {
}
ProjectDefinition that = (ProjectDefinition) o;
String key = getKey();
- return !(key != null ? !key.equals(that.getKey()) : that.getKey() != null);
+ return !((key != null) ? !key.equals(that.getKey()) : (that.getKey() != null));
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
index 1e33ff929e5..86b240416fb 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java
@@ -55,20 +55,19 @@ public final class ZipUtils {
return toDir;
}
+ public static File unzip(InputStream zip, File toDir) throws IOException {
+ unzip(zip, toDir, TrueZipEntryFilter.INSTANCE);
+ return toDir;
+ }
+
private enum TrueZipEntryFilter implements ZipEntryFilter {
INSTANCE;
-
@Override
public boolean accept(ZipEntry entry) {
return true;
}
}
- public static File unzip(InputStream zip, File toDir) throws IOException {
- unzip(zip, toDir, TrueZipEntryFilter.INSTANCE);
- return toDir;
- }
-
public static File unzip(InputStream stream, File toDir, ZipEntryFilter filter) throws IOException {
if (!toDir.exists()) {
FileUtils.forceMkdir(toDir);