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

8240709: Enable javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java on all L&F #595

Closed
wants to merge 1 commit into from

Conversation

@mrserb
Copy link
Member

@mrserb mrserb commented Oct 11, 2020

Fix for various memory leaks in Nimbus and Motif L&Fs, see comments inline.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Testing

Linux x64 Windows x64 macOS x64
Build ✔️ (5/5 passed) ✔️ (2/2 passed) ✔️ (2/2 passed)
Test (tier1) ✔️ (9/9 passed) ✔️ (9/9 passed) ✔️ (9/9 passed)

Issue

  • JDK-8240709: Enable javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java on all L&F

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/595/head:pull/595
$ git checkout pull/595

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 11, 2020

👋 Welcome back serb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 11, 2020

@mrserb The following label will be automatically applied to this pull request:

  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the swing label Oct 11, 2020
@@ -108,10 +132,6 @@ protected void installListeners() {
*/
@Override
protected void uninstallListeners() {
if (iconPane instanceof JToggleButton) {
((JToggleButton)iconPane).removeActionListener(handler);
frame.removePropertyChangeListener(this);
Copy link
Member Author

@mrserb mrserb Oct 11, 2020

Choose a reason for hiding this comment

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

This code is never executed, the iconPane is null here, it is moved above to the uninstallComponents()

comboBox.removePropertyChangeListener(this);
if (editorComponent!=null){
public void unregister() {
comboBox.removePropertyChangeListener("editor", this);
Copy link
Member Author

@mrserb mrserb Oct 11, 2020

Choose a reason for hiding this comment

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

The listener is added as "comboBox.addPropertyChangeListener("editor",this);" and should be removed by the pair API.

}
};

SwingUtilities.invokeLater( initCode );
Copy link
Member Author

@mrserb mrserb Oct 11, 2020

Choose a reason for hiding this comment

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

This code was added in 1998, the intention was to postpone the initialization of the editor's background till everything in the combo box will be initialized, but:

  • Since then we have a special method configureEditor() which called every time the editor is changed and sets the correct background (see below in this file)
  • If the L&F will be changed to something else the posted event will "poison" the background of the editor by the "motif color".

@@ -91,9 +91,7 @@ public static void main(String[] args) throws Exception {
List<Process> tasks = new ArrayList<>();
for (LookAndFeelInfo laf : getInstalledLookAndFeels()) {
String name = laf.getName();
if (name.contains("OS X") || name.contains("Metal")) {
Copy link
Member Author

@mrserb mrserb Oct 11, 2020

Choose a reason for hiding this comment

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

The test was checked on all platforms via mach5

@mrserb mrserb marked this pull request as ready for review Oct 11, 2020
@openjdk openjdk bot added the rfr label Oct 11, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 11, 2020

Webrevs

Copy link
Member

@azuev-java azuev-java left a comment

Looks ok.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 21, 2020

@mrserb This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8240709: Enable javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java on all L&F

Reviewed-by: kizune

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 181 new commits pushed to the master branch:

  • 2e510e0: 8255043: Incorrectly styled copyright text
  • 6bd05b1: 8255074: sun.nio.fs.WindowsPath::getPathForWin32Calls synchronizes on String object
  • 9e9f5e6: 8017179: [macosx] list1 and list2 vistble item isn't desired
  • 2ee2b4a: 8231454: File lock in Windows on a loaded jar due to a leak in Introspector::getBeanInfo
  • 42a6ead: 8254884: Make sure jvm does not crash with Arm SVE and Vector API
  • e5870cf: 8252133: The java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java fails if metal pipeline is active
  • afc967f: 8254783: jpackage fails on Windows when application name differs from installer name
  • 3ccf487: 8253019: Enhanced JPEG decoding
  • cfb02d4: 8250861: Crash in MinINode::Ideal(PhaseGVN*, bool)
  • 0d35235: 8249927: Specify limits of jdk.serialProxyInterfaceLimit
  • ... and 171 more: https://git.openjdk.java.net/jdk/compare/d43f14161e996523e6c2c725d9eb4f70a253267a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Oct 21, 2020
@mrserb
Copy link
Member Author

@mrserb mrserb commented Oct 22, 2020

/integrate

@openjdk openjdk bot closed this Oct 22, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 22, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Oct 22, 2020

@mrserb Since your change was applied there have been 205 commits pushed to the master branch:

  • 5d26229: 8255174: Vector API unit tests for missed public api code coverage
  • b9186be: 6606767: resexhausted00[34] fail assert(!thread->owns_locks(), "must release all locks when leaving VM")
  • 1191a63: 8199697: FIPS 186-4 RSA Key Generation
  • 60d3fa2: 8255022: Documentation missing for Vector API zero methods
  • 9ade94b: 8206311: Add docs-javase, docs-reference to CI build
  • 3445031: 8255200: ProblemList com/sun/jdi/EATests.java for ZGC
  • 85a8949: 8254913: Increase InlineSmallCode default from 2000 to 2500 for x64
  • 56ea490: 8233343: Deprecate -XX:+CriticalJNINatives flag which implements JavaCritical native functions
  • 615b759: 8255070: Shenandoah: Use single thread for concurrent CLD liveness test
  • 6020991: 8255068: [JVMCI] errors during compiler creation can be hidden
  • ... and 195 more: https://git.openjdk.java.net/jdk/compare/d43f14161e996523e6c2c725d9eb4f70a253267a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7d3d4da.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@mrserb mrserb deleted the JDK-8240709 branch Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants