Program: 104046
Project: 104046
Buggy source:
/** 
 * Creates a new default <tt>EventNotification</tt> or obtains the corresponding existing one and registers a new action in it.
 * @param eventType the name of the event (as defined by the plugin that'sregistering it) that we are setting an action for.
 * @param actionType the type of the action that is to be executed when thespecified event occurs (could be one of the ACTION_XXX fields).
 * @param actionDescriptor a String containing a description of the action(a URI to the sound file for audio notifications or a command line for exec action types) that should be executed when the action occurs.
 * @param defaultMessage the default message to use if no specific messagehas been provided when firing the notification.
 */
public void registerDefaultNotificationForEvent(String eventType,String actionType,String actionDescriptor,String defaultMessage){
  logger.debug("String_Node_Str" + eventType + "String_Node_Str"+ actionType+ "String_Node_Str"+ actionDescriptor+ "String_Node_Str"+ defaultMessage);
  if (isDefault(eventType,actionType)) {
    NotificationActionHandler handler=getEventNotificationActionHandler(eventType,actionType);
    boolean isNew=false;
    if (handler == null) {
      isNew=true;
      if (actionType.equals(NotificationService.ACTION_SOUND)) {
        handler=new SoundNotificationHandlerImpl(actionDescriptor,-1);
      }
 else       if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE)) {
        handler=new LogMessageNotificationHandlerImpl(LogMessageNotificationHandler.INFO_LOG_TYPE);
      }
 else       if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE)) {
        handler=new PopupMessageNotificationHandlerImpl(defaultMessage);
      }
 else       if (actionType.equals(NotificationService.ACTION_COMMAND)) {
        handler=new CommandNotificationHandlerImpl(actionDescriptor);
      }
    }
    this.saveNotification(eventType,actionType,handler,handler.isEnabled(),true);
    EventNotification notification=null;
    if (notificationsTable.containsKey(eventType))     notification=(EventNotification)notificationsTable.get(eventType);
 else {
      notification=new EventNotification(eventType);
      notificationsTable.put(eventType,notification);
    }
    notification.addAction(actionType,handler);
    fireNotificationActionTypeEvent(isNew ? NotificationActionTypeEvent.ACTION_ADDED : NotificationActionTypeEvent.ACTION_CHANGED,eventType,actionType,handler);
  }
  EventNotification notification=null;
  if (defaultNotificationsTable.containsKey(eventType))   notification=defaultNotificationsTable.get(eventType);
 else {
    notification=new EventNotification(eventType);
    defaultNotificationsTable.put(eventType,notification);
  }
  NotificationActionHandler handler=null;
  if (actionType.equals(NotificationService.ACTION_SOUND)) {
    handler=new SoundNotificationHandlerImpl(actionDescriptor,-1);
  }
 else   if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE)) {
    handler=new LogMessageNotificationHandlerImpl(LogMessageNotificationHandler.INFO_LOG_TYPE);
  }
 else   if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE)) {
    handler=new PopupMessageNotificationHandlerImpl(defaultMessage);
  }
 else   if (actionType.equals(NotificationService.ACTION_COMMAND)) {
    handler=new CommandNotificationHandlerImpl(actionDescriptor);
  }
  notification.addAction(actionType,handler);
}

Fixed version (ground truth):
/** 
 * Creates a new default <tt>EventNotification</tt> or obtains the corresponding existing one and registers a new action in it.
 * @param eventType the name of the event (as defined by the plugin that'sregistering it) that we are setting an action for.
 * @param actionType the type of the action that is to be executed when thespecified event occurs (could be one of the ACTION_XXX fields).
 * @param actionDescriptor a String containing a description of the action(a URI to the sound file for audio notifications or a command line for exec action types) that should be executed when the action occurs.
 * @param defaultMessage the default message to use if no specific messagehas been provided when firing the notification.
 */
public void registerDefaultNotificationForEvent(String eventType,String actionType,String actionDescriptor,String defaultMessage){
  logger.debug("String_Node_Str" + eventType + "String_Node_Str"+ actionType+ "String_Node_Str"+ actionDescriptor+ "String_Node_Str"+ defaultMessage);
  if (isDefault(eventType,actionType)) {
    NotificationActionHandler handler=getEventNotificationActionHandler(eventType,actionType);
    boolean isNew=false;
    if (handler == null) {
      isNew=true;
      if (actionType.equals(NotificationService.ACTION_SOUND)) {
        handler=new SoundNotificationHandlerImpl(actionDescriptor,-1);
      }
 else       if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE)) {
        handler=new LogMessageNotificationHandlerImpl(LogMessageNotificationHandler.INFO_LOG_TYPE);
      }
 else       if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE)) {
        handler=new PopupMessageNotificationHandlerImpl(defaultMessage);
      }
 else       if (actionType.equals(NotificationService.ACTION_COMMAND)) {
        handler=new CommandNotificationHandlerImpl(actionDescriptor);
      }
    }
    this.saveNotification(eventType,actionType,handler,handler.isEnabled(),true);
    EventNotification notification=null;
    if (notificationsTable.containsKey(eventType))     notification=notificationsTable.get(eventType);
 else {
      notification=new EventNotification(eventType);
      notificationsTable.put(eventType,notification);
    }
    notification.addAction(actionType,handler);
    fireNotificationActionTypeEvent(isNew ? NotificationActionTypeEvent.ACTION_ADDED : NotificationActionTypeEvent.ACTION_CHANGED,eventType,actionType,handler);
  }
  EventNotification notification=null;
  if (defaultNotificationsTable.containsKey(eventType))   notification=defaultNotificationsTable.get(eventType);
 else {
    notification=new EventNotification(eventType);
    defaultNotificationsTable.put(eventType,notification);
  }
  NotificationActionHandler handler=null;
  if (actionType.equals(NotificationService.ACTION_SOUND)) {
    handler=new SoundNotificationHandlerImpl(actionDescriptor,-1);
  }
 else   if (actionType.equals(NotificationService.ACTION_LOG_MESSAGE)) {
    handler=new LogMessageNotificationHandlerImpl(LogMessageNotificationHandler.INFO_LOG_TYPE);
  }
 else   if (actionType.equals(NotificationService.ACTION_POPUP_MESSAGE)) {
    handler=new PopupMessageNotificationHandlerImpl(defaultMessage);
  }
 else   if (actionType.equals(NotificationService.ACTION_COMMAND)) {
    handler=new CommandNotificationHandlerImpl(actionDescriptor);
  }
  notification.addAction(actionType,handler);
}