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

Avoid UnsupportedOperationException in ZipPath#toFile with JDK 17 #169

Merged

Conversation

centic9
Copy link
Member

@centic9 centic9 commented Feb 10, 2024

This changes the list of kept open files from "File" to "Path" because File.toPath() can lead to UnsupportOperationException in some cases.

Additionally this enhances output and JavaDoc in a few places.

Fixes #160

Testing done

  • Existing tests run fine and added some more tests
  • Using a local build for running a number of applications

Submitter checklist

Preview Give feedback

centic9 and others added 3 commits February 10, 2024 12:00
For ZipPath, toFile() is not possible and throws an exception.

So we should not try to get the File of Paths
but rather keep working with the Path

This closes jenkinsci#160

Keep FileRecord for backwards-compatibility.

Add test for zip-file walking

Also verify that the correct type of object is
registered as 'marker' by the instrumentation

Add slightly more testing to check one unexpected
file-handle leak that is reported

Ignore closing of ZipFile/URLJarFile in tests

Add one more test for Files.createTempFile()
Also add test for http-server setup
@basil basil changed the title Avoid unsupported operation Path.toFile() Avoid UnsupportedOperationException in ZipPath#toFile with JDK 17 Feb 29, 2024
@basil basil added the bug label Feb 29, 2024
Copy link
Member

@basil basil left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@basil basil merged commit 000d9da into jenkinsci:master Feb 29, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnsupportedOperationException in ZipPath#toFile with JDK 17
2 participants