This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 178294
Collapse All | Expand All

(-)options.keymap/src/org/netbeans/modules/options/keymap/KeymapModel.java (-11 / +15 lines)
Lines 1-7 Link Here
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
3
 *
4
 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
4
 * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
5
 *
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
7
 * General Public License Version 2 only ("GPL") or the Common
Lines 67-91 Link Here
67
    private static final Logger LOG = Logger.getLogger(KeymapModel.class.getName ());
67
    private static final Logger LOG = Logger.getLogger(KeymapModel.class.getName ());
68
    private static final Logger UI_LOG = Logger.getLogger("org.netbeans.ui.options"); // NOI18N
68
    private static final Logger UI_LOG = Logger.getLogger("org.netbeans.ui.options"); // NOI18N
69
                                    
69
                                    
70
    private static ArrayList<KeymapManager> al = new ArrayList<KeymapManager>();
70
    private static ArrayList<KeymapManager> al = null;
71
    
71
    
72
    /**
72
    /**
73
     * @return All the registered implementations.
73
     * @return All the registered implementations.
74
     */
74
     */
75
    public static Collection<? extends KeymapManager> getKeymapManagerInstances() {
75
    public static Collection<? extends KeymapManager> getKeymapManagerInstances() {
76
        if (!al.isEmpty()) {
76
        if (null != al) {
77
            return al;
77
            return al;
78
        }
78
        }
79
        al.addAll(Lookup.getDefault().lookupAll(KeymapManager.class));
79
        
80
80
        synchronized (KeymapModel.class) {
81
        if (LOG.isLoggable(Level.FINE)) {
81
            if (null == al) {
82
            LOG.fine("Dumping registered KeymapManagers: ");
82
                al = new ArrayList<KeymapManager>(Lookup.getDefault().lookupAll(KeymapManager.class));
83
            for(KeymapManager m : al) {
83
                al.trimToSize();
84
                LOG.fine("    KeymapManager: " + s2s(m));
84
                if (LOG.isLoggable(Level.FINE)) {
85
                    LOG.fine("Dumping registered KeymapManagers: ");
86
                    for (KeymapManager m : al) {
87
                        LOG.fine("    KeymapManager: " + s2s(m));
88
                    }
89
                    LOG.fine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
90
                }
85
            }
91
            }
86
            LOG.fine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
87
        }
92
        }
88
89
        return al;
93
        return al;
90
    }
94
    }
91
    
95
    

Return to bug 178294