src/java.desktop/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java
Print this page
*** 86,96 ****
private JMenuBar lastMenuBar;
/**
* Registers the specified component.
*/
! synchronized static void register(JComponent c) {
if (c == null) {
// Exception is thrown as convenience for callers that are
// typed to throw an NPE.
throw new NullPointerException("JComponent must be non-null");
}
--- 86,96 ----
private JMenuBar lastMenuBar;
/**
* Registers the specified component.
*/
! static synchronized void register(JComponent c) {
if (c == null) {
// Exception is thrown as convenience for callers that are
// typed to throw an NPE.
throw new NullPointerException("JComponent must be non-null");
}
*** 98,108 ****
}
/**
* Unregisters the specified component.
*/
! synchronized static void unregister(JComponent c) {
for (int counter = components.size() - 1; counter >= 0; counter--) {
// Search for the component, removing any flushed references
// along the way.
JComponent target = components.get(counter).get();
--- 98,108 ----
}
/**
* Unregisters the specified component.
*/
! static synchronized void unregister(JComponent c) {
for (int counter = components.size() - 1; counter >= 0; counter--) {
// Search for the component, removing any flushed references
// along the way.
JComponent target = components.get(counter).get();
*** 114,124 ****
/**
* Finds a previously registered component of class <code>target</code>
* that shares the JRootPane ancestor of <code>from</code>.
*/
! synchronized static Object findRegisteredComponentOfType(JComponent from,
Class<?> target) {
JRootPane rp = SwingUtilities.getRootPane(from);
if (rp != null) {
for (int counter = components.size() - 1; counter >= 0; counter--){
Object component = ((WeakReference)components.get(counter)).
--- 114,124 ----
/**
* Finds a previously registered component of class <code>target</code>
* that shares the JRootPane ancestor of <code>from</code>.
*/
! static synchronized Object findRegisteredComponentOfType(JComponent from,
Class<?> target) {
JRootPane rp = SwingUtilities.getRootPane(from);
if (rp != null) {
for (int counter = components.size() - 1; counter >= 0; counter--){
Object component = ((WeakReference)components.get(counter)).