Program: 61915
Project: 61915
Buggy source:
public ActionPanel(MainPanel mainPanel){
  DefaultSyntaxKit.initKit();
  this.mainPanel=mainPanel;
  editor=new LineMarkedEditorPane();
  editor.setEditable(false);
  decompiledEditor=new LineMarkedEditorPane();
  decompiledEditor.setEditable(false);
  searchPanel=new JPanel(new FlowLayout());
  JButton prevSearchButton=new JButton(View.getIcon("String_Node_Str"));
  prevSearchButton.setMargin(new Insets(3,3,3,3));
  prevSearchButton.addActionListener(this);
  prevSearchButton.setActionCommand(ACTION_SEARCH_PREV);
  JButton nextSearchButton=new JButton(View.getIcon("String_Node_Str"));
  nextSearchButton.setMargin(new Insets(3,3,3,3));
  nextSearchButton.addActionListener(this);
  nextSearchButton.setActionCommand(ACTION_SEARCH_NEXT);
  JButton cancelSearchButton=new JButton(View.getIcon("String_Node_Str"));
  cancelSearchButton.setMargin(new Insets(3,3,3,3));
  cancelSearchButton.addActionListener(this);
  cancelSearchButton.setActionCommand(ACTION_SEARCH_CANCEL);
  searchPos=new JLabel("String_Node_Str");
  searchForLabel=new JLabel(AppStrings.translate("String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  searchPanel.add(searchForLabel);
  searchPanel.add(prevSearchButton);
  searchPanel.add(new JLabel("String_Node_Str"));
  searchPanel.add(searchPos);
  searchPanel.add(nextSearchButton);
  searchPanel.add(cancelSearchButton);
  JButton graphButton=new JButton(View.getIcon("String_Node_Str"));
  graphButton.setActionCommand(ACTION_GRAPH);
  graphButton.addActionListener(this);
  graphButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  graphButton.setMargin(new Insets(3,3,3,3));
  hexButton=new JToggleButton(View.getIcon("String_Node_Str"));
  hexButton.setActionCommand(ACTION_HEX);
  hexButton.addActionListener(this);
  hexButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  hexButton.setMargin(new Insets(3,3,3,3));
  hexOnlyButton=new JToggleButton(View.getIcon("String_Node_Str"));
  hexOnlyButton.setActionCommand(ACTION_HEX_ONLY);
  hexOnlyButton.addActionListener(this);
  hexOnlyButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  hexOnlyButton.setMargin(new Insets(3,3,3,3));
  if (!Configuration.showHexOnlyButton.get()) {
    hexOnlyButton.setVisible(false);
  }
  topButtonsPan=new JPanel();
  topButtonsPan.setLayout(new BoxLayout(topButtonsPan,BoxLayout.X_AXIS));
  topButtonsPan.add(graphButton);
  topButtonsPan.add(hexButton);
  topButtonsPan.add(hexOnlyButton);
  JPanel panCode=new JPanel(new BorderLayout());
  panCode.add(new JScrollPane(editor),BorderLayout.CENTER);
  panCode.add(topButtonsPan,BorderLayout.NORTH);
  JPanel panB=new JPanel();
  panB.setLayout(new BorderLayout());
  asmLabel.setHorizontalAlignment(SwingConstants.CENTER);
  panB.add(asmLabel,BorderLayout.NORTH);
  panB.add(panCode,BorderLayout.CENTER);
  JPanel buttonsPan=new JPanel();
  buttonsPan.setLayout(new FlowLayout());
  buttonsPan.add(editButton);
  buttonsPan.add(saveButton);
  buttonsPan.add(cancelButton);
  editButton.setMargin(new Insets(3,3,3,10));
  saveButton.setMargin(new Insets(3,3,3,10));
  cancelButton.setMargin(new Insets(3,3,3,10));
  JPanel decButtonsPan=new JPanel(new FlowLayout());
  decButtonsPan.add(editDecompiledButton);
  decButtonsPan.add(experimentalLabel);
  decButtonsPan.add(saveDecompiledButton);
  decButtonsPan.add(cancelDecompiledButton);
  editDecompiledButton.setMargin(new Insets(3,3,3,10));
  saveDecompiledButton.setMargin(new Insets(3,3,3,10));
  cancelDecompiledButton.setMargin(new Insets(3,3,3,10));
  panB.add(buttonsPan,BorderLayout.SOUTH);
  saveButton.addActionListener(this);
  saveButton.setActionCommand(ACTION_SAVE_ACTION);
  editButton.addActionListener(this);
  editButton.setActionCommand(ACTION_EDIT_ACTION);
  cancelButton.addActionListener(this);
  cancelButton.setActionCommand(ACTION_CANCEL_ACTION);
  saveButton.setVisible(false);
  cancelButton.setVisible(false);
  saveDecompiledButton.addActionListener(this);
  saveDecompiledButton.setActionCommand(ACTION_SAVE_DECOMPILED);
  editDecompiledButton.addActionListener(this);
  editDecompiledButton.setActionCommand(ACTION_EDIT_DECOMPILED);
  cancelDecompiledButton.addActionListener(this);
  cancelDecompiledButton.setActionCommand(ACTION_CANCEL_DECOMPILED);
  saveDecompiledButton.setVisible(false);
  cancelDecompiledButton.setVisible(false);
  JPanel decPanel=new JPanel(new BorderLayout());
  decPanel.add(new JScrollPane(decompiledEditor),BorderLayout.CENTER);
  decPanel.add(searchPanel,BorderLayout.NORTH);
  searchPanel.setVisible(false);
  JPanel panA=new JPanel();
  panA.setLayout(new BorderLayout());
  panA.add(decPanel,BorderLayout.CENTER);
  panA.add(decLabel,BorderLayout.NORTH);
  panA.add(decButtonsPan,BorderLayout.SOUTH);
  decLabel.setHorizontalAlignment(SwingConstants.CENTER);
  setLayout(new BorderLayout());
  add(splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panA,panB),BorderLayout.CENTER);
  splitPane.setResizeWeight(0.5);
  splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent pce){
      Configuration.guiActionSplitPaneDividerLocation.set((int)pce.getNewValue());
    }
  }
);
  editor.setContentType("String_Node_Str");
  editor.setFont(new Font("String_Node_Str",Font.PLAIN,editor.getFont().getSize()));
  decompiledEditor.setContentType("String_Node_Str");
  decompiledEditor.setFont(new Font("String_Node_Str",Font.PLAIN,decompiledEditor.getFont().getSize()));
  editor.addCaretListener(new CaretListener(){
    @Override public void caretUpdate(    CaretEvent e){
      if (ignoreCarret) {
        return;
      }
      if (editMode || editDecompiledMode) {
        return;
      }
      editor.getCaret().setVisible(true);
      int pos=editor.getCaretPosition();
      Highlighting lastH=null;
      for (      Highlighting h : disassembledHilights) {
        if (pos < h.startPos) {
          break;
        }
        lastH=h;
      }
      String ofs=lastH == null ? "String_Node_Str" : lastH.getPropertyString("String_Node_Str");
      Highlighting h2=Highlighting.search(decompiledHilights,"String_Node_Str",ofs);
      if (h2 != null) {
        ignoreCarret=true;
        decompiledEditor.setCaretPosition(h2.startPos);
        decompiledEditor.getCaret().setVisible(true);
        ignoreCarret=false;
      }
    }
  }
);
  decompiledEditor.addCaretListener(new CaretListener(){
    @Override public void caretUpdate(    CaretEvent e){
      if (ignoreCarret) {
        return;
      }
      if (editMode || editDecompiledMode) {
        return;
      }
      decompiledEditor.getCaret().setVisible(true);
      int pos=decompiledEditor.getCaretPosition();
      Highlighting h=Highlighting.search(decompiledHilights,pos);
      if (h != null) {
        Highlighting h2=Highlighting.search(disassembledHilights,"String_Node_Str",h.getPropertyString("String_Node_Str"));
        if (h2 != null) {
          ignoreCarret=true;
          if (h2.startPos > 0 && h2.startPos < editor.getText().length()) {
            editor.setCaretPosition(h2.startPos);
          }
          editor.getCaret().setVisible(true);
          ignoreCarret=false;
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public ActionPanel(MainPanel mainPanel){
  DefaultSyntaxKit.initKit();
  this.mainPanel=mainPanel;
  editor=new LineMarkedEditorPane();
  editor.setEditable(false);
  decompiledEditor=new LineMarkedEditorPane();
  decompiledEditor.setEditable(false);
  searchPanel=new JPanel(new FlowLayout());
  JButton prevSearchButton=new JButton(View.getIcon("String_Node_Str"));
  prevSearchButton.setMargin(new Insets(3,3,3,3));
  prevSearchButton.addActionListener(this);
  prevSearchButton.setActionCommand(ACTION_SEARCH_PREV);
  JButton nextSearchButton=new JButton(View.getIcon("String_Node_Str"));
  nextSearchButton.setMargin(new Insets(3,3,3,3));
  nextSearchButton.addActionListener(this);
  nextSearchButton.setActionCommand(ACTION_SEARCH_NEXT);
  JButton cancelSearchButton=new JButton(View.getIcon("String_Node_Str"));
  cancelSearchButton.setMargin(new Insets(3,3,3,3));
  cancelSearchButton.addActionListener(this);
  cancelSearchButton.setActionCommand(ACTION_SEARCH_CANCEL);
  searchPos=new JLabel("String_Node_Str");
  searchForLabel=new JLabel(AppStrings.translate("String_Node_Str").replace("String_Node_Str","String_Node_Str"));
  searchPanel.add(searchForLabel);
  searchPanel.add(prevSearchButton);
  searchPanel.add(new JLabel("String_Node_Str"));
  searchPanel.add(searchPos);
  searchPanel.add(nextSearchButton);
  searchPanel.add(cancelSearchButton);
  JButton graphButton=new JButton(View.getIcon("String_Node_Str"));
  graphButton.setActionCommand(ACTION_GRAPH);
  graphButton.addActionListener(this);
  graphButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  graphButton.setMargin(new Insets(3,3,3,3));
  hexButton=new JToggleButton(View.getIcon("String_Node_Str"));
  hexButton.setActionCommand(ACTION_HEX);
  hexButton.addActionListener(this);
  hexButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  hexButton.setMargin(new Insets(3,3,3,3));
  hexOnlyButton=new JToggleButton(View.getIcon("String_Node_Str"));
  hexOnlyButton.setActionCommand(ACTION_HEX_ONLY);
  hexOnlyButton.addActionListener(this);
  hexOnlyButton.setToolTipText(AppStrings.translate("String_Node_Str"));
  hexOnlyButton.setMargin(new Insets(3,3,3,3));
  if (!Configuration.showHexOnlyButton.get()) {
    hexOnlyButton.setVisible(false);
  }
  topButtonsPan=new JPanel();
  topButtonsPan.setLayout(new BoxLayout(topButtonsPan,BoxLayout.X_AXIS));
  topButtonsPan.add(graphButton);
  topButtonsPan.add(hexButton);
  topButtonsPan.add(hexOnlyButton);
  JPanel panCode=new JPanel(new BorderLayout());
  panCode.add(new JScrollPane(editor),BorderLayout.CENTER);
  panCode.add(topButtonsPan,BorderLayout.NORTH);
  JPanel panB=new JPanel();
  panB.setLayout(new BorderLayout());
  asmLabel.setHorizontalAlignment(SwingConstants.CENTER);
  panB.add(asmLabel,BorderLayout.NORTH);
  panB.add(panCode,BorderLayout.CENTER);
  JPanel buttonsPan=new JPanel();
  buttonsPan.setLayout(new FlowLayout());
  buttonsPan.add(editButton);
  buttonsPan.add(saveButton);
  buttonsPan.add(cancelButton);
  editButton.setMargin(new Insets(3,3,3,10));
  saveButton.setMargin(new Insets(3,3,3,10));
  cancelButton.setMargin(new Insets(3,3,3,10));
  JPanel decButtonsPan=new JPanel(new FlowLayout());
  decButtonsPan.add(editDecompiledButton);
  decButtonsPan.add(experimentalLabel);
  decButtonsPan.add(saveDecompiledButton);
  decButtonsPan.add(cancelDecompiledButton);
  editDecompiledButton.setMargin(new Insets(3,3,3,10));
  saveDecompiledButton.setMargin(new Insets(3,3,3,10));
  cancelDecompiledButton.setMargin(new Insets(3,3,3,10));
  panB.add(buttonsPan,BorderLayout.SOUTH);
  saveButton.addActionListener(this);
  saveButton.setActionCommand(ACTION_SAVE_ACTION);
  editButton.addActionListener(this);
  editButton.setActionCommand(ACTION_EDIT_ACTION);
  cancelButton.addActionListener(this);
  cancelButton.setActionCommand(ACTION_CANCEL_ACTION);
  saveButton.setVisible(false);
  cancelButton.setVisible(false);
  saveDecompiledButton.addActionListener(this);
  saveDecompiledButton.setActionCommand(ACTION_SAVE_DECOMPILED);
  editDecompiledButton.addActionListener(this);
  editDecompiledButton.setActionCommand(ACTION_EDIT_DECOMPILED);
  cancelDecompiledButton.addActionListener(this);
  cancelDecompiledButton.setActionCommand(ACTION_CANCEL_DECOMPILED);
  saveDecompiledButton.setVisible(false);
  cancelDecompiledButton.setVisible(false);
  JPanel decPanel=new JPanel(new BorderLayout());
  decPanel.add(new JScrollPane(decompiledEditor),BorderLayout.CENTER);
  decPanel.add(searchPanel,BorderLayout.NORTH);
  searchPanel.setVisible(false);
  JPanel panA=new JPanel();
  panA.setLayout(new BorderLayout());
  panA.add(decPanel,BorderLayout.CENTER);
  panA.add(decLabel,BorderLayout.NORTH);
  panA.add(decButtonsPan,BorderLayout.SOUTH);
  decLabel.setHorizontalAlignment(SwingConstants.CENTER);
  setLayout(new BorderLayout());
  add(splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panA,panB),BorderLayout.CENTER);
  splitPane.setResizeWeight(0.5);
  splitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent pce){
      Configuration.guiActionSplitPaneDividerLocation.set((int)pce.getNewValue());
    }
  }
);
  editor.setFont(new Font("String_Node_Str",Font.PLAIN,editor.getFont().getSize()));
  decompiledEditor.setFont(new Font("String_Node_Str",Font.PLAIN,decompiledEditor.getFont().getSize()));
  editor.addCaretListener(new CaretListener(){
    @Override public void caretUpdate(    CaretEvent e){
      if (ignoreCarret) {
        return;
      }
      if (editMode || editDecompiledMode) {
        return;
      }
      editor.getCaret().setVisible(true);
      int pos=editor.getCaretPosition();
      Highlighting lastH=null;
      for (      Highlighting h : disassembledHilights) {
        if (pos < h.startPos) {
          break;
        }
        lastH=h;
      }
      String ofs=lastH == null ? "String_Node_Str" : lastH.getPropertyString("String_Node_Str");
      Highlighting h2=Highlighting.search(decompiledHilights,"String_Node_Str",ofs);
      if (h2 != null) {
        ignoreCarret=true;
        decompiledEditor.setCaretPosition(h2.startPos);
        decompiledEditor.getCaret().setVisible(true);
        ignoreCarret=false;
      }
    }
  }
);
  decompiledEditor.addCaretListener(new CaretListener(){
    @Override public void caretUpdate(    CaretEvent e){
      if (ignoreCarret) {
        return;
      }
      if (editMode || editDecompiledMode) {
        return;
      }
      decompiledEditor.getCaret().setVisible(true);
      int pos=decompiledEditor.getCaretPosition();
      Highlighting h=Highlighting.search(decompiledHilights,pos);
      if (h != null) {
        Highlighting h2=Highlighting.search(disassembledHilights,"String_Node_Str",h.getPropertyString("String_Node_Str"));
        if (h2 != null) {
          ignoreCarret=true;
          if (h2.startPos > 0 && h2.startPos < editor.getText().length()) {
            editor.setCaretPosition(h2.startPos);
          }
          editor.getCaret().setVisible(true);
          ignoreCarret=false;
        }
      }
    }
  }
);
}