]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5196 Quality profile names should be case sensitive
authorJulien HENRY <julien.henry@sonarsource.com>
Thu, 3 Apr 2014 15:58:09 +0000 (17:58 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Thu, 3 Apr 2014 16:00:21 +0000 (18:00 +0200)
sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDao.java
sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/QualityProfileMapper.xml

index 24f0bca7cc6bbb019ee1d536817608b578a368dd..be550fdc706ab014740cf856ea25bc6c5624abc4 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.sonar.core.qualityprofile.db;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.ibatis.session.SqlSession;
 import org.sonar.api.ServerComponent;
 import org.sonar.core.component.ComponentDto;
@@ -102,7 +101,6 @@ public class QualityProfileDao implements ServerComponent {
     }
   }
 
-
   public QualityProfileDto selectByProjectAndLanguage(long projectId, String language, String key) {
     SqlSession session = mybatis.openSession();
     try {
@@ -152,40 +150,39 @@ public class QualityProfileDao implements ServerComponent {
   }
 
   public List<QualityProfileDto> selectChildren(String name, String language, SqlSession session) {
-    return session.getMapper(QualityProfileMapper.class).selectChildren(StringUtils.upperCase(name), language);
+    return session.getMapper(QualityProfileMapper.class).selectChildren(name, language);
   }
 
   public List<QualityProfileDto> selectChildren(String name, String language) {
     SqlSession session = mybatis.openSession();
     try {
-      return selectChildren(StringUtils.upperCase(name), language, session);
+      return selectChildren(name, language, session);
     } finally {
       MyBatis.closeQuietly(session);
     }
   }
 
   public int countChildren(String name, String language, SqlSession session) {
-    return session.getMapper(QualityProfileMapper.class).countChildren(StringUtils.upperCase(name), language);
+    return session.getMapper(QualityProfileMapper.class).countChildren(name, language);
   }
 
   public int countChildren(String name, String language) {
     SqlSession session = mybatis.openSession();
     try {
-      return countChildren(StringUtils.upperCase(name), language, session);
+      return countChildren(name, language, session);
     } finally {
       MyBatis.closeQuietly(session);
     }
   }
 
   public QualityProfileDto selectByNameAndLanguage(String name, String language, SqlSession session) {
-    return session.getMapper(QualityProfileMapper.class).selectByNameAndLanguage(StringUtils.upperCase(name), language);
+    return session.getMapper(QualityProfileMapper.class).selectByNameAndLanguage(name, language);
   }
 
-
   public QualityProfileDto selectByNameAndLanguage(String name, String language) {
     SqlSession session = mybatis.openSession();
     try {
-      return selectByNameAndLanguage(StringUtils.upperCase(name), language, session);
+      return selectByNameAndLanguage(name, language, session);
     } finally {
       MyBatis.closeQuietly(session);
     }
index 78eff7dd4e2c6e9f2227662e1ff1be2b4d143026..a764f207187d3db662a549021055ebbef0eac215 100644 (file)
@@ -41,7 +41,7 @@
     SELECT <include refid="profilesColumns"/>
     FROM rules_profiles p
     <where>
-      AND UPPER(p.name)=#{name}
+      AND p.name=#{name}
       AND p.language=#{language}
     </where>
   </select>
@@ -73,7 +73,7 @@
     SELECT <include refid="profilesColumns"/>
     FROM rules_profiles p
     <where>
-      AND UPPER(p.parent_name)=#{name}
+      AND p.parent_name=#{name}
       AND p.language=#{language}
     </where>
     ORDER BY p.name
@@ -83,7 +83,7 @@
     SELECT count(p.id)
     FROM rules_profiles p
     <where>
-      AND UPPER(p.parent_name)=#{name}
+      AND p.parent_name=#{name}
       AND p.language=#{language}
     </where>
   </select>