From 076bed2e34e4ddac3ff1a071432cf1c6d9ccbfe2 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 29 Feb 2016 15:02:45 +0100 Subject: [PATCH] Fix quality flaws --- .../src/main/java/org/sonar/db/DbSession.java | 2 -- .../sonar/db/qualityprofile/ActiveRuleDto.java | 16 ---------------- .../sonar/db/qualityprofile/ActiveRuleMapper.xml | 2 -- 3 files changed, 20 deletions(-) diff --git a/sonar-db/src/main/java/org/sonar/db/DbSession.java b/sonar-db/src/main/java/org/sonar/db/DbSession.java index 845dc679c64..be3ec9a741f 100644 --- a/sonar-db/src/main/java/org/sonar/db/DbSession.java +++ b/sonar-db/src/main/java/org/sonar/db/DbSession.java @@ -31,10 +31,8 @@ import org.apache.ibatis.session.SqlSession; public class DbSession implements SqlSession { private SqlSession session; - private int actionCount; public DbSession(SqlSession session) { - this.actionCount = 0; this.session = session; } diff --git a/sonar-db/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java b/sonar-db/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java index 2b4613889bb..53d14c1957d 100644 --- a/sonar-db/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java +++ b/sonar-db/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java @@ -45,14 +45,10 @@ public class ActiveRuleDto { private long updatedAt; // These fields do not exists in db, it's only retrieve by joins - private Integer parentId; private String repository; private String ruleField; private String profileKey; - /** - * @deprecated for internal use, should be private - */ public ActiveRuleDto setKey(ActiveRuleKey key) { this.repository = key.ruleKey().repository(); this.ruleField = key.ruleKey().rule(); @@ -119,18 +115,6 @@ public class ActiveRuleDto { return this; } - @CheckForNull - @Deprecated - public Integer getParentId() { - return parentId; - } - - @Deprecated - public ActiveRuleDto setParentId(@Nullable Integer parentId) { - this.parentId = parentId; - return this; - } - public boolean isInherited() { return StringUtils.equals(INHERITED, inheritance); } diff --git a/sonar-db/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml b/sonar-db/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml index d8b0a1ab0ae..6951207cdc1 100644 --- a/sonar-db/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml @@ -28,7 +28,6 @@ a.rule_id as ruleId, a.failure_level as severity, a.inheritance as inheritance, - active_rule_parent.id as parentId, a.created_at as "createdAt", a.updated_at as "updatedAt" @@ -37,7 +36,6 @@ INNER JOIN rules_profiles qp ON qp.id=a.profile_id LEFT JOIN rules_profiles profile_parent ON profile_parent.kee=qp.parent_kee - LEFT JOIN active_rules active_rule_parent ON active_rule_parent.profile_id=profile_parent.id AND a.rule_id=active_rule_parent.rule_id