]> source.dussan.org Git - sonarqube.git/commitdiff
Minor changes on org.sonar.server.rule2
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 30 Apr 2014 09:09:00 +0000 (11:09 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 30 Apr 2014 09:09:00 +0000 (11:09 +0200)
sonar-server/src/main/java/org/sonar/server/rule2/RuleDoc.java
sonar-server/src/main/java/org/sonar/server/rule2/RuleImpl.java [deleted file]
sonar-server/src/main/java/org/sonar/server/rule2/RuleIndex.java

index 791609101eab3072d4b276873a715dcd59a0aa4a..c06b3eee4e1c225c146e8c0cf64b2f895d5bdc6f 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-/*
-* SonarQube, open source software quality management tool.
-* Copyright (C) 2008-2014 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.server.rule2;
 
 import org.sonar.api.rule.RuleKey;
diff --git a/sonar-server/src/main/java/org/sonar/server/rule2/RuleImpl.java b/sonar-server/src/main/java/org/sonar/server/rule2/RuleImpl.java
deleted file mode 100644 (file)
index 5aa7648..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 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.server.rule2;
-
-import org.sonar.api.rule.RuleKey;
-import org.sonar.api.rule.RuleStatus;
-import org.sonar.api.server.debt.DebtRemediationFunction;
-import org.sonar.server.search.Hit;
-
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class RuleImpl implements Rule {
-
-  private Map<String, Object> fields;
-
-  public RuleImpl(){
-    this.fields = new HashMap<String, Object>();
-  }
-
-  private RuleImpl(Map<String, Object> fields){
-    this.fields = fields;
-  }
-
-  @Override
-  public RuleKey key() {
-    return RuleKey.of((String)this.fields.get("repositoryKey"),
-      (String)this.fields.get("ruleKey"));
-  }
-
-  @Override
-  public String language() {
-    return (String) this.fields.get("language");
-  }
-
-  @Override
-  public String name() {
-    return (String) this.fields.get("name");
-  }
-
-  @Override
-  public String description() {
-    return (String) this.fields.get("description");
-  }
-
-  @Override
-  public String severity() {
-    return (String) this.fields.get("severity");
-  }
-
-  @Override
-  public RuleStatus status() {
-    return RuleStatus.valueOf( (String) this.fields.get("status"));
-  }
-
-  @Override
-  public boolean template() {
-    //FIXME missign information in map.
-    return false;
-  }
-
-  @Override
-  @SuppressWarnings("unchecked")
-  public List<String> tags() {
-    return (List<String>) this.fields.get("tags");
-  }
-
-  @Override
-  @SuppressWarnings("unchecked")
-  public List<String> systemTags() {
-    return (List<String>) this.fields.get("systemTags");
-  }
-
-  @Override
-  public List<RuleParam> params() {
-    //FIXME not yet Implemented in ES
-    return Collections.emptyList();
-  }
-
-  @Override
-  public String debtCharacteristicKey() {
-    return (String) this.fields.get("debtCharacteristicKey");
-  }
-
-  @Override
-  public String debtSubCharacteristicKey() {
-    return (String) this.fields.get("debtSubCharacteristicKey");
-  }
-
-  @Override
-  public DebtRemediationFunction debtRemediationFunction() {
-    //FIXME how to construct from string "defaultRemediationFunction"
-    return null;
-  }
-
-  @Override
-  public Date createdAt() {
-    return (Date) this.fields.get("createdAt");
-  }
-
-  @Override
-  public Date updatedAt() {
-    return (Date) this.fields.get("updatedAt");
-  }
-
-  public static Rule fromHit(Hit hit) {
-    return new RuleImpl(hit.getFields());
-  }
-}
index be2b188bcb57c274039dbae5f1f994b8ac0077bf..2259c7a8979f9555131df6c80888331d75ebf28a 100644 (file)
@@ -29,7 +29,6 @@ import org.sonar.core.profiling.Profiling;
 import org.sonar.core.qualityprofile.db.ActiveRuleDao;
 import org.sonar.core.qualityprofile.db.ActiveRuleDto;
 import org.sonar.core.rule.RuleConstants;
-import org.sonar.server.rule2.RuleDao;
 import org.sonar.core.rule.RuleDto;
 import org.sonar.server.es.ESNode;
 import org.sonar.server.search.BaseIndex;