Skip to content

Commit

Permalink
8282036: Change java/util/zip/ZipFile/DeleteTempJar.java to stop Http…
Browse files Browse the repository at this point in the history
…Server cleanly in case of exceptions

Reviewed-by: jpai, alanb, dfuchs
  • Loading branch information
thejasviv authored and jaikiran committed Jun 28, 2022
1 parent ca78f7b commit 784fa0a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/jdk/java/util/zip/ZipFile/DeleteTempJar.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -72,16 +72,19 @@ public void handle(HttpExchange e) {
}
}
});
server.start();

URL url = new URL("jar:http://localhost:"
server.start();
try {
URL url = new URL("jar:http://localhost:"
+ new Integer(server.getAddress().getPort()).toString()
+ "/deletetemp.jar!/");
JarURLConnection c = (JarURLConnection)url.openConnection();
JarFile f = c.getJarFile();
check(f.getEntry("entry") != null);
System.out.println(f.getName());
server.stop(0);
JarURLConnection c = (JarURLConnection)url.openConnection();
JarFile f = c.getJarFile();
check(f.getEntry("entry") != null);
System.out.println(f.getName());
} finally {
server.stop(0);
}
}

//--------------------- Infrastructure ---------------------------
Expand Down

5 comments on commit 784fa0a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 784fa0a Jan 30, 2023

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 784fa0a Jan 30, 2023

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-784fa0ad in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 784fa0ad from the openjdk/jdk repository.

The commit being backported was authored by Thejasvi Voniadka on 28 Jun 2022 and was reviewed by Jaikiran Pai, Alan Bateman and Daniel Fuchs.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-784fa0ad:GoeLin-backport-784fa0ad
$ git checkout GoeLin-backport-784fa0ad
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-784fa0ad

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 784fa0a Jan 30, 2023

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 784fa0a Jan 30, 2023

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-784fa0ad in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 784fa0ad from the openjdk/jdk repository.

The commit being backported was authored by Thejasvi Voniadka on 28 Jun 2022 and was reviewed by Jaikiran Pai, Alan Bateman and Daniel Fuchs.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-784fa0ad:GoeLin-backport-784fa0ad
$ git checkout GoeLin-backport-784fa0ad
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev GoeLin-backport-784fa0ad

Please sign in to comment.