Skip to content

Commit

Permalink
8311881: jdk/javax/swing/ProgressMonitor/ProgressTest.java does not s…
Browse files Browse the repository at this point in the history
…how the ProgressMonitorInputStream all the time

Reviewed-by: azvegint, tr
  • Loading branch information
prsadhuk committed Jul 24, 2023
1 parent 04f39e1 commit 197981b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/jdk/javax/swing/ProgressMonitor/ProgressTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
*/

import java.io.InputStream;

import java.awt.EventQueue;
import javax.swing.ProgressMonitorInputStream;

public class ProgressTest {

static volatile long total = 0;
private static final String instructionsText =
"A ProgressMonitor will be shown.\n" +
" If it shows blank progressbar after 2048MB bytes read,\n"+
Expand Down Expand Up @@ -69,15 +69,20 @@ public int read() {
public void run() {
byte[] buffer = new byte[512];
int nb = 0;
long total = 0;
while (true) {
try {
nb = pmis.read(buffer);
} catch (Exception e){}
if (nb == 0) break;
total += nb;

pmis.getProgressMonitor().setNote(total/(1024*1024)+" MB Read");
System.out.println("total " + total);
if ((total % (1024*1024)) == 0) {
try {
EventQueue.invokeAndWait(() -> {
pmis.getProgressMonitor().setNote(total/(1024*1024)+" MB Read");
});
} catch (Exception e) {}
}
}
}
};
Expand Down

5 comments on commit 197981b

@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 197981b Apr 5, 2024

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 197981b Apr 5, 2024

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 backport-GoeLin-197981b4 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-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 197981b4 from the openjdk/jdk repository.

The commit being backported was authored by Prasanta Sadhukhan on 24 Jul 2023 and was reviewed by Alexander Zvegintsev and Tejesh R.

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/jdk21u-dev:

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 197981b Apr 5, 2024

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 197981b Apr 5, 2024

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 backport-GoeLin-197981b4 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-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 197981b4 from the openjdk/jdk repository.

The commit being backported was authored by Prasanta Sadhukhan on 24 Jul 2023 and was reviewed by Alexander Zvegintsev and Tejesh R.

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/jdk21u-dev:

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

Please sign in to comment.