コード例 #1
0
 public synchronized KeyedHashSet getImportedSources(KeyedHashSet visited) {
   if ((loaderFlags & FLAG_IMPORTSINIT) != 0) return importedSources;
   BundleDescription bundleDesc = proxy.getBundleDescription();
   ExportPackageDescription[] packages = bundleDesc.getResolvedImports();
   if (packages != null && packages.length > 0) {
     if (importedSources == null) importedSources = new KeyedHashSet(packages.length, false);
     for (int i = 0; i < packages.length; i++) {
       if (packages[i].getExporter() == bundleDesc)
         continue; // ignore imports resolved to this bundle
       PackageSource source = createExportPackageSource(packages[i], visited);
       if (source != null) importedSources.add(source);
     }
   }
   loaderFlags |= FLAG_IMPORTSINIT;
   return importedSources;
 }
コード例 #2
0
 public void checkWiringState_6() {
   ExportPackageDescription[] exports = bundle_6.getResolvedImports();
   assertNotNull("export array is unexpectedly null", exports);
   assertTrue("export array is unexpectedly empty", exports.length > 0);
   for (int i = 0; i < exports.length; i++) {
     ExportPackageDescription exp = exports[i];
     String exportPackageName = exp.getName();
     assertNotNull("package name is null", exportPackageName);
     if (exportPackageName.equals("org.w3c.dom")) {
       assertNotNull("Package [org.w3c.dom] is not wired when it should be ", exp.getExporter());
       assertEquals("Package [org.w3c.dom] is wired incorrectly ", exp.getExporter(), bundle_4);
     } else if (exportPackageName.equals("org.xml.sax")) {
       assertNotNull("Package [org.xml.sax] is not wired when it should be ", exp.getExporter());
       assertEquals("Package [org.xml.sax] is wired incorrectly ", exp.getExporter(), bundle_3);
     }
   } // end for
 } // end method