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.
return NO_NEW_TYPES;
}
private static final WeakHashMap overridesGetDefaultAction = new WeakHashMap (27);
/** Checks whether subclass overrides a method
*/
private boolean overridesAMethod (String name, Class[] arguments) {
// we are subclass of AbstractNode
try {
java.lang.reflect.Method m = getClass ().getMethod (name, arguments);
if (m.getDeclaringClass () != AbstractNode.class) {
// ok somebody overriden the method
return true;
} catch (NoSuchMethodException ex) {
org.openide.ErrorManager.getDefault().notify(ex);
return false;
/** Gets preferred action.
* By default, null.
* @return preferred action
* @since 3.29
public Action getPreferredAction() {
boolean delegate = false;
return preferredAction;
Class c = getClass ();
if (c != AbstractNode.class) {
synchronized (overridesGetDefaultAction) {
Boolean b = (Boolean)overridesGetDefaultAction.get (c);
if (b == null) {
b = overridesAMethod ("getDefaultAction", new Class[0] ) ? Boolean.TRUE : Boolean.FALSE; // NOI18N
overridesGetDefaultAction.put (c, b);
delegate = b.booleanValue();
return delegate ? getDefaultAction () : preferredAction;