aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-07-16 18:04:14 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-07-16 18:05:00 +0200
commit116ae0ab65d88b776c091a6ccee13578b4e3314c (patch)
tree8158aa04f4260c86dd725a49636e6eaa2ed5b866
parent1c72a4c10bf4922a6a6d638b4e56758a914b2258 (diff)
downloadsonarqube-116ae0ab65d88b776c091a6ccee13578b4e3314c.tar.gz
sonarqube-116ae0ab65d88b776c091a6ccee13578b4e3314c.zip
SONAR-4501 Moved Category & SubCategory to internal package
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/internal/Category.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java)4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/internal/SubCategory.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java)5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/internal/package-info.java23
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java3
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/config/internal/CategoryTest.java (renamed from sonar-plugin-api/src/test/java/org/sonar/api/config/CategoryTest.java)5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb4
7 files changed, 40 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
index 94edae487ff..c27f1a0babd 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
@@ -19,6 +19,9 @@
*/
package org.sonar.api.config;
+import org.sonar.api.config.internal.SubCategory;
+
+import org.sonar.api.config.internal.Category;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/Category.java
index ddb8ff34367..ff7b958a2d1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/Category.java
@@ -17,7 +17,7 @@
* 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.config;
+package org.sonar.api.config.internal;
import org.apache.commons.lang.StringUtils;
@@ -35,7 +35,7 @@ public class Category {
this(originalKey, false);
}
- Category(String originalKey, boolean special) {
+ public Category(String originalKey, boolean special) {
this.originalKey = originalKey;
this.special = special;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/SubCategory.java
index cd90b20e2f0..04cf2747473 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/SubCategory.java
@@ -17,7 +17,8 @@
* 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.config;
+package org.sonar.api.config.internal;
+
/**
* @since 3.7
@@ -28,7 +29,7 @@ public class SubCategory extends Category {
super(originalKey);
}
- SubCategory(String originalKey, boolean special) {
+ public SubCategory(String originalKey, boolean special) {
super(originalKey, special);
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/package-info.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/package-info.java
new file mode 100644
index 00000000000..139939481bf
--- /dev/null
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/internal/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.api.config.internal;
+
+import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
index 9bc2eace66b..dacbb9106dc 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
@@ -19,6 +19,9 @@
*/
package org.sonar.api.config;
+import org.sonar.api.config.internal.SubCategory;
+
+import org.sonar.api.config.internal.Category;
import org.junit.Test;
import org.sonar.api.Properties;
import org.sonar.api.Property;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/CategoryTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/internal/CategoryTest.java
index e8ee207892f..7ac22319e63 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/config/CategoryTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/internal/CategoryTest.java
@@ -17,7 +17,7 @@
* 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.config;
+package org.sonar.api.config.internal;
import org.junit.Test;
@@ -28,6 +28,9 @@ public class CategoryTest {
@Test
public void category_key_is_case_insentive() {
assertThat(new Category("Licenses")).isEqualTo(new Category("licenses"));
+
+ // Just to raise coverage
+ assertThat(new Category("Licenses")).isNotEqualTo(new SubCategory("foo"));
}
@Test
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
index 13032ed779a..869c6b61458 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/application_controller.rb
@@ -282,7 +282,7 @@ class ApplicationController < ActionController::Base
default_category = @categories.empty? ? nil : @categories[0]
@category = default_category
else
- @category = @categories.select {|c| c == Java::OrgSonarApiConfig::Category.new(params[:category])}.first
+ @category = @categories.select {|c| c == Java::OrgSonarApiConfigInternal::Category.new(params[:category])}.first
not_found('category') if @category.nil?
end
@@ -296,7 +296,7 @@ class ApplicationController < ActionController::Base
((@subcategories_per_categories[@category].include? @category) ? @category : @subcategories_per_categories[@category][0])
@subcategory = default_subcategory
else
- @subcategory = @subcategories_per_categories[@category].select {|s| s == Java::OrgSonarApiConfig::SubCategory.new(params[:subcategory])}.first
+ @subcategory = @subcategories_per_categories[@category].select {|s| s == Java::OrgSonarApiConfigInternal::SubCategory.new(params[:subcategory])}.first
not_found('subcategory') if @subcategory.nil?
end