aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-02-01 18:15:45 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2014-02-01 22:54:25 +0100
commit8ee22cbabf8142c29b510bc82bfb726b3b215520 (patch)
tree485852bc1a62f3391b5959c9ebcb1d4e20e04eab /sonar-deprecated
parentfdc48661ae475a51fed88f53e2c744629e07d08b (diff)
downloadsonarqube-8ee22cbabf8142c29b510bc82bfb726b3b215520.tar.gz
sonarqube-8ee22cbabf8142c29b510bc82bfb726b3b215520.zip
Fix some quality flaws
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/resources/ProjectUtils.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/resources/ProjectUtils.java b/sonar-deprecated/src/main/java/org/sonar/api/resources/ProjectUtils.java
new file mode 100644
index 00000000000..7540d7ddb2f
--- /dev/null
+++ b/sonar-deprecated/src/main/java/org/sonar/api/resources/ProjectUtils.java
@@ -0,0 +1,69 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * SonarQube is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+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;
+
+/**
+ * @since 1.10
+ * @deprecated see method comments
+ */
+@Deprecated
+public final class ProjectUtils {
+
+ private ProjectUtils() {
+ // utility class with only static methods
+ }
+
+ /**
+ * @deprecated since 2.6 use JavaUtils.getTargetVersion() instead.
+ */
+ @Deprecated
+ public static String getJavaVersion(Project project) {
+ String version = project.getConfiguration() != null ? project.getConfiguration().getString("sonar.java.target") : null;
+ return StringUtils.isNotBlank(version) ? version : "1.5";
+ }
+
+ /**
+ * @deprecated since 2.6 use JavaUtils.getSourceVersion() instead.
+ */
+ @Deprecated
+ public static String getJavaSourceVersion(Project project) {
+ String version = project.getConfiguration() != null ? project.getConfiguration().getString("sonar.java.source") : null;
+ return StringUtils.isNotBlank(version) ? version : "1.5";
+ }
+
+ /**
+ * @since 2.7
+ * @deprecated in 4.2. Replaced by org.sonar.api.resources.InputFileUtils#toFiles()
+ */
+ @Deprecated
+ public static List<java.io.File> toIoFiles(Collection<InputFile> inputFiles) {
+ List<java.io.File> files = Lists.newArrayList();
+ for (InputFile inputFile : inputFiles) {
+ files.add(inputFile.getFile());
+ }
+ return files;
+ }
+}