Bug 568204 - Replace Platform.getBundle with Platform.getLog The caller in LaunchUpdateIntroAction uses Platform.getBundle in a cold path in order to get hold of the platform log. However, this requires looking up the bundle by name, when we already have a means to acquire the log directly from the Platform, so use that instead. Instead of using `log.(new Status)` use the default method `error` which does the same thing and is more compact. Change-Id: I822898f0ed91ed43a0390a4c0436024f93486bfd
diff --git a/platform/org.eclipse.platform/src-intro/org/eclipse/platform/internal/LaunchUpdateIntroAction.java b/platform/org.eclipse.platform/src-intro/org/eclipse/platform/internal/LaunchUpdateIntroAction.java index 85d4015..e594838 100644 --- a/platform/org.eclipse.platform/src-intro/org/eclipse/platform/internal/LaunchUpdateIntroAction.java +++ b/platform/org.eclipse.platform/src-intro/org/eclipse/platform/internal/LaunchUpdateIntroAction.java
@@ -23,7 +23,6 @@ import org.eclipse.ui.handlers.IHandlerService; import org.eclipse.ui.intro.IIntroSite; import org.eclipse.ui.intro.config.IIntroAction; -import org.osgi.framework.Bundle; public class LaunchUpdateIntroAction implements IIntroAction { @@ -52,10 +51,7 @@ try { cmd.executeWithChecks(executionEvent); } catch (ExecutionException e) { - String bundleId = "org.eclipse.platform"; //$NON-NLS-1$ - Bundle bundle = Platform.getBundle(bundleId); - if (bundle != null) - Platform.getLog(bundle).log(new Status(IStatus.ERROR, bundleId, "Exception executing command: " + command, e)); //$NON-NLS-1$ + Platform.getLog(LaunchUpdateIntroAction.class).error("Exception executing command: " + command, e); //$NON-NLS-1$ } catch (NotDefinedException e) { return false; } catch (NotEnabledException e) {