diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-07-12 12:45:43 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-07-12 13:18:57 +0400 |
commit | ab6af5363626a14f9cdba7ded99125075a317881 (patch) | |
tree | 249ee2d2fe2bb9cccaa81d7458a74e5446a4ffef /sonar-plugin-api | |
parent | 43da0ad5489f38cfbde2b1728fd791c4528f1ab7 (diff) | |
download | sonarqube-ab6af5363626a14f9cdba7ded99125075a317881.tar.gz sonarqube-ab6af5363626a14f9cdba7ded99125075a317881.zip |
SONAR-2604 Default value for properties "sonar.java.source" and "sonar.java.target" should be "1.5"
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectUtils.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectUtils.java index bf89e3f8d6a..a88932b6ae3 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ProjectUtils.java @@ -20,6 +20,7 @@ package org.sonar.api.resources; import com.google.common.collect.Lists; +import org.apache.commons.lang.StringUtils; import java.util.Collection; import java.util.List; @@ -41,10 +42,8 @@ public final class ProjectUtils { */ @Deprecated public static String getJavaVersion(Project project) { - if (project.getConfiguration() != null) { - return project.getConfiguration().getString("sonar.java.target"); - } - return null; + String version = project.getConfiguration() != null ? project.getConfiguration().getString("sonar.java.target") : null; + return StringUtils.isNotBlank(version) ? version : "1.5"; } /** @@ -52,10 +51,8 @@ public final class ProjectUtils { */ @Deprecated public static String getJavaSourceVersion(Project project) { - if (project.getConfiguration() != null) { - return project.getConfiguration().getString("sonar.java.source"); - } - return null; + String version = project.getConfiguration() != null ? project.getConfiguration().getString("sonar.java.source") : null; + return StringUtils.isNotBlank(version) ? version : "1.5"; } /** |