Program: 178753
Project: 178753
Buggy source:
private static PortalCoord generatePortal(Block block,BlockFace face){
  PortalCoord portal=new PortalCoord();
  if (face == BlockFace.DOWN || face == BlockFace.UP) {
    if (!Config.CompactPortal) {
      portal.border.add(block.getRelative(1,0,0));
      portal.border.add(block.getRelative(0,0,1));
      portal.border.add(block.getRelative(-1,0,0));
      portal.border.add(block.getRelative(0,0,-1));
      portal.border.add(block.getRelative(1,0,-1));
      portal.border.add(block.getRelative(-1,0,1));
      portal.border.add(block.getRelative(1,0,1));
      portal.border.add(block.getRelative(-1,0,-1));
    }
    portal.border.add(block.getRelative(1,0,0));
    portal.inside.add(block);
    if (face == BlockFace.DOWN) {
      portal.destloc=block.getRelative(0,-2,0).getLocation();
      portal.tpface=BlockFace.DOWN;
    }
 else {
      portal.destloc=block.getRelative(0,2,0).getLocation();
      portal.tpface=BlockFace.UP;
    }
  }
 else {
    int x=0;
    int z=0;
switch (face) {
case NORTH:
      z=-1;
    portal.tpface=BlockFace.SOUTH;
  break;
case EAST:
x=-1;
portal.tpface=BlockFace.WEST;
break;
case SOUTH:
z=1;
portal.tpface=BlockFace.NORTH;
break;
case WEST:
x=1;
portal.tpface=BlockFace.EAST;
break;
}
if (!Config.CompactPortal) {
portal.border.add(block.getRelative(0,1,0));
portal.border.add(block.getRelative(x * 1,0,z * 1));
portal.border.add(block.getRelative(x * -1,0,z * -1));
portal.border.add(block.getRelative(x * 1,1,z * 1));
portal.border.add(block.getRelative(x * -1,1,z * -1));
portal.border.add(block.getRelative(x * 1,-1,z * 1));
portal.border.add(block.getRelative(x * -1,-1,z * -1));
portal.border.add(block.getRelative(x * 1,-2,z * 1));
portal.border.add(block.getRelative(x * -1,-2,z * -1));
}
portal.border.add(block.getRelative(0,-2,0));
portal.inside.add(block);
portal.inside.add(block.getRelative(0,-1,0));
portal.destloc=block.getRelative(z * 1,-1,x * 1).getLocation();
}
return portal;
}

Fixed version (ground truth):
private static PortalCoord generatePortal(Block block,BlockFace face){
  PortalCoord portal=new PortalCoord();
  if (face == BlockFace.DOWN || face == BlockFace.UP) {
    if (!Config.CompactPortal) {
      portal.border.add(block.getRelative(1,0,0));
      portal.border.add(block.getRelative(0,0,1));
      portal.border.add(block.getRelative(-1,0,0));
      portal.border.add(block.getRelative(0,0,-1));
      portal.border.add(block.getRelative(1,0,-1));
      portal.border.add(block.getRelative(-1,0,1));
      portal.border.add(block.getRelative(1,0,1));
      portal.border.add(block.getRelative(-1,0,-1));
    }
    portal.border.add(block.getRelative(1,0,0));
    portal.inside.add(block);
    if (face == BlockFace.DOWN) {
      portal.destloc=block.getRelative(0,-2,0).getLocation();
      portal.tpface=BlockFace.DOWN;
    }
 else {
      portal.destloc=block.getRelative(0,2,0).getLocation();
      portal.tpface=BlockFace.UP;
    }
    portal.vertical=true;
  }
 else {
    int x=0;
    int z=0;
switch (face) {
case NORTH:
      z=-1;
    portal.tpface=BlockFace.SOUTH;
  break;
case EAST:
x=-1;
portal.tpface=BlockFace.WEST;
break;
case SOUTH:
z=1;
portal.tpface=BlockFace.NORTH;
break;
case WEST:
x=1;
portal.tpface=BlockFace.EAST;
break;
}
if (!Config.CompactPortal) {
portal.border.add(block.getRelative(0,1,0));
portal.border.add(block.getRelative(x * 1,0,z * 1));
portal.border.add(block.getRelative(x * -1,0,z * -1));
portal.border.add(block.getRelative(x * 1,1,z * 1));
portal.border.add(block.getRelative(x * -1,1,z * -1));
portal.border.add(block.getRelative(x * 1,-1,z * 1));
portal.border.add(block.getRelative(x * -1,-1,z * -1));
portal.border.add(block.getRelative(x * 1,-2,z * 1));
portal.border.add(block.getRelative(x * -1,-2,z * -1));
}
portal.border.add(block.getRelative(0,-2,0));
portal.inside.add(block);
portal.inside.add(block.getRelative(0,-1,0));
portal.destloc=block.getRelative(z * 1,-1,x * 1).getLocation();
portal.vertical=false;
}
return portal;
}