Modified findClassBeforeModule() to throw an exception with a more
meaningful message when the underlying module could not be resolved.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@349967 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java b/framework/src/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
index 7630731..7c22675 100755
--- a/framework/src/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
+++ b/framework/src/org/apache/felix/framework/searchpolicy/R4SearchPolicy.java
@@ -101,7 +101,12 @@
         }
         catch (ResolveException ex)
         {
-            throw new ClassNotFoundException(name);
+            // We do not use the resolve exception as the
+            // cause of the exception, since this would
+            // potentially leak internal module information.
+            throw new ClassNotFoundException(
+                name + ": cannot resolve package "
+                + ex.getPackage() + ".");
         }
 
         // Get the package of the target class.
@@ -590,7 +595,7 @@
                 else
                 {
                     throw new ResolveException(
-                            "Unable to resolve.", module, imports[impIdx]);
+                        "Unable to resolve.", module, imports[impIdx]);
                 }
             }
             else if (candidates.length > 0)