Skip to content
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

[703] fix NPE when no build binaries on system PATH #704

Merged
merged 3 commits into from
Feb 11, 2024

Conversation

ghentschke
Copy link
Contributor

  • fixes NPE when new cmake project has been created while there are no C/C++ build binaries on the PATH environment variable. The NPE has been thrown when the children of the project should be fetched (e.g. in project explorer view)

fixes #703

- fixes NPE when new cmake project has been created while there are no
C/C++ build binaries on the PATH environment variable. The NPE has been
thrown when the children of the project should be fetched (e.g. in
project explorer view)

fixes eclipse-cdt#703
Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

This change is fine - but that relatively new method (getBinaryParserIds) is supposed to return non-null and something violated API by it returning null here.

It would be good to identify how getBinaryParserIds is returning null here.

@ghentschke
Copy link
Contributor Author

ghentschke commented Feb 9, 2024

Its the org.eclipse.cdt.core.build.ErrorBuildConfiguration.getBinaryParserIds() which returns null

- fix NPE cause in ErrorBuildConfiguration

fixes eclipse-cdt#703
Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

I continue to be fine with this - and leave it up to you how much more you want to dig into the history here.

I was surprised that I allowed through an auto generated method comment in #75 - that was until I looked at the whole file to be reminded of this unexpected design decision to explicitly allow NPEs:

* TODO leaving most of the implementation as default. I don't think any of these methods get called when
* we're in this error state but we'll keep an eye open for NPE's and bad behavior.

@ghentschke ghentschke merged commit d04849b into eclipse-cdt:main Feb 11, 2024
5 checks passed
@ghentschke
Copy link
Contributor Author

Thank you @jonahgraham

@ghentschke
Copy link
Contributor Author

I was surprised that I allowed through an auto generated method comment in #75 - that was until I looked at the whole file to be reminded of this unexpected design decision to explicitly allow NPEs:

I had the same thoughts as I saw the lazy handling ;-)

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.

NPE after creation of new cmake project
2 participants