Use ILog.of in IDEApplication version-file logger#17
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes internal StatusUtil dependencies in IDEApplication and WorkbenchActivitySupport, replacing them with standard Status or plugin-specific logging. A suggestion was made to simplify the logging in IDEApplication by passing the context message directly to Status.error to handle potential null localized messages and maintain the correct plugin ID.
| IDEWorkbenchPlugin.log("Could not write version file", //$NON-NLS-1$ | ||
| StatusUtil.newError(e)); | ||
| Status.error(e.getLocalizedMessage(), e)); |
There was a problem hiding this comment.
The logging call can be simplified by passing the context message directly to Status.error(...). This ensures the message is correctly associated with the status and avoids potential issues if e.getLocalizedMessage() returns null. Furthermore, using the log(IStatus) overload ensures that the plug-in ID set by Status.error (the application bundle) is preserved, which aligns with the stated goal of relocating the logged plug-in ID.
IDEWorkbenchPlugin.log(Status.error("Could not write version file", e)); //$NON-NLS-1$There was a problem hiding this comment.
Applied with one adjustment: IDEWorkbenchPlugin doesn't expose a log(IStatus) single-arg overload (only log(String), log(String, Throwable), log(Class, String, Throwable), log(String, IStatus)), so the literal suggestion wouldn't compile. I went with the equivalent that satisfies the same intent and matches the recent b51da6b9eca migration:
ILog.of(IDEApplication.class).error("Could not write version file", e); //$NON-NLS-1$This produces one log entry (instead of the two emitted by the previous IDEWorkbenchPlugin.log(message, status) helper), preserves the context message regardless of e.getLocalizedMessage(), and keeps the plug-in id at org.eclipse.ui.ide.application.
3de8563 to
3d7b588
Compare
IDEApplication.start set the splash shell's taskbar title via ChooseWorkspaceDialog.getWindowTitle(). That helper is scoped to the workspace chooser dialog: it returns Platform.getProduct().getName(), and falls back to an IDEWorkbenchMessages string whose name (ChooseWorkspaceDialog_defaultProductName) is tied to the chooser dialog's presentation. Using it for the splash shell is a layering inversion. The splash is a property of the application, not of the chooser dialog, and the dialog-specific NLS fallback is not appropriate for the splash taskbar entry. Read Platform.getProduct().getName() directly in IDEApplication. If no product is configured, leave the launcher's default title in place rather than substituting a chooser-dialog placeholder. ChooseWorkspaceDialog.getWindowTitle() is retained as an internal helper for the dialog itself. No user-visible change for Eclipse IDE products, which always have a product name configured.
Replaces the cross-bundle call to org.eclipse.ui.internal.ide.StatusUtil .newError(...) in IDEApplication#writeVersion with ILog.of(IDEApplication .class).error(message, throwable), and drops the now-unused StatusUtil import. Behavior changes: - Plug-in id moves from "org.eclipse.ui.ide" (IDE_WORKBENCH constant in the called StatusUtil) to "org.eclipse.ui.ide.application", which is the bundle that actually emits the version-file write failure. - The previous IDEWorkbenchPlugin.log(message, status) helper emitted two separate log entries (one for the message, one for the status); this now produces a single coherent entry whose status carries both the context message and the throwable, removing the dependency on the potentially-null e.getLocalizedMessage().
Give the preference dialog's filter field the full set of search-related style bits (SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL) so it is rendered as a native search field with a magnifier and cancel icon. Also override setInitialText to expose the hint via Text#setMessage only, instead of stuffing it into the field's content. The dialog auto-focuses the filter field on open, so the old initial-text fallback was never actually shown as a placeholder and forced users to delete the hint before typing.
3d7b588 to
ba64dcd
Compare
Migrates the single cross-bundle
StatusUtil.newError(e)inIDEApplication#writeVersiontoILog.of(IDEApplication.class).error(message, throwable). The logged plug-in id moves from"org.eclipse.ui.ide"to"org.eclipse.ui.ide.application"— the bundle that actually emits the version-file write failure — and the previous double-log emitted byIDEWorkbenchPlugin.log(message, status)collapses to a single coherent entry. As a side effect the dependency onIOException.getLocalizedMessage()(potentially null) goes away.Tracked in vogellacompany/tasks#1837. The larger
org.eclipse.ui.workbenchmigration is still blocked on the open plug-in-id decision and is not in this PR.