Program: 35252
Project: 35252
Buggy source:
public MyCodeList(JByteMod jam,JLabel editor){
  super(new DefaultListModel<InstrEntry>());
  this.editor=editor;
  this.setFont(new Font(Font.SANS_SERIF,Font.PLAIN,13));
  this.addMouseListener(new MouseAdapter(){
    public void mousePressed(    MouseEvent e){
      InstrEntry entry=(InstrEntry)MyCodeList.this.getSelectedValue();
      List<InstrEntry> selected=MyCodeList.this.getSelectedValuesList();
      if (entry == null) {
        JPopupMenu menu=new JPopupMenu();
        if (currentMethod != null) {
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                EditDialogue.createInsertInsnDialog(currentMethod,null);
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
            }
          }
);
          menu.add(add);
        }
 else         if (currentClass != null) {
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                FieldNode fn=new FieldNode(1,"String_Node_Str","String_Node_Str","String_Node_Str",null);
                EditDialogueSpec.createEditDialogue(null,fn);
                if (fn.signature.isEmpty()) {
                  fn.signature=null;
                }
                currentClass.fields.add(fn);
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(currentClass);
            }
          }
);
          menu.add(add);
        }
        menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
        return;
      }
      MethodNode mn=entry.getMethod();
      if (SwingUtilities.isRightMouseButton(e)) {
        AbstractInsnNode ain=entry.getInstr();
        if (mn != null) {
          if (selected.size() > 1) {
            JPopupMenu menu=new JPopupMenu();
            JMenuItem remove=new JMenuItem("String_Node_Str");
            remove.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                for (                InstrEntry sel : selected) {
                  mn.instructions.remove(sel.getInstr());
                }
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(remove);
            menu.addPopupMenuListener(new PopupMenuListener(){
              public void popupMenuCanceled(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeInvisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeVisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(false);
              }
            }
);
            menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
          }
 else {
            JPopupMenu menu=new JPopupMenu();
            JMenuItem insert=new JMenuItem("String_Node_Str");
            insert.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                try {
                  EditDialogue.createInsertInsnDialog(mn,ain);
                }
 catch (                Exception e1) {
                  new ErrorDisplay(e1);
                }
              }
            }
);
            menu.add(insert);
            JMenuItem edit=new JMenuItem("String_Node_Str");
            edit.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                try {
                  EditDialogue.createEditInsnDialog(mn,ain);
                }
 catch (                Exception e1) {
                  new ErrorDisplay(e1);
                }
              }
            }
);
            menu.add(edit);
            JMenuItem duplicate=new JMenuItem("String_Node_Str");
            duplicate.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                try {
                  if (ain instanceof LabelNode) {
                    mn.instructions.insert(ain,new LabelNode());
                  }
 else {
                    mn.instructions.insert(ain,ain.clone(new HashMap<>()));
                  }
                  MyCodeList.this.loadInstructions(mn);
                }
 catch (                Exception e1) {
                  new ErrorDisplay(e1);
                }
              }
            }
);
            menu.add(duplicate);
            JMenuItem up=new JMenuItem("String_Node_Str");
            up.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                AbstractInsnNode node=ain.getPrevious();
                mn.instructions.remove(node);
                mn.instructions.insert(ain,node);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(up);
            JMenuItem down=new JMenuItem("String_Node_Str");
            down.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                AbstractInsnNode node=ain.getNext();
                mn.instructions.remove(node);
                mn.instructions.insertBefore(ain,node);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(down);
            JMenuItem remove=new JMenuItem("String_Node_Str");
            remove.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                mn.instructions.remove(ain);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(remove);
            menu.addPopupMenuListener(new PopupMenuListener(){
              public void popupMenuCanceled(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeInvisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeVisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(false);
              }
            }
);
            menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
          }
        }
 else {
          FieldEntry fle=(FieldEntry)entry;
          ClassNode cn=fle.getCn();
          JPopupMenu menu=new JPopupMenu();
          JMenuItem edit=new JMenuItem("String_Node_Str");
          edit.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                EditDialogue.createEditFieldDialog(cn,fle.getFn());
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(edit);
          JMenuItem remove=new JMenuItem("String_Node_Str");
          remove.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              cn.fields.remove(fle.getFn());
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(remove);
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                FieldNode fn=new FieldNode(1,"String_Node_Str","String_Node_Str","String_Node_Str",null);
                if (EditDialogueSpec.createEditDialogue(null,fn)) {
                  if (fn.signature.isEmpty()) {
                    fn.signature=null;
                  }
                  cn.fields.add(fn);
                }
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(add);
          menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public MyCodeList(JByteMod jam,JLabel editor){
  super(new DefaultListModel<InstrEntry>());
  this.editor=editor;
  this.setFont(new Font(Font.SANS_SERIF,Font.PLAIN,13));
  this.addMouseListener(new MouseAdapter(){
    public void mousePressed(    MouseEvent e){
      InstrEntry entry=(InstrEntry)MyCodeList.this.getSelectedValue();
      List<InstrEntry> selected=MyCodeList.this.getSelectedValuesList();
      if (entry == null) {
        JPopupMenu menu=new JPopupMenu();
        if (currentMethod != null) {
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                EditDialogue.createInsertInsnDialog(currentMethod,null);
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
            }
          }
);
          menu.add(add);
        }
 else         if (currentClass != null) {
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                FieldNode fn=new FieldNode(1,"String_Node_Str","String_Node_Str","String_Node_Str",null);
                EditDialogueSpec.createEditDialogue(null,fn);
                if (fn.signature.isEmpty()) {
                  fn.signature=null;
                }
                currentClass.fields.add(fn);
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(currentClass);
            }
          }
);
          menu.add(add);
        }
        menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
        return;
      }
      MethodNode mn=entry.getMethod();
      if (SwingUtilities.isRightMouseButton(e)) {
        AbstractInsnNode ain=entry.getInstr();
        if (mn != null) {
          if (selected.size() > 1) {
            JPopupMenu menu=new JPopupMenu();
            JMenuItem remove=new JMenuItem("String_Node_Str");
            remove.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                for (                InstrEntry sel : selected) {
                  mn.instructions.remove(sel.getInstr());
                }
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(remove);
            menu.addPopupMenuListener(new PopupMenuListener(){
              public void popupMenuCanceled(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeInvisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeVisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(false);
              }
            }
);
            menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
          }
 else {
            JPopupMenu menu=new JPopupMenu();
            JMenuItem insert=new JMenuItem("String_Node_Str");
            insert.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                try {
                  EditDialogue.createInsertInsnDialog(mn,ain);
                }
 catch (                Exception e1) {
                  new ErrorDisplay(e1);
                }
              }
            }
);
            menu.add(insert);
            if (EditDialogue.canEdit(ain)) {
              JMenuItem edit=new JMenuItem("String_Node_Str");
              edit.addActionListener(new ActionListener(){
                public void actionPerformed(                ActionEvent e){
                  try {
                    EditDialogue.createEditInsnDialog(mn,ain);
                  }
 catch (                  Exception e1) {
                    new ErrorDisplay(e1);
                  }
                }
              }
);
              menu.add(edit);
            }
            JMenuItem duplicate=new JMenuItem("String_Node_Str");
            duplicate.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                try {
                  if (ain instanceof LabelNode) {
                    mn.instructions.insert(ain,new LabelNode());
                  }
 else {
                    mn.instructions.insert(ain,ain.clone(new HashMap<>()));
                  }
                  MyCodeList.this.loadInstructions(mn);
                }
 catch (                Exception e1) {
                  new ErrorDisplay(e1);
                }
              }
            }
);
            menu.add(duplicate);
            JMenuItem up=new JMenuItem("String_Node_Str");
            up.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                AbstractInsnNode node=ain.getPrevious();
                mn.instructions.remove(node);
                mn.instructions.insert(ain,node);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(up);
            JMenuItem down=new JMenuItem("String_Node_Str");
            down.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                AbstractInsnNode node=ain.getNext();
                mn.instructions.remove(node);
                mn.instructions.insertBefore(ain,node);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(down);
            JMenuItem remove=new JMenuItem("String_Node_Str");
            remove.addActionListener(new ActionListener(){
              public void actionPerformed(              ActionEvent e){
                mn.instructions.remove(ain);
                MyCodeList.this.loadInstructions(mn);
              }
            }
);
            menu.add(remove);
            menu.addPopupMenuListener(new PopupMenuListener(){
              public void popupMenuCanceled(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeInvisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(true);
              }
              public void popupMenuWillBecomeVisible(              PopupMenuEvent popupMenuEvent){
                MyCodeList.this.setFocusable(false);
              }
            }
);
            menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
          }
        }
 else {
          FieldEntry fle=(FieldEntry)entry;
          ClassNode cn=fle.getCn();
          JPopupMenu menu=new JPopupMenu();
          JMenuItem edit=new JMenuItem("String_Node_Str");
          edit.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                EditDialogue.createEditFieldDialog(cn,fle.getFn());
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(edit);
          JMenuItem remove=new JMenuItem("String_Node_Str");
          remove.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              cn.fields.remove(fle.getFn());
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(remove);
          JMenuItem add=new JMenuItem("String_Node_Str");
          add.addActionListener(new ActionListener(){
            public void actionPerformed(            ActionEvent e){
              try {
                FieldNode fn=new FieldNode(1,"String_Node_Str","String_Node_Str","String_Node_Str",null);
                if (EditDialogueSpec.createEditDialogue(null,fn)) {
                  if (fn.signature.isEmpty()) {
                    fn.signature=null;
                  }
                  cn.fields.add(fn);
                }
              }
 catch (              Exception e1) {
                new ErrorDisplay(e1);
              }
              MyCodeList.this.loadFields(cn);
            }
          }
);
          menu.add(add);
          menu.show(jam,(int)jam.getMousePosition().getX(),(int)jam.getMousePosition().getY());
        }
      }
    }
  }
);
}