Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMat Booth2015-03-10 15:41:18 +0000
committerMat Booth2015-03-10 16:32:36 +0000
commit0fd8224fc27c090b1597b6df556d1e9209ae6d83 (patch)
tree2f6d5bc4debcf28ee6a852956c2dd3ab56801eba
parentd4b112e9e7de6d4067865db7950d1c825cc3812b (diff)
downloadorg.eclipse.linuxtools-0fd8224fc27c090b1597b6df556d1e9209ae6d83.tar.gz
org.eclipse.linuxtools-0fd8224fc27c090b1597b6df556d1e9209ae6d83.tar.xz
org.eclipse.linuxtools-0fd8224fc27c090b1597b6df556d1e9209ae6d83.zip
Don't hardcode the plugin ID in man-pages plugin.
The hard coded ID was incorrect (o.e.l.man versus o.e.l.man.core) so trying to look up the bundle by it's ID fails and any contributions that rely on this will not work correctly. This commit also removes some non-javadoc comments from the Activator. Change-Id: I2b1f9769bbfd4d9fb1b1c67c2ed71e68a8b54213 Signed-off-by: Mat Booth <mat.booth@redhat.com> Reviewed-on: https://git.eclipse.org/r/43589 Tested-by: Hudson CI
-rw-r--r--man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/Activator.java33
-rw-r--r--man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/parser/ManParser.java4
2 files changed, 16 insertions, 21 deletions
diff --git a/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/Activator.java b/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/Activator.java
index 33e6b5f67e..2921a5dc2b 100644
--- a/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/Activator.java
+++ b/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat Inc. and others.
+ * Copyright (c) 2009, 2015 Red Hat Inc. 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
@@ -18,40 +18,27 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- /** The plug-in ID */
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.man"; //$NON-NLS-1$
-
// The shared instance
private static Activator plugin;
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
- * )
- */
+ private BundleContext context;
+
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
+ this.context = context;
plugin = this;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
- * )
- */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
+ this.context = null;
super.stop(context);
}
/**
- * Returns the shared instance
+ * Returns the shared instance of the bundle activator.
*
* @return the shared instance
*/
@@ -59,4 +46,12 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
+ /**
+ * Returns the bundle symbolic name of the plug-in.
+ *
+ * @return an ID unique to this plug-in
+ */
+ public String getPluginId() {
+ return context.getBundle().getSymbolicName();
+ }
}
diff --git a/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/parser/ManParser.java b/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/parser/ManParser.java
index c99631e31c..a56e475237 100644
--- a/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/parser/ManParser.java
+++ b/man/org.eclipse.linuxtools.man.core/src/org/eclipse/linuxtools/internal/man/parser/ManParser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat Inc. and others.
+ * Copyright (c) 2009, 2015 Red Hat Inc. 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
@@ -60,7 +60,7 @@ public class ManParser {
}
} catch (IOException | InterruptedException e1) {
Status status = new Status(IStatus.ERROR, e1.getMessage(),
- Activator.PLUGIN_ID);
+ Activator.getDefault().getPluginId());
Activator.getDefault().getLog().log(status);
}
return sb;

Back to the top