Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Eliminate dependency on Swing and call to invokeLater #345

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

Open
JaroslavTulach wants to merge 2 commits into oracle:master
base: master
Choose a base branch
Loading
from JaroslavTulach:jtulach/NoSwingReference

Conversation

@JaroslavTulach
Copy link
Contributor

@JaroslavTulach JaroslavTulach commented Sep 10, 2021

There is a support for reporting progress of long running operations via the HeapProgress class. However this class directly calls into AWT which would better be avoided if the librrary is supposed to be used in a headless mode.

This PR keeps the compatibility with existing HeapProgress behavior, yet it avoid the AWT interactions until somebody access HeapProgress.getProgress() model.

mokun reacted with thumbs up emoji
}

synchronized static void notifyUpdates(Handle h, int type) {
privatesynchronized static void notifyUpdates(Handle h, Type type) {
Copy link

Choose a reason for hiding this comment

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

how bout ?

private synchronized static void notifyUpdates(Handle h, BiConsumer<Listener, Handle> c) {
 for (Listener onChange : listeners) {
 c.accept(onChange, h);
 }
}

and then call it like

 @Override
 public void close() {
 notifyUpdates(this, 2);
 notifyUpdates(this, Listener::finished);
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers

@lbownik lbownik lbownik left review comments

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 0x6675636b796f75676974687562 approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /