public StateHelper getStateHelper() { return state.getStateHelper(); }
@Override public IApiComponent[] getDependentComponents(IApiComponent[] components) throws CoreException { ArrayList<BundleDescription> bundles = getBundleDescriptions(components); BundleDescription[] bundleDescriptions = getState().getStateHelper().getDependentBundles(bundles.toArray(new BundleDescription[bundles.size()])); return getApiComponents(bundleDescriptions); }
@Override public IApiComponent[] getPrerequisiteComponents(IApiComponent[] components) throws CoreException { ArrayList<BundleDescription> bundles = getBundleDescriptions(components); BundleDescription[] bundlesDescriptions = getState().getStateHelper().getPrerequisites(bundles.toArray(new BundleDescription[bundles.size()])); return getApiComponents(bundlesDescriptions); }
/** * Resolves the root errors for the given set of errors * * @param rerrors * @param collector * @return the resolved leaf set of problem messages */ private String[] resolveRootErrors(ResolverError[] rerrors) { TreeSet<String> collector = new TreeSet<>((o1, o2) -> (o1).compareTo(o2)); ResolverError error = null; VersionConstraint[] constraints = null; BundleDescription[] bundle = new BundleDescription[1]; for (ResolverError rerror : rerrors) { error = rerror; if (error.getType() != ResolverError.MISSING_REQUIRE_BUNDLE) { collector.add(error.toString()); } bundle[0] = error.getBundle(); constraints = bundle[0].getContainingState().getStateHelper().getUnsatisfiedLeaves(bundle); if (constraints.length == 0) { collector.add(error.toString()); } for (VersionConstraint constraint : constraints) { collector.add(constraint.toString()); } } return collector.toArray(new String[collector.size()]); }
/** * Returns all of the visible dependent components from the current state * * @param components * @return the listing of visible dependent components to the given ones * @throws CoreException */ public IApiComponent[] getVisibleDependentComponents(IApiComponent[] components) throws CoreException { ArrayList<BundleDescription> bundles = getBundleDescriptions(components); BundleDescription[] descs = getState().getStateHelper().getDependentBundles(bundles.toArray(new BundleDescription[bundles.size()])); HashSet<BundleDescription> visible = new HashSet<>(); ExportPackageDescription[] packages = null; for (BundleDescription desc : descs) { packages = getState().getStateHelper().getVisiblePackages(desc); for (ExportPackageDescription package1 : packages) { if (bundles.contains(package1.getSupplier())) { visible.add(desc); } } } return getApiComponents(visible.toArray(new BundleDescription[visible.size()])); }
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);
public static boolean isDiscouraged(String fullyQualifiedName, IJavaProject project, BundleDescription desc) { // allow classes within the project itself try { IType type = project.findType(fullyQualifiedName.replace('$', '.')); if (type != null && type.exists()) { HashMap<String, IPackageFragment> map = PDEJavaHelper.getPackageFragmentsHash(project, Collections.EMPTY_LIST, false); if (map.containsValue(type.getPackageFragment())) { return false; } } } catch (JavaModelException e) { } // just grab the package int dot = fullyQualifiedName.lastIndexOf('.'); if (dot != -1) // check for the default package case fullyQualifiedName = fullyQualifiedName.substring(0, dot); else fullyQualifiedName = "."; //$NON-NLS-1$ State state = desc.getContainingState(); StateHelper helper = state.getStateHelper(); ExportPackageDescription[] exports = helper.getVisiblePackages(desc); for (int i = 0; i < exports.length; i++) { BundleDescription exporter = exports[i].getExporter(); if (exporter == null) continue; if (fullyQualifiedName.equals(exports[i].getName()) && helper.getAccessCode(desc, exports[i]) == StateHelper.ACCESS_DISCOURAGED) return true; } return false; }
for (DependencyEntry entry : dependencyComputer.computeDependencies(state.getStateHelper(), bundleDescription)) { if (EquinoxResolver.SYSTEM_BUNDLE_ID == entry.desc.getBundleId()) { if (entry.rules != null) { strictBootClasspathAccessRules); project.setContextValue(TychoConstants.CTX_ECLIPSE_PLUGIN_BOOTCLASSPATH_EXTRA_ACCESSRULES, dependencyComputer.computeBootClasspathExtraAccessRules(state.getStateHelper(), bundleDescription));
BundleDescription bundle = ((BundleComponent) component).getBundleDescription(); if (bundle != null) { StateHelper helper = getState().getStateHelper(); ExportPackageDescription[] visiblePackages = helper.getVisiblePackages(bundle); for (ExportPackageDescription pkg : visiblePackages) {
VersionConstraint[] constraints = desc.getContainingState().getStateHelper().getUnsatisfiedConstraints(desc); for (int i = 0; i < constraints.length; i++) { if (constraints[i] instanceof ImportPackageSpecification) {
VersionConstraint[] constraints = desc.getContainingState().getStateHelper().getUnsatisfiedConstraints(desc); for (int i = 0; i < constraints.length; i++) { if (constraints[i] instanceof ImportPackageSpecification) {
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);
imports = desc.getContainingState().getStateHelper().getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES | StateHelper.VISIBLE_INCLUDE_ALL_HOST_WIRES);