Merge remote-tracking branch 'origin/R4_2_maintenance'
diff --git a/bundles/org.eclipse.e4.core.contexts/pom.xml b/bundles/org.eclipse.e4.core.contexts/pom.xml
index 587ebdf..fc31d62 100644
--- a/bundles/org.eclipse.e4.core.contexts/pom.xml
+++ b/bundles/org.eclipse.e4.core.contexts/pom.xml
@@ -21,6 +21,6 @@
   </parent>
   <groupId>org.eclipse.platform.runtime</groupId>
   <artifactId>org.eclipse.e4.core.contexts</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>1.2.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/bundles/org.eclipse.e4.core.di.extensions/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.di.extensions/META-INF/MANIFEST.MF
index 600d819..3eb44a5 100644
--- a/bundles/org.eclipse.e4.core.di.extensions/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.core.di.extensions/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.e4.core.di.extensions;singleton:=true
-Bundle-Version: 0.11.0.qualifier
+Bundle-Version: 0.11.100.qualifier
 Bundle-Activator: org.eclipse.e4.core.di.internal.extensions.DIEActivator
 Require-Bundle: org.eclipse.osgi;bundle-version="3.6.0",
  org.eclipse.equinox.preferences;bundle-version="3.3.0",
diff --git a/bundles/org.eclipse.e4.core.di.extensions/pom.xml b/bundles/org.eclipse.e4.core.di.extensions/pom.xml
index 5d72edd..0f3ef71 100644
--- a/bundles/org.eclipse.e4.core.di.extensions/pom.xml
+++ b/bundles/org.eclipse.e4.core.di.extensions/pom.xml
@@ -21,6 +21,6 @@
   </parent>
   <groupId>org.eclipse.platform.runtime</groupId>
   <artifactId>org.eclipse.e4.core.di.extensions</artifactId>
-  <version>0.11.0-SNAPSHOT</version>
+  <version>0.11.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/bundles/org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/extensions/EventObjectSupplier.java b/bundles/org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/extensions/EventObjectSupplier.java
index c15c202..907466c 100644
--- a/bundles/org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/extensions/EventObjectSupplier.java
+++ b/bundles/org.eclipse.e4.core.di.extensions/src/org/eclipse/e4/core/di/internal/extensions/EventObjectSupplier.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -157,6 +157,8 @@
 
 		if (track)
 			subscribe(topic, eventAdmin, requestor);
+		else
+			unsubscribe(requestor);
 
 		if (!currentEvents.containsKey(topic))
 			return IInjector.NOT_A_VALUE;
@@ -205,12 +207,14 @@
 	}
 
 	protected void unsubscribe(IRequestor requestor) {
+		if (requestor == null)
+			return;
 		synchronized (registrations) {
 			Iterator<Entry<Subscriber, ServiceRegistration>> i = registrations.entrySet().iterator();
 			while (i.hasNext()) {
 				Entry<Subscriber, ServiceRegistration> entry = i.next();
 				Subscriber key = entry.getKey();
-				if (key.getRequestor() != requestor)
+				if (!requestor.equals(key.getRequestor()))
 					continue;
 				ServiceRegistration registration = entry.getValue();
 				registration.unregister();
diff --git a/bundles/org.eclipse.e4.core.di/pom.xml b/bundles/org.eclipse.e4.core.di/pom.xml
index d3e10e7..147a17b 100644
--- a/bundles/org.eclipse.e4.core.di/pom.xml
+++ b/bundles/org.eclipse.e4.core.di/pom.xml
@@ -22,6 +22,6 @@
   </parent>
   <groupId>org.eclipse.platform.runtime</groupId>
   <artifactId>org.eclipse.e4.core.di</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>1.2.0-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ClassRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ClassRequestor.java
index f8b32a8..d868e7a 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ClassRequestor.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ClassRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -67,4 +67,27 @@
 		return tmp.toString();
 	}
 
+	public int hashCode() {
+		final int prime = 31;
+		int result = super.hashCode();
+		result = prime * result + ((clazzName == null) ? 0 : clazzName.hashCode());
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (!super.equals(obj))
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ClassRequestor other = (ClassRequestor) obj;
+		if (clazzName == null) {
+			if (other.clazzName != null)
+				return false;
+		} else if (!clazzName.equals(other.clazzName))
+			return false;
+		return true;
+	}
+
 }
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java
index 848e5b1..72a3c19 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/ConstructorRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -98,4 +98,27 @@
 		return tmp.toString();
 	}
 
+	public int hashCode() {
+		final int prime = 31;
+		int result = super.hashCode();
+		result = prime * result + ((constructor == null) ? 0 : constructor.hashCode());
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (!super.equals(obj))
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ConstructorRequestor other = (ConstructorRequestor) obj;
+		if (constructor == null) {
+			if (other.constructor != null)
+				return false;
+		} else if (!constructor.equals(other.constructor))
+			return false;
+		return true;
+	}
+
 }
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java
index d6a7a2b..6e82310 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/FieldRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -71,4 +71,27 @@
 		return tmp.toString();
 	}
 
+	public int hashCode() {
+		final int prime = 31;
+		int result = super.hashCode();
+		result = prime * result + ((field == null) ? 0 : field.hashCode());
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (!super.equals(obj))
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		FieldRequestor other = (FieldRequestor) obj;
+		if (field == null) {
+			if (other.field != null)
+				return false;
+		} else if (!field.equals(other.field))
+			return false;
+		return true;
+	}
+
 }
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java
index dcef637..1b70ad9 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/MethodRequestor.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 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
@@ -107,4 +107,27 @@
 		return tmp.toString();
 	}
 
+	public int hashCode() {
+		final int prime = 31;
+		int result = super.hashCode();
+		result = prime * result + ((method == null) ? 0 : method.hashCode());
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (!super.equals(obj))
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		MethodRequestor other = (MethodRequestor) obj;
+		if (method == null) {
+			if (other.method != null)
+				return false;
+		} else if (!method.equals(other.method))
+			return false;
+		return true;
+	}
+
 }
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/Requestor.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/Requestor.java
index 41552b2..64e0f47 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/Requestor.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/Requestor.java
@@ -157,4 +157,38 @@
 		actualArgs = null;
 		return;
 	}
+
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + (groupUpdates ? 1231 : 1237);
+		result = prime * result + ((injector == null) ? 0 : injector.hashCode());
+		result = prime * result + (isOptional ? 1231 : 1237);
+		result = prime * result + ((primarySupplier == null) ? 0 : primarySupplier.hashCode());
+		Object refObject = getRequestingObject();
+		result = prime * result + ((refObject == null) ? 0 : refObject.hashCode());
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Requestor other = (Requestor) obj;
+		if (groupUpdates != other.groupUpdates)
+			return false;
+		if (injector != other.injector)
+			return false;
+		if (isOptional != other.isOptional)
+			return false;
+		if (primarySupplier != other.primarySupplier)
+			return false;
+		if (getRequestingObject() != other.getRequestingObject())
+			return false;
+		return true;
+	}
+
 }