aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/colorizers/JavaColorizerFormat.java7
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java3
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java3
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/resources/Java.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java)0
-rw-r--r--sonar-deprecated/src/test/java/org/sonar/api/resources/JavaTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaTest.java)0
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java6
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java9
10 files changed, 20 insertions, 14 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/colorizers/JavaColorizerFormat.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/colorizers/JavaColorizerFormat.java
index 86e1bc729a8..302d7ad9ce3 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/colorizers/JavaColorizerFormat.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/colorizers/JavaColorizerFormat.java
@@ -19,17 +19,16 @@
*/
package org.sonar.plugins.core.colorizers;
-import java.util.List;
-
-import org.sonar.api.resources.Java;
import org.sonar.api.web.CodeColorizerFormat;
import org.sonar.colorizer.CodeColorizer;
import org.sonar.colorizer.Tokenizer;
+import java.util.List;
+
public class JavaColorizerFormat extends CodeColorizerFormat{
public JavaColorizerFormat() {
- super(Java.KEY);
+ super("java");
}
@Override
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
index d463d8cf314..fb1443dbaa3 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
@@ -36,7 +36,6 @@ import org.sonar.api.config.Settings;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.PersistenceMode;
-import org.sonar.api.resources.Java;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.SonarException;
import org.sonar.duplications.block.Block;
@@ -87,7 +86,7 @@ public class SonarEngine extends CpdEngine {
@Override
public boolean isLanguageSupported(String language) {
- return Java.KEY.equals(language);
+ return "java".equals(language);
}
@Override
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java b/sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java
index 334b9c1f98c..c113b5edbdf 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/ResourceKeyMigration.java
@@ -109,7 +109,7 @@ public class ResourceKeyMigration implements BatchComponent {
// Now compute migration of the parent dir
String oldKey = StringUtils.substringAfterLast(oldEffectiveKey, ":");
Resource sonarFile;
- if (Java.KEY.equals(resourceModel.getLanguageKey())) {
+ if ("java".equals(resourceModel.getLanguageKey())) {
sonarFile = new JavaFile(oldKey);
} else {
sonarFile = new File(oldKey);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
index bf169d2b7d7..aa3ed738920 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
@@ -69,7 +69,7 @@ public class ComponentIndexer implements BatchComponent {
pathFromSourceDir = inputFile.relativePath();
}
Resource sonarFile = File.create(inputFile.relativePath(), pathFromSourceDir, languages.get(languageKey), unitTest);
- if (Java.KEY.equals(languageKey)) {
+ if ("java".equals(languageKey)) {
sonarFile.setDeprecatedKey(JavaFile.fromRelativePath(pathFromSourceDir, false).getDeprecatedKey());
} else {
sonarFile.setDeprecatedKey(pathFromSourceDir);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java
index 142f2d1c252..1a7f2ca6f39 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/InputFileBuilder.java
@@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
-import org.sonar.api.resources.Java;
import org.sonar.api.resources.JavaFile;
import org.sonar.api.scan.filesystem.PathResolver;
import org.sonar.batch.bootstrap.AnalysisMode;
@@ -118,7 +117,7 @@ class InputFileBuilder {
inputFile.setPathRelativeToSourceDir(sourceRelativePath);
inputFile.setSourceDirAbsolutePath(FilenameUtils.normalize(sourceDir.getAbsolutePath(), true));
- if (Java.KEY.equals(inputFile.language())) {
+ if ("java".equals(inputFile.language())) {
inputFile.setDeprecatedKey(new StringBuilder()
.append(moduleKey).append(":").append(JavaFile.fromRelativePath(sourceRelativePath, false).getDeprecatedKey()).toString());
} else {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java b/sonar-deprecated/src/main/java/org/sonar/api/resources/Java.java
index 917c0ad7dc5..917c0ad7dc5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/resources/Java.java
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaTest.java b/sonar-deprecated/src/test/java/org/sonar/api/resources/JavaTest.java
index 94c42354649..94c42354649 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaTest.java
+++ b/sonar-deprecated/src/test/java/org/sonar/api/resources/JavaTest.java
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
index 40102b15366..5bdaba53eed 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
@@ -24,7 +24,9 @@ import org.sonar.api.resources.Project;
/**
* @since 2.6
+ * @deprecated in 4.2. See API provided by Java plugins.
*/
+@Deprecated
public final class JavaUtils {
public static final String PACKAGE_SEPARATOR = ".";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
index 8d9bacef6f5..414097c0798 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
@@ -47,17 +47,23 @@ public class RulesProfile implements Cloneable {
/**
* Name of the default profile "Sonar Way"
+ * @deprecated in 4.2. Use your own constant.
*/
+ @Deprecated
public static final String SONAR_WAY_NAME = "Sonar way";
/**
* Name of the default java profile "Sonar way with Findbugs"
+ * @deprecated in 4.2. Use your own constant.
*/
+ @Deprecated
public static final String SONAR_WAY_FINDBUGS_NAME = "Sonar way with Findbugs";
/**
* Name of the default java profile "Sun checks"
+ * @deprecated in 4.2. Use your own constant.
*/
+ @Deprecated
public static final String SUN_CONVENTIONS_NAME = "Sun checks";
@Id
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java
index 81189d1163f..8a83ea6fe85 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java
@@ -106,11 +106,12 @@ public class FileTest {
@Test
public void setLanguage() {
- File file = new File(Java.INSTANCE, "Foo.java");
- assertThat(file.getLanguage(), is((Language) Java.INSTANCE));
+ Language lang = mock(Language.class);
+ File file = new File(lang, "Foo.java");
+ assertThat(file.getLanguage(), is(lang));
- file = new File(Java.INSTANCE, "org/sonar", "Foo.java");
- assertThat(file.getLanguage(), is((Language) Java.INSTANCE));
+ file = new File(lang, "org/sonar", "Foo.java");
+ assertThat(file.getLanguage(), is(lang));
assertThat(file.getParent().getLanguage(), nullValue());
}