diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-25 19:11:13 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-25 19:26:43 +0100 |
commit | 1d97046d483bb2bfad503abd467f20b80faabdd5 (patch) | |
tree | 46fba127f432373c2ec6345ce8f6eebec86aa3c8 /plugins/sonar-squid-java-plugin/src | |
parent | e7de7db7a3a3de0bf7961f0b5210156182622f10 (diff) | |
download | sonarqube-1d97046d483bb2bfad503abd467f20b80faabdd5.tar.gz sonarqube-1d97046d483bb2bfad503abd467f20b80faabdd5.zip |
Fix Squid plugin to correctly build the relation between a Java file and its package
Diffstat (limited to 'plugins/sonar-squid-java-plugin/src')
-rw-r--r-- | plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ResourceIndex.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ResourceIndex.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ResourceIndex.java index 1e869d208f2..f0720cdb7f8 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ResourceIndex.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/ResourceIndex.java @@ -63,7 +63,8 @@ public final class ResourceIndex extends HashMap<SourceCode, Resource> { Collection<SourceCode> files = squid.search(new QueryByType(SourceFile.class)); for (SourceCode squidFile : files) { JavaFile sonarFile = SquidUtils.convertJavaFileKeyFromSquidFormat(squidFile.getKey()); - context.saveResource(sonarFile); + JavaPackage sonarPackage = (JavaPackage)get(squidFile.getParent(SourcePackage.class)); + context.index(sonarFile, sonarPackage); put(squidFile, context.getResource(sonarFile)); // resource is reloaded to get the id } } |