[jboss-cvs] JBossAS SVN: r82079 - in projects/jboss-cl/branches/Branch_2_0/classloading/src: test/java/org/jboss/test/classloading/dependency/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 5 09:06:56 EST 2008
Author: adrian at jboss.org
Date: 2008-12-05 09:06:56 -0500 (Fri, 05 Dec 2008)
New Revision: 82079
Modified:
projects/jboss-cl/branches/Branch_2_0/classloading/src/main/java/org/jboss/classloading/spi/dependency/ClassLoadingSpace.java
projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/ConflictingRequirementUnitTestCase.java
Log:
[JBCL-77] - Don't join to non-existent classloading space, log a warning instead
Modified: projects/jboss-cl/branches/Branch_2_0/classloading/src/main/java/org/jboss/classloading/spi/dependency/ClassLoadingSpace.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloading/src/main/java/org/jboss/classloading/spi/dependency/ClassLoadingSpace.java 2008-12-05 14:06:45 UTC (rev 82078)
+++ projects/jboss-cl/branches/Branch_2_0/classloading/src/main/java/org/jboss/classloading/spi/dependency/ClassLoadingSpace.java 2008-12-05 14:06:56 UTC (rev 82079)
@@ -321,8 +321,15 @@
{
// Do we need to join with another classloading space?
ClassLoadingSpace space = otherModule.getClassLoadingSpace();
- if (this != space)
- space.joinAndResolve(this);
+ if (space != null)
+ {
+ if (this != space)
+ space.joinAndResolve(this);
+ }
+ else
+ {
+ log.warn(module + " resolved " + dependency.getRequirement() + " to " + otherModule + " which has import-all=true. Cannot check its consistency.");
+ }
}
}
}
Modified: projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/ConflictingRequirementUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/ConflictingRequirementUnitTestCase.java 2008-12-05 14:06:45 UTC (rev 82078)
+++ projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/ConflictingRequirementUnitTestCase.java 2008-12-05 14:06:56 UTC (rev 82079)
@@ -343,4 +343,42 @@
}
assertNoClassLoader(contextA1);
}
+
+ public void testRequirementReferencesImportAll() throws Exception
+ {
+ ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
+ MockClassLoadingMetaData a1 = new MockClassLoadingMetaData("a", "1.0.0");
+ a1.setPathsAndPackageNames(A.class);
+ a1.setImportAll(true);
+ KernelControllerContext contextA1 = install(a1);
+ try
+ {
+ ClassLoader clA1 = assertClassLoader(contextA1);
+ assertLoadClass(A.class, clA1);
+ assertLoadClassFail(B.class, clA1);
+ assertLoadClassFail(C.class, clA1);
+
+ MockClassLoadingMetaData b1 = new MockClassLoadingMetaData("b", "1.0.0");
+ b1.getRequirements().addRequirement(factory.createRequireModule("a", new VersionRange("1.0.0", "2.0.0")));
+ b1.setPathsAndPackageNames(B.class);
+ KernelControllerContext contextB1 = install(b1);
+ try
+ {
+ ClassLoader clB1 = assertClassLoader(contextB1);
+ assertLoadClass(B.class, clB1);
+ assertLoadClass(A.class, clB1, clA1);
+ assertLoadClassFail(C.class, clB1);
+ }
+ finally
+ {
+ uninstall(contextB1);
+ }
+ assertNoClassLoader(contextB1);
+ }
+ finally
+ {
+ uninstall(contextA1);
+ }
+ assertNoClassLoader(contextA1);
+ }
}
More information about the jboss-cvs-commits
mailing list