Latest OSGi Companion code from build 4.2.0.200808181231
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/AdminPermission.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/AdminPermission.java
index 4997d1e..0475c4b 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/AdminPermission.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/AdminPermission.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2007-10-11 10:45:28 -0400 (Thu, 11 Oct 2007) $
+ * $Date: 2008/07/31 22:25:18 $
  * 
  * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved.
  * 
@@ -74,7 +74,7 @@
  * </ul>
  * 
  * @ThreadSafe
- * @version $Revision: 1.24 $
+ * @version $Revision: 1.25 $
  */
 
 public final class AdminPermission extends BasicPermission {
@@ -101,6 +101,7 @@
 	public final static String			EXTENSIONLIFECYCLE	= "extensionLifecycle";
 	/**
 	 * The action string <code>lifecycle</code> (Value is "lifecycle").
+	 * 
 	 * @since 1.3
 	 */
 	public final static String			LIFECYCLE			= "lifecycle";
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Constants.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Constants.java
index 24d5992..b6d7bf2 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Constants.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Constants.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2007-08-09 21:17:58 -0400 (Thu, 09 Aug 2007) $
+ * $Date: 2008-08-04 12:32:08 -0400 (Mon, 04 Aug 2008) $
  *
  * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved.
  *
@@ -27,7 +27,7 @@
  * <code>java.lang.String</code>, unless otherwise indicated.
  * 
  * @since 1.1
- * @version $Revision: 4930 $
+ * @version $Revision: 5248 $
  */
 
 public interface Constants {
@@ -552,6 +552,25 @@
 	public static final String	SERVICE_RANKING							= "service.ranking";
 
 	/**
+	 * Service property (named &quot;service.type&quot;) to provide information
+	 * about the type of the service. For example, if this service is proxied,
+	 * the property value might contain a string such as &quot;proxied&quot;.
+	 * 
+	 * <p>
+	 * The OSGi Alliance reserves all property value strings that start with
+	 * &quot;osgi.&quot;.
+	 * 
+	 * <p>
+	 * This property may be supplied in the properties <code>Dictionary</code>
+	 * object passed to the <code>BundleContext.registerService</code> method.
+	 * The value of this property must be of type <code>String</code>,
+	 * <code>String[]</code>, or <code>Collection</code> of <code>String</code>.
+	 * 
+	 * @since 1.5
+	 */
+	public static final String	SERVICE_TYPE							= "service.type";
+	
+	/**
 	 * Service property (named &quot;service.vendor&quot;) identifying a
 	 * service's vendor.
 	 * 
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Version.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Version.java
index 1a15ae7..1d9a6de 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Version.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/Version.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2007-08-09 21:17:58 -0400 (Thu, 09 Aug 2007) $
+ * $Date: 2008-07-25 12:51:53 -0400 (Fri, 25 Jul 2008) $
  * 
  * Copyright (c) OSGi Alliance (2004, 2007). All Rights Reserved.
  * 
@@ -39,7 +39,7 @@
  * 
  * @since 1.3
  * @Immutable
- * @version $Revision: 4930 $
+ * @version $Revision: 5193 $
  */
 
 public class Version implements Comparable {
@@ -72,14 +72,14 @@
 	}
 
 	/**
-	 * Creates a version identifier from the specifed components.
+	 * Creates a version identifier from the specified components.
 	 * 
 	 * @param major Major component of the version identifier.
 	 * @param minor Minor component of the version identifier.
 	 * @param micro Micro component of the version identifier.
 	 * @param qualifier Qualifier component of the version identifier. If
-	 *        <code>null</code> is specified, then the qualifier will be set
-	 *        to the empty string.
+	 *        <code>null</code> is specified, then the qualifier will be set to
+	 *        the empty string.
 	 * @throws IllegalArgumentException If the numerical components are negative
 	 *         or the qualifier string is invalid.
 	 */
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/FindHook.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/FindHook.java
index 82b7bf4..50c72c1 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/FindHook.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/FindHook.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2008-07-10 17:24:58 -0400 (Thu, 10 Jul 2008) $
+ * $Date: 2008-07-31 15:04:40 -0400 (Thu, 31 Jul 2008) $
  * 
  * Copyright (c) OSGi Alliance (2008). All Rights Reserved.
  * 
@@ -31,7 +31,7 @@
  * operations on other service hooks.
  * 
  * @ThreadSafe
- * @version $Revision: 5176 $
+ * @version $Revision: 5215 $
  */
 
 public interface FindHook {
@@ -50,10 +50,12 @@
 	 *        of a call to
 	 *        {@link BundleContext#getAllServiceReferences(String, String)}
 	 * @param references A <code>Collection</code> of Service References to be
-	 *        returned to the finding bundle. The method implementation can
+	 *        returned to the finding bundle. The method implementation may
 	 *        remove references from the collection to prevent the references
-	 *        from being returned to the finding bundle. Attempting to add to
-	 *        the collection will result in an
+	 *        from being returned to the finding bundle. The collection supports
+	 *        all the optional <code>Collection</code> operations except
+	 *        <code>add</code> and <code>addAll</code>. Attempting to add to the
+	 *        collection will result in an
 	 *        <code>UnsupportedOperationException</code>.
 	 */
 	void find(BundleContext context, String name, String filter,
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/PublishHook.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/PublishHook.java
index b557426..f492000 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/PublishHook.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/hooks/service/PublishHook.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2008-07-10 17:24:58 -0400 (Thu, 10 Jul 2008) $
+ * $Date: 2008-07-31 15:04:40 -0400 (Thu, 31 Jul 2008) $
  * 
  * Copyright (c) OSGi Alliance (2008). All Rights Reserved.
  * 
@@ -31,7 +31,7 @@
  * are not called for service operations on other service hooks.
  * 
  * @ThreadSafe
- * @version $Revision: 5176 $
+ * @version $Revision: 5215 $
  */
 
 public interface PublishHook {
@@ -42,10 +42,13 @@
 	 * 
 	 * @param event The service event to be delivered.
 	 * @param bundles A <code>Collection</code> of Bundles which have listeners
-	 *        to which the event may be delivered. The method implementation can
+	 *        to which the event may be delivered. The method implementation may
 	 *        remove bundles from the collection to prevent the event from being
-	 *        delivered to those bundles. Attempting to add to the collection
-	 *        will result in an <code>UnsupportedOperationException</code>.
+	 *        delivered to those bundles. The collection supports all the
+	 *        optional <code>Collection</code> operations except
+	 *        <code>add</code> and <code>addAll</code>. Attempting to add to the
+	 *        collection will result in an
+	 *        <code>UnsupportedOperationException</code>.
 	 */
 	void event(ServiceEvent event, Collection bundles);
 }
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/launch/SystemBundle.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/launch/SystemBundle.java
new file mode 100644
index 0000000..8ace123
--- /dev/null
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/launch/SystemBundle.java
@@ -0,0 +1,104 @@
+/*
+ * $Date: 2008-07-31 14:34:04 -0400 (Thu, 31 Jul 2008) $
+ * 
+ * Copyright (c) OSGi Alliance (2008). 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.framework.launch;
+
+import java.util.Properties;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * This interface should be implemented by framework implementations when their
+ * main object is created. It allows a configurator to set the properties and
+ * launch the framework.
+ * 
+ * TODO The javadoc in this class need a good scrub before release.
+ * 
+ * @ThreadSafe
+ * @version $Revision: 5214 $
+ */
+public interface SystemBundle extends Bundle {
+	/**
+	 * The name of a Security Manager class with public empty constructor. A
+	 * valid value is also true, this means that the framework should
+	 * instantiate its own security manager. If not set, security could be
+	 * defined by a parent framework or there is no security. This can be
+	 * detected by looking if there is a security manager set
+	 */
+	String SECURITY = "org.osgi.framework.security";
+
+	/**
+	 * A valid file path in the file system to a directory that exists. The
+	 * framework is free to use this directory as it sees fit. This area can not
+	 * be shared with anything else. If this property is not set, the framework
+	 * should use a file area from the parent bundle. If it is not embedded, it
+	 * must use a reasonable platform default.
+	 */
+	String STORAGE = "org.osgi.framework.storage";
+
+	/**
+	 * A list of paths (separated by path separator) that point to additional
+	 * directories to search for platform specific libraries
+	 */
+	String LIBRARIES = "org.osgi.framework.libraries";
+	/**
+	 * The command to give a file executable permission. This is necessary in
+	 * some environments for running shared libraries.
+	 */
+	String EXECPERMISSION = "org.osgi.framework.command.execpermission";
+
+	/**
+	 * Points to a directory with certificates. ###??? Keystore? Certificate
+	 * format?
+	 */
+	String ROOT_CERTIFICATES = "org.osgi.framework.root.certificates";
+
+	/**
+	 * Set by the configurator but the framework should provide a reasonable
+	 * default.
+	 */
+	String WINDOWSYSTEM = "org.osgi.framework.windowsystem";
+
+	/**
+	 * Configure this framework with the given properties. These properties can
+	 * contain framework specific properties or of the general kind defined in
+	 * the specification or in this interface.
+	 * 
+	 * @param configuration
+	 *            The properties. This properties can be backed by another
+	 *            properties, it can there not be assumed that it contains all
+	 *            keys. Use it only through the getProperty methods. This
+	 *            parameter may be null.
+	 * 
+	 */
+	void init(Properties configuration);
+
+	/**
+	 * Wait until the framework is completely finished.
+	 * 
+	 * This method will return if the framework is stopped and has cleaned up
+	 * all the framework resources.
+	 * 
+	 * @param timeout
+	 *            Maximum number of milliseconds to wait until the framework is
+	 *            finished. Specifying a zero will wait indefinitely.
+	 * @throws InterruptedException When the wait was interrupted
+	 * 
+	 */
+
+	void waitForStop(long timeout) throws InterruptedException;
+}
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/AbstractTracked.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/AbstractTracked.java
index 1f2d7ed..cd8fdf9 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/AbstractTracked.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/AbstractTracked.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2008-07-03 17:21:28 -0400 (Thu, 03 Jul 2008) $
+ * $Date: 2008-07-31 16:15:58 -0400 (Thu, 31 Jul 2008) $
  * 
  * Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
  * 
@@ -33,7 +33,7 @@
  * implementation of the Tracker class.
  * 
  * @ThreadSafe
- * @version $Revision: 5121 $
+ * @version $Revision: 5216 $
  * @since 1.4
  */
 abstract class AbstractTracked {
@@ -396,7 +396,7 @@
 
 	/**
 	 * Call the Tracker modified method. If this method is overridden, the
-	 * overridding method MUST call this method to increment the tracking count.
+	 * overriding method MUST call this method to increment the tracking count.
 	 * 
 	 * @GuardedBy this
 	 */
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java
index 4a92b2e..c8bdf03 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/util/tracker/ServiceTracker.java
@@ -1,5 +1,5 @@
 /*
- * $Date: 2008-07-03 17:21:28 -0400 (Thu, 03 Jul 2008) $
+ * $Date: 2008-08-01 20:54:43 -0400 (Fri, 01 Aug 2008) $
  * 
  * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
  * 
@@ -56,7 +56,7 @@
  * thread-safe.
  * 
  * @ThreadSafe
- * @version $Revision: 5121 $
+ * @version $Revision: 5237 $
  */
 public class ServiceTracker implements ServiceTrackerCustomizer {
 	/* set this to true to compile in debug messages */
@@ -177,7 +177,7 @@
 		this.trackReference = null;
 		this.trackClass = clazz;
 		this.customizer = (customizer == null) ? this : customizer;
-		this.listenerFilter = "(" + Constants.OBJECTCLASS + "=" + clazz.toString() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		this.listenerFilter = "(" + Constants.OBJECTCLASS + "=" + clazz + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		try {
 			this.filter = context.createFilter(listenerFilter);
 		}
@@ -214,12 +214,15 @@
 		this.context = context;
 		this.trackReference = null;
 		this.trackClass = null;
-		final Version frameworkVersion = new Version((String) AccessController
+		final Version frameworkVersion = (Version) AccessController
 				.doPrivileged(new PrivilegedAction() {
 					public Object run() {
-						return context.getProperty(Constants.FRAMEWORK_VERSION);
+						String version = context
+								.getProperty(Constants.FRAMEWORK_VERSION);
+						return (version == null) ? Version.emptyVersion
+								: new Version(version);
 					}
-				}));
+				});
 		final boolean endMatchSupported = (frameworkVersion
 				.compareTo(endMatchVersion) >= 0);
 		this.listenerFilter = endMatchSupported ? filter.toString() : null;