-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move long running operations to the activation of the PluginsTab #1233
Move long running operations to the activation of the PluginsTab #1233
Conversation
Test Results 285 files - 6 285 suites - 6 45m 3s ⏱️ - 19m 45s For more details on these failures, see this check. Results for commit bc7b0df. ± Comparison against base commit b8c244d. ♻️ This comment has been updated with latest results. |
Test failures seem to be unrelated and they fail also locally (I tested on my machine) even before applying this PR. See #1227 The license check seems unrelated too, though I don't know why it happens. |
9d4f738
to
84532fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this.
I have tested this and in general this works well, I just noticed that when I switch between the configs with the Plug-ins
tab activate and don't save, the activation is never skipped. Is that intended?
ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java
Outdated
Show resolved
Hide resolved
I just remember that there was already an attempt in the past and there where also some glitches so one should be aware of that. The build failure effectively says that you changed the public API documentation and therefore need to touch the docs bundle. |
By the way if the expensive operation can be identified, it could be wrapped in a |
👍
Yes, it's intended: I can't skip the activation when first switching (or switching back) to a launch config because the tab is instantiated again and everything needs to be populated again. Skipping is only possible when switching back and forth between tabs in the same launch config because the config (and all its tab) remain in memory.
@laeubi you mean #946 ? The glitch was that the |
bf51a12
to
b2f280a
Compare
b2f280a
to
aede775
Compare
I also inlined a call in I hope I addressed everything, @laeubi and @HannesWell ? |
Actually I forgot to wrap the method in 'BusyIndicator.showWhile(...)'. I'll do it today. Feel free to comment on the rest |
aede775
to
3bd791e
Compare
I found an error when creating a new Eclipse launch configuration in the dialog: !STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.widgets.Button.getSelection()" because "this.fIncludeOptionalButton" is null
at org.eclipse.pde.internal.ui.launcher.AbstractPluginBlock.performApply(AbstractPluginBlock.java:951)
at org.eclipse.pde.internal.ui.launcher.BlockAdapter.performApply(BlockAdapter.java:84)
at org.eclipse.pde.ui.launcher.PluginsTab.performApply(PluginsTab.java:210)
at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.performApply(AbstractLaunchConfigurationTabGroup.java:106)
at org.eclipse.pde.ui.launcher.EclipseLauncherTabGroup.performApply(EclipseLauncherTabGroup.java:46)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.performApply(LaunchConfigurationTabGroupWrapper.java:205)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.handleApplyPressed(LaunchConfigurationTabGroupViewer.java:1521)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:1045)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.lambda$1(LaunchConfigurationsDialog.java:607)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:817)
at org.eclipse.jface.viewers.ColumnViewer.firePostSelectionChanged(ColumnViewer.java:1065)
at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1665)
at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1091)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.handleConfigurationAdded(LaunchConfigurationView.java:330)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.lambda$0(LaunchConfigurationView.java:305)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
... I'm setting this PR to be a draft so I can further look into it tomorrow. I'll let you know when it's ready to be reviewed again |
3bd791e
to
d480bdb
Compare
ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java
Outdated
Show resolved
Hide resolved
Ready for review. The NPE was because of a premature invocation of FTR:
|
Failing test is unrelated |
d480bdb
to
daf97c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
While trying out the change I noticed that the activated method is already called in a 'busy-curser' context, so we don't have to start another nested one and save the extra code(complexity). Btw. in this case I would have just passed null
as Display to reuse the current one.
To prevent the NPE I also think we should use a more local check.
I pushed my suggestions as another commit to your branch. Please incorporate it as you find it suitable.
If you agree with the suggestions, I'm fine with this change.
@HannesWell thank you for the suggestion, I like the changes! Ready to merge on my part 👍 I assume in this case 2 commits are OK? If not, let me know and I can squash them and add you as co-author :-) |
Great. |
2456c70
to
a5a7d73
Compare
- Inline value and delete some outdated JavaDoc - Skip calls to AbstractpluginBlock::performApply before the block is even created to avoid NPEs Contributes to eclipse-pde#1232 Co-authored-by: Hannes Wellmann <[email protected]>
a5a7d73
to
bc7b0df
Compare
Squashed 👍 |
Failing test is unrelated and already documented here: #554 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @fedejeanne. Nice contribution.
Activating a Eclipse launch config becomes faster and faster with your contributions. :)
I assume this change caused new regression, please check #1250. |
PluginsTab" This change reverts main change from commit 98a5865 changes because it caused a severe regression. See eclipse-pde#1233 Fixes eclipse-pde#1250
PluginsTab" This change reverts main change from commit 98a5865 changes because it caused a severe regression. See eclipse-pde#1233 Fixes eclipse-pde#1250
PluginsTab" This change reverts main change from commit 98a5865 changes because it caused a severe regression. See eclipse-pde#1233 Fixes eclipse-pde#1250
Move the long running operations in the
PluginsTab
frominitializeFrom
toactivated
. Only run these operations the first time the tab is activated in order to:a. Only run them when the tab is actually selected
b. Not run them again if the tab is deselected and selected again (without leaving the current launch configuration)
How to test
Plugins
tab in one of them and make some changes (save them)Plugins
tab should be selected and it should look fine. The activation should not be skipped i.e. it should not hit thereturn;
in line 167Plugins
tab should be selected and contain all changes you applied before. The activation should not be skippedPlugins
tab again --> The activation should be skipped i.e. hit should hit thereturn;
in line 167Contributes to #1232