aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-03-14 16:01:06 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-03-14 16:03:31 +0100
commit56b30607c4a0d8c54222cb29ce49bb429e8a09e3 (patch)
tree130fe8fba2f04a27f4c65721c84438c088a2731c
parent8e7ffed1b130c47fe5ac394b4f5c78dd901bff1b (diff)
downloadsonarqube-56b30607c4a0d8c54222cb29ce49bb429e8a09e3.tar.gz
sonarqube-56b30607c4a0d8c54222cb29ce49bb429e8a09e3.zip
SONAR-4139 Move Java language definition to sonar-java-plugin
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java4
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java3
-rw-r--r--pom.xml2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java4
-rw-r--r--sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java25
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb2
6 files changed, 28 insertions, 12 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 188bf6d0ee2..2af797f7ff8 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -17,6 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
+
package org.sonar.plugins.core;
import com.google.common.collect.ImmutableList;
@@ -412,9 +413,6 @@ public final class CorePlugin extends SonarPlugin {
UserManagedMetrics.class,
Periods.class,
- // languages
- Java.class,
-
// pages
Lcom4Viewer.class,
TestsViewer.class,
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 9f99584f2aa..17636206353 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
@@ -17,6 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
+
package org.sonar.plugins.cpd;
import com.google.common.collect.Iterables;
@@ -97,7 +98,7 @@ public class SonarEngine extends CpdEngine {
@Override
public boolean isLanguageSupported(Language language) {
- return Java.INSTANCE.equals(language);
+ return Java.KEY.equals(language.getKey());
}
static String getFullKey(Project project, Resource<?> resource) {
diff --git a/pom.xml b/pom.xml
index 181b2993b34..66bd69e62e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
<properties>
<sonarUpdateCenter.version>1.5</sonarUpdateCenter.version>
- <sonarJava.version>1.2</sonarJava.version>
+ <sonarJava.version>1.3-SNAPSHOT</sonarJava.version>
<sonarGwt.version>3.3.1</sonarGwt.version>
<h2.version>1.3.167</h2.version>
<jetty.version>6.1.25</jetty.version>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java
index 16beba017d9..d29825bd639 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Java.java
@@ -17,6 +17,7 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
+
package org.sonar.api.resources;
import org.apache.commons.lang.ArrayUtils;
@@ -24,9 +25,12 @@ import org.apache.commons.lang.StringUtils;
/**
* Java language implementation
+ * This class have been moved in the plugin sonar-java
*
* @since 1.10
+ * @deprecated in 3.6
*/
+@Deprecated
public class Java extends AbstractLanguage {
public static final Java INSTANCE = new Java();
diff --git a/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java b/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java
index 0b7d3e7c6f9..ae7fb145342 100644
--- a/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java
+++ b/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java
@@ -17,13 +17,18 @@
* License along with Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
+
package org.sonar.server.rules;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.ServerComponent;
import org.sonar.api.database.DatabaseSession;
-import org.sonar.api.profiles.*;
+import org.sonar.api.profiles.ProfileExporter;
+import org.sonar.api.profiles.ProfileImporter;
+import org.sonar.api.profiles.RulesProfile;
+import org.sonar.api.profiles.XMLProfileParser;
+import org.sonar.api.profiles.XMLProfileSerializer;
import org.sonar.api.rules.ActiveRule;
import org.sonar.api.rules.ActiveRuleParam;
import org.sonar.api.utils.ValidationMessages;
@@ -36,20 +41,28 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import static com.google.common.collect.Lists.newArrayList;
+
public final class ProfilesConsole implements ServerComponent {
private DatabaseSessionFactory sessionFactory;
private XMLProfileParser xmlProfileParser;
private XMLProfileSerializer xmlProfileSerializer;
- private List<ProfileExporter> exporters = new ArrayList<ProfileExporter>();
- private List<ProfileImporter> importers = new ArrayList<ProfileImporter>();
+ private List<ProfileExporter> exporters = newArrayList();
+ private List<ProfileImporter> importers = newArrayList();
+
+ public ProfilesConsole(DatabaseSessionFactory sessionFactory, XMLProfileParser xmlProfileParser, XMLProfileSerializer xmlProfileSerializer) {
+ this.sessionFactory = sessionFactory;
+ this.xmlProfileParser = xmlProfileParser;
+ this.xmlProfileSerializer = xmlProfileSerializer;
+ this.exporters = newArrayList();
+ this.importers = newArrayList();
+ }
public ProfilesConsole(DatabaseSessionFactory sessionFactory, XMLProfileParser xmlProfileParser, XMLProfileSerializer xmlProfileSerializer,
ProfileExporter[] exporters,
ProfileImporter[] importers) {
- this.xmlProfileParser = xmlProfileParser;
- this.xmlProfileSerializer = xmlProfileSerializer;
- this.sessionFactory = sessionFactory;
+ this(sessionFactory, xmlProfileParser, xmlProfileSerializer);
this.exporters.addAll(Arrays.asList(exporters));
this.importers.addAll(Arrays.asList(importers));
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
index ba08fb9de42..c7f6a7797cd 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
@@ -29,7 +29,7 @@ class ProfilesController < ApplicationController
# GET /profiles/index
def index
add_breadcrumbs ROOT_BREADCRUMB
- @profiles = Profile.find(:all)
+ @profiles = Profile.all
Api::Utils.insensitive_sort!(@profiles){|profile| profile.name}
end