Program: 78870
Project: 78870
Buggy source:
/** 
 * Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift". These strings can be localized by changing the <code>awt.properties</code> file. <p> Note that passing negative parameter is incorrect, and will cause the returning an unspecified string. Zero parameter means that no modifiers were passed and will cause the returning an empty string.
 * @param modifiers a modifier mask describing the extendedmodifier keys and mouse buttons for the event
 * @return a text description of the combination of extendedmodifier keys and mouse buttons that were held down during the event.
 * @since 1.4
 */
public static String getModifiersExText(int modifiers){
  StringBuilder buf=new StringBuilder();
  if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  int buttonNumber=1;
  for (  int mask : InputEvent.BUTTON_DOWN_MASK) {
    if ((modifiers & mask) != 0) {
      buf.append(Toolkit.getProperty("String_Node_Str" + buttonNumber,"String_Node_Str" + buttonNumber));
      buf.append("String_Node_Str");
    }
    buttonNumber++;
  }
  if (buf.length() > 0) {
    buf.setLength(buf.length() - 1);
  }
  return buf.toString();
}

Fixed version (ground truth):
/** 
 * Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift". These strings can be localized by changing the <code>awt.properties</code> file. <p> Note that passing negative parameter is incorrect, and will cause the returning an unspecified string. Zero parameter means that no modifiers were passed and will cause the returning an empty string.
 * @return a String describing the extended modifier keys andmouse buttons
 * @param modifiers a modifier mask describing the extendedmodifier keys and mouse buttons for the event
 * @return a text description of the combination of extendedmodifier keys and mouse buttons that were held down during the event.
 * @since 1.4
 */
public static String getModifiersExText(int modifiers){
  StringBuilder buf=new StringBuilder();
  if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
    buf.append(Toolkit.getProperty("String_Node_Str","String_Node_Str"));
    buf.append("String_Node_Str");
  }
  int buttonNumber=1;
  for (  int mask : InputEvent.BUTTON_DOWN_MASK) {
    if ((modifiers & mask) != 0) {
      buf.append(Toolkit.getProperty("String_Node_Str" + buttonNumber,"String_Node_Str" + buttonNumber));
      buf.append("String_Node_Str");
    }
    buttonNumber++;
  }
  if (buf.length() > 0) {
    buf.setLength(buf.length() - 1);
  }
  return buf.toString();
}