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

Handle missing default VMInstall when querying JVM system-packages #722

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

HannesWell
Copy link
Member

Fixes #721

This handles the case that JavaRuntime.getDefaultVMInstall() returns null, which according to the docs happens
when no defaultVM was set or when the default VM has been disposed.

I also considered to just select any of the available VMs, maybe the 'latest' one, but since no default JRE should actually not happen (at least I get an error in the preferences if I don't select one), for me it seems to be better to warn the user about that instead of selecting just any VM.

@akurtakov should we merge this now to have this in RC1 or better wait for RC2?

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

Please change to not return null in querySystemPackages() and we probably should trigger one extra build containing this patch for RC1.

@github-actions
Copy link

Test Results

     246 files  +       6       246 suites  +6   57m 4s ⏱️ + 8m 23s
  3 299 tests  -        1    3 274 ✔️  -        1  24 💤 ±  0  0  - 1  1 🔥 +1 
10 194 runs  +2 721  10 121 ✔️ +2 697  72 💤 +24  0  - 1  1 🔥 +1 

For more details on these errors, see this check.

Results for commit 70cb73f. ± Comparison against base commit ac4df5b.

This pull request removes 1 test.
AllPDEMinimalTests org.eclipse.pde.ui.tests.launcher.AllLauncherTests org.eclipse.pde.ui.tests.launcher.FeatureBasedLaunchTest ‑ Unknown test

@iloveeclipse
Copy link
Member

@akurtakov, @HannesWell : tests are green, I would propose to merge and re-trigger IBuild for RC1.
WDYT?

@HannesWell
Copy link
Member Author

@akurtakov, @HannesWell : tests are green, I would propose to merge and re-trigger IBuild for RC1. WDYT?

Agree on merging. But isn't a I-Build triggered any way in about two hours?

@HannesWell
Copy link
Member Author

@akurtakov, @HannesWell : tests are green, I would propose to merge and re-trigger IBuild for RC1. WDYT?

Agree on merging. But isn't a I-Build triggered any way in about two hours?

Looking at the calender there is indeed no more I-build planned for RC1. So I agree on both. :)
Lets give @akurtakov a few more minutes to response.

@akurtakov
Copy link
Member

Please merge and trigger I-build.

@HannesWell HannesWell merged commit 3f5584d into eclipse-pde:master Aug 24, 2023
11 of 14 checks passed
@HannesWell HannesWell deleted the fix721 branch August 24, 2023 07:59
@iloveeclipse
Copy link
Member

@HannesWell
Copy link
Member Author

https://ci.eclipse.org/releng/job/Builds/job/I-build-4.29/125/

Thanks.

And thank you Andrey and Gireesh for your reviews!

if (targetVM == null) {
LOGGER.warn("No default JRE installation selected"); //$NON-NLS-1$
return List.of();
}
Collection<String> targetVMSystemPackages = querySystemPackages(targetVM, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather let querySystemPackages return a stream instead instead it is even converted to a stream right after that... and having null as return value for collections is really ugly....

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 in PDEState.querySystemPackages()
5 participants