diff options
author | Thomas Watson | 2012-10-31 15:20:13 +0000 |
---|---|---|
committer | Thomas Watson | 2012-10-31 15:20:13 +0000 |
commit | c343180660d3ee829d18ed3997e50c5f71ce85e4 (patch) | |
tree | ff5c1e5cda4760cdd45240ea6890416b7861a244 /bundles | |
parent | 3d32621b5ef0bb863049d06f9af4859d3fcbcec1 (diff) | |
download | rt.equinox.bundles-c343180660d3ee829d18ed3997e50c5f71ce85e4.tar.gz rt.equinox.bundles-c343180660d3ee829d18ed3997e50c5f71ce85e4.tar.xz rt.equinox.bundles-c343180660d3ee829d18ed3997e50c5f71ce85e4.zip |
remove dead code in org.eclipse.equinox.resolver projectsI20121031-2000
Diffstat (limited to 'bundles')
34 files changed, 0 insertions, 2896 deletions
diff --git a/bundles/org.eclipse.equinox.resolver.tests/.classpath b/bundles/org.eclipse.equinox.resolver.tests/.classpath deleted file mode 100644 index 64c5e31b7..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.equinox.resolver.tests/.project b/bundles/org.eclipse.equinox.resolver.tests/.project deleted file mode 100644 index 2011f36d6..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.equinox.resolver.tests</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index effb56f65..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Aug 17 09:34:28 CDT 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/bundles/org.eclipse.equinox.resolver.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.resolver.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 1a2a230fa..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %bundleName -Bundle-SymbolicName: org.eclipse.equinox.resolver.tests -Bundle-Version: 1.1.100 -Bundle-Activator: org.eclipse.equinox.resolver.tests.Activator -Import-Package: junit.framework;version="3.8.2", - org.eclipse.osgi.service.resolver;version="1.6.0", - org.eclipse.osgi.service.resolver.extras;version="1.0.0", - org.osgi.framework;version="1.6.0", - org.osgi.framework.resource;version="1.0.0", - org.osgi.framework.wiring;version="1.1.0", - org.osgi.service.packageadmin;version="1.2.0", - org.osgi.service.resolver, - org.osgi.util.tracker;version="1.5.0" -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-Localization: plugin -Bundle-Vendor: %bundleVendor -Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.equinox.resolver.tests/build.properties b/bundles/org.eclipse.equinox.resolver.tests/build.properties deleted file mode 100644 index e4846b740..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################### -# Copyright (c) 2011 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties -
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.resolver.tests/plugin.properties b/bundles/org.eclipse.equinox.resolver.tests/plugin.properties deleted file mode 100644 index c485b0e8a..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2007 IBM Corporation. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -bundleVendor = Eclipse.org -bundleName = User Admin Service Tests diff --git a/bundles/org.eclipse.equinox.resolver.tests/pom.xml b/bundles/org.eclipse.equinox.resolver.tests/pom.xml deleted file mode 100644 index 4761cd48b..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright (c) 2012 Eclipse Foundation. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Distribution License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/org/documents/edl-v10.php - - Contributors: - Igor Fedorenko - initial implementation ---> - -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>rt.equinox.bundles</artifactId> - <groupId>org.eclipse.equinox.bundles</groupId> - <version>3.8.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - <groupId>org.eclipse.equinox.bundles</groupId> - <artifactId>org.eclipse.equinox.resolver.tests</artifactId> - <version>1.1.100</version> - <packaging>eclipse-test-plugin</packaging> -</project> diff --git a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/Activator.java b/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/Activator.java deleted file mode 100644 index 05b1d44bd..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/Activator.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 IBM Corporation and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.resolver.tests; - -import org.osgi.framework.*; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.util.tracker.ServiceTracker; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator implements BundleActivator { - public static String BUNDLE_RESOLVER = "org.eclipse.equinox.resolver"; //$NON-NLS-1$ - - private static Activator plugin; - private static BundleContext context; - - private ServiceTracker packageAdminTracker; - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bc) throws Exception { - plugin = this; - packageAdminTracker = new ServiceTracker(bc, PackageAdmin.class.getName(), null); - packageAdminTracker.open(); - Activator.context = bc; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bc) throws Exception { - if (packageAdminTracker != null) { - packageAdminTracker.close(); - packageAdminTracker = null; - } - plugin = null; - } - - private static Activator getDefault() { - return plugin; - } - - public static synchronized BundleContext getBundleContext() { - return context; - } - - public static synchronized Bundle getBundle(String symbolicName) { - PackageAdmin packageAdmin = Activator.getDefault().getPackageAdmin(); - if (packageAdmin == null) - return null; - - Bundle[] bundles = packageAdmin.getBundles(symbolicName, null); - if (bundles == null) - return null; - for (int i = 0; i < bundles.length; i++) { - if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) { - return bundles[i]; - } - } - return null; - } - - private PackageAdmin getPackageAdmin() { - if (packageAdminTracker == null) { - return null; - } - return (PackageAdmin) packageAdminTracker.getService(); - } - -} diff --git a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/AllTests.java b/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/AllTests.java deleted file mode 100644 index c5f590caa..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/AllTests.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 IBM Corporation and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.resolver.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -public class AllTests { - - public static Test suite() { - TestSuite suite = new TestSuite("Tests for Equinox Resolver"); //$NON-NLS-1$ - suite.addTestSuite(ResolverTest.class); - return suite; - } - -} diff --git a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/ResolverTest.java b/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/ResolverTest.java deleted file mode 100644 index 58e375035..000000000 --- a/bundles/org.eclipse.equinox.resolver.tests/src/org/eclipse/equinox/resolver/tests/ResolverTest.java +++ /dev/null @@ -1,572 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.resolver.tests; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import junit.framework.TestCase; - -import org.eclipse.osgi.service.resolver.BaseDescription; -import org.eclipse.osgi.service.resolver.BundleDescription; -import org.eclipse.osgi.service.resolver.PlatformAdmin; -import org.eclipse.osgi.service.resolver.ResolverError; -import org.eclipse.osgi.service.resolver.State; -import org.eclipse.osgi.service.resolver.StateObjectFactory; -import org.eclipse.osgi.service.resolver.VersionConstraint; -import org.eclipse.osgi.service.resolver.extras.DescriptionReference; -import org.eclipse.osgi.service.resolver.extras.SpecificationReference; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleException; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceReference; -import org.osgi.framework.resource.Capability; -import org.osgi.framework.resource.Requirement; -import org.osgi.framework.resource.Resource; -import org.osgi.framework.resource.Wire; -import org.osgi.framework.wiring.BundleCapability; -import org.osgi.framework.wiring.BundleRevision; -import org.osgi.framework.wiring.BundleWiring; -import org.osgi.service.resolver.Environment; -import org.osgi.service.resolver.Resolver; - -public class ResolverTest extends TestCase { - - private Resolver resolver; - private ServiceReference<Resolver> resolverRef; - private PlatformAdmin platformAdmin; - private ServiceReference<PlatformAdmin> platformAdminRef; - - protected void setUp() throws Exception { - Activator.getBundle(Activator.BUNDLE_RESOLVER).start(); - resolverRef = Activator.getBundleContext().getServiceReference(Resolver.class); - resolver = Activator.getBundleContext().getService(resolverRef); - assertNotNull("No resolver service.", resolver); //$NON-NLS-1$ - platformAdminRef = Activator.getBundleContext().getServiceReference(PlatformAdmin.class); - platformAdmin = Activator.getBundleContext().getService(platformAdminRef); - assertNotNull("No platformadmin service.", resolver); //$NON-NLS-1$ - } - - protected void tearDown() throws Exception { - Activator.getBundleContext().ungetService(resolverRef); - Activator.getBundleContext().ungetService(platformAdminRef); - Activator.getBundle(Activator.BUNDLE_RESOLVER).stop(); - } - - private Map<String, Map<String, List<BaseDescription>>> getRepository(List<? extends BundleRevision> bundles) { - Map<String, Map<String, List<BaseDescription>>> repository = new HashMap<String, Map<String,List<BaseDescription>>>(); - for (BundleRevision revision : bundles) { - List<BundleCapability> capabilities = revision.getDeclaredCapabilities(null); - for (BundleCapability capability : capabilities) { - BaseDescription description = ((DescriptionReference) capability).getDescription(); - Map<String, List<BaseDescription>> namespace = repository.get(capability.getNamespace()); - if (namespace == null) { - namespace = new HashMap<String, List<BaseDescription>>(2); - repository.put(capability.getNamespace(), namespace); - } - List<BaseDescription> repoCapabilities = namespace.get(description.getName()); - if (repoCapabilities == null) { - repoCapabilities = new ArrayList<BaseDescription>(2); - namespace.put(description.getName(), repoCapabilities); - } - repoCapabilities.add(description); - if (repoCapabilities.size() > 1) { - Collections.sort(repoCapabilities, new Comparator<BaseDescription>() { - public int compare(BaseDescription d1, BaseDescription d2) { - String systemBundle = "org.eclipse.osgi"; - if (systemBundle.equals(d1.getSupplier().getSymbolicName()) && !systemBundle.equals(d2.getSupplier().getSymbolicName())) - return -1; - else if (!systemBundle.equals(d1.getSupplier().getSymbolicName()) && systemBundle.equals(d2.getSupplier().getSymbolicName())) - return 1; - if (d1.getSupplier().isResolved() != d2.getSupplier().isResolved()) - return d1.getSupplier().isResolved() ? -1 : 1; - int versionCompare = -(d1.getVersion().compareTo(d2.getVersion())); - if (versionCompare != 0) - return versionCompare; - return d1.getSupplier().getBundleId() <= d2.getSupplier().getBundleId() ? -1 : 1; - } - }); - } - } - } - return repository; - } - - @SuppressWarnings("unchecked") - private void getRequirementsRevsionsWiring(List<BundleRevision> revisions, Map<Resource, List<Wire>> wiring) { - Bundle[] bundles = Activator.getBundleContext().getBundles(); - bundlesLoop: for (Bundle bundle : bundles) { - BundleRevision revision = bundle.adapt(BundleRevision.class); - BundleDescription description = (BundleDescription) revision; - if (!description.isResolved()) { - // check the ee - description.getContainingState().resolve(new BundleDescription[] {description}, false); - ResolverError[] errors = description.getContainingState().getResolverErrors(description); - for (ResolverError resolverError : errors) { - if (resolverError.getType() == ResolverError.PLATFORM_FILTER) - continue bundlesLoop; - } - } - revisions.add(revision); - BundleWiring bundleWiring = revision.getWiring(); - if (bundleWiring != null) { - List<? extends Wire> wires = bundleWiring.getRequiredWires(null); - wiring.put(revision, (List<Wire>) wires); - } - } - } - - @SuppressWarnings("unchecked") - private Map<Resource, List<Wire>> getWiring(List<BundleDescription> revisions) { - State state = platformAdmin.getFactory().createState(true); - for (BundleDescription bundle : revisions) { - if (bundle.getContainingState() != null) - throw new IllegalArgumentException("Bundle already in a state: " + bundle); - state.addBundle(bundle); - } - state.resolve(); - Map<Resource, List<Wire>> result = new HashMap<Resource, List<Wire>>(); - for (BundleDescription bundle : revisions) { - BundleWiring bundleWiring = bundle.getWiring(); - if (bundleWiring != null) { - List<? extends Wire> wires = bundleWiring.getRequiredWires(null); - result.put(bundle, (List<Wire>) wires); - } - } - return result; - } - - private void compareWirings(Map<Resource, List<Wire>> expected, - Map<Resource, List<Wire>> actual) { - assertEquals("Wrong number of bundles got resolved.", expected.size(), actual.size()); - for (Map.Entry<Resource, List<Wire>> resourceEntry : expected.entrySet()) { - List<Wire> expectedWires = resourceEntry.getValue(); - List<Wire> actualWires = actual.get(resourceEntry.getKey()); - assertNotNull("No wires found for: " + resourceEntry.getKey(), actualWires); - for (Wire expectedWire : expectedWires) { - boolean found = false; - for (Wire actualWire : actualWires) { - boolean sameProvider = expectedWire.getProvider().equals(actualWire.getProvider()); - boolean sameCapability = expectedWire.getCapability().equals(actualWire.getCapability()); - boolean sameRequirer = expectedWire.getRequirer().equals(actualWire.getRequirer()); - boolean sameRequirement = expectedWire.getRequirement().equals(actualWire.getRequirement()); - found = sameProvider && sameCapability && sameRequirer && sameRequirement; - if (found) - break; - } - if (!found) - fail("Failed to find expected wire: " + expectedWire); - } - } - } - - public void testResolverService01() { - List<BundleRevision> revisions = new ArrayList<BundleRevision>(); - Map<Resource, List<Wire>> wiring = new HashMap<Resource, List<Wire>>(); - getRequirementsRevsionsWiring(revisions, wiring); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), null, revisions); - - System.out.println("Number of bundles currently resolved: " + wiring.size()); - System.out.println("Number of bundles to resolve: " + revisions.size()); - System.out.println("Number of bundles that got resolved: " + result.size()); - - compareWirings(wiring, result); - } - - public void testResolverService02() { - List<BundleRevision> revisions = new ArrayList<BundleRevision>(); - Map<Resource, List<Wire>> wiring = new HashMap<Resource, List<Wire>>(); - getRequirementsRevsionsWiring(revisions, wiring); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(wiring, repository), null, revisions); - - System.out.println("Number of bundles currently resolved: " + wiring.size()); - System.out.println("Number of bundles to resolve: " + revisions.size()); - System.out.println("Number of bundles that got resolved: " + result.size()); - - assertEquals("Wrong number of bundles got resolved.", 0, result.size()); - } - - public void testResolverServiceImportPackage() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleDescription> revisions = new ArrayList<BundleDescription>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.IMPORT_PACKAGE, "b, c"); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b"); - BundleDescription b = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription c = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(c); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), Arrays.asList(a), null); - - Map<Resource, List<Wire>> expectedWiring = getWiring(revisions); - compareWirings(expectedWiring, result); - dumpResults(result); - } - - public void testResolverServiceFragmentHost1() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleDescription> revisions = new ArrayList<BundleDescription>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.IMPORT_PACKAGE, "b, c"); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - BundleDescription b = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "BFrag"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.FRAGMENT_HOST, "B"); - manifest.put(Constants.EXPORT_PACKAGE, "b"); - BundleDescription bFrag = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(bFrag); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - BundleDescription c = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(c); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "CFrag"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.FRAGMENT_HOST, "C"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription cFrag = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(cFrag); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), Arrays.asList(a), null); - - Map<Resource, List<Wire>> expectedWiring = getWiring(revisions); - compareWirings(expectedWiring, result); - dumpResults(result); - } - - public void testResolverServiceFragmentHost2() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleDescription> revisions = new ArrayList<BundleDescription>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.IMPORT_PACKAGE, "b.frag, b; v=1"); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b; version=1.0; v=1"); - BundleDescription b1 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b1); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "2.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b; version=1.0; v=2"); - BundleDescription b2 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b2); - - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "BFrag"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.FRAGMENT_HOST, "B; multiple-hosts:=true"); - manifest.put(Constants.EXPORT_PACKAGE, "b.frag; uses:=b"); - BundleDescription bFrag = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(bFrag); - - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), Arrays.asList(a), null); - - Map<Resource, List<Wire>> expectedWiring = getWiring(revisions); - compareWirings(expectedWiring, result); - dumpResults(result); - } - - public void testResolverServiceRequireBundle() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleDescription> revisions = new ArrayList<BundleDescription>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.REQUIRE_BUNDLE, "B, C"); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b"); - BundleDescription b = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription c = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(c); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), Arrays.asList(a), null); - - Map<Resource, List<Wire>> expectedWiring = getWiring(revisions); - compareWirings(expectedWiring, result); - dumpResults(result); - } - - public void testResolverServiceRequireCapability() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleRevision> revisions = new ArrayList<BundleRevision>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.REQUIRE_CAPABILITY, "B; filter:=\"(B=b)\", C; filter:=\"(C=c)\""); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.PROVIDE_CAPABILITY, "B; B=b"); - BundleDescription b = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(b); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.PROVIDE_CAPABILITY, "C; C=c"); - BundleDescription c = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(c); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository), Arrays.asList(a), null); - dumpResults(result); - } - - - private void dumpResults(Map<Resource, List<Wire>> result) { - System.out.println("TestCase: " + getName()); - for (Map.Entry<Resource, List<Wire>> entry : result.entrySet()) { - System.out.println(" " + entry.getKey()); - for (Wire wire : entry.getValue()) { - System.out.println(" " + wire); - } - } - } - - public void testResolverPreferenceOrder() throws BundleException { - StateObjectFactory factory = platformAdmin.getFactory(); - int id = 0; - List<BundleDescription> revisions = new ArrayList<BundleDescription>(); - Hashtable<String, String> manifest = new Hashtable<String, String>(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "A"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.IMPORT_PACKAGE, "b"); - manifest.put(Constants.REQUIRE_BUNDLE, "C"); - manifest.put(Constants.REQUIRE_CAPABILITY, "D; filter:=\"(D=d)\""); - BundleDescription a = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(a); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "3.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b; version=3.0"); - BundleDescription b3 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(b3); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "2.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b; version=2.0"); - BundleDescription b2 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(b2); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "B"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "b; version=1.0"); - BundleDescription b1 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(b1); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "3.0"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription c3 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(c3); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "2.0"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription c2 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(c2); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "C"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.EXPORT_PACKAGE, "c"); - BundleDescription c1 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME) + manifest.get(Constants.BUNDLE_VERSION), id++); - revisions.add(c1); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D"); - manifest.put(Constants.BUNDLE_VERSION, "3.0"); - manifest.put(Constants.PROVIDE_CAPABILITY, "D; D=d; version:Version=\"3.0\""); - BundleDescription d3 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(d3); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D"); - manifest.put(Constants.BUNDLE_VERSION, "2.0"); - manifest.put(Constants.PROVIDE_CAPABILITY, "D; D=d; version:Version=\"2.0\""); - BundleDescription d2 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(d2); - - manifest.clear(); - manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); - manifest.put(Constants.BUNDLE_SYMBOLICNAME, "D"); - manifest.put(Constants.BUNDLE_VERSION, "1.0"); - manifest.put(Constants.PROVIDE_CAPABILITY, "D; D=d; version:Version=\"1.0\""); - BundleDescription d1 = factory.createBundleDescription(null, manifest, manifest.get(Constants.BUNDLE_SYMBOLICNAME), id++); - revisions.add(d1); - - Map<String, Map<String, List<BaseDescription>>> repository = getRepository(revisions); - Map<Resource, List<Wire>> result = resolver.resolve(new TestEnvironment(null, repository, true), Arrays.asList(a), null); - - Map<Resource, List<Wire>> expectedWiring = getWiring(revisions); - dumpResults(result); - compareWirings(expectedWiring, result); - } - - - - class TestEnvironment implements Environment { - private final Map<Resource, List<Wire>> wiring; - private final Map<String, Map<String, List<BaseDescription>>> repository; - private final boolean reverseCandidates; - public TestEnvironment(Map<Resource, List<Wire>> wiring, Map<String, Map<String, List<BaseDescription>>> repository) { - this(wiring, repository, false); - } - - public TestEnvironment(Map<Resource, List<Wire>> wiring, Map<String, Map<String, List<BaseDescription>>> repository, boolean reverseCandidates) { - this.wiring = wiring; - this.repository = repository; - this.reverseCandidates = reverseCandidates; - } - - public boolean isEffective(Requirement requirement) throws NullPointerException { - return true; - } - - public Map<Resource, List<Wire>> getWiring() { - if (wiring == null) - return Collections.emptyMap(); - else - return wiring; - } - - public Collection<Capability> findProviders(Requirement requirement) throws NullPointerException { - List<Capability> result = new ArrayList<Capability>(); - Map<String, List<BaseDescription>> namespace = repository.get(requirement.getNamespace()); - VersionConstraint specification = ((SpecificationReference) requirement).getSpecification(); - String name = specification.getName(); - List<BaseDescription> candidates; - if (name == null || name.indexOf('*') > -1) { - candidates = new ArrayList<BaseDescription>(); - for (List<BaseDescription> baseDescriptions : namespace.values()) { - candidates.addAll(baseDescriptions); - } - } else { - candidates = namespace.get(name); - } - if (candidates != null) { - for (BaseDescription baseDescription : candidates) { - if (BundleRevision.HOST_NAMESPACE.equals(requirement.getNamespace())) { - result.addAll(baseDescription.getSupplier().getCapabilities(BundleRevision.HOST_NAMESPACE)); - } else { - result.add(baseDescription.getCapability()); - } - } - } - if (reverseCandidates) - Collections.reverse(result); - return result; - } - } -} diff --git a/bundles/org.eclipse.equinox.resolver/.classpath b/bundles/org.eclipse.equinox.resolver/.classpath deleted file mode 100644 index 64c5e31b7..000000000 --- a/bundles/org.eclipse.equinox.resolver/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/bundles/org.eclipse.equinox.resolver/.options b/bundles/org.eclipse.equinox.resolver/.options deleted file mode 100644 index 1ed20b8a2..000000000 --- a/bundles/org.eclipse.equinox.resolver/.options +++ /dev/null @@ -1 +0,0 @@ -#### Debugging options for org.eclipse.equinox.resolver diff --git a/bundles/org.eclipse.equinox.resolver/.project b/bundles/org.eclipse.equinox.resolver/.project deleted file mode 100644 index 4625d14a9..000000000 --- a/bundles/org.eclipse.equinox.resolver/.project +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.equinox.resolver</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> - </natures> -</projectDescription> diff --git a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.resources.prefs b/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 16532b29e..000000000 --- a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Tue May 25 15:00:03 EDT 2004 -encoding/<project>=ISO-8859-1 -eclipse.preferences.version=1 diff --git a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.runtime.prefs b/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 5a0ad22d2..000000000 --- a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -line.separator=\n diff --git a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 48c956de7..000000000 --- a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,346 +0,0 @@ -#Mon Aug 15 09:06:59 CDT 2011 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=error -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=false -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false -org.eclipse.jdt.core.formatter.comment.format_line_comments=false -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=false -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=80 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=800 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index d2a5fa982..000000000 --- a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,58 +0,0 @@ -#Tue Aug 21 11:21:59 CDT 2007 -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_core -formatter_settings_version=11 -internal.default.compliance=default -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=; -org.eclipse.jdt.ui.ondemandthreshold=3 -org.eclipse.jdt.ui.staticondemandthreshold=99 -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=false -sp_cleanup.correct_indentation=false -sp_cleanup.format_source_code=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_variable_declarations_final=true -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=false -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=false -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=false -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.pde.core.prefs b/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index e993d41da..000000000 --- a/bundles/org.eclipse.equinox.resolver/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri Dec 02 16:20:40 CST 2005 -eclipse.preferences.version=1 -pluginProject.equinox=false -pluginProject.extensions=true diff --git a/bundles/org.eclipse.equinox.resolver/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.resolver/META-INF/MANIFEST.MF deleted file mode 100644 index ecb6f63cc..000000000 --- a/bundles/org.eclipse.equinox.resolver/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.equinox.resolver -Bundle-Version: 1.0.0.qualifier -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.osgi.service.resolver;version="1.0.0" -Import-Package: org.eclipse.osgi.service.resolver;version="1.5.0", - org.eclipse.osgi.service.resolver.extras; version="1.0", - org.eclipse.osgi.util;version="1.1", - org.osgi.framework;version="1.6.0", - org.osgi.framework.hooks.resolver;version="1.0.0", - org.osgi.framework.resource;version="1.0.0", - org.osgi.framework.wiring;version="1.1.0", - org.osgi.util.tracker;version="1.5.0" -Bundle-ActivationPolicy: lazy -Bundle-Activator: org.eclipse.equinox.internal.resolver.Activator diff --git a/bundles/org.eclipse.equinox.resolver/about.html b/bundles/org.eclipse.equinox.resolver/about.html deleted file mode 100644 index 460233046..000000000 --- a/bundles/org.eclipse.equinox.resolver/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> -<title>About</title> -</head> -<body lang="EN-US"> -<h2>About This Content</h2> - -<p>June 2, 2006</p> -<h3>License</h3> - -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> - -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> - -</body> -</html>
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.resolver/about_files/LICENSE-2.0.txt b/bundles/org.eclipse.equinox.resolver/about_files/LICENSE-2.0.txt deleted file mode 100644 index d64569567..000000000 --- a/bundles/org.eclipse.equinox.resolver/about_files/LICENSE-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/bundles/org.eclipse.equinox.resolver/build.properties b/bundles/org.eclipse.equinox.resolver/build.properties deleted file mode 100644 index 970279b5d..000000000 --- a/bundles/org.eclipse.equinox.resolver/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 2005, 2009 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml,\ - about_files/ -src.includes = about.html,\ - schema/,\ - about_files/ - -javacWarnings..=-unusedPrivate diff --git a/bundles/org.eclipse.equinox.resolver/plugin.properties b/bundles/org.eclipse.equinox.resolver/plugin.properties deleted file mode 100644 index a5bec34a3..000000000 --- a/bundles/org.eclipse.equinox.resolver/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2011 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### -pluginName = Equinox Resolver -providerName = Eclipse.org - Equinox diff --git a/bundles/org.eclipse.equinox.resolver/pom.xml b/bundles/org.eclipse.equinox.resolver/pom.xml deleted file mode 100644 index b50b064dd..000000000 --- a/bundles/org.eclipse.equinox.resolver/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright (c) 2012 Eclipse Foundation. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Distribution License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/org/documents/edl-v10.php - - Contributors: - Igor Fedorenko - initial implementation ---> - -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>rt.equinox.bundles</artifactId> - <groupId>org.eclipse.equinox.bundles</groupId> - <version>3.8.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - <groupId>org.eclipse.equinox.bundles</groupId> - <artifactId>org.eclipse.equinox.resolver</artifactId> - <version>1.0.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> -</project> diff --git a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/Activator.java b/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/Activator.java deleted file mode 100644 index 38728169a..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/Activator.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM - Initial API and implementation - ******************************************************************************/ -package org.eclipse.equinox.internal.resolver; - -import org.eclipse.osgi.service.resolver.StateObjectFactory; -import org.osgi.framework.*; -import org.osgi.service.resolver.Resolver; - -public class Activator implements BundleActivator { - - private ServiceRegistration<Resolver> resolverReg; - - public void start(BundleContext context) throws Exception { - resolverReg = context.registerService(Resolver.class, new EquinoxResolver(StateObjectFactory.defaultFactory), null); - } - - public void stop(BundleContext context) throws Exception { - resolverReg.unregister(); - resolverReg = null; - } - -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolver.java b/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolver.java deleted file mode 100644 index c5116f8bd..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolver.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM - Initial API and implementation - ******************************************************************************/ -package org.eclipse.equinox.internal.resolver; - -import java.util.*; -import org.eclipse.osgi.service.resolver.State; -import org.eclipse.osgi.service.resolver.StateObjectFactory; -import org.osgi.framework.resource.Resource; -import org.osgi.framework.resource.Wire; -import org.osgi.service.resolver.*; - -public class EquinoxResolver implements Resolver { - private final StateObjectFactory factory; - - public EquinoxResolver(StateObjectFactory factory) { - this.factory = factory; - } - - public Map<Resource, List<Wire>> resolve(Environment environment, Collection<? extends Resource> mandatoryResources, Collection<? extends Resource> optionalResources) throws ResolutionException { - State state = factory.createState(true); - Hashtable<String, Object> platformProperties = new Hashtable<String, Object>(); - platformProperties.put("osgi.support.multipleHosts", "true"); //$NON-NLS-1$ //$NON-NLS-2$ - state.setPlatformProperties(platformProperties); - EquinoxResolverHook resolverHook = new EquinoxResolverHook(state, environment); - state.setResolverHookFactory(resolverHook); - return resolverHook.resolve(mandatoryResources, optionalResources); - } -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolverHook.java b/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolverHook.java deleted file mode 100644 index 28eaef05a..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/EquinoxResolverHook.java +++ /dev/null @@ -1,474 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM - Initial API and implementation - ******************************************************************************/ -package org.eclipse.equinox.internal.resolver; - -import java.util.*; -import java.util.Map.Entry; -import org.eclipse.equinox.internal.resolver.FilterParser.FilterComponent; -import org.eclipse.osgi.service.resolver.*; -import org.eclipse.osgi.service.resolver.extras.*; -import org.osgi.framework.*; -import org.osgi.framework.hooks.resolver.ResolverHook; -import org.osgi.framework.hooks.resolver.ResolverHookFactory; -import org.osgi.framework.resource.*; -import org.osgi.framework.wiring.*; -import org.osgi.service.resolver.Environment; -import org.osgi.service.resolver.ResolutionException; - -public class EquinoxResolverHook implements ResolverHookFactory, ResolverHook { - private final State state; - private final Environment environment; - private final Map<Resource, Map<String, List<Wire>>> wiring; - private final Map<Resource, BundleDescription> resourceToDescription = new HashMap<Resource, BundleDescription>(); - - public EquinoxResolverHook(State state, Environment environment) { - this.state = state; - this.environment = environment; - Map<Resource, List<Wire>> envWiring = environment.getWiring(); - this.wiring = new HashMap<Resource, Map<String, List<Wire>>>(); - if (envWiring != null) { - for (Map.Entry<Resource, List<Wire>> wires : envWiring.entrySet()) { - Map<String, List<Wire>> mappedWires = new HashMap<String, List<Wire>>(); - this.wiring.put(wires.getKey(), mappedWires); - for (Wire wire : wires.getValue()) { - String namespace = wire.getRequirement().getNamespace(); - List<Wire> namespaceWires = mappedWires.get(namespace); - if (namespaceWires == null) { - namespaceWires = new ArrayList<Wire>(); - mappedWires.put(namespace, namespaceWires); - } - namespaceWires.add(wire); - } - } - } - } - - public Map<Resource, List<Wire>> resolve(Collection<? extends Resource> mandatoryResources, Collection<? extends Resource> optionalResources) throws ResolutionException { - if (mandatoryResources == null) - mandatoryResources = Collections.emptyList(); - if (optionalResources == null) - optionalResources = Collections.emptyList(); - if (mandatoryResources.isEmpty() && optionalResources.isEmpty()) - return Collections.emptyMap(); - - // Populate the Equinox State with the initial set of resolved resources - for (Resource resource : wiring.keySet()) { - state.addBundle(createDescription(resource)); - } - // resolve the existing resources according to the wiring - if (!wiring.isEmpty()) - state.resolve(); - // all descriptions added up to this point must be resolved. - for (BundleDescription description : resourceToDescription.values()) { - if (!description.isResolved()) - throw new ResolutionException("Could not resolve the resource: " + description.getUserObject()); //$NON-NLS-1$ - } - // Populate the Equinox State with the initial set of mandatory/optional resources - for (Resource resource : mandatoryResources) - state.addBundle(createDescription(resource)); - for (Resource resource : optionalResources) - state.addBundle(createDescription(resource)); - - Map<Resource, List<Wire>> result = new HashMap<Resource, List<Wire>>(); - state.resolve(); - - List<BundleDescription> unresolvedMandatory = new ArrayList<BundleDescription>(mandatoryResources.size()); - for (Resource resource : mandatoryResources) { - BundleDescription description = resourceToDescription.get(resource); - if (!description.isResolved()) - unresolvedMandatory.add(description); - else - addWires(result, description); - } - if (!unresolvedMandatory.isEmpty()) { - // TODO need to make a better error message here - throw new ResolutionException("Could not resolve mandatory resources: " + unresolvedMandatory); //$NON-NLS-1$ - } - - for (Resource resource : optionalResources) { - BundleDescription description = resourceToDescription.get(resource); - if (description.isResolved()) - addWires(result, description); - } - - return result; - } - - private void addWires(Map<Resource, List<Wire>> result, BundleDescription resolved) { - Resource resource = (Resource) resolved.getUserObject(); - if (result.get(resource) != null || wiring.get(resource) != null) - return; // already processed or previously resolved - BundleWiring bundleWiring = resolved.getWiring(); - List<BundleWire> bundleWires = bundleWiring.getRequiredWires(null); - List<Wire> wires = new ArrayList<Wire>(bundleWires.size()); - result.put(resource, wires); - for (BundleWire bundleWire : bundleWires) { - final Resource requirer = (Resource) ((BundleDescription) bundleWire.getRequirer()).getUserObject(); - final Resource provider = (Resource) ((BundleDescription) bundleWire.getProvider()).getUserObject(); - - final Requirement requirement = (Requirement) ((SpecificationReference) bundleWire.getRequirement()).getSpecification().getUserObject(); - final Capability capability; - BundleDescription capabilityDescription; - if (BundleRevision.HOST_NAMESPACE.equals(requirement.getNamespace()) || BundleRevision.BUNDLE_NAMESPACE.equals(requirement.getNamespace())) { - List<Capability> capabilities = provider.getCapabilities(requirement.getNamespace()); - capability = capabilities.get(0); - capabilityDescription = (BundleDescription) bundleWire.getProvider(); - } else { - BaseDescription baseDescription = ((DescriptionReference) bundleWire.getCapability()).getDescription(); - capabilityDescription = baseDescription.getSupplier(); - capability = (Capability) baseDescription.getUserObject(); - } - - addWires(result, capabilityDescription); - - wires.add(new Wire() { - public Resource getRequirer() { - return requirer; - } - - public Requirement getRequirement() { - return requirement; - } - - public Resource getProvider() { - return provider; - } - - public Capability getCapability() { - return capability; - } - - public String toString() { - return "[" + requirer + ':' + requirement.getResource() + ':' + requirement + "] -> [" + provider + ':' + capability.getResource() + ':' + capability + ']'; //$NON-NLS-1$ //$NON-NLS-2$ - } - }); - } - } - - Capability getOriginalCapability(Capability capability) { - if (BundleRevision.HOST_NAMESPACE.equals(capability.getNamespace()) || BundleRevision.BUNDLE_NAMESPACE.equals(capability.getNamespace())) { - Resource provider = (Resource) ((BundleDescription) capability.getResource()).getUserObject(); - List<Capability> capabilities = provider.getCapabilities(capability.getNamespace()); - return capabilities.get(0); - } - return (Capability) ((DescriptionReference) capability).getDescription().getUserObject(); - } - - private BundleDescription createDescription(Resource resource) { - BundleDescription description = resourceToDescription.get(resource); - if (description != null) - return description; - Collection<Capability> idList = resource.getCapabilities(ResourceConstants.IDENTITY_NAMESPACE); - if (idList.size() != 1) - throw new IllegalArgumentException("Bogus osgi.identity: " + idList); //$NON-NLS-1$ - Capability id = idList.iterator().next(); - - Map<String, Object> idAttrs = new HashMap<String, Object>(id.getAttributes()); - - String symbolicName = (String) idAttrs.remove(ResourceConstants.IDENTITY_NAMESPACE); - Version version = (Version) idAttrs.remove(ResourceConstants.IDENTITY_VERSION_ATTRIBUTE); - - String symbolicNameSpecification = symbolicName + toString(idAttrs, "=", true) + toString(id.getDirectives(), ":=", true); //$NON-NLS-1$ //$NON-NLS-2$ - - List<ExportPackageDescription> exportPackages = new ArrayList<ExportPackageDescription>(); - List<GenericDescription> provideCapabilities = new ArrayList<GenericDescription>(); - List<ImportPackageSpecification> importPackages = new ArrayList<ImportPackageSpecification>(); - List<GenericSpecification> requireCapabilities = new ArrayList<GenericSpecification>(); - List<HostSpecification> fragmentHost = new ArrayList<HostSpecification>(0); - List<BundleSpecification> requireBundles = new ArrayList<BundleSpecification>(); - - Collection<Capability> capabilities = resource.getCapabilities(null); - - Capability osgiIdentity = null; - for (Capability capability : capabilities) { - String namespace = capability.getNamespace(); - if (ResourceConstants.IDENTITY_NAMESPACE.equals(namespace)) { - osgiIdentity = capability; - continue; - } else if (namespace == null || BundleRevision.HOST_NAMESPACE.equals(namespace) || BundleRevision.BUNDLE_NAMESPACE.equals(namespace)) { - continue; - } else if (BundleRevision.PACKAGE_NAMESPACE.equals(namespace)) { - exportPackages.addAll(creatExportPackage(capability)); - } else { - provideCapabilities.addAll(createProvideCapability(capability)); - } - } - - Collection<Requirement> requirements = resource.getRequirements(null); - for (Requirement requirement : requirements) { - String namespace = requirement.getNamespace(); - if (namespace == null || !environment.isEffective(requirement)) { - continue; - } else if (BundleRevision.BUNDLE_NAMESPACE.equals(namespace)) { - requireBundles.addAll(createRequireBundle(requirement)); - } else if (BundleRevision.HOST_NAMESPACE.equals(namespace)) { - fragmentHost.addAll(createFragmentHost(requirement)); - } else if (BundleRevision.PACKAGE_NAMESPACE.equals(namespace)) { - importPackages.addAll(createImportPackage(requirement)); - } else { - requireCapabilities.addAll(createRequireCapability(requirement)); - } - } - - BundleDescription result = state.getFactory().createBundleDescription(state.getHighestBundleId() + 1, symbolicNameSpecification, version, null, requireBundles.toArray(new BundleSpecification[requireBundles.size()]), fragmentHost.size() == 0 ? null : fragmentHost.get(0), importPackages.toArray(new ImportPackageSpecification[importPackages.size()]), exportPackages.toArray(new ExportPackageDescription[exportPackages.size()]), null, null, requireCapabilities.toArray(new GenericSpecification[requireCapabilities.size()]), provideCapabilities.toArray(new GenericDescription[provideCapabilities.size()]), null); - resourceToDescription.put(resource, result); - result.setUserObject(resource); - GenericDescription[] genericDescs = result.getGenericCapabilities(); - for (GenericDescription genericDesc : genericDescs) { - if (ResourceConstants.IDENTITY_NAMESPACE.equals(genericDesc.getType())) - genericDesc.setUserObject(osgiIdentity); - } - return result; - - } - - private List<ExportPackageDescription> creatExportPackage(Capability capability) { - Map<String, Object> attributes = new HashMap<String, Object>(capability.getAttributes()); - Map<String, String> directives = capability.getDirectives(); - String packageName = (String) attributes.remove(BundleRevision.PACKAGE_NAMESPACE); - // remove invalid attributes - attributes.remove(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE); - attributes.remove(Constants.BUNDLE_VERSION_ATTRIBUTE); - String declaration = packageName + toString(attributes, "=", true) + toString(directives, ":=", true); //$NON-NLS-1$//$NON-NLS-2$ - List<ExportPackageDescription> result = state.getFactory().createExportPackageDescriptions(declaration); - for (ExportPackageDescription export : result) { - export.setUserObject(capability); - } - return result; - } - - private List<GenericDescription> createProvideCapability(Capability capability) { - Map<String, Object> attributes = capability.getAttributes(); - Map<String, String> directives = capability.getDirectives(); - if ("osgi.ee".equals(capability.getNamespace())) { //$NON-NLS-1$ - attributes = new HashMap<String, Object>(attributes); - attributes.remove("x-equinox-ee"); //$NON-NLS-1$ - } - if (directives.get(Constants.EFFECTIVE_DIRECTIVE) != null) { - // always remove the effective directive - directives = new HashMap<String, String>(directives); - directives.remove(Constants.EFFECTIVE_DIRECTIVE); - } - String declaration = capability.getNamespace() + toString(attributes, "=", false) + toString(directives, ":=", true); //$NON-NLS-1$//$NON-NLS-2$ - List<GenericDescription> result = state.getFactory().createGenericDescriptions(declaration); - for (GenericDescription genericDescription : result) { - genericDescription.setUserObject(capability); - } - return result; - } - - private List<BundleSpecification> createRequireBundle(Requirement requirement) { - String declaration = createOSGiRequirement(requirement, BundleRevision.BUNDLE_NAMESPACE, Constants.BUNDLE_VERSION_ATTRIBUTE); - List<BundleSpecification> result = state.getFactory().createBundleSpecifications(declaration); - for (BundleSpecification bundleSpecification : result) { - bundleSpecification.setUserObject(requirement); - } - return result; - } - - private List<HostSpecification> createFragmentHost(Requirement requirement) { - String declaration = createOSGiRequirement(requirement, BundleRevision.HOST_NAMESPACE, Constants.BUNDLE_VERSION_ATTRIBUTE); - List<HostSpecification> result = state.getFactory().createHostSpecifications(declaration); - for (HostSpecification hostSpecification : result) { - hostSpecification.setUserObject(requirement); - } - return result; - } - - private List<ImportPackageSpecification> createImportPackage(Requirement requirement) { - String declaration = createOSGiRequirement(requirement, BundleRevision.PACKAGE_NAMESPACE, Constants.VERSION_ATTRIBUTE, Constants.BUNDLE_VERSION_ATTRIBUTE); - List<ImportPackageSpecification> result = state.getFactory().createImportPackageSpecifications(declaration); - for (ImportPackageSpecification importPackageSpecification : result) { - importPackageSpecification.setUserObject(requirement); - } - return result; - } - - private List<GenericSpecification> createRequireCapability(Requirement requirement) { - Map<String, String> directives = requirement.getDirectives(); - if (directives.get(Constants.EFFECTIVE_DIRECTIVE) != null) { - // always remove the effective directive; all requirements are effective at this point - directives = new HashMap<String, String>(directives); - directives.remove(Constants.EFFECTIVE_DIRECTIVE); - } - String declaration = requirement.getNamespace() + toString(requirement.getAttributes(), "=", false) + toString(requirement.getDirectives(), ":=", true); //$NON-NLS-1$ //$NON-NLS-2$ - List<GenericSpecification> result = state.getFactory().createGenericSpecifications(declaration); - for (GenericSpecification genericSpecification : result) { - genericSpecification.setUserObject(requirement); - } - return result; - } - - private String createOSGiRequirement(Requirement requirement, String namespace, String... versions) { - Map<String, String> directives = new HashMap<String, String>(requirement.getDirectives()); - String filter = directives.remove(ResourceConstants.REQUIREMENT_FILTER_DIRECTIVE); - if (filter == null) - throw new IllegalArgumentException("No filter directive found:" + requirement); //$NON-NLS-1$ - FilterParser parser = new FilterParser(filter); - FilterComponent component = null; - try { - component = parser.parse(); - } catch (InvalidSyntaxException e) { - throw new IllegalArgumentException("Invalid filter directive", e); //$NON-NLS-1$ - } - Map<String, String> matchingAttributes = component.getStandardOSGiAttributes(versions); - String name = matchingAttributes.remove(namespace); - if (name == null) - throw new IllegalArgumentException("Invalid requirement: " + requirement); //$NON-NLS-1$ - return name + toString(matchingAttributes, "=", true) + toString(directives, ":=", true); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public ResolverHook begin(Collection<BundleRevision> triggers) { - return this; - } - - public void filterResolvable(Collection<BundleRevision> candidates) { - // nothing - } - - public void filterSingletonCollisions(BundleCapability singleton, Collection<BundleCapability> collisionCandidates) { - // clear all collisions; environment is expected to handle singletons - collisionCandidates.clear(); - return; - } - - public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { - // this is quick and dirty way to do this; we know the resources are BundleDescriptions - BundleDescription description = (BundleDescription) requirement.getResource(); - Resource originalResource = (Resource) description.getUserObject(); - Map<String, List<Wire>> resolvedWires = wiring.get(originalResource); - if (resolvedWires != null) { - filterAccordingToWiring(requirement, originalResource, description, resolvedWires, candidates); - } else { - filterAccordingToEnvironment(requirement, candidates); - } - } - - private void filterAccordingToEnvironment(BundleRequirement requirement, Collection<BundleCapability> candidates) { - Requirement originalRequirement = (Requirement) ((SpecificationReference) requirement).getSpecification().getUserObject(); - Collection<Capability> envCapabilities = environment.findProviders(originalRequirement); - // first find new resources that should be added to the state - boolean added = false; - for (Capability capability : envCapabilities) { - Resource originalResource = capability.getResource(); - BundleDescription existing = resourceToDescription.get(originalResource); - if (existing == null) { - BundleDescription toAdd = createDescription(originalResource); - state.addBundle(toAdd); - added = true; - } - } - if (added) - return; // do nothing resolver needs to recall us - // Now filter out the candidates from the resolver according to the environment - for (Iterator<BundleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { - BaseDescription description = ((DescriptionReference) iCandidates.next()).getDescription(); - Capability originalCapability; - if (BundleRevision.HOST_NAMESPACE.equals(requirement.getNamespace()) || BundleRevision.BUNDLE_NAMESPACE.equals(requirement.getNamespace())) { - Resource provider = (Resource) description.getUserObject(); - List<Capability> hostCapabilities = provider.getCapabilities(requirement.getNamespace()); - originalCapability = hostCapabilities.get(0); - } else { - originalCapability = (Capability) description.getUserObject(); - } - if (!envCapabilities.contains(originalCapability)) - iCandidates.remove(); - } - if (candidates.size() > 1) { - if (candidates instanceof Sortable<?>) { - final List<Capability> sorted = new ArrayList<Capability>(envCapabilities); - ((Sortable<BundleCapability>) candidates).sort(new Comparator<BundleCapability>() { - public int compare(BundleCapability o1, BundleCapability o2) { - Capability orig1 = getOriginalCapability(o1); - Capability orig2 = getOriginalCapability(o2); - int o1Index = sorted.indexOf(orig1); - int o2Index = sorted.indexOf(orig2); - return o1Index - o2Index; - } - }); - } - } - } - - private Resource getHostResource(Resource originalResource, Map<String, List<Wire>> resolvedWires) { - if (resolvedWires == null) - return null; - List<Wire> hostWires = resolvedWires.get(BundleRevision.HOST_NAMESPACE); - if (hostWires == null) - return null; - return hostWires.size() > 0 ? hostWires.get(0).getCapability().getResource() : null; - } - - @SuppressWarnings("unchecked") - private void filterAccordingToWiring(Requirement requirement, Resource originalResource, BundleDescription description, Map<String, List<Wire>> resolvedWires, Collection<BundleCapability> candidates) { - if (description.getHost() != null && !BundleRevision.HOST_NAMESPACE.equals(requirement.getNamespace())) { - originalResource = getHostResource(originalResource, resolvedWires); - resolvedWires = originalResource == null ? Collections.EMPTY_MAP : wiring.get(originalResource); - } - List<Wire> namespaceWires = resolvedWires.get(requirement.getNamespace()); - if (namespaceWires == null) { - candidates.clear(); - } else { - for (Iterator<BundleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { - Capability candidate = iCandidates.next(); - Resource origProvider = (Resource) ((BaseDescription) candidate.getResource()).getUserObject(); - Collection<Capability> origCapabilities = origProvider.getCapabilities(candidate.getNamespace()); - boolean found = false; - wireLoop: for (Wire wire : namespaceWires) { - for (Capability capability : origCapabilities) { - if (wire.getCapability().equals(capability)) { - found = true; - break wireLoop; - } - } - } - if (!found) - iCandidates.remove(); - } - } - } - - public void end() { - // nothing - } - - static <V> String toString(Map<String, V> map, String assignment, boolean stringsOnly) { - if (map.isEmpty()) - return ""; //$NON-NLS-1$ - Set<Entry<String, V>> set = map.entrySet(); - StringBuffer sb = new StringBuffer(); - for (Entry<String, V> entry : set) { - sb.append("; "); //$NON-NLS-1$ - String key = entry.getKey(); - Object value = entry.getValue(); - if (value instanceof List) { - @SuppressWarnings("unchecked") - List<Object> list = (List<Object>) value; - if (list.size() == 0) - continue; - Object component = list.get(0); - String className = component.getClass().getName(); - String type = className.substring(className.lastIndexOf('.') + 1); - sb.append(key).append(':').append("List<").append(type).append(">").append(assignment).append('"'); //$NON-NLS-1$ //$NON-NLS-2$ - for (Object object : list) - sb.append(object).append(','); - sb.setLength(sb.length() - 1); - sb.append('"'); - } else { - String type = ""; //$NON-NLS-1$ - if (!(value instanceof String) && !stringsOnly) { - String className = value.getClass().getName(); - type = ":" + className.substring(className.lastIndexOf('.') + 1); //$NON-NLS-1$ - } - sb.append(key).append(type).append(assignment).append('"').append(value).append('"'); - } - } - return sb.toString(); - } -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/FilterParser.java b/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/FilterParser.java deleted file mode 100644 index f8d92b738..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/eclipse/equinox/internal/resolver/FilterParser.java +++ /dev/null @@ -1,416 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: IBM - Initial API and implementation - ******************************************************************************/ -package org.eclipse.equinox.internal.resolver; - -import java.util.*; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.Version; - -public class FilterParser { - static class Range { - private char leftRule = 0; - private Version leftVersion; - private Version rightVersion; - private char rightRule = 0; - private Collection<Version> excludes = new ArrayList<Version>(0); - - public String toString() { - if (rightVersion == null) { - return leftVersion.toString(); - } - return leftRule + leftVersion.toString() + ',' + rightVersion.toString() + rightRule; - } - - void addExclude(Version exclude) { - this.excludes.add(exclude); - setLeft(leftRule, leftVersion); - setRight(rightRule, rightVersion); - } - - boolean setLeft(char leftRule, Version leftVersion) { - if (this.leftVersion != null && this.leftVersion != leftVersion) - return false; - this.leftRule = excludes.contains(leftVersion) ? '(' : leftRule; - this.leftVersion = leftVersion; - return true; - } - - boolean setRight(char rightRule, Version rightVersion) { - if (this.rightVersion != null && this.rightVersion != rightVersion) - return false; - this.rightRule = excludes.contains(rightVersion) ? ')' : rightRule; - this.rightVersion = rightVersion; - return true; - } - } - - public static class FilterComponent { - /* filter operators */ - public static final int EQUAL = 1; - public static final int APPROX = 2; - public static final int GREATER = 3; - public static final int LESS = 4; - public static final int AND = 7; - public static final int OR = 8; - public static final int NOT = 9; - - private final int op; - private final String attr; - private final String value; - private final List<FilterComponent> nested; - - public FilterComponent(int op, List<FilterComponent> nested) { - this.op = op; - this.attr = null; - this.value = null; - this.nested = nested; - } - - public FilterComponent(int op, String attr, String value) { - this.op = op; - this.attr = attr; - this.value = value; - this.nested = Collections.emptyList(); - } - - public int getOp() { - return op; - } - - public String getAttr() { - return attr; - } - - public String getValue() { - return value; - } - - public List<FilterComponent> getNested() { - return nested; - } - - public Map<String, String> getStandardOSGiAttributes(String... versions) { - if (op != AND && op != EQUAL) - throw new IllegalStateException("Invalid filter for Starndard OSGi Attributes: " + op); //$NON-NLS-1$ - Map<String, String> result = new HashMap<String, String>(); - Map<String, Range> versionAttrs = new HashMap<String, Range>(); - if (versions != null) { - for (String versionAttr : versions) { - versionAttrs.put(versionAttr, null); - } - } - addAttributes(result, versionAttrs, false); - for (Map.Entry<String, Range> entry : versionAttrs.entrySet()) { - Range range = entry.getValue(); - if (range != null) { - result.put(entry.getKey(), range.toString()); - } - } - - return result; - } - - private void addAttributes(Map<String, String> attributes, Map<String, Range> versionAttrs, boolean not) { - if (op == EQUAL) { - if (!versionAttrs.containsKey(attr)) { - attributes.put(attr, value); - } else { - // this is an exact range e.g. [value,value] - Range currentRange = versionAttrs.get(attr); - if (currentRange != null) { - if (not) { - // this is an expanded for of the filter, e.g.: - // [1.0,2.0) -> (&(version>=1.0)(version<=2.0)(!(version=2.0))) - currentRange.addExclude(new Version(value)); - } else { - throw new IllegalStateException("Invalid range for: " + attr); //$NON-NLS-1$ - } - } - currentRange = new Range(); - Version version = new Version(value); - currentRange.setLeft('[', version); - currentRange.setRight(']', version); - versionAttrs.put(attr, currentRange); - } - } else if (op == LESS) { - if (!versionAttrs.containsKey(attr)) - throw new IllegalStateException("Invalid attribute: " + attr); //$NON-NLS-1$ - Range currentRange = versionAttrs.get(attr); - if (currentRange == null) { - currentRange = new Range(); - versionAttrs.put(attr, currentRange); - } - if (not) { - // this must be a range start "(value" - if (!currentRange.setLeft('(', new Version(value))) - throw new IllegalStateException("range start is already processed for attribute: " + attr); //$NON-NLS-1$ - } else { - // this must be a range end "value]" - if (!currentRange.setRight(']', new Version(value))) - throw new IllegalStateException("range end is already processed for attribute: " + attr); //$NON-NLS-1$ - } - } else if (op == GREATER) { - if (!versionAttrs.containsKey(attr)) - throw new IllegalStateException("Invalid attribute: " + attr); //$NON-NLS-1$ - Range currentRange = versionAttrs.get(attr); - if (currentRange == null) { - currentRange = new Range(); - versionAttrs.put(attr, currentRange); - } - if (not) { - // this must be a range end "value)" - if (!currentRange.setRight(')', new Version(value))) - throw new IllegalStateException("range end is already processed for attribute: " + attr); //$NON-NLS-1$ - } else { - // this must be a range start "[value" - if (!currentRange.setLeft('[', new Version(value))) - throw new IllegalStateException("range start is already processed for attribute: " + attr); //$NON-NLS-1$ - } - } else if (op == AND) { - for (FilterComponent component : nested) { - component.addAttributes(attributes, versionAttrs, false); - } - } else if (op == NOT) { - nested.get(0).addAttributes(attributes, versionAttrs, true); - } else { - throw new IllegalStateException("Invalid filter for standard OSGi requirements: " + op); //$NON-NLS-1$ - } - } - } - - private final String filterstring; - private final char[] filterChars; - private int pos; - - public FilterParser(String filterstring) { - this.filterstring = filterstring; - filterChars = filterstring.toCharArray(); - pos = 0; - } - - public FilterComponent parse() throws InvalidSyntaxException { - FilterComponent filter; - try { - filter = parse_filter(); - } catch (ArrayIndexOutOfBoundsException e) { - throw new InvalidSyntaxException("Filter ended abruptly", filterstring, e); //$NON-NLS-1$ - } - - if (pos != filterChars.length) { - throw new InvalidSyntaxException("Extraneous trailing characters: " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - return filter; - } - - private FilterComponent parse_filter() throws InvalidSyntaxException { - FilterComponent filter; - skipWhiteSpace(); - - if (filterChars[pos] != '(') { - throw new InvalidSyntaxException("Missing '(': " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - pos++; - - filter = parse_filtercomp(); - - skipWhiteSpace(); - - if (filterChars[pos] != ')') { - throw new InvalidSyntaxException("Missing ')': " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - pos++; - - skipWhiteSpace(); - - return filter; - } - - private FilterComponent parse_filtercomp() throws InvalidSyntaxException { - skipWhiteSpace(); - - char c = filterChars[pos]; - - switch (c) { - case '&' : { - pos++; - return parse_and(); - } - case '|' : { - pos++; - return parse_or(); - } - case '!' : { - pos++; - return parse_not(); - } - } - return parse_item(); - } - - private FilterComponent parse_and() throws InvalidSyntaxException { - int lookahead = pos; - skipWhiteSpace(); - - if (filterChars[pos] != '(') { - pos = lookahead - 1; - return parse_item(); - } - - List<FilterComponent> operands = new ArrayList<FilterComponent>(10); - - while (filterChars[pos] == '(') { - FilterComponent child = parse_filter(); - operands.add(child); - } - - return new FilterComponent(FilterComponent.AND, operands); - } - - private FilterComponent parse_or() throws InvalidSyntaxException { - int lookahead = pos; - skipWhiteSpace(); - - if (filterChars[pos] != '(') { - pos = lookahead - 1; - return parse_item(); - } - - List<FilterComponent> operands = new ArrayList<FilterComponent>(10); - - while (filterChars[pos] == '(') { - FilterComponent child = parse_filter(); - operands.add(child); - } - - return new FilterComponent(FilterComponent.OR, operands); - } - - private FilterComponent parse_not() throws InvalidSyntaxException { - int lookahead = pos; - skipWhiteSpace(); - - if (filterChars[pos] != '(') { - pos = lookahead - 1; - return parse_item(); - } - - List<FilterComponent> operands = new ArrayList<FilterComponent>(1); - FilterComponent child = parse_filter(); - operands.add(child); - - return new FilterComponent(FilterComponent.NOT, operands); - } - - private FilterComponent parse_item() throws InvalidSyntaxException { - String attr = parse_attr(); - - skipWhiteSpace(); - - switch (filterChars[pos]) { - case '~' : { - if (filterChars[pos + 1] == '=') { - pos += 2; - return new FilterComponent(FilterComponent.APPROX, attr, parse_value()); - } - break; - } - case '>' : { - if (filterChars[pos + 1] == '=') { - pos += 2; - return new FilterComponent(FilterComponent.GREATER, attr, parse_value()); - } - break; - } - case '<' : { - if (filterChars[pos + 1] == '=') { - pos += 2; - return new FilterComponent(FilterComponent.LESS, attr, parse_value()); - } - break; - } - case '=' : { - pos++; - return new FilterComponent(FilterComponent.EQUAL, attr, parse_value()); - } - } - - throw new InvalidSyntaxException("Invalid operator: " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - private String parse_attr() throws InvalidSyntaxException { - skipWhiteSpace(); - - int begin = pos; - int end = pos; - - char c = filterChars[pos]; - - while (c != '~' && c != '<' && c != '>' && c != '=' && c != '(' && c != ')') { - pos++; - - if (!Character.isWhitespace(c)) { - end = pos; - } - - c = filterChars[pos]; - } - - int length = end - begin; - - if (length == 0) { - throw new InvalidSyntaxException("Missing attr: " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - return new String(filterChars, begin, length); - } - - private String parse_value() throws InvalidSyntaxException { - StringBuffer sb = new StringBuffer(filterChars.length - pos); - - parseloop: while (true) { - char c = filterChars[pos]; - - switch (c) { - case ')' : { - break parseloop; - } - - case '(' : { - throw new InvalidSyntaxException("Invalid value: " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - case '\\' : { - pos++; - c = filterChars[pos]; - /* fall through into default */ - } - - default : { - sb.append(c); - pos++; - break; - } - } - } - - if (sb.length() == 0) { - throw new InvalidSyntaxException("Missing value: " + filterstring.substring(pos), filterstring); //$NON-NLS-1$ - } - - return sb.toString(); - } - - private void skipWhiteSpace() { - for (int length = filterChars.length; (pos < length) && Character.isWhitespace(filterChars[pos]);) { - pos++; - } - } -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Environment.java b/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Environment.java deleted file mode 100644 index 4196f58b5..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Environment.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2011). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.resolver; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.osgi.framework.resource.Capability; -import org.osgi.framework.resource.Requirement; -import org.osgi.framework.resource.Resource; -import org.osgi.framework.resource.Wire; - -/** - * An environment provides options and constraints to the potential solution of - * a {@link Resolver#resolve(Environment, Collection, Collection)} operation. - * - * <p> - * Environments: - * <ul> - * <li>Provide {@link Capability capabilities} that the Resolver can use - * to satisfy {@link Requirement requirements} via the - * {@link #findProviders(Requirement)} method</li> - * - * <li>Constrain solutions via the {@link #getWiring()} method. A wiring - * consists of a map of existing {@link Resource resources} to {@link Wire - * wires}. - * - * <li>Filter transitive requirements that are brought in as part of a resolve - * operation via the {@link #isEffective(Requirement)}. - * </ul> - * - * <p> - * An environment may be used to provide capabilities via local {@link Resource - * resources} and/or remote {@link org.osgi.service.repository.Repository repositories}. - * - * <p> - * A resolver may call the {@link #findProviders(Requirement)}, - * {@link #isEffective(Requirement)} and {@link #getWiring()} method any number of - * times during a resolve using any thread. Environments may also be shared - * between several resolvers. As such implementors should ensure that this class - * is properly synchronized. - * - * @ThreadSafe - */ -public interface Environment { - /** - * Find any capabilities that {@link Requirement#matches(Capability) match} - * the supplied requirement. - * - * <p> - * A resolver should use the iteration order or the returned capability - * collection to infer preference in the case where multiple capabilities - * match a requirement. Capabilities at the start of the iteration are implied - * to be preferred over capabilities at the end. - * - * @param requirement - * the requirement that a resolver is attempting to satisfy - * - * @return an collection of capabilities that match the supplied - * requirement - * - * @throws NullPointerException if the requirement is null - */ - Collection<Capability> findProviders(Requirement requirement); - - /** - * Test if a given requirement should be wired in a given resolve - * operation. If this method returns false then the resolver should ignore - * this requirement during this resolve operation. - * - * <p> - * The primary use case for this is to test the <code>effective</code> directive - * on the requirement, though implementations are free to use this for any other - * purposes. - * - * @param requirement the Requirement to test - * - * @return true if the requirement should be considered as part of this resolve operation - * - * @throws NullPointerException if requirement is null - */ - boolean isEffective(Requirement requirement); - - /** - * An immutable map of wires between revisions. Multiple calls to this method - * for the same environment object must result in the same set of wires. - * - * @return the wires already defined in this environment - */ - Map<Resource, List<Wire>> getWiring(); -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/ResolutionException.java b/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/ResolutionException.java deleted file mode 100644 index 3597bbc23..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/ResolutionException.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2011). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.resolver; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -import org.osgi.framework.resource.Requirement; - -/** - * Indicates failure to resolve a set of requirements. - * - * <p> - * If a resolution failure is caused by a missing mandatory dependency a - * resolver may include any requirements it has considered in the resolution - * exception. Clients may access this set of dependencies via the - * {@link #getUnresolvedRequirements()} method. - * - * <p> - * Resolver implementations may subclass this class to provide extra state - * information about the reason for the resolution failure. - * - * @ThreadSafe - * @Immutable - */ -public class ResolutionException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - // NOTE used requirement[] not collection to avoid accidental serialization - // issues - private Requirement[] unresolvedRequirements; - - /** - * Creates an exception of type {@code ResolutionException}. - * - * <p> - * This method creates an {@code ResolutionException} object with the - * specified message, cause and unresolvedRequirements. - * - * @param message - * The message. - * @param cause - * The cause of this exception. - * @param unresolvedRequirements - * the requirements that are unresolved or null if no unresolved requirements - * information is provided. - */ - public ResolutionException(String message, Throwable cause, - Collection<Requirement> unresolvedRequirements) { - super(message, cause); - if (unresolvedRequirements != null) { - // copy array both fixes serialization issues and - // ensures exception is immutable - this.unresolvedRequirements = unresolvedRequirements - .toArray(new Requirement[unresolvedRequirements.size()]); - } - } - - /** - * Creates an exception of type {@code ResolutionException}. - * - * <p> - * This method creates an {@code ResolutionException} object with the - * specified message. - * - * @param message - * The message. - */ - public ResolutionException(String message) { - super(message); - } - - /** - * Creates an exception of type {@code ResolutionException}. - * - * <p> - * This method creates an {@code ResolutionException} object with the - * specified cause. - * - * @param cause - * The cause of this exception. - */ - public ResolutionException(Throwable cause) { - super(cause); - } - - /** - * May contain one or more unresolved mandatory requirements from mandatory - * resources. - * - * <p> - * This exception is provided for informational purposes and the specific set - * of requirements that are returned after a resolve failure is not defined. - * - * @return a collection of requirements that are unsatisfied - */ - public Collection<Requirement> getUnresolvedRequirements() { - // creating at each call ensures internal data is immutable - // TODO could use a transient field to reduce CPU cost at expense of RAM - - // both trivial compared to code complexity - if (unresolvedRequirements == null) { - return Collections.EMPTY_LIST; - } else { - ArrayList<Requirement> requirements = new ArrayList<Requirement>( - unresolvedRequirements.length); - for (Requirement r : unresolvedRequirements) { - requirements.add(r); - } - return requirements; - } - } -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Resolver.java b/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Resolver.java deleted file mode 100644 index 5735a30be..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/Resolver.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2006, 2010). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This document is an experimental draft to enable interoperability -// between bundle repositories. There is currently no commitment to -// turn this draft into an official specification. - -package org.osgi.service.resolver; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.osgi.framework.resource.Resource; -import org.osgi.framework.resource.Wire; - -/** - * A resolver is a service interface that can be used to find resolutions for - * specified {@link Resource resources} based on a supplied {@link Environment}. - * - * @ThreadSafe - * @version $Id$ - */ -public interface Resolver { - /** - * Attempt to resolve the resources based on the specified environment and - * return any new resources and wires to the caller. - * - * <p> - * The resolver considers two groups of resources: - * <ul> - * <li>Mandatory - any resource in the mandatory group must be resolved, a - * failure to satisfy any mandatory requirement for these resources will - * result in a {@link ResolutionException}</li> - * <li>Optional - any resource in the optional group may be resolved, a - * failure to satisfy a mandatory requirement for a resource in this group - * will not fail the overall resolution but no resources or wires will be - * returned for this resource.</li> - * </ul> - * - * <h3>Delta</h3> - * <p> - * The resolve method returns the delta between the start state defined by - * {@link Environment#getWiring()} and the end resolved state, i.e. only new - * resources and wires are included. To get the complete resolution the caller - * can merge the start state and the delta using something like the following: - * - * <pre> - * Map<Resource, List<Wire>> delta = resolver.resolve(env, resources, null); - * Map<Resource, List<Wire>> wiring = env.getWiring(); - * - * for (Map.Entry<Resource, List<Wire>> e : delta.entrySet()) { - * Resource res = e.getKey(); - * List<Wire> newWires = e.getValue(); - * - * List<Wire> currentWires = wiring.get(res); - * if (currentWires != null) { - * newWires.addAll(currentWires); - * } - * - * wiring.put(res, newWires); - * } - * </pre> - * - * <h3>Consistency</h3> - * <p> - * For a given resolve operation the parameters to the resolve method should be - * considered immutable. This means that resources should have constant - * capabilities and requirements and an environment should return a consistent - * set of capabilities, wires and effective requirements. - * - * <p> - * The behavior of the resolver is not defined if resources or the environment - * supply inconsistent information. - * - * @param environment - * the environment into which to resolve the requirements - * @param mandatoryResources - * The resources that must be resolved during this resolution step or - * null if no resources must be resolved - * @param optionalResources - * Any resources which the resolver should attempt to resolve but - * that will not cause an exception if resolution is impossible or - * null if no resources are optional. - * - * @return the new resources and wires required to satisfy the requirements - * - * @throws ResolutionException - * if the resolution cannot be satisfied for any reason - * @throws NullPointerException - * if environment is null - */ - Map<Resource, List<Wire>> resolve(Environment environment, - Collection<? extends Resource> mandatoryResources, - Collection<? extends Resource> optionalResources) - throws ResolutionException; -} diff --git a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/package-info.java b/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/package-info.java deleted file mode 100644 index ffe26e5b9..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/package-info.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Resolver Package Version 1.0. - * - * <p> - * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - * - * <p> - * Example import for consumers using the API in this package: - * <p> - * {@code Import-Package: org.osgi.service.resolver; version="[1.0,2.0)"} - * <p> - * Example import for providers implementing the API in this package: - * <p> - * {@code Import-Package: org.osgi.service.resolver; version="[1.0,1.1)"} - * - * @version $Id$ - */ - -package org.osgi.service.resolver;
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/packageinfo b/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/packageinfo deleted file mode 100644 index 7c8de0324..000000000 --- a/bundles/org.eclipse.equinox.resolver/src/org/osgi/service/resolver/packageinfo +++ /dev/null @@ -1 +0,0 @@ -version 1.0 |