org.eclipse.osgi_3.8.2.v20130124-134944

ngBuffer bundleEE = new StringBuffer("Bundle-RequiredExecutionEnvironment".length() + 20);
      bundleEE.append("Bundle-RequiredExecutionEnvironment").append(": ");
      for (int i = 0; i < ees.length; i++)
      {
        if (i > 0) {
          bundleEE.append(",");
        }
        bundleEE.append(ees[i]);
      }
      state.addResolverError(bundleDesc, 16384, bundleEE.toString(), null);
      return false;
    }
    NativeCodeSpecification nativeCode = bundleDesc.getNativeCodeSpecification();
    if (nativeCode != null)
    {
      NativeCodeDescription[] nativeCodeSuppliers = nativeCode.getPossibleSuppliers();
      NativeCodeDescription highestRanked = null;
      for (int i = 0; i < nativeCodeSuppliers.length; i++) {
        if ((nativeCode.isSatisfiedBy(nativeCodeSuppliers[i])) && ((highestRanked == null) || (highestRanked.compareTo(nativeCodeSuppliers[i]) < 0))) {
          highestRanked = nativeCodeSuppliers[i];
        }
      }
      if (highestRanked == null)
      {
        if (!nativeCode.isOptional())
        {
          state.addResolverError(bundleDesc, 65536, nativeCode.toString(), nativeCode);
          return false;
        }
      }
      else if (highestRanked.hasInvalidNativePaths())
      {
        state.addResolverError(bundleDesc, 131072, highestRanked.toString(), nativeCode);
        return false;
      }
      state.resolveConstraint(nativeCode, highestRanked);
    }
    String platformFilter = bundleDesc.getPlatformFilter();
    if (platformFilter == null) {
      return true;
    }
    if (platformProperties == null) {
      return false;
    }
    try
    {
      Filter filter = FilterImpl.newInstance(platformFilter);
      for (int i = 0; i < platformProperties.length; i++)
      {
        Dictionary props = platformProperties[i];
        if (filter.matchCase(props)) {
          return true;
        }
      }
    }
    catch (InvalidSyntaxException localInvalidSyntaxException) {}
    state.addResolverError(bundleDesc, 8192, platformFilter, null);
    return false;
  }
  
  private void attachFragment(ResolverBundle bundle, Collection<String> processedFragments)
  {
    if (processedFragments.contains(bundle.getName())) {
      return;
    }
    processedFragments.add(bundle.getName());
    
    List<ResolverBundle> fragments = resolverBundles.get(bundle.getName());
    for (Iterator localIterator = fragments.iterator(); localIterator.hasNext();)
    {
      ResolverBundle fragment = (ResolverBundle)localIterator.next();
      if (!fragment.isResolved()) {
        attachFragment0(fragment);
      }
    }
  }
  
  private void attachFragment0(ResolverBundle bundle)
  {
    if ((!bundle.isFragment()) || (!bundle.isResolvable())) {
      return;
    }
    bundle.clearWires();
    if (!resolveOSGiEE(bundle)) {
      return;
    }
    boolean foundMatch = false;
    BundleConstraint hostConstraint = bundle.getHost();
    long timestamp;
    List<ResolverBundle> candidates;
    do
    {
      timestamp = state.getTimeStamp();
      List<ResolverBundle> hosts = resolverBundles.get(hostConstraint.getVersionConstraint().getName());
      candidates = new ArrayList(hosts);
      hostCapabilities = new ArrayList(hosts.size());
      for (Iterator<ResolverBundle> iCandidates = candidates.iterator(); iCandidates.hasNext();)
      {
        ResolverBundle host = (ResolverBundle)iCandidates.next();
        if ((!host.isResolvable()) || (!host.getBundleDescription().attachFragments()) || (!hostConstraint.isSatisfiedBy(host)))
        {
          iCandidates.remove();
        }
        else
        {
          List<BundleCapability> h = host.getBundleDescription().getDeclaredCapabilities("osgi.wiring.host");
          
          hostCapabilities.add((BundleCapability)h.get(0));
        }
      }
      if (hook != null) {
        hook.filterMatches(hostConstraint.getRequirement(), asCapabilities(new ArrayMap(hostCapabilities, candidates)));
      }
    } while (timestamp != state.getTimeStamp());
    for (List<BundleCapability> hostCapabilities = candidates.iterator(); hostCapabilities.hasNext();)
    {
      ResolverBundle host = (ResolverBundle)hostCapabilities.next();
      foundMatch = true;
      host.attachFragment(bundle, true);
    }
    if (!foundMatch) {
      state.addResolverError(bundle.getBundleDescription(), 4, bundle.getHost().getVersionConstraint().toString(), bundle.getHost().getVersionConstraint());
    }
  }
  
  private boolean resolveOSGiEE(ResolverBundle bundle)
  {
    GenericConstraint[] requirements = bundle.getGenericRequires();
    GenericConstraint[] arrayOfGenericConstraint1;
    int j = (arrayOfGenericConstraint1 = requirements).length;
    for (int i = 0; i < j; i++)
    {
      GenericConstraint requirement = arrayOfGenericConstraint1[i];
      if (("osgi.ee".equals(requirement.getNameSpace())) || (requirement.isEffective())) {
        if (!resolveGenericReq(requirement, new ArrayList(0)))
        {
          if ((DEBUG) || (DEBUG_GENERICS)) {
            log("** GENERICS " + requirement.getVersionConstraint().getName() + "[" + requirement.getBundleDescription() + "] failed to resolve");
          }
          state.addResolverError(requirement.getVersionConstraint().getBundle(), 32768, requirement.getVersionConstraint().toString(), requirement.getVersionConstraint());
          if (!developmentMode) {
            return false;
          }
        }
        else
        {
          VersionSupplier supplier = requirement.getSelectedSupplier();
          Integer ee = supplier == null ? null : (Integer)((GenericDescription)supplier.getBaseDescription()).getAttributes().get("x-equinox-ee");
          if ((ee != null) && (((BundleDescriptionImpl)bundle.getBaseDescription()).getEquinoxEE() < 0)) {
            ((BundleDescriptionImpl)bundle.getBundleDescription()).setEquinoxEE(ee.intValue());
          }
        }
      }
    }
    return true;
  }
  
  /* Error */
  public synchronized void resolve(BundleDescription[] reRefresh, Dictionary<Object, Object>[] platformProperties)
  {
    // Byte code:
    //   0: getstatic 1458	org/eclipse/osgi/internal/module/ResolverImpl:DEBUG	Z
    //   3: ifeq +9 -> 12
    //   6: ldc_w 730
    //   9: invokestatic 1654	org/eclipse/osgi/internal/module/ResolverImpl:log	(Ljava/lang/String;)V
    //   12: aload_0
    //   13: getfield 1480	org/eclipse/osgi/internal/module/ResolverImpl:state	Lorg/eclipse/osgi/service/resolver/State;
    //   16: ifnonnull +14 -> 30
    //   19: new 790	java/lang/IllegalStateException
    //   22: dup
    //   23: ldc_w 755
    //   26: invokespecial 1484	java/lang/IllegalStateException:<init>	(Ljava/lang/String;)V
    //   29: athrow
    //   30: aload_0
    //   31: getfield 1466	org/eclipse/osgi/internal/module/ResolverImpl:initialized	Z
    //   34: ifne +7 -> 41
    //   37: aload_0
    //   38: invokespecial 1647	org/eclipse/osgi/internal/module/ResolverImpl:initialize	()V
    //   41: aload_0
    //   42: aload_0
    //   43: getfield 1480	org/eclipse/osgi/internal/module/ResolverImpl:state	Lorg/eclipse/osgi/service/resolver/State;
    //   46: instanceof 837
    //   49: ifeq +16 -> 65
    //   52: aload_0
    //   53: getfield 1480	org/eclipse/osgi/internal/module/ResolverImpl:state	Lorg/eclipse/osgi/service/resolver/State;
    //   56: checkcast 837	org/eclipse/osgi/internal/resolver/StateImpl
    //   59: invokevirtual 1753	org/eclipse/osgi/internal/resolver/StateImpl:getResolverHook	()Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   62: goto +4 -> 66
    //   65: aconst_null
    //   66: putfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   69: aload_0
    //   70: aload_2
    //   71: arraylength
    //   72: ifne +7 -> 79
    //   75: iconst_0
    //   76: goto +18 -> 94
    //   79: ldc_w 762
    //   82: aload_2
    //   83: iconst_0
    //   84: aaload
    //   85: ldc_w 772
    //   88: invokevirtual 1514	java/util/Dictionary:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   91: invokevirtual 1494	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   94: putfield 1465	org/eclipse/osgi/internal/module/ResolverImpl:developmentMode	Z
    //   97: aload_0
    //   98: aload_0
    //   99: aload_2
    //   100: invokespecial 1656	org/eclipse/osgi/internal/module/ResolverImpl:getUsesTimeout	([Ljava/util/Dictionary;)J
    //   103: putfield 1457	org/eclipse/osgi/internal/module/ResolverImpl:usesTimeout	J
    //   106: aload_0
    //   107: aload_0
    //   108: aload_2
    //   109: invokespecial 1655	org/eclipse/osgi/internal/module/ResolverImpl:getMultipleSuppliersLimit	([Ljava/util/Dictionary;)I
    //   112: putfield 1456	org/eclipse/osgi/internal/module/ResolverImpl:usesMultipleSuppliersLimit	I
    //   115: aload_0
    //   116: aload_1
    //   117: invokespecial 1702	org/eclipse/osgi/internal/module/ResolverImpl:addDevConstraints	([Lorg/eclipse/osgi/service/resolver/BundleDescription;)[Lorg/eclipse/osgi/service/resolver/BundleDescription;
    //   120: astore_1
    //   121: aload_1
    //   122: ifnull +44 -> 166
    //   125: iconst_0
    //   126: istore_3
    //   127: goto +33 -> 160
    //   130: aload_0
    //   131: getfield 1470	org/eclipse/osgi/internal/module/ResolverImpl:bundleMapping	Ljava/util/HashMap;
    //   134: aload_1
    //   135: iload_3
    //   136: aaload
    //   137: invokevirtual 1519	java/util/HashMap:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   140: checkcast 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   143: astore 4
    //   145: aload 4
    //   147: ifnull +10 -> 157
    //   150: aload_0
    //   151: aload 4
    //   153: iconst_0
    //   154: invokespecial 1673	org/eclipse/osgi/internal/module/ResolverImpl:unresolveBundle	(Lorg/eclipse/osgi/internal/module/ResolverBundle;Z)V
    //   157: iinc 3 1
    //   160: iload_3
    //   161: aload_1
    //   162: arraylength
    //   163: if_icmplt -33 -> 130
    //   166: aload_0
    //   167: getfield 1479	org/eclipse/osgi/internal/module/ResolverImpl:resolverExports	Lorg/eclipse/osgi/internal/module/VersionHashMap;
    //   170: invokevirtual 1736	org/eclipse/osgi/internal/module/VersionHashMap:reorder	()V
    //   173: aload_0
    //   174: getfield 1478	org/eclipse/osgi/internal/module/ResolverImpl:resolverBundles	Lorg/eclipse/osgi/internal/module/VersionHashMap;
    //   177: invokevirtual 1736	org/eclipse/osgi/internal/module/VersionHashMap:reorder	()V
    //   180: aload_0
    //   181: invokespecial 1649	org/eclipse/osgi/internal/module/ResolverImpl:reorderGenerics	()V
    //   184: aload_0
    //   185: aload_2
    //   186: invokespecial 1657	org/eclipse/osgi/internal/module/ResolverImpl:getCurrentEEs	([Ljava/util/Dictionary;)V
    //   189: aload_2
    //   190: arraylength
    //   191: ifne +7 -> 198
    //   194: iconst_0
    //   195: goto +18 -> 213
    //   198: ldc_w 779
    //   201: aload_2
    //   202: iconst_0
    //   203: aaload
    //   204: ldc_w 770
    //   207: invokevirtual 1514	java/util/Dictionary:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   210: invokevirtual 1494	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   213: istore_3
    //   214: aconst_null
    //   215: astore 4
    //   217: iload_3
    //   218: ifeq +59 -> 277
    //   221: aload_0
    //   222: getfield 1480	org/eclipse/osgi/internal/module/ResolverImpl:state	Lorg/eclipse/osgi/service/resolver/State;
    //   225: invokeinterface 1827 1 0
    //   230: astore 5
    //   232: aload 5
    //   234: arraylength
    //   235: anewarray 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   238: astore 4
    //   240: iconst_0
    //   241: istore 6
    //   243: goto +26 -> 269
    //   246: aload 4
    //   248: iload 6
    //   250: aload_0
    //   251: getfield 1470	org/eclipse/osgi/internal/module/ResolverImpl:bundleMapping	Ljava/util/HashMap;
    //   254: aload 5
    //   256: iload 6
    //   258: aaload
    //   259: invokevirtual 1519	java/util/HashMap:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   262: checkcast 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   265: aastore
    //   266: iinc 6 1
    //   269: iload 6
    //   271: aload 5
    //   273: arraylength
    //   274: if_icmplt -28 -> 246
    //   277: getstatic 1452	java/util/Collections:EMPTY_LIST	Ljava/util/List;
    //   280: astore 5
    //   282: aload_0
    //   283: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   286: ifnull +145 -> 431
    //   289: new 800	java/util/ArrayList
    //   292: dup
    //   293: aload_0
    //   294: getfield 1471	org/eclipse/osgi/internal/module/ResolverImpl:unresolvedBundles	Ljava/util/HashSet;
    //   297: invokespecial 1511	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   300: astore 6
    //   302: new 800	java/util/ArrayList
    //   305: dup
    //   306: aload 6
    //   308: invokeinterface 1768 1 0
    //   313: invokespecial 1509	java/util/ArrayList:<init>	(I)V
    //   316: astore 7
    //   318: aload 6
    //   320: invokeinterface 1774 1 0
    //   325: astore 9
    //   327: goto +28 -> 355
    //   330: aload 9
    //   332: invokeinterface 1767 1 0
    //   337: checkcast 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   340: astore 8
    //   342: aload 7
    //   344: aload 8
    //   346: invokevirtual 1619	org/eclipse/osgi/internal/module/ResolverBundle:getBundleDescription	()Lorg/eclipse/osgi/service/resolver/BundleDescription;
    //   349: invokeinterface 1772 2 0
    //   354: pop
    //   355: aload 9
    //   357: invokeinterface 1766 1 0
    //   362: ifne -32 -> 330
    //   365: new 818	org/eclipse/osgi/internal/baseadaptor/ArrayMap
    //   368: dup
    //   369: aload 7
    //   371: aload 6
    //   373: invokespecial 1537	org/eclipse/osgi/internal/baseadaptor/ArrayMap:<init>	(Ljava/util/List;Ljava/util/List;)V
    //   376: astore 8
    //   378: aload 6
    //   380: invokeinterface 1768 1 0
    //   385: istore 9
    //   387: aload_0
    //   388: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   391: aload 8
    //   393: invokeinterface 1840 2 0
    //   398: aload 8
    //   400: invokevirtual 1536	org/eclipse/osgi/internal/baseadaptor/ArrayMap:size	()I
    //   403: iload 9
    //   405: if_icmpge +26 -> 431
    //   408: new 800	java/util/ArrayList
    //   411: dup
    //   412: aload_0
    //   413: getfield 1471	org/eclipse/osgi/internal/module/ResolverImpl:unresolvedBundles	Ljava/util/HashSet;
    //   416: invokespecial 1511	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   419: astore 5
    //   421: aload 5
    //   423: aload 6
    //   425: invokeinterface 1761 2 0
    //   430: pop
    //   431: aload_0
    //   432: iconst_0
    //   433: putfield 1467	org/eclipse/osgi/internal/module/ResolverImpl:usesCalculationTimeout	Z
    //   436: new 800	java/util/ArrayList
    //   439: dup
    //   440: aload_0
    //   441: getfield 1471	org/eclipse/osgi/internal/module/ResolverImpl:unresolvedBundles	Ljava/util/HashSet;
    //   444: invokespecial 1511	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   447: astore 6
    //   449: new 800	java/util/ArrayList
    //   452: dup
    //   453: iconst_1
    //   454: invokespecial 1509	java/util/ArrayList:<init>	(I)V
    //   457: astore 7
    //   459: aload_0
    //   460: invokevirtual 1653	org/eclipse/osgi/internal/module/ResolverImpl:getSystemBundle	()Ljava/lang/String;
    //   463: astore 8
    //   465: aload 6
    //   467: invokeinterface 1774 1 0
    //   472: astore 9
    //   474: goto +54 -> 528
    //   477: aload 9
    //   479: invokeinterface 1767 1 0
    //   484: checkcast 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   487: astore 10
    //   489: aload 10
    //   491: invokevirtual 1607	org/eclipse/osgi/internal/module/ResolverBundle:getName	()Ljava/lang/String;
    //   494: astore 11
    //   496: aload 11
    //   498: ifnull +30 -> 528
    //   501: aload 11
    //   503: aload 8
    //   505: invokevirtual 1494	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   508: ifeq +20 -> 528
    //   511: aload 7
    //   513: aload 10
    //   515: invokeinterface 1772 2 0
    //   520: pop
    //   521: aload 9
    //   523: invokeinterface 1765 1 0
    //   528: aload 9
    //   530: invokeinterface 1766 1 0
    //   535: ifne -58 -> 477
    //   538: aload 7
    //   540: invokeinterface 1770 1 0
    //   545: ifne +30 -> 575
    //   548: aload_0
    //   549: aload 7
    //   551: aload 7
    //   553: invokeinterface 1768 1 0
    //   558: anewarray 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   561: invokeinterface 1775 2 0
    //   566: checkcast 783	[Lorg/eclipse/osgi/internal/module/ResolverBundle;
    //   569: aload_2
    //   570: aload 5
    //   572: invokespecial 1706	org/eclipse/osgi/internal/module/ResolverImpl:resolveBundles	([Lorg/eclipse/osgi/internal/module/ResolverBundle;[Ljava/util/Dictionary;Ljava/util/Collection;)V
    //   575: aload_0
    //   576: aload 6
    //   578: aload 6
    //   580: invokeinterface 1768 1 0
    //   585: anewarray 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   588: invokeinterface 1775 2 0
    //   593: checkcast 783	[Lorg/eclipse/osgi/internal/module/ResolverBundle;
    //   596: aload_2
    //   597: aload 5
    //   599: invokespecial 1706	org/eclipse/osgi/internal/module/ResolverImpl:resolveBundles	([Lorg/eclipse/osgi/internal/module/ResolverBundle;[Ljava/util/Dictionary;Ljava/util/Collection;)V
    //   602: iload_3
    //   603: ifeq +12 -> 615
    //   606: aload_0
    //   607: aload 4
    //   609: invokespecial 1684	org/eclipse/osgi/internal/module/ResolverImpl:resolveOptionalConstraints	([Lorg/eclipse/osgi/internal/module/ResolverBundle;)Ljava/util/Collection;
    //   612: goto +6 -> 618
    //   615: getstatic 1452	java/util/Collections:EMPTY_LIST	Ljava/util/List;
    //   618: astore 9
    //   620: aload_0
    //   621: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   624: astore 10
    //   626: aload 10
    //   628: ifnull +15 -> 643
    //   631: aload_0
    //   632: aconst_null
    //   633: putfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   636: aload 10
    //   638: invokeinterface 1839 1 0
    //   643: aload_0
    //   644: aload_0
    //   645: getfield 1470	org/eclipse/osgi/internal/module/ResolverImpl:bundleMapping	Ljava/util/HashMap;
    //   648: invokevirtual 1518	java/util/HashMap:values	()Ljava/util/Collection;
    //   651: aload_0
    //   652: getfield 1470	org/eclipse/osgi/internal/module/ResolverImpl:bundleMapping	Ljava/util/HashMap;
    //   655: invokevirtual 1515	java/util/HashMap:size	()I
    //   658: anewarray 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   661: invokeinterface 1763 2 0
    //   666: checkcast 783	[Lorg/eclipse/osgi/internal/module/ResolverBundle;
    //   669: invokespecial 1676	org/eclipse/osgi/internal/module/ResolverImpl:stateResolveBundles	([Lorg/eclipse/osgi/internal/module/ResolverBundle;)V
    //   672: aload 9
    //   674: invokeinterface 1762 1 0
    //   679: astore 12
    //   681: goto +44 -> 725
    //   684: aload 12
    //   686: invokeinterface 1767 1 0
    //   691: checkcast 828	org/eclipse/osgi/internal/module/ResolverBundle
    //   694: astore 11
    //   696: aload_0
    //   697: getfield 1480	org/eclipse/osgi/internal/module/ResolverImpl:state	Lorg/eclipse/osgi/service/resolver/State;
    //   700: aload 11
    //   702: invokevirtual 1619	org/eclipse/osgi/internal/module/ResolverBundle:getBundleDescription	()Lorg/eclipse/osgi/service/resolver/BundleDescription;
    //   705: iconst_0
    //   706: aconst_null
    //   707: aconst_null
    //   708: aconst_null
    //   709: aconst_null
    //   710: aconst_null
    //   711: aconst_null
    //   712: aconst_null
    //   713: aconst_null
    //   714: invokeinterface 1834 11 0
    //   719: aload_0
    //   720: aload 11
    //   722: invokespecial 1668	org/eclipse/osgi/internal/module/ResolverImpl:stateResolveBundle	(Lorg/eclipse/osgi/internal/module/ResolverBundle;)V
    //   725: aload 12
    //   727: invokeinterface 1766 1 0
    //   732: ifne -48 -> 684
    //   735: aload_0
    //   736: getfield 1479	org/eclipse/osgi/internal/module/ResolverImpl:resolverExports	Lorg/eclipse/osgi/internal/module/VersionHashMap;
    //   739: invokevirtual 1736	org/eclipse/osgi/internal/module/VersionHashMap:reorder	()V
    //   742: aload_0
    //   743: getfield 1478	org/eclipse/osgi/internal/module/ResolverImpl:resolverBundles	Lorg/eclipse/osgi/internal/module/VersionHashMap;
    //   746: invokevirtual 1736	org/eclipse/osgi/internal/module/VersionHashMap:reorder	()V
    //   749: aload_0
    //   750: invokespecial 1649	org/eclipse/osgi/internal/module/ResolverImpl:reorderGenerics	()V
    //   753: iload_3
    //   754: ifeq +10 -> 764
    //   757: aload_0
    //   758: aload 4
    //   760: invokespecial 1684	org/eclipse/osgi/internal/module/ResolverImpl:resolveOptionalConstraints	([Lorg/eclipse/osgi/internal/module/ResolverBundle;)Ljava/util/Collection;
    //   763: pop
    //   764: getstatic 1458	org/eclipse/osgi/internal/module/ResolverImpl:DEBUG	Z
    //   767: ifeq +38 -> 805
    //   770: ldc_w 731
    //   773: invokestatic 1654	org/eclipse/osgi/internal/module/ResolverImpl:log	(Ljava/lang/String;)V
    //   776: goto +29 -> 805
    //   779: astore 13
    //   781: aload_0
    //   782: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   785: ifnull +12 -> 797
    //   788: aload_0
    //   789: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   792: invokeinterface 1839 1 0
    //   797: aload_0
    //   798: aconst_null
    //   799: putfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   802: aload 13
    //   804: athrow
    //   805: aload_0
    //   806: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   809: ifnull +12 -> 821
    //   812: aload_0
    //   813: getfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   816: invokeinterface 1839 1 0
    //   821: aload_0
    //   822: aconst_null
    //   823: putfield 1481	org/eclipse/osgi/internal/module/ResolverImpl:hook	Lorg/osgi/framework/hooks/resolver/ResolverHook;
    //   826: return
    // Line number table:
    //   Java source line #415	-> byte code offset #0
    //   Java source line #416	-> byte code offset #6
    //   Java source line #417	-> byte code offset #12
    //   Java source line #418	-> byte code offset #19
    //   Java source line #420	-> byte code offset #30
    //   Java source line #421	-> byte code offset #37
    //   Java source line #422	-> byte code offset #41
    //   Java source line #425	-> byte code offset #69
    //   Java source line #427	-> byte code offset #97
    //   Java source line #429	-> byte code offset #106
    //   Java source line #430	-> byte code offset #115
    //   Java source line #432	-> byte code offset #121
    //   Java source line #433	-> byte code offset #125
    //   Java source line #434	-> byte code offset #130
    //   Java source line #435	-> byte code offset #145
    //   Java source line #436	-> byte code offset #150
    //   Java source line #433	-> byte code offset #157
    //   Java source line #439	-> byte code offset #166
    //   Java source line #440	-> byte code offset #173
    //   Java source line #441	-> byte code offset #180
    //   Java source line #443	-> byte code offset #184
    //   Java source line #444	-> byte code offset #189
    //   Java source line #445	-> byte code offset #214
    //   Java source line #446	-> byte code offset #217
    //   Java source line #447	-> byte code offset #221
    //   Java source line #448	-> byte code offset #232
    //   Java source line #449	-> byte code offset #240
    //   Java source line #450	-> byte code offset #246
    //   Java source line #449	-> byte code offset #266
    //   Java source line #454	-> byte code offset #277
    //   Java source line #455	-> byte code offset #282
    //   Java source line #456	-> byte code offset #289
    //   Java source line #457	-> byte code offset #302
    //   Java source line #458	-> byte code offset #318
    //   Java source line #459	-> byte code offset #342
    //   Java source line #458	-> byte code offset #355
    //   Java source line #460	-> byte code offset #365
    //   Java source line #461	-> byte code offset #378
    //   Java source line #462	-> byte code offset #387
    //   Java source line #463	-> byte code offset #398
    //   Java source line #464	-> byte code offset #408
    //   Java source line #465	-> byte code offset #421
    //   Java source line #469	-> byte code offset #431
    //   Java source line #471	-> byte code offset #436
    //   Java source line #473	-> byte code offset #449
    //   Java source line #474	-> byte code offset #459
    //   Java source line #475	-> byte code offset #465
    //   Java source line #476	-> byte code offset #477
    //   Java source line #477	-> byte code offset #489
    //   Java source line #478	-> byte code offset #496
    //   Java source line #479	-> byte code offset #511
    //   Java source line #480	-> byte code offset #521
    //   Java source line #475	-> byte code offset #528
    //   Java source line #483	-> byte code offset #538
    //   Java source line #484	-> byte code offset #548
    //   Java source line #487	-> byte code offset #575
    //   Java source line #490	-> byte code offset #602
    //   Java source line #491	-> byte code offset #620
    //   Java source line #492	-> byte code offset #626
    //   Java source line #493	-> byte code offset #631
    //   Java source line #494	-> byte code offset #636
    //   Java source line #499	-> byte code offset #643
    //   Java source line #501	-> byte code offset #672
    //   Java source line #502	-> byte code offset #696
    //   Java source line #503	-> byte code offset #719
    //   Java source line #501	-> byte code offset #725
    //   Java source line #506	-> byte code offset #735
    //   Java source line #507	-> byte code offset #742
    //   Java source line #508	-> byte code offset #749
    //   Java source line #509	-> byte code offset #753
    //   Java source line #510	-> byte code offset #757
    //   Java source line #511	-> byte code offset #764
    //   Java source line #512	-> byte code offset #770
    //   Java source line #513	-> byte code offset #776
    //   Java source line #514	-> byte code offset #781
    //   Java source line #515	-> byte code offset #788
    //   Java source line #516	-> byte code offset #797
    //   Java source line #517	-> byte code offset #802
    //   Java source line #514	-> byte code offset #805
    //   Java source line #515	-> byte code offset #812
    //   Java source line #516	-> byte code offset #821
    //   Java source line #518	-> byte code offset #826
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	827	0	this	ResolverImpl
    //   0	827	1	reRefresh	BundleDescription[]
    //   0	827	2	platformProperties	Dictionary[]
    //   126	35	3	i	int
    //   213	541	3	resolveOptional	boolean
    //   143	9	4	rb	ResolverBundle
    //   215	544	4	currentlyResolved	ResolverBundle[]
    //   230	42	5	resolvedBundles	BundleDescription[]
    //   280	318	5	hookDisabled	Collection<ResolverBundle>
    //   241	29	6	i	int
    //   300	124	6	resolvableBundles	List<ResolverBundle>
    //   447	132	6	toResolve	List<ResolverBundle>
    //   316	54	7	resolvableRevisions	List<org.osgi.framework.wiring.BundleRevision>
    //   457	95	7	unresolvedSystemBundles	List<ResolverBundle>
    //   340	5	8	bundle	ResolverBundle
    //   376	23	8	resolvable	ArrayMap<org.osgi.framework.wiring.BundleRevision, ResolverBundle>
    //   463	41	8	systemBSN	String
    //   325	31	9	localIterator1	Iterator
    //   385	21	9	size	int
    //   472	57	9	iToResolve	Object
    //   618	55	9	optionalResolved	Object
    //   487	27	10	rb	ResolverBundle
    //   624	13	10	current	ResolverHook
    //   494	8	11	symbolicName	String
    //   694	27	11	bundle	ResolverBundle
    //   679	47	12	localIterator2	Iterator
    //   779	24	13	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   69	779	779	finally
  }
  
  private long getUsesTimeout(Dictionary<Object, Object>[] platformProperties)
  {
    try
    {
      Object timeout = platformProperties.length == 0 ? null : platformProperties[0].get("osgi.usesTimeout");
      if (timeout != null)
      {
        long temp = Long.parseLong(timeout.toString());
        if (temp < 0L) {
          return -1L;
        }
        if (temp == 0L) {
          return Long.MAX_VALUE;
        }
        return temp;
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return -1L;
  }
  
  private int getMultipleSuppliersLimit(Dictionary<Object, Object>[] platformProperties)
  {
    try
    {
      Object limit = platformProperties.length == 0 ? null : platformProperties[0].get("osgi.usesLimit");
      if (limit != null)
      {
        int temp = Integer.parseInt(limit.toString());
        if (temp < 0) {
          return MAX_MULTIPLE_SUPPLIERS_MERGE;
        }
        if (temp == 0) {
          return Integer.MAX_VALUE;
        }
        return temp;
      }
    }
    catch (NumberFormatException localNumberFormatException) {}
    return MAX_MULTIPLE_SUPPLIERS_MERGE;
  }
  
  private BundleDescription[] addDevConstraints(BundleDescription[] reRefresh)
  {
    if (!developmentMode) {
      return reRefresh;
    }
    Set<BundleDescription> additionalRefresh = new HashSet();
    ResolverBundle[] unresolved = (ResolverBundle[])unresolvedBundles.toArray(new ResolverBundle[unresolvedBundles.size()]);
    for (int i = 0; i < unresolved.length; i++)
    {
      addUnresolvedWithDependents(unresolved[i], additionalRefresh);
      addHostsFromFragmentConstraints(unresolved[i], additionalRefresh);
    }
    if (additionalRefresh.size() == 0) {
      return reRefresh;
    }
    if (reRefresh != null) {
      for (int i = 0; i < reRefresh.length; i++) {
        additionalRefresh.add(reRefresh[i]);
      }
    }
    return (BundleDescription[])additionalRefresh.toArray(new BundleDescription[additionalRefresh.size()]);
  }
  
  private void addUnresolvedWithDependents(ResolverBundle unresolved, Set<BundleDescription> additionalRefresh)
  {
    BundleDescription[] dependents = unresolved.getBundleDescription().getDependents();
    if (dependents.length > 0) {
      additionalRefresh.add(unresolved.getBundleDescription());
    }
  }
  
  private void addHostsFromFragmentConstraints(ResolverBundle unresolved, Set<BundleDescription> additionalRefresh)
  {
    if (!unresolved.isFragment()) {
      return;
    }
    ImportPackageSpecification[] newImports = unresolved.getBundleDescription().getImportPackages();
    BundleSpecification[] newRequires = unresolved.getBundleDescription().getRequiredBundles();
    if ((newImports.length == 0) && (newRequires.length == 0)) {
      return;
    }
    BundleConstraint hostConstraint = unresolved.getHost();
    List<ResolverBundle> hosts = resolverBundles.get(hostConstraint.getVersionConstraint().getName());
    for (Iterator localIterator = hosts.iterator(); localIterator.hasNext();)
    {
      ResolverBundle host = (ResolverBundle)localIterator.next();
      if ((hostConstraint.isSatisfiedBy(host)) && (host.isResolved())) {
        additionalRefresh.add(host.getBundleDescription());
      }
    }
  }
  
  private Collection<ResolverBundle> resolveOptionalConstraints(ResolverBundle[] bundles)
  {
    Collection<ResolverBundle> result = new ArrayList();
    for (int i = 0; i < bundles.length; i++) {
      if ((bundles[i] != null) && (resolveOptionalConstraints(bundles[i]))) {
        result.add(bundles[i]);
      }
    }
    return result;
  }
  
  private boolean resolveOptionalConstraints(ResolverBundle bundle)
  {
    BundleConstraint[] requires = bundle.getRequires();
    List<ResolverBundle> cycle = new ArrayList();
    boolean resolvedOptional = false;
    for (int i = 0; i < requires.length; i++) {
      if ((requires[i].isOptional()) && (requires[i].getSelectedSupplier() == null))
      {
        cycle.clear();
        resolveRequire(requires[i], cycle);
        if (requires[i].getSelectedSupplier() != null) {
          resolvedOptional = true;
        }
      }
    }
    ResolverImport[] imports = bundle.getImportPackages();
    for (int i = 0; i < imports.length; i++) {
      if ((imports[i].isOptional()) && (imports[i].getSelectedSupplier() == null))
      {
        cycle.clear();
        resolveImport(imports[i], cycle);
        if (imports[i].getSelectedSupplier() != null) {
          resolvedOptional = true;
        }
      }
    }
    return resolvedOptional;
  }
  
  private void getCurrentEEs(Dictionary<Object, Object>[] platformProperties)
  {
    CURRENT_EES = new String[platformProperties.length][];
    for (int i = 0; i < platformProperties.length; i++)
    {
      String eeSpecs = (String)platformProperties[i].get("org.osgi.framework.executionenvironment");
      CURRENT_EES[i] = ManifestElement.getArrayFromList(eeSpecs, ",");
    }
  }
  
  private void resolveBundles(ResolverBundle[] bundles, Dictionary<Object, Object>[] platformProperties, Collection<ResolverBundle> hookDisabled)
  {
    ResolverBundle[] arrayOfResolverBundle;
    int j = (arrayOfResolverBundle = bundles).length;
    for (int i = 0; i < j; i++)
    {
      ResolverBundle bundle = arrayOfResolverBundle[i];
      state.removeResolverErrors(bundle.getBundleDescription());
      
      bundle.setResolvable((isResolvable(bundle, platformProperties, hookDisabled)) || (developmentMode));
    }
    selectSingletons(bundles);
    resolveBundles0(bundles, platformProperties);
    if (DEBUG_WIRING) {
      printWirings();
    }
  }
  
  private void selectSingletons(ResolverBundle[] bundles)
  {
    if (developmentMode) {
      return;
    }
    Map<String, Collection<ResolverBundle>> selectedSingletons = new HashMap(bundles.length);
    ResolverBundle[] arrayOfResolverBundle;
    int j = (arrayOfResolverBundle = bundles).length;
    for (int i = 0; i < j; i++)
    {
      ResolverBundle bundle = arrayOfResolverBundle[i];
      if ((bundle.getBundleDescription().isSingleton()) && (bundle.isResolvable()))
      {
        String bsn = bundle.getName();
        Collection<ResolverBundle> selected = (Collection)selectedSingletons.get(bsn);
        if (selected == null)
        {
          selected = new ArrayList(1);
          selectedSingletons.put(bsn, selected);
          
          List<ResolverBundle> sameBSN = resolverBundles.get(bsn);
          if (sameBSN.size() < 2)
          {
            selected.add(bundle);
          }
          else
          {
            for (Iterator localIterator1 = sameBSN.iterator(); localIterator1.hasNext();)
            {
              ResolverBundle singleton = (ResolverBundle)localIterator1.next();
              if ((singleton.getBundleDescription().isSingleton()) && (singleton.getBundleDescription().isResolved())) {
                selected.add(singleton);
              }
            }
            Map<ResolverBundle, Collection<ResolverBundle>> collisionMap = getCollisionMap(sameBSN);
            for (Iterator localIterator2 = sameBSN.iterator(); localIterator2.hasNext();)
            {
              ResolverBundle singleton = (ResolverBundle)localIterator2.next();
              if (!selected.contains(singleton))
              {
                Collection<ResolverBundle> collisions = (Collection)collisionMap.get(singleton);
                if ((collisions != null) && (singleton.isResolvable()))
                {
                  Collection<ResolverBundle> pickOneToResolve = new ArrayList();
                  for (Iterator localIterator3 = collisions.iterator(); localIterator3.hasNext();)
                  {
                    ResolverBundle collision = (ResolverBundle)localIterator3.next();
                    if (selected.contains(collision))
                    {
                      singleton.setResolvable(false);
                      state.addResolverError(singleton.getBundleDescription(), 8, collision.getBundleDescription().toString(), null);
                      break;
                    }
                    if (!pickOneToResolve.contains(collision)) {
                      pickOneToResolve.add(collision);
                    }
                  }
                  for (localIterator3 = collisionMap.entrySet().iterator(); localIterator3.hasNext();)
                  {
                    Map.Entry<ResolverBundle, Collection<ResolverBundle>> collisionEntry = (Map.Entry)localIterator3.next();
                    if ((collisionEntry.getKey() != singleton) && (((Collection)collisionEntry.getValue()).contains(singleton)))
                    {
                      if (selected.contains(collisionEntry.getKey()))
                      {
                        singleton.setResolvable(false);
                        state.addResolverError(singleton.getBundleDescription(), 8, ((ResolverBundle)collisionEntry.getKey()).getBundleDescription().toString(), null);
                        break;
                      }
                      if (!pickOneToResolve.contains(collisionEntry.getKey())) {
                        pickOneToResolve.add((ResolverBundle)collisionEntry.getKey());
                      }
                    }
                  }
                  if (singleton.isResolvable())
                  {
                    pickOneToResolve.add(singleton);
                    selected.add(pickOneToResolve(pickOneToResolve));
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
  private ResolverBundle pickOneToResolve(Collection<ResolverBundle> pickOneToResolve)
  {
    ResolverBundle selectedVersion = null;
    for (Iterator localIterator = pickOneToResolve.iterator(); localIterator.hasNext();)
    {
      ResolverBundle singleton = (ResolverBundle)localIterator.next();
      if (selectedVersion == null) {
        selectedVersion = singleton;
      }
      boolean higherVersion = selectionPolicy.compare(selectedVersion.getBundleDescription(), singleton.getBundleDescription()) > 0;
      if (higherVersion) {
        selectedVersion = singleton;
      }
    }
    for (localIterator = pickOneToResolve.iterator(); localIterator.hasNext();)
    {
      ResolverBundle singleton = (ResolverBundle)localIterator.next();
      if (singleton != selectedVersion)
      {
        singleton.setResolvable(false);
        state.addResolverError(singleton.getBundleDescription(), 8, selectedVersion.getBundleDescription().toString(), null);
      }
    }
    return selectedVersion;
  }
  
  private Map<ResolverBundle, Collection<ResolverBundle>> getCollisionMap(List<ResolverBundle> sameBSN)
  {
    Map<ResolverBundle, Collection<ResolverBundle>> result = new HashMap();
    for (Iterator localIterator1 = sameBSN.iterator(); localIterator1.hasNext();)
    {
      ResolverBundle singleton = (ResolverBundle)localIterator1.next();
      if ((singleton.getBundleDescription().isSingleton()) && (singleton.isResolvable()))
      {
        List<ResolverBundle> collisionCandidates = new ArrayList(sameBSN.size() - 1);
        List<BundleCapability> capabilities = new ArrayList(sameBSN.s
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd