aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-10-15 20:30:57 +0000
committerGodin <mandrikov@gmail.com>2010-10-15 20:30:57 +0000
commitaa7291344042c0d70b3fd17beba416868f7da390 (patch)
tree8537799aa2974b2015f54e10eaad14a78fbdaa49 /sonar-core
parent70633da3fced3985d29274196747604e6c958112 (diff)
downloadsonarqube-aa7291344042c0d70b3fd17beba416868f7da390.tar.gz
sonarqube-aa7291344042c0d70b3fd17beba416868f7da390.zip
SONAR-1838:
* Fix small and stupid bug in ClassLoadersCollection - important to have dot at the end of package name * Add prefixes "com.sonar.plugins." and "com.sonarsource.plugins." for export
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/classloaders/ClassLoadersCollection.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/classloaders/ClassLoadersCollection.java b/sonar-core/src/main/java/org/sonar/core/classloaders/ClassLoadersCollection.java
index 858ed05f88b..b7b2b3bb7fd 100644
--- a/sonar-core/src/main/java/org/sonar/core/classloaders/ClassLoadersCollection.java
+++ b/sonar-core/src/main/java/org/sonar/core/classloaders/ClassLoadersCollection.java
@@ -30,7 +30,7 @@ import java.util.Collection;
*/
public class ClassLoadersCollection {
- private static final String EXPORTED_PREFIX = "org.sonar.plugins.";
+ private static final String[] PREFIXES_TO_EXPORT = { "org.sonar.plugins.", "com.sonar.plugins.", "com.sonarsource.plugins." };
private ClassWorld world = new ClassWorld();
private ClassLoader baseClassLoader;
@@ -49,7 +49,6 @@ public class ClassLoadersCollection {
for (URL constituent : urls) {
realm.addConstituent(constituent);
}
- // export(realm, EXPORTED_PREFIX + key);
return realm.getClassLoader();
} catch (DuplicateRealmException e) {
throw new SonarException(e);
@@ -62,7 +61,12 @@ public class ClassLoadersCollection {
public void done() {
for (Object o : world.getRealms()) {
ClassRealm realm = (ClassRealm) o;
- export(realm, EXPORTED_PREFIX + realm.getId());
+ String[] packagesToExport = new String[PREFIXES_TO_EXPORT.length];
+ for (int i = 0; i < PREFIXES_TO_EXPORT.length; i++) {
+ // important to have dot at the end of package name
+ packagesToExport[i] = PREFIXES_TO_EXPORT[i] + realm.getId() + ".";
+ }
+ export(realm, packagesToExport);
}
}