Program: 178702
Project: 178702
Buggy source:
public void delete(){
  BlockHolder bh;
  for (  V10Location loc : border) {
    if (plugin.portalManager.oldBlocks.containsKey(loc)) {
      bh=plugin.portalManager.oldBlocks.get(loc);
      bh.reset();
      if (plugin.gelManager.gelMap.containsKey(bh)) {
        plugin.gelManager.gelMap.remove(bh);
        for (        ArrayList<BlockHolder> blocks : plugin.gelManager.gels.values())         blocks.remove(bh);
      }
      plugin.portalManager.oldBlocks.remove(loc);
    }
    plugin.portalManager.borderBlocks.remove(loc);
  }
  for (  V10Location loc : inside) {
    if (loc == null)     continue;
    if (plugin.portalManager.oldBlocks.containsKey(loc)) {
      bh=plugin.portalManager.oldBlocks.get(loc);
      bh.reset();
      if (plugin.gelManager.gelMap.containsKey(bh)) {
        plugin.gelManager.gelMap.remove(bh);
        for (        ArrayList<BlockHolder> blocks : plugin.gelManager.gels.values())         blocks.remove(bh);
      }
      plugin.portalManager.oldBlocks.remove(loc);
    }
    plugin.portalManager.insideBlocks.remove(loc);
  }
  if (plugin.config.FillPortalBack > -1) {
    for (    V10Location loc : behind) {
      if (plugin.portalManager.oldBlocks.containsKey(loc)) {
        bh=plugin.portalManager.oldBlocks.get(loc);
        bh.reset();
        if (plugin.gelManager.gelMap.containsKey(bh)) {
          plugin.gelManager.gelMap.remove(bh);
          for (          ArrayList<BlockHolder> blocks : plugin.gelManager.gels.values())           blocks.remove(bh);
        }
        plugin.portalManager.oldBlocks.remove(loc);
      }
      plugin.portalManager.behindBlocks.remove(loc);
    }
  }
  if (horizontal) {
    for (    V10Location l : awayBlocks)     plugin.portalManager.awayBlocks.remove(l);
    plugin.portalManager.awayBlocksY.remove(awayBlocksY[0]);
    plugin.portalManager.awayBlocksY.remove(awayBlocksY[1]);
  }
  if (orange)   owner.orangePortal=null;
 else   owner.bluePortal=null;
  open=false;
  plugin.portalManager.portals.remove(this);
  plugin.regionManager.getRegion(centerBlock).portals.remove(this);
  if (getDestination() != null && getDestination().open) {
    if (getDestination().isRegionPortal()) {
      V10Location loc=getDestination().centerBlock;
      plugin.regionManager.getRegion(loc).regionPortalClosed(orange);
    }
 else     getDestination().close();
  }
  if (isRegionPortal())   plugin.regionManager.getRegion(centerBlock).regionPortalDeleted(this);
}

Fixed version (ground truth):
public void delete(){
  BlockHolder bh;
  for (  V10Location loc : border) {
    if (plugin.portalManager.oldBlocks.containsKey(loc)) {
      bh=plugin.portalManager.oldBlocks.get(loc);
      bh.reset();
      if (plugin.gelManager.gelMap.containsKey(bh))       plugin.gelManager.removeGel(bh);
      plugin.portalManager.oldBlocks.remove(loc);
    }
    plugin.portalManager.borderBlocks.remove(loc);
  }
  for (  V10Location loc : inside) {
    if (loc == null)     continue;
    if (plugin.portalManager.oldBlocks.containsKey(loc)) {
      bh=plugin.portalManager.oldBlocks.get(loc);
      bh.reset();
      if (plugin.gelManager.gelMap.containsKey(bh))       plugin.gelManager.removeGel(bh);
      plugin.portalManager.oldBlocks.remove(loc);
    }
    plugin.portalManager.insideBlocks.remove(loc);
  }
  if (plugin.config.FillPortalBack > -1) {
    for (    V10Location loc : behind) {
      if (plugin.portalManager.oldBlocks.containsKey(loc)) {
        bh=plugin.portalManager.oldBlocks.get(loc);
        bh.reset();
        if (plugin.gelManager.gelMap.containsKey(bh))         plugin.gelManager.removeGel(bh);
        plugin.portalManager.oldBlocks.remove(loc);
      }
      plugin.portalManager.behindBlocks.remove(loc);
    }
  }
  if (horizontal) {
    for (    V10Location l : awayBlocks)     plugin.portalManager.awayBlocks.remove(l);
    plugin.portalManager.awayBlocksY.remove(awayBlocksY[0]);
    plugin.portalManager.awayBlocksY.remove(awayBlocksY[1]);
  }
  if (orange)   owner.orangePortal=null;
 else   owner.bluePortal=null;
  open=false;
  plugin.portalManager.portals.remove(this);
  plugin.regionManager.getRegion(centerBlock).portals.remove(this);
  if (getDestination() != null && getDestination().open) {
    if (getDestination().isRegionPortal()) {
      V10Location loc=getDestination().centerBlock;
      plugin.regionManager.getRegion(loc).regionPortalClosed(orange);
    }
 else     getDestination().close();
  }
  if (isRegionPortal())   plugin.regionManager.getRegion(centerBlock).regionPortalDeleted(this);
}