-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1746 Fix IllegalStateException in ActiveLaunchConfigurationProvider when JobManager is suspended #1432
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
IEP-1746 Fix IllegalStateException in ActiveLaunchConfigurationProvider when JobManager is suspended #1432
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,6 @@ | |
| public class IDFBuildConfiguration extends CBuildConfiguration | ||
| { | ||
|
|
||
| private static final ActiveLaunchConfigurationProvider LAUNCH_CONFIG_PROVIDER = new ActiveLaunchConfigurationProvider(); | ||
| private static final String NINJA = "Ninja"; //$NON-NLS-1$ | ||
| protected static final String COMPILE_COMMANDS_JSON = "compile_commands.json"; //$NON-NLS-1$ | ||
| protected static final String COMPONENTS = "components"; //$NON-NLS-1$ | ||
|
|
@@ -190,16 +189,29 @@ public String getProperty(String name) | |
| { | ||
| try | ||
| { | ||
| ILaunchConfiguration configuration = LAUNCH_CONFIG_PROVIDER.getActiveLaunchConfiguration(); | ||
| if (configuration != null | ||
| && configuration.getType().getIdentifier().equals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE)) | ||
| ILaunchBarManager launchBarManager = IDFCorePlugin.getService(ILaunchBarManager.class); | ||
| ILaunchConfiguration configuration = null; | ||
|
|
||
| if (launchBarManager != null) | ||
| { | ||
| configuration = launchBarManager.getActiveLaunchConfiguration(); | ||
| } | ||
|
|
||
| if (configuration == null) | ||
| { | ||
| Logger.log("Warning: Launch Bar not ready. Falling back to default properties for " + name); //$NON-NLS-1$ | ||
| return super.getProperty(name); | ||
|
Comment on lines
+200
to
+203
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid warning-level logging on this hot path.
🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| if (configuration.getType().getIdentifier().equals(IDFLaunchConstants.DEBUG_LAUNCH_CONFIG_TYPE)) | ||
| { | ||
| configuration = new LaunchUtil(DebugPlugin.getDefault().getLaunchManager()) | ||
| .getBoundConfiguration(configuration); | ||
| } | ||
| String property = configuration == null ? StringUtil.EMPTY | ||
| : configuration.getAttribute(name, StringUtil.EMPTY); | ||
|
|
||
| String property = configuration.getAttribute(name, StringUtil.EMPTY); | ||
| property = property.isBlank() ? getSettings().get(name, StringUtil.EMPTY) : property; | ||
|
Comment on lines
+200
to
213
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve the existing settings fallback when no active launch configuration exists. This early return changes the resolution order from “launch config, then Suggested fix if (configuration == null)
{
- Logger.log("Warning: Launch Bar not ready. Falling back to default properties for " + name); //$NON-NLS-1$
- return super.getProperty(name);
+ Logger.log("Warning: Launch Bar not ready. Falling back to persisted properties for " + name); //$NON-NLS-1$
+ String property = getSettings().get(name, StringUtil.EMPTY);
+ return property.isBlank() ? super.getProperty(name) : property;
}🤖 Prompt for AI Agents |
||
|
|
||
| return property; | ||
| } | ||
| catch (CoreException e) | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.