Program: 170729
Project: 170729
Buggy source:
private Map<String,ActionMenuItem> createActionMap(AbstractInsnNode ain,int x,int y){
  ActionMenuItem itemEdit=new ActionMenuItem(Lang.get("String_Node_Str"),() -> createEdit(ain,x,y));
  ActionMenuItem itemNewBefore=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new OpcodeCreationBox(true,list,method,ain)));
  ActionMenuItem itemNewAfter=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new OpcodeCreationBox(false,list,method,ain)));
  ActionMenuItem itemUp=new ActionMenuItem(Lang.get("String_Node_Str"),() -> {
    Asm.moveUp(list.getMethod().instructions,list.getSelectedValuesList());
    list.repopulate();
  }
);
  ActionMenuItem itemDown=new ActionMenuItem(Lang.get("String_Node_Str"),() -> {
    Asm.moveDown(list.getMethod().instructions,list.getSelectedValuesList());
    list.repopulate();
  }
);
  ActionMenuItem itemSave=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new BlockSaveBox(list.getSelectedValuesList())));
  ActionMenuItem itemInsert=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new BlockInsertBox(method.instructions,list)));
  ActionMenuItem itemRemove=new ActionMenuItem(Lang.get("String_Node_Str"),(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      if (recaf.configs.ui.confirmDeletions) {
        int dialogResult=JOptionPane.showConfirmDialog(null,Lang.get("String_Node_Str"),Lang.get("String_Node_Str"),JOptionPane.YES_NO_OPTION);
        if (dialogResult != JOptionPane.YES_OPTION) {
          return;
        }
      }
      DefaultListModel<AbstractInsnNode> model=(DefaultListModel<AbstractInsnNode>)list.getModel();
      int[] ascending=list.getSelectedIndices();
      if (ascending.length > 1) {
        List<Range> ranges=new ArrayList<>();
        int startIndex=ascending[0], lastIndex=-1;
        for (int i=1; i < ascending.length; i++) {
          int currentIndex=ascending[i];
          if (lastIndex - currentIndex != -1) {
            ranges.add(new Range(startIndex,ascending[i - 1]));
            startIndex=currentIndex;
          }
          lastIndex=currentIndex;
        }
        ranges.add(new Range(startIndex,lastIndex));
        Collections.sort(ranges);
        for (        Range range : ranges) {
          model.removeRange(range.start,range.end);
          AbstractInsnNode insnStart=method.instructions.get(range.start);
          AbstractInsnNode insnEnd=method.instructions.get(range.end);
          link(insnStart,insnEnd);
        }
        setSize(model.size());
      }
 else {
        model.remove(list.getSelectedIndex());
        method.instructions.remove(ain);
      }
    }
    /** 
 * Links two given insns together via their linked list's previous and next values.
 * @param insnStart
 * @param insnEnd
 */
    private void link(    AbstractInsnNode insnStart,    AbstractInsnNode insnEnd){
      try {
        boolean first=method.instructions.getFirst().equals(insnStart);
        Field next=AbstractInsnNode.class.getDeclaredField("String_Node_Str");
        Field prev=AbstractInsnNode.class.getDeclaredField("String_Node_Str");
        next.setAccessible(true);
        prev.setAccessible(true);
        if (first) {
          Field listStart=InsnList.class.getDeclaredField("String_Node_Str");
          listStart.setAccessible(true);
          listStart.set(method.instructions,insnEnd.getNext());
          prev.set(insnEnd.getNext(),null);
        }
 else {
          next.set(insnStart.getPrevious(),insnEnd.getNext());
          prev.set(insnEnd.getNext(),insnStart.getPrevious());
        }
        if (method.instructions instanceof TInsnList) {
          ((TInsnList)method.instructions).setModified();
        }
      }
 catch (      Exception e) {
      }
    }
    /** 
 * Sets the InsnList size through reflection since insns were cut out of the list through reflection and not the given methods. It's ugly but it makes a MASSIVE performance boost to do it this way.
 * @param size New method instructions size.
 */
    private void setSize(    int size){
      try {
        Field f=InsnList.class.getDeclaredField("String_Node_Str");
        f.setAccessible(true);
        f.setInt(method.instructions,size);
      }
 catch (      Exception e) {
      }
    }
    /** 
 * Utility class for creating comparable ranges of opcode indices.
 * @author Matt
 */
class Range implements Comparable<Range> {
      int start, end;
      public Range(      int start,      int end){
        this.start=start;
        this.end=end;
      }
      @Override public int compareTo(      Range r){
        if (start > r.start)         return -1;
 else         if (start < r.start)         return 1;
        return 0;
      }
    }
  }
));
  Map<String,ActionMenuItem> actionMap=new HashMap<>();
  if (list.getSelectedIndices().length == 1) {
    actionMap.put("String_Node_Str",itemEdit);
    actionMap.put("String_Node_Str",itemNewBefore);
    actionMap.put("String_Node_Str",itemNewAfter);
    actionMap.put("String_Node_Str",itemUp);
    actionMap.put("String_Node_Str",itemDown);
    actionMap.put("String_Node_Str",itemInsert);
    actionMap.put("String_Node_Str",createGotoDef(ain));
    actionMap.put("String_Node_Str",createGotoJump(ain));
  }
 else {
    actionMap.put("String_Node_Str",itemUp);
    actionMap.put("String_Node_Str",itemDown);
    actionMap.put("String_Node_Str",itemSave);
    actionMap.put("String_Node_Str",itemInsert);
  }
  actionMap.put("String_Node_Str",itemRemove);
  return actionMap;
}

Fixed version (ground truth):
private Map<String,ActionMenuItem> createActionMap(AbstractInsnNode ain,int x,int y){
  ActionMenuItem itemEdit=new ActionMenuItem(Lang.get("String_Node_Str"),() -> createEdit(ain,x,y));
  ActionMenuItem itemNewBefore=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new OpcodeCreationBox(true,list,method,ain)));
  ActionMenuItem itemNewAfter=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new OpcodeCreationBox(false,list,method,ain)));
  ActionMenuItem itemUp=new ActionMenuItem(Lang.get("String_Node_Str"),() -> {
    Asm.moveUp(list.getMethod().instructions,list.getSelectedValuesList());
    list.repopulate();
  }
);
  ActionMenuItem itemDown=new ActionMenuItem(Lang.get("String_Node_Str"),() -> {
    Asm.moveDown(list.getMethod().instructions,list.getSelectedValuesList());
    list.repopulate();
  }
);
  ActionMenuItem itemSave=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new BlockSaveBox(list.getSelectedValuesList())));
  ActionMenuItem itemInsert=new ActionMenuItem(Lang.get("String_Node_Str"),() -> display.addWindow(new BlockInsertBox(method.instructions,list)));
  ActionMenuItem itemRemove=new ActionMenuItem(Lang.get("String_Node_Str"),(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      if (recaf.configs.ui.confirmDeletions) {
        int dialogResult=JOptionPane.showConfirmDialog(null,Lang.get("String_Node_Str"),Lang.get("String_Node_Str"),JOptionPane.YES_NO_OPTION);
        if (dialogResult != JOptionPane.YES_OPTION) {
          return;
        }
      }
      DefaultListModel<AbstractInsnNode> model=(DefaultListModel<AbstractInsnNode>)list.getModel();
      int[] ascending=list.getSelectedIndices();
      if (ascending.length > 1) {
        List<Range> ranges=new ArrayList<>();
        int startIndex=ascending[0], lastIndex=-1;
        for (int i=1; i < ascending.length; i++) {
          int currentIndex=ascending[i];
          if (lastIndex - currentIndex != -1) {
            ranges.add(new Range(startIndex,ascending[i - 1]));
            startIndex=currentIndex;
          }
          lastIndex=currentIndex;
        }
        ranges.add(new Range(startIndex,lastIndex));
        Collections.sort(ranges);
        for (        Range range : ranges) {
          model.removeRange(range.start,range.end);
          AbstractInsnNode insnStart=method.instructions.get(range.start);
          AbstractInsnNode insnEnd=method.instructions.get(range.end);
          link(insnStart,insnEnd);
        }
        setSize(model.size());
      }
 else {
        model.remove(list.getSelectedIndex());
        method.instructions.remove(ain);
      }
    }
    /** 
 * Links two given insns together via their linked list's previous and next values.
 * @param insnStart
 * @param insnEnd
 */
    private void link(    AbstractInsnNode insnStart,    AbstractInsnNode insnEnd){
      try {
        boolean first=method.instructions.getFirst().equals(insnStart);
        Field next=AbstractInsnNode.class.getDeclaredField("String_Node_Str");
        Field prev=AbstractInsnNode.class.getDeclaredField("String_Node_Str");
        next.setAccessible(true);
        prev.setAccessible(true);
        if (first) {
          Field listStart=InsnList.class.getDeclaredField("String_Node_Str");
          listStart.setAccessible(true);
          listStart.set(method.instructions,insnEnd.getNext());
          prev.set(insnEnd.getNext(),null);
        }
 else {
          next.set(insnStart.getPrevious(),insnEnd.getNext());
          prev.set(insnEnd.getNext(),insnStart.getPrevious());
        }
        Field listStart=InsnList.class.getDeclaredField("String_Node_Str");
        listStart.setAccessible(true);
        listStart.set(method.instructions,null);
        if (method.instructions instanceof TInsnList) {
          ((TInsnList)method.instructions).setModified();
        }
      }
 catch (      Exception e) {
      }
    }
    /** 
 * Sets the InsnList size through reflection since insns were cut out of the list through reflection and not the given methods. It's ugly but it makes a MASSIVE performance boost to do it this way.
 * @param size New method instructions size.
 */
    private void setSize(    int size){
      try {
        Field f=InsnList.class.getDeclaredField("String_Node_Str");
        f.setAccessible(true);
        f.setInt(method.instructions,size);
      }
 catch (      Exception e) {
      }
    }
    /** 
 * Utility class for creating comparable ranges of opcode indices.
 * @author Matt
 */
class Range implements Comparable<Range> {
      int start, end;
      public Range(      int start,      int end){
        this.start=start;
        this.end=end;
      }
      @Override public int compareTo(      Range r){
        if (start > r.start)         return -1;
 else         if (start < r.start)         return 1;
        return 0;
      }
    }
  }
));
  Map<String,ActionMenuItem> actionMap=new HashMap<>();
  if (list.getSelectedIndices().length == 1) {
    actionMap.put("String_Node_Str",itemEdit);
    actionMap.put("String_Node_Str",itemNewBefore);
    actionMap.put("String_Node_Str",itemNewAfter);
    actionMap.put("String_Node_Str",itemUp);
    actionMap.put("String_Node_Str",itemDown);
    actionMap.put("String_Node_Str",itemInsert);
    actionMap.put("String_Node_Str",createGotoDef(ain));
    actionMap.put("String_Node_Str",createGotoJump(ain));
  }
 else {
    actionMap.put("String_Node_Str",itemUp);
    actionMap.put("String_Node_Str",itemDown);
    actionMap.put("String_Node_Str",itemSave);
    actionMap.put("String_Node_Str",itemInsert);
  }
  actionMap.put("String_Node_Str",itemRemove);
  return actionMap;
}