Avoid ISE during headless tests, see also
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=302e999bdd58cbcd7a279283204cd3078bc3fd82
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF
index 5bed800..1b4cbbd 100644
--- a/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.objectteams.otdt.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.objectteams.otdt.ui;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: org.eclipse.objectteams.otdt.ui.OTDTUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaEditorActivationListener.java b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaEditorActivationListener.java
index b276b62..3e81fdb 100644
--- a/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaEditorActivationListener.java
+++ b/plugins/org.eclipse.objectteams.otdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/callinmarkers/JavaEditorActivationListener.java
@@ -24,7 +24,6 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
@@ -56,33 +55,29 @@
//{OT_COPY_PASTE from org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.ActivationListener
protected IWorkbenchPart fActiveEditor;
- private IWorkbench fWorkbench;
public void installListener() {
- /*
- * XXX: Don't in-line this field unless the following bug has been fixed:
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55246
- */
- fWorkbench= PlatformUI.getWorkbench();
-
- fWorkbench.addWindowListener(this);
+ try {
+ PlatformUI.getWorkbench().addWindowListener(this);
+ } catch (IllegalStateException ise) {
+ return; // wrongly trying to install in a headless environment?
+ }
// Ensure existing windows get connected
- IWorkbenchWindow[] windows= fWorkbench.getWorkbenchWindows();
- for (int i= 0, length= windows.length; i < length; i++)
- windows[i].getPartService().addPartListener(this);
+ for (IWorkbenchWindow windows : PlatformUI.getWorkbench().getWorkbenchWindows())
+ windows.getPartService().addPartListener(this);
}
public void uninstallListener() {
- if (fWorkbench == null)
- return;
-
- fWorkbench.removeWindowListener(this);
+ try {
+ PlatformUI.getWorkbench().removeWindowListener(this);
+ } catch (IllegalStateException ise) {
+ return; // wrongly trying to uninstall in a headless environment?
+ }
// Ensure existing windows get disconnected
- IWorkbenchWindow[] windows= fWorkbench.getWorkbenchWindows();
- for (int i= 0, length= windows.length; i < length; i++)
- windows[i].getPartService().removePartListener(this);
+ for (IWorkbenchWindow windows : PlatformUI.getWorkbench().getWorkbenchWindows())
+ windows.getPartService().removePartListener(this);
}
public void partActivated(IWorkbenchPartReference ref) {
diff --git a/releng/map/otdt.map.in b/releng/map/otdt.map.in
index 9c983da..bed9dc5 100644
--- a/releng/map/otdt.map.in
+++ b/releng/map/otdt.map.in
@@ -15,7 +15,7 @@
plugin@org.eclipse.objectteams.otdt.debug=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.debug,tag=builds/201406101339
plugin@org.eclipse.objectteams.otdt.debug.ui=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.debug.ui
-plugin@org.eclipse.objectteams.otdt.ui=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.ui,tag=builds/201406101339
+plugin@org.eclipse.objectteams.otdt.ui=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.ui
plugin@org.eclipse.objectteams.otdt.doc=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.doc
!plugin@org.eclipse.objectteams.otdt.metrics=GIT,repo=git://git.eclipse.org/gitroot/objectteams/org.eclipse.objectteams.git,path=plugins/org.eclipse.objectteams.otdt.metrics,tag=builds/201101290806