private void generateConfigurationOperation(IInstallableUnit fromIU, IInstallableUnit toIU) { Collection<IInstallableUnitFragment> fromFragments = fromIU.getFragments(); Collection<IInstallableUnitFragment> toFragments = toIU.getFragments(); if (fromFragments == toFragments) return; //Check to see if the two arrays are equals independently of the order of the fragments if (fromFragments.size() == toFragments.size() && fromFragments.containsAll(toFragments)) return; plan.updateInstallableUnit(fromIU, toIU); }
public Collection<IInstallableUnitFragment> getFragments() { int fcount = fragments.length; if (fcount == 0) return CollectionUtils.emptyList(); ArrayList<IInstallableUnitFragment> result = new ArrayList<IInstallableUnitFragment>(fcount); result.addAll(Arrays.asList(fragments)); for (int i = 0; i < fcount; i++) { IInstallableUnit fragment = fragments[i]; if (fragment.isResolved()) result.addAll(fragment.getFragments()); } return result; }
public boolean isIUMatch(IInstallableUnit iu) { if (iu.getFragments() != null && !iu.getFragments().isEmpty()) return false; String id = iu.getId(); String name = iu.getProperty(IInstallableUnit.PROP_NAME, null); if (name == null || name.startsWith("%")) //$NON-NLS-1$ name = ""; //$NON-NLS-1$ if (patternMatcher.matches(id) || patternMatcher.matches(name)) { return true; } return false; } }
public static String formatInstallableUnitOperand(InstallableUnitOperand iuOperand) { StringBuffer buffer = new StringBuffer(); buffer.append(iuOperand.first()); if (iuOperand.first() != null && iuOperand.first().getFragments() != null) buffer.append(DebugHelper.formatArray(iuOperand.first().getFragments(), true, false)); buffer.append(" --> "); //$NON-NLS-1$ buffer.append(iuOperand.second()); if (iuOperand.second() != null && iuOperand.second().getFragments() != null) buffer.append(DebugHelper.formatArray(iuOperand.second().getFragments(), true, false)); return buffer.toString(); }
public static String formatInstallableUnitOperand(InstallableUnitOperand iuOperand) { StringBuffer buffer = new StringBuffer(); buffer.append(iuOperand.first()); if (iuOperand.first() != null && iuOperand.first().getFragments() != null) buffer.append(DebugHelper.formatArray(iuOperand.first().getFragments(), true, false)); buffer.append(" --> "); //$NON-NLS-1$ buffer.append(iuOperand.second()); if (iuOperand.second() != null && iuOperand.second().getFragments() != null) buffer.append(DebugHelper.formatArray(iuOperand.second().getFragments(), true, false)); return buffer.toString(); }