Skip to content

GH #798: At execution Espressif-IDE getting 'Cannot invoke "org.eclipse.debug.core.ILaunchConfiguration.getType()" because "configuration" is null'#804

Merged
kolipakakondal merged 3 commits intomasterfrom
IEP-1002
Aug 11, 2023
Merged

GH #798: At execution Espressif-IDE getting 'Cannot invoke "org.eclipse.debug.core.ILaunchConfiguration.getType()" because "configuration" is null'#804
kolipakakondal merged 3 commits intomasterfrom
IEP-1002

Conversation

@sigmaaa
Copy link
Copy Markdown
Collaborator

@sigmaaa sigmaaa commented Jul 25, 2023

Description

The problem was that LaunchBarManager could return null because it was not yet initialized during the eclipse starting phase.

Fixes # (IEP-1002)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

Test 1

  • run build -> during indexer phase restart eclipse -> after restarting open error log -> should be no NPE exception there

Test 2

  • create/clean a workspace -> install tools -> create new project -> create new launch configuration -> should be created correctly. Verify that there is no such error:
Screenshot 2023-07-25 at 20 38 54

Test Configuration:

  • ESP-IDF Version:
  • OS (Windows,Linux and macOS):

Dependent components impacted by this PR:

  • build
  • IDFBuildConfiguration

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

Copy link
Copy Markdown
Collaborator Author

@sigmaaa sigmaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added test coverage for ActiveLaunchConfigurationProvider and optimization for IDFBuildConfiguration

Copy link
Copy Markdown
Collaborator

@kolipakakondal kolipakakondal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Optional<Job> launchBarInitJob = Stream.of(jobs)
.filter(job -> job.getName()
.equals(org.eclipse.launchbar.core.internal.Messages.LaunchBarManager_0))
.findAny();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid referencing internal classes and messages if possible. In this case if we can copy the message and compare it directly

Copy link
Copy Markdown
Collaborator Author

@sigmaaa sigmaaa Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kolipakakondal, thanks for your feedback. In this case, we rely on this message because it's the name of the Job, so if this message is changed on the eclipse side, this code just won't work and we won't know about it

@AndriiFilippov
Copy link
Copy Markdown
Collaborator

AndriiFilippov commented Aug 8, 2023

Hi @sigmaaa !

Tested under:

OS - Windows 10
ESP-IDF: v5.1

Test 1 👍
Test 2 👍

Do not see "At execution Espressif-IDE getting 'Cannot invoke "org.eclipse.debug.core.ILaunchConfiguration.getType()" because "configuration" is null'" error, but see this one (probably my local issue):

Error: Cannot invoke "org.eclipse.cdt.core.ICDescriptorManager.addDescriptorListener(org.eclipse.cdt.core.ICDescriptorListener)" because the return value of "org.eclipse.cdt.core.CCorePlugin.getCDescriptorManager()" is null

java.lang.NullPointerException: Cannot invoke "org.eclipse.cdt.core.ICDescriptorManager.addDescriptorListener(org.eclipse.cdt.core.ICDescriptorListener)" because the return value of "org.eclipse.cdt.core.CCorePlugin.getCDescriptorManager()" is null
	at org.eclipse.cdt.internal.core.model.DefaultPathEntryStore.<init>(DefaultPathEntryStore.java:87)
	at org.eclipse.cdt.internal.core.model.PathEntryStoreProxy.createDefaultProvider(PathEntryStoreProxy.java:121)
	at org.eclipse.cdt.internal.core.settings.model.AbstractCExtensionProxy.checkUpdateProvider(AbstractCExtensionProxy.java:102)
	at org.eclipse.cdt.internal.core.settings.model.AbstractCExtensionProxy.doHandleEvent(AbstractCExtensionProxy.java:172)
	at org.eclipse.cdt.internal.core.model.PathEntryStoreProxy.doHandleEvent(PathEntryStoreProxy.java:152)
	at org.eclipse.cdt.internal.core.settings.model.AbstractCExtensionProxy.handleEvent(AbstractCExtensionProxy.java:159)
	at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.notifyListeners(CProjectDescriptionManager.java:2190)
	at org.eclipse.cdt.internal.core.settings.model.AbstractCProjectDescriptionStorage.fireLoadedEvent(AbstractCProjectDescriptionStorage.java:272)
	at org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage.getProjectDescription(XmlProjectDescriptionStorage.java:267)
	at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescriptionInternal(CProjectDescriptionManager.java:427)
	at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:409)
	at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:403)
	at org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager.getProjectDescription(CProjectDescriptionManager.java:396)
	at org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsScannerInfoProvider.getScannerInformation(LanguageSettingsScannerInfoProvider.java:78)
	at org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsScannerInfoProvider.getScannerInformation(LanguageSettingsScannerInfoProvider.java:1)
	at org.eclipse.cdt.internal.core.model.TranslationUnit.getScannerInfo(TranslationUnit.java:1070)
	at org.eclipse.cdt.internal.core.pdom.indexer.ProjectIndexerInputAdapter.getBuildConfiguration(ProjectIndexerInputAdapter.java:160)
	at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.getScannerInfo(AbstractIndexerTask.java:1030)
	at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:909)
	at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:572)

@kolipakakondal
Copy link
Copy Markdown
Collaborator

Hi @sigmaaa Please verify @AndriiFilippov comments and see if that's an issue. I've merging this PR since I have NPE issue while adding clang toolchain

@kolipakakondal kolipakakondal added this to the v2.11.0 milestone Aug 11, 2023
@kolipakakondal kolipakakondal merged commit 5ef1178 into master Aug 11, 2023
@kolipakakondal kolipakakondal deleted the IEP-1002 branch August 11, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

At execution Espressif-IDE getting 'Cannot invoke "org.eclipse.debug.core.ILaunchConfiguration.getType()" because "configuration" is null' (IEP-1002)

3 participants