Skip to content

Fix potential NPE in TestOpenJ9DiagnosticsMXBean.tearDown() - #16295

Merged
keithc-ca merged 1 commit into
eclipse-openj9:masterfrom
pshipton:npe
Nov 8, 2022
Merged

Fix potential NPE in TestOpenJ9DiagnosticsMXBean.tearDown()#16295
keithc-ca merged 1 commit into
eclipse-openj9:masterfrom
pshipton:npe

Conversation

@pshipton

@pshipton pshipton commented Nov 8, 2022

Copy link
Copy Markdown
Member

Related to issue #16253

Related to issue eclipse-openj9#16253

Signed-off-by: Peter Shipton <Peter_Shipton@ca.ibm.com>
File[] files = fdir.listFiles();
for (File file : files) {
file.delete();
if (files != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This still makes assumptions that there are no subdirectories or other non-file entries, but it is an improvement.

@keithc-ca

Copy link
Copy Markdown
Contributor

I don't think PR testing would be helpful for this change.

@keithc-ca
keithc-ca merged commit e3589c7 into eclipse-openj9:master Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants