Skip to content

Port ZipArchiveTest #10099

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

Merged
merged 4 commits into from
Oct 28, 2020
Merged

Port ZipArchiveTest #10099

merged 4 commits into from
Oct 28, 2020

Conversation

liufengyun
Copy link
Contributor

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

archive.close()
// The following results in IOException on Windows (file in use by another process).
// As jar is a temp file, it will be deleted automatically.
// Files.delete(jar)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is better to try to delete it

try Files.delete(jar) catch case _: IOException => ()

Copy link
Contributor

Choose a reason for hiding this comment

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

Or make it conditional using System.getProperty("os.name").

Copy link
Contributor

Choose a reason for hiding this comment

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

This way we would at least test that we can delete it in a non-Windows OS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know what is using the jar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to be Windows-specific --- it should not be used as on Linux machines.


private[this] var closeables: List[java.io.Closeable] = Nil
override def close(): Unit = {
closeables.foreach(_.close)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can simpli

Suggested change
closeables.foreach(_.close)
closeables.foreach(_.close)
closeables = Nil

@liufengyun liufengyun merged commit 756fe47 into scala:master Oct 28, 2020
@liufengyun liufengyun deleted the zip-test branch October 28, 2020 19:04
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

3 participants