]> source.dussan.org Git - sonarqube.git/commitdiff
Do not use deprecated rule categories (column MEASURES.RULES_CATEGORY_ID, table RULES...
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 15 Mar 2012 10:00:57 +0000 (11:00 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 15 Mar 2012 10:00:57 +0000 (11:00 +0100)
35 files changed:
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml
sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml
sonar-core/src/main/resources/META-INF/persistence.xml
sonar-core/src/test/resources/org/sonar/core/rule/CacheRuleFinderTest/shared.xml
sonar-core/src/test/resources/org/sonar/core/rule/DefaultRuleFinderTest/shared.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml
sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java [deleted file]
sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java [deleted file]
sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/database/DatabaseProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java
sonar-plugin-api/src/main/java/org/sonar/api/rules/Iso9126RulesCategories.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
sonar-plugin-api/src/main/java/org/sonar/api/rules/RulesCategory.java
sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleTest.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/001_initial_schema.rb
sonar-server/src/test/java/org/sonar/server/configuration/ProfilesBackupTest.java
sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml
sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updadeRuleFields.xml
sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/updateRuleParameters.xml

index af40b4e992484b9f92411991ba76a014f8db9d43..47dd47e31a2f7d0bbe7854e2dc17dbc8c0faf9f8 100644 (file)
@@ -1,8 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-  <rules_categories id="6" name="Usability" description="Usability"/>
-
   <rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
          plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
          cardinality="SINGLE" parent_id="[null]"/>
index c194c9d12f6143d2da5c40349e47bd63b326ec3d..b5ce1f7afc717f2f212671c0302bd3820d96d9d7 100644 (file)
@@ -1,8 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-  <rules_categories id="6" name="Usability" description="Usability"/>
-
   <rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
          plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
          cardinality="SINGLE" parent_id="[null]"/>
index 869a9459c805df5d687caafbcce499dea102476b..5bd323e886669a66e992908c13aac616ac641447 100644 (file)
@@ -1,7 +1,4 @@
 <dataset>
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-  <rules_categories id="6" name="Usability" description="Usability"/>
-
   <rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
          plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
          cardinality="SINGLE" parent_id="[null]"/>
index 3fd471af8ce418fff189e9a8b831686851d12069..4818b2d8b759a830f3313d93c84a7497ad76d8c6 100644 (file)
@@ -1,5 +1,4 @@
 <dataset>
-  <rules_categories id="1" name="category one" description="one"/>
   <rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
          plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
 
index fb0c0b5e52e36b2978e104801a94e96961b7f8ab..7c719cc0df3ec3ebb5e789755c3123093f07f079 100644 (file)
@@ -1,5 +1,4 @@
 <dataset>
-  <rules_categories id="1" name="category one" description="one"/>
   <rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
          plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
 
index 022dbcd01698bcf63da1cb5a22a37d633eeaede3..8b66612aeac5d1d01d163eaa4a67885884596002 100644 (file)
@@ -6,9 +6,6 @@
            enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
 
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-  <rules_categories id="6" name="Usability" description="Usability"/>
-
   <rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
          plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
          cardinality="SINGLE" parent_id="[null]"/>
index 4585e14ba0b5cc5ffdfbb87d6ba0b007bda940f4..8cc0d86f00a7e21de208162c344d818c2d568a36 100644 (file)
@@ -1,5 +1,4 @@
 <dataset>
-  <rules_categories id="1" name="category one" description="One"/>
   <rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
          plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
  
index 7d2c6a63cdb9a3aaca9d7923adb3cce175994966..357801c27b9ca02f359a08a5ad07ec214ea9485f 100644 (file)
@@ -25,7 +25,6 @@
     <class>org.sonar.api.security.GroupRole</class>
     <class>org.sonar.api.rules.Rule</class>
     <class>org.sonar.api.rules.RuleParam</class>
-    <class>org.sonar.api.rules.RulesCategory</class>
     <class>org.sonar.api.resources.ProjectLink</class>
     <class>org.sonar.api.profiles.RulesProfile</class>
     <class>org.sonar.api.rules.ActiveRule</class>
index fc4fcd733aa26ba53fb3e681c5208ea4c03b3e1f..4e02fa9c0b3e64e2dfe7c736ba91efcd7dc52dc9 100644 (file)
@@ -1,6 +1,4 @@
 <dataset>
-  <rules_categories id="6" name="Efficiency" description="Efficiency" />
-
   <!-- CHECKSTYLE -->
 
   <rules id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
index fc4fcd733aa26ba53fb3e681c5208ea4c03b3e1f..4e02fa9c0b3e64e2dfe7c736ba91efcd7dc52dc9 100644 (file)
@@ -1,6 +1,4 @@
 <dataset>
-  <rules_categories id="6" name="Efficiency" description="Efficiency" />
-
   <!-- CHECKSTYLE -->
 
   <rules id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
index beb32a48647b0bb7ddecd8ebf414e87b553f18d1..dc6eb2966ef05466954953d73397e9793c2efdf3 100644 (file)
@@ -1,8 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-  <rules_categories id="2" name="category two" description="two"/>
-
   <rules id="1" name="rule one" description="desc" plugin_config_key="config"
          plugin_rule_key="rule_one" plugin_name="plugin1" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
index c7505dab4dfb57f6339a0d00089f6f8194a61425..f5004757f820b9051d24a0378454af4c8f3ab941 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules id="1" name="rule1" description="desc" plugin_config_key="config"
          plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
index c882291431471c18738897296aa034370ed045ce..ad93402fa5b4ea8cdeff6a1ebd6c9a434717a7e1 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules id="1" name="rule1" description="desc" plugin_config_key="config"
          plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
index b8eeab6cd243da81992fbb51b2503e49354c34bc..394b84a737406177bacc0b7378cf013406be41eb 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
   <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
 
index 21ba79e615ae111c2ec748d4717a1c865e269967..107805b86f2eb1b0ae3c94d207a4c0de9ad9a5ca 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
   <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
 
index b8eeab6cd243da81992fbb51b2503e49354c34bc..394b84a737406177bacc0b7378cf013406be41eb 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
   <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
 
index c398ce6e1508424455b58b44ea1f1b4b2210a7a9..8bb3979e8ad54b99e21d27d477d6d27ab1debc84 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <!-- Rules -->
   <rules id="1" name="new1" description="test1" plugin_config_key="checker/new1"
          plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
index d993d31f9101112f9c1e6129d469b940622ec36f..4d4c0ba987f50f52a64f79f0ebdb2897ac16a368 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules id="1" name="foo" description="test" plugin_config_key="checker/foo"
          plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
index 9c435f0ff62f2ff5f76e845b8d5a7a55eec95bc2..35d4172d221617bb400bbdaa484b972cc9bb32bd 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="category one" description="one"/>
-
   <rules id="1" name="rule one" description="desc" plugin_config_key="other config"
          plugin_rule_key="rule_one" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
   <rules id="2" name="rule two" description="desc" plugin_config_key="config"
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Profile.java
deleted file mode 100644 (file)
index 2584621..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("profile")
-public class Profile {
-
-  @XStreamAsAttribute
-  private String language;
-
-  @XStreamAsAttribute
-  private String name;
-
-  @XStreamImplicit
-  private List<Rule> rules = new ArrayList<Rule>();
-
-  public List<Rule> getRules() {
-    return rules;
-  }
-
-  public void setRules(List<Rule> rules) {
-    this.rules = rules;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public void setName(String name) {
-    this.name = name;
-  }
-
-  public String getLanguage() {
-    return language;
-  }
-
-  public void setLanguage(String language) {
-    this.language = language;
-  }
-}
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Property.java
deleted file mode 100644 (file)
index dc7345c..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("property")
-public class Property {
-
-  @XStreamAsAttribute
-  private String name;
-
-  @XStreamAsAttribute
-  private String value;
-
-  public Property(String name, String value) {
-    this.name = name;
-    this.value = value;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public String getValue() {
-    return value;
-  }
-}
\ No newline at end of file
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java b/sonar-deprecated/src/main/java/org/sonar/api/rules/xml/Rule.java
deleted file mode 100644 (file)
index 88d4c93..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("rule")
-public class Rule implements Comparable<String> {
-
-  @XStreamAsAttribute
-  private String key;
-
-  @XStreamAsAttribute
-  private String priority;
-
-  @XStreamImplicit
-  private List<Property> properties;
-
-  public Rule(String ref) {
-    this(ref, null);
-  }
-
-  public Rule(String ref, String priority) {
-    this.key = ref;
-    this.priority = priority;
-  }
-
-  public String getKey() {
-    return key;
-  }
-
-  public void setProperties(List<Property> properties) {
-    this.properties = properties;
-  }
-
-  public List<Property> getProperties() {
-    return properties;
-  }
-
-  public int compareTo(String o) {
-    return o.compareTo(key);
-  }
-
-  public String getPriority() {
-    return priority;
-  }
-
-  public void setPriority(String priority) {
-    this.priority = priority;
-  }
-
-  public void addProperty(Property property) {
-    if (properties == null) {
-      properties = new ArrayList<Property>();
-    }
-    properties.add(property);
-  }
-
-}
\ No newline at end of file
index 00d4af08a4360a1acd320e09771b8918fb729ddf..b3e7aebe13926f4e3071476494f1eee31ab8d3a9 100644 (file)
@@ -41,19 +41,11 @@ public interface DatabaseProperties {
   String PROP_EMBEDDED_PORT = "sonar.embeddedDatabase.port";
   String PROP_HIBERNATE_DEFAULT_SCHEMA = "sonar.hibernate.default_schema";
 
-
   String PROP_EMBEDDED_DATA_DIR = "sonar.embeddedDatabase.dataDir";
   String DIALECT_DERBY = "derby";
-  
-  /**
-   * @deprecated not supported anymore since v.2.13.
-   */
-  @Deprecated
-  String DIALECT_HSQLDB = "hsqldb";
   String DIALECT_MYSQL = "mysql";
   String DIALECT_POSTGRESQL = "postgresql";
   String DIALECT_ORACLE = "oracle";
   String DIALECT_DB2 = "db2";
-
   String DIALECT_MSSQL = "mssql";
 }
\ No newline at end of file
index d30464595b2b6d71e7306aac8bc7e0f122b18670..0e82d047a1d950d743ae8815e3945574da0392c2 100644 (file)
@@ -283,22 +283,6 @@ public class MeasureModel implements Cloneable {
     return this;
   }
 
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public Integer getRulesCategoryId() {
-    return null;
-  }
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public MeasureModel setRulesCategoryId(Integer id) {
-    return this;
-  }
-
   /**
    * @return the rule priority
    */
index 467abf96283e498196e3cdac55f338eb8230144d..22619d0cbaa6a161e9a943ed856e996f45ab0885 100644 (file)
@@ -82,22 +82,6 @@ public class RuleFailureModel extends BaseIdentifiable {
     return StringUtils.abbreviate(StringUtils.trim(message), MESSAGE_COLUMN_SIZE);
   }
 
-  /**
-   * @deprecated since 2.7. Replace by getPriority()
-   */
-  @Deprecated
-  public RulePriority getLevel() {
-    return priority;
-  }
-
-  /**
-   * @deprecated since 2.7. Replace by setPriority()
-   */
-  @Deprecated
-  public void setLevel(RulePriority priority) {
-    this.priority = priority;
-  }
-
   public Integer getRuleId() {
     return ruleId;
   }
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Iso9126RulesCategories.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Iso9126RulesCategories.java
deleted file mode 100644 (file)
index 46abe96..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.api.rules;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @deprecated since 2.5. See http://jira.codehaus.org/browse/SONAR-2007
- */
-@Deprecated
-public final class Iso9126RulesCategories {
-  private Iso9126RulesCategories() {
-  }
-
-  public static final RulesCategory RELIABILITY = new RulesCategory("Reliability",
-      "The extent to which the project can be expected to perform its intended function with rescission." +
-      " Some examples : are loop indexes range tested? Is input data checked for range errors ? Is divide-by-zero avoided ? Is exception handling provided ?");
-  public static final RulesCategory EFFICIENCY = new RulesCategory("Efficiency",
-      "The extent to which the project fulfills its purpose without waste of resources." +
-      " This means resources in the sense of memory utilisation and processor speed.");
-  public static final RulesCategory PORTABILITY = new RulesCategory("Portability",
-      "The extent to which the project can be operated easily and well on multiple computer configurations." +
-      " Portability can mean both between different hardware setups and between different operating systems -- such as running on both Mac OS X and GNU/Linux.");
-  public static final RulesCategory USABILITY = new RulesCategory("Usability",
-      "The extent to which the project can be understood, learned, operated, attractive and compliant with usability regulations and guidelines." +
-      " It commonly relies on naming conventions and formatting rules.");
-  public static final RulesCategory MAINTAINABILITY = new RulesCategory("Maintainability",
-      "The extent to which the project facilitates updating to satisfy new requirements. Thus the the project which is maintainable should be not complex.");
-
-  public static final List<RulesCategory> ALL = Collections.unmodifiableList(Arrays.asList(RELIABILITY, EFFICIENCY, PORTABILITY, USABILITY, MAINTAINABILITY));
-}
index 7c3b48bfc3baa77de2405d74abda294afeff0a31..efcc8dd3bfd171dc75c2b7db6f776bc1dbe543ae 100644 (file)
@@ -36,8 +36,6 @@ import java.util.List;
 @Table(name = "rules")
 public final class Rule {
 
-  private static final RulesCategory NONE = new RulesCategory("none");
-
   @Id
   @Column(name = "id")
   @GeneratedValue
@@ -188,22 +186,6 @@ public final class Rule {
     return this;
   }
 
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public RulesCategory getRulesCategory() {
-    return NONE;
-  }
-
-  /**
-   * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
-   */
-  @Deprecated
-  public Rule setRulesCategory(RulesCategory rulesCategory) {
-    return this;
-  }
-
   /**
    * @deprecated since 2.5 use {@link #getRepositoryKey()} instead
    */
index 31e237ead7ea035ac4ebac526141901c9e425442..3e5c1acdd5f852c6aabc08f296a23fa7ab62e0ff 100644 (file)
@@ -26,7 +26,6 @@ import org.hibernate.annotations.Cache;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 import org.hibernate.annotations.Immutable;
 import org.sonar.api.database.BaseIdentifiable;
-import org.sonar.check.IsoCategory;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -36,16 +35,9 @@ import javax.persistence.Table;
  * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
  */
 @Deprecated
-@Immutable
-@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
-@Entity
-@Table(name = "rules_categories")
 public class RulesCategory extends BaseIdentifiable {
 
-  @Column(name = "name", updatable = false, nullable = false)
   private String name;
-
-  @Column(name = "description", updatable = false, nullable = true)
   private String description;
 
   /**
@@ -116,60 +108,22 @@ public class RulesCategory extends BaseIdentifiable {
     }
     RulesCategory other = (RulesCategory) obj;
     return new EqualsBuilder()
-        .append(name, other.getName()).isEquals();
+      .append(name, other.getName()).isEquals();
   }
 
   @Override
   public int hashCode() {
     return new HashCodeBuilder(17, 37)
-        .append(name)
-        .toHashCode();
+      .append(name)
+      .toHashCode();
   }
 
   @Override
   public String toString() {
     return new ToStringBuilder(this)
-        .append("id", getId())
-        .append("name", name)
-        .append("desc", description)
-        .toString();
-  }
-
-  public IsoCategory toIsoCategory() {
-    if (name.equals(Iso9126RulesCategories.EFFICIENCY.getName())) {
-      return IsoCategory.Efficiency;
-    }
-    if (name.equals(Iso9126RulesCategories.MAINTAINABILITY.getName())) {
-      return IsoCategory.Maintainability;
-    }
-    if (name.equals(Iso9126RulesCategories.PORTABILITY.getName())) {
-      return IsoCategory.Portability;
-    }
-    if (name.equals(Iso9126RulesCategories.RELIABILITY.getName())) {
-      return IsoCategory.Reliability;
-    }
-    if (name.equals(Iso9126RulesCategories.USABILITY.getName())) {
-      return IsoCategory.Usability;
-    }
-    return null;
-  }
-
-  public static RulesCategory fromIsoCategory(IsoCategory iso) {
-    if (iso == IsoCategory.Efficiency) {
-      return Iso9126RulesCategories.EFFICIENCY;
-    }
-    if (iso == IsoCategory.Maintainability) {
-      return Iso9126RulesCategories.MAINTAINABILITY;
-    }
-    if (iso == IsoCategory.Portability) {
-      return Iso9126RulesCategories.PORTABILITY;
-    }
-    if (iso == IsoCategory.Reliability) {
-      return Iso9126RulesCategories.RELIABILITY;
-    }
-    if (iso == IsoCategory.Usability) {
-      return Iso9126RulesCategories.USABILITY;
-    }
-    return null;
+      .append("id", getId())
+      .append("name", name)
+      .append("desc", description)
+      .toString();
   }
 }
index aebea90a313700ae4126f42f54ecc86320f05939..3cc984f6bb2d80950b6d1619e83453f5b7a3df74 100644 (file)
@@ -55,7 +55,7 @@ public class RuleTest {
   public void shouldRemoveNewLineCharactersInNameWithfirstConstructor() {
     Rule rule;
     for (String example : getExamplesContainingNewLineCharacter()) {
-      rule = new Rule(null, null, example, (RulesCategory) null, null);
+      rule = new Rule(null, null).setName(example);
       assertThat(rule.getName(), is("test"));
     }
   }
@@ -64,7 +64,7 @@ public class RuleTest {
   public void shouldRemoveNewLineCharactersInNameWithSecondConstructor() {
     Rule rule;
     for (String example : getExamplesContainingNewLineCharacter()) {
-      rule = new Rule(null, null, example, null, null);
+      rule = new Rule(null, null).setName(example);
       assertThat(rule.getName(), is("test"));
     }
   }
@@ -77,9 +77,6 @@ public class RuleTest {
     rule = new Rule("name", "key");
     assertThat(rule.getSeverity(), Is.is(RulePriority.MAJOR));
 
-    rule = new Rule("pkey", "key", "name", Iso9126RulesCategories.EFFICIENCY, null, null);
-    assertThat(rule.getSeverity(), Is.is(RulePriority.MAJOR));
-
     rule.setSeverity(RulePriority.BLOCKER);
     assertThat(rule.getSeverity(), Is.is(RulePriority.BLOCKER));
 
index 09ea92f6d6c39531dcfc1519b1c863eeeee8fe71..f13ed7a1af0805aee2131e00e29c6a901db8ae0c 100644 (file)
@@ -73,7 +73,7 @@ class Api::TimemachineController < Api::ApiController
       @measures_by_sid={}
 
       unless @metrics.empty?
-        sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.person_id IS NULL']
+        sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.person_id IS NULL']
         sql_values = {:rid => @resource.id, :status => Snapshot::STATUS_PROCESSED}
 
         if params[:fromDateTime]
index c199fecb76fb094f67077889dbd0c0845886d7c0..d57ae80c12bf367c3b7e508acf37615602ab3300 100644 (file)
@@ -72,7 +72,7 @@ class InitialSchema < ActiveRecord::Migration
       t.column :rule_id,             :integer
       t.column :rules_category_id,   :integer
       t.column :text_value, :string, :limit => 96, :null => true
-      t.column 'tendency', :integer, :null => true
+      t.column :tendency, :integer, :null => true
       t.column :measure_date, :datetime, :null => true
       t.column :project_id, :integer, :null => true
       t.column :alert_status, :string, :limit => 5, :null => true
index d7c72f8ad31e33cda8405e4c9c69a62d107b9071..8533b26b7b3172898f25466a968406ce9696ba87 100644 (file)
@@ -106,8 +106,8 @@ public class ProfilesBackupTest extends AbstractDbUnitTestCase {
     RulesProfile profileNotProvided = new RulesProfile("test not provided", "lang", false, false);
     getSession().save(profileProvided, profileNotProvided);
 
-    Rule rule1 = new Rule("testPlugin", "testKey", "testName", null, null);
-    Rule rule2 = new Rule("testPlugin", "testKey2", "testName2", null, null);
+    Rule rule1 = new Rule("testPlugin", "testKey");
+    Rule rule2 = new Rule("testPlugin", "testKey2");
     getSession().save(rule1, rule2);
     RuleParam ruleParam1 = new RuleParam(rule1, "paramKey", "test", "int");
     getSession().save(ruleParam1);
index a94cecdc87bf2f05055effc643cc251b6a4f2997..c2218110bbbf6b2d99ac824358b4e7b8e3a4441d 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
   <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
                    enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]" />
 
index 93f5b83f9c9646c3d36a2639f5a8a3d293170664..a21b0eddd82c3c9354bdddc85b1c827029e3195b 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
   <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
                    enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>
 
index aa40846284665b2756c7d25dcf779d00adebc6c9..5afc29ed294d433b59273e5ec89aeffe5b08f87b 100644 (file)
@@ -1,7 +1,5 @@
 <dataset>
 
-  <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
   <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
                    enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>