JDK-7180976 : Pending String deadlocks UIDefaults
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2012-07-01
  • Updated: 2015-09-29
  • Resolved: 2014-12-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b48Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
Retrieving a value from UIDefaults which has been set to the literal string "Pending" blocks indefinitely.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Put "Pending" in UIDefaults, then retrieve it.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"Pending" is returned.
ACTUAL -
Deadlock.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Pending implements Runnable {
	public static void main(String[] args) {
		EventQueue.invokeLater(new Pending());
	}

	@Override
	public void run() {
		UIManager.put("foobar", "Pending");
		System.out.println(UIManager.get("foobar"));
	}
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use new String("Pending") instead of the literal string "Pending".

Comments
Regression of JDK-6727661 and JDK-6727662
23-12-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION It seems the javax.swing.UIDefaults#PENDING field should be defined so: private static final Object PENDING = new String("Pending");
24-07-2012