summaryrefslogtreecommitdiffstats
path: root/sonar-core/src
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-01-23 09:47:58 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2014-01-23 09:52:57 +0100
commitdc19e6d7dceb39c04ba7cfc2e7ba99f2650f1504 (patch)
treecf491c7c6ba02d2276038404d2a64ccd953033e7 /sonar-core/src
parentb9798b1f7f3a6014a84aac497f2db04d326d035d (diff)
downloadsonarqube-dc19e6d7dceb39c04ba7cfc2e7ba99f2650f1504.tar.gz
sonarqube-dc19e6d7dceb39c04ba7cfc2e7ba99f2650f1504.zip
SONAR-3024 Perform one shot migration of all project resources
Diffstat (limited to 'sonar-core/src')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java13
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml1
-rw-r--r--sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java1
3 files changed, 1 insertions, 14 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java
index d8ba9b5c648..a17b51d22f3 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentKeys.java
@@ -55,19 +55,6 @@ public final class ComponentKeys {
return key;
}
- public static String createDeprecatedEffectiveKey(Project project, Resource resource) {
- String key = resource.getKey();
- if (!StringUtils.equals(Scopes.PROJECT, resource.getScope())) {
- // not a project nor a library
- key = new StringBuilder(ResourceModel.KEY_SIZE)
- .append(project.getKey())
- .append(':')
- .append(resource.getDeprecatedKey())
- .toString();
- }
- return key;
- }
-
/**
* <p>Test if given parameter is valid for a project/module. Valid format is:</p>
* <ul>
diff --git a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
index e2d0d0a4745..ef9389a5a27 100644
--- a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
@@ -41,6 +41,7 @@
<resultMap id="resourceResultMap" type="Resource">
<id property="id" column="id"/>
<result property="key" column="kee"/>
+ <result property="deprecatedKey" column="deprecated_kee"/>
<result property="path" column="path"/>
<result property="name" column="name"/>
<result property="longName" column="long_name"/>
diff --git a/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java b/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java
index 42391a2cb2a..04b29175341 100644
--- a/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/component/ComponentKeysTest.java
@@ -35,7 +35,6 @@ public class ComponentKeysTest {
Directory dir = Directory.create("src/org/foo", "org/foo");
assertThat(ComponentKeys.createEffectiveKey(project, dir)).isEqualTo("my_project:src/org/foo");
- assertThat(ComponentKeys.createDeprecatedEffectiveKey(project, dir)).isEqualTo("my_project:org/foo");
Library library = new Library("junit:junit", "4.7");
assertThat(ComponentKeys.createEffectiveKey(project, library)).isEqualTo("junit:junit");