1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
---
layout: default
class: Header
title: Require-Bundle ::= bundle-description ( ',' bundle-description )*
summary: The Require-Bundle header specifies that all exported packages from another bundle must be im- ported, effectively requiring the public interface of another bundle.
---
verifyDirectives(Constants.REQUIRE_BUNDLE, "visibility:|resolution:", SYMBOLICNAME, "bsn");
//
// If there is a Require bundle, all bets are off and
// we cannot verify anything
//
if (domain.getRequireBundle().isEmpty() && domain.get("ExtensionBundle-Activator") == null
&& (domain.getFragmentHost()== null || domain.getFragmentHost().getKey().equals("system.bundle"))) {
if (!unresolvedReferences.isEmpty()) {
// Now we want to know the
// classes that are the culprits
Set<String> culprits = new HashSet<String>();
for (Clazz clazz : analyzer.getClassspace().values()) {
if (hasOverlap(unresolvedReferences, clazz.getReferred()))
culprits.add(clazz.getAbsolutePath());
}
if (analyzer instanceof Builder)
warning("Unresolved references to %s by class(es) %s on the " + Constants.BUNDLE_CLASSPATH + ": %s",
unresolvedReferences, culprits, analyzer.getBundleClasspath().keySet());
else
error("Unresolved references to %s by class(es) %s on the " + Constants.BUNDLE_CLASSPATH + ": %s",
unresolvedReferences, culprits, analyzer.getBundleClasspath().keySet());
return;
}
} else if (isPedantic())
warning("Use of " + Constants.REQUIRE_BUNDLE + ", ExtensionBundle-Activator, or a system bundle fragment makes it impossible to verify unresolved references");
|