1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Possible NPE in "getUniqueIdentifier" if the plugin's bundle hasn't been loaded. Replaced by a constant string for the plugin id.

This commit is contained in:
Mikhail Khodjaiants 2007-07-25 11:45:42 +00:00
parent 8563df14dc
commit 79c143bd48
4 changed files with 4 additions and 28 deletions

View file

@ -122,13 +122,7 @@ public class CDebugCorePlugin extends Plugin {
* @return the unique identifier of this plugin * @return the unique identifier of this plugin
*/ */
public static String getUniqueIdentifier() { public static String getUniqueIdentifier() {
if ( getDefault() == null ) { return PLUGIN_ID;
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return PLUGIN_ID;
}
return getDefault().getBundle().getSymbolicName();
} }
/** /**

View file

@ -492,13 +492,7 @@ public class MIPlugin extends Plugin {
* Convenience method which returns the unique identifier of this plugin. * Convenience method which returns the unique identifier of this plugin.
*/ */
public static String getUniqueIdentifier() { public static String getUniqueIdentifier() {
if (getDefault() == null) { return PLUGIN_ID;
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return PLUGIN_ID;
}
return getDefault().getBundle().getSymbolicName();
} }
public void debugLog(String message) { public void debugLog(String message) {

View file

@ -56,12 +56,6 @@ public class MIUIPlugin extends AbstractUIPlugin {
* @return the unique identifier of this plugin * @return the unique identifier of this plugin
*/ */
public static String getUniqueIdentifier() { public static String getUniqueIdentifier() {
if ( getDefault() == null ) { return PLUGIN_ID;
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return PLUGIN_ID;
}
return getDefault().getBundle().getSymbolicName();
} }
} }

View file

@ -106,13 +106,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
* Convenience method which returns the unique identifier of this plugin. * Convenience method which returns the unique identifier of this plugin.
*/ */
public static String getUniqueIdentifier() { public static String getUniqueIdentifier() {
if ( getDefault() == null ) { return PLUGIN_ID;
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return PLUGIN_ID;
}
return getDefault().getBundle().getSymbolicName();
} }
/** /**