Program: 3215
Project: 3215
Buggy source:
/** 
 * Based on the passed in array compute the shape,offsets, and strides for the given indexes
 * @param indexes the indexesto compute this based on
 */
public void exec(INDArrayIndex... indexes){
  int[] shape=arr.shape();
  for (int i=0; i < indexes.length; i++) {
    INDArrayIndex idx=indexes[i];
    if (idx instanceof PointIndex && (arr.isVector() && indexes.length == 1 ? idx.current() >= shape[i + 1] : idx.current() >= shape[i])) {
      throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str"+ idx.current()+ "String_Node_Str");
    }
  }
  indexes=NDArrayIndex.resolve(arr.shapeInfoDataBuffer(),indexes);
  if (tryShortCircuit(indexes)) {
    return;
  }
  int numIntervals=0;
  int newAxesPrepend=0;
  boolean encounteredAll=false;
  List<Integer> oneDimensionWithAllEncountered=new ArrayList<>();
  List<Integer> accumShape=new ArrayList<>();
  List<Integer> accumStrides=new ArrayList<>();
  List<Integer> accumOffsets=new ArrayList<>();
  List<Integer> intervalStrides=new ArrayList<>();
  List<Integer> pointStrides=new ArrayList<>();
  List<Integer> pointOffsets=new ArrayList<>();
  int numPointIndexes=0;
  int shapeIndex=0;
  int strideIndex=0;
  List<Integer> prependNewAxes=new ArrayList<>();
  for (int i=0; i < indexes.length; i++) {
    INDArrayIndex idx=indexes[i];
    if (idx instanceof NDArrayIndexAll) {
      encounteredAll=true;
      if (i < arr.rank() && arr.size(i) == 1)       oneDimensionWithAllEncountered.add(i);
    }
    if (idx instanceof PointIndex) {
      pointOffsets.add(idx.offset());
      pointStrides.add(arr.stride(strideIndex));
      numPointIndexes++;
      shapeIndex++;
      strideIndex++;
      continue;
    }
 else     if (idx instanceof NewAxis) {
      if (encounteredAll) {
        prependNewAxes.add(i);
      }
 else       newAxesPrepend++;
      continue;
    }
 else     if (idx instanceof IntervalIndex && !(idx instanceof NDArrayIndexAll) || idx instanceof SpecifiedIndex) {
      if (idx instanceof IntervalIndex) {
        accumStrides.add(arr.stride(strideIndex) * idx.stride());
        intervalStrides.add(idx.stride());
        numIntervals++;
      }
 else       accumStrides.add(arr.stride(strideIndex));
      accumShape.add(idx.length());
      if (idx instanceof IntervalIndex) {
        accumOffsets.add(idx.offset());
      }
 else       accumOffsets.add(idx.offset());
      shapeIndex++;
      strideIndex++;
      continue;
    }
    accumShape.add(shape[shapeIndex++]);
    accumStrides.add(arr.stride(strideIndex++));
    accumOffsets.add(idx.offset());
  }
  while (shapeIndex < shape.length) {
    if (Shape.isVector(shape)) {
      accumShape.add(1);
      shapeIndex++;
    }
 else     accumShape.add(shape[shapeIndex++]);
  }
  int delta=(shape.length <= 2 ? shape.length : shape.length - numPointIndexes);
  boolean needsFilledIn=accumShape.size() != accumStrides.size() && accumOffsets.size() != accumShape.size();
  while (accumOffsets.size() < delta && needsFilledIn)   accumOffsets.add(0);
  while (accumShape.size() < 2) {
    if (Shape.isRowVectorShape(arr.shape()))     accumShape.add(0,1);
 else     accumShape.add(1);
  }
  while (strideIndex < accumShape.size()) {
    accumStrides.add(arr.stride(strideIndex++));
  }
  if (newAxesPrepend > 0) {
    for (int i=0; i < newAxesPrepend; i++) {
      accumShape.add(0,1);
      accumStrides.add(0,0);
      accumOffsets.add(0,0);
    }
  }
  int numAdded=0;
  for (int i=0; i < prependNewAxes.size(); i++) {
    accumShape.add(prependNewAxes.get(i) - numAdded,1);
    accumStrides.add(prependNewAxes.get(i) - numAdded,0);
    numAdded++;
  }
  int trailingZeroRemove=accumOffsets.size() - 1;
  while (accumOffsets.size() > accumShape.size()) {
    if (accumOffsets.get(trailingZeroRemove) == 0)     accumOffsets.remove(accumOffsets.size() - 1);
    trailingZeroRemove--;
  }
  if (accumStrides.size() < accumOffsets.size())   accumStrides.addAll(pointStrides);
  while (accumOffsets.size() < accumShape.size()) {
    if (Shape.isRowVectorShape(arr.shape()))     accumOffsets.add(0,0);
 else     accumOffsets.add(0);
  }
  if (Shape.isMatrix(shape) && indexes[0] instanceof PointIndex && indexes[1] instanceof NDArrayIndexAll) {
    Collections.reverse(accumShape);
  }
  if (arr.isMatrix() && indexes[0] instanceof PointIndex && indexes[1] instanceof IntervalIndex) {
    this.shapes=new int[2];
    shapes[0]=1;
    IntervalIndex idx=(IntervalIndex)indexes[1];
    shapes[1]=idx.length();
  }
 else   this.shapes=Ints.toArray(accumShape);
  boolean isColumnVector=Shape.isColumnVectorShape(this.shapes);
  while (accumStrides.size() < accumOffsets.size()) {
    if (!isColumnVector)     accumStrides.add(0,arr.elementStride());
 else     accumStrides.add(arr.elementStride());
  }
  this.strides=Ints.toArray(accumStrides);
  this.offsets=Ints.toArray(accumOffsets);
  if (numPointIndexes > 0 && !pointStrides.isEmpty()) {
    if (newAxesPrepend >= 1) {
      while (pointStrides.size() < accumOffsets.size()) {
        pointStrides.add(1);
      }
      for (int i=0; i < accumStrides.size(); i++) {
        if (accumStrides.get(i) == 0)         pointStrides.set(i,0);
      }
    }
    while (pointOffsets.size() < pointStrides.size()) {
      pointOffsets.add(0);
    }
    if (arr.isRowVector() && !intervalStrides.isEmpty() && pointOffsets.get(0) == 0 && !(indexes[1] instanceof IntervalIndex))     this.offset=indexes[1].offset();
 else     this.offset=ArrayUtil.dotProductLong(pointOffsets,pointStrides);
  }
 else {
    this.offset=0;
  }
  if (numIntervals > 0 && arr.rank() > 2) {
    if (encounteredAll && arr.size(0) != 1)     this.offset+=ArrayUtil.dotProductLong(accumOffsets,accumStrides);
 else     this.offset+=ArrayUtil.dotProductLong(accumOffsets,accumStrides) / Math.max(1,numIntervals);
  }
 else   if (numIntervals > 0 && anyHaveStrideOne(indexes))   this.offset+=ArrayUtil.calcOffsetLong(accumShape,accumOffsets,accumStrides);
 else   this.offset+=ArrayUtil.calcOffsetLong(accumShape,accumOffsets,accumStrides) / Math.max(1,numIntervals);
}

Fixed version (ground truth):
/** 
 * Based on the passed in array compute the shape,offsets, and strides for the given indexes
 * @param indexes the indexesto compute this based on
 */
public void exec(INDArrayIndex... indexes){
  int[] shape=arr.shape();
  for (int i=0; i < indexes.length; i++) {
    INDArrayIndex idx=indexes[i];
    if (idx instanceof PointIndex && (arr.isVector() && indexes.length == 1 ? idx.current() >= shape[i + 1] : idx.current() >= shape[i])) {
      throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str"+ idx.current()+ "String_Node_Str");
    }
  }
  indexes=NDArrayIndex.resolve(arr.shapeInfoDataBuffer(),indexes);
  if (tryShortCircuit(indexes)) {
    return;
  }
  int numIntervals=0;
  int newAxesPrepend=0;
  boolean encounteredAll=false;
  List<Integer> oneDimensionWithAllEncountered=new ArrayList<>();
  List<Integer> accumShape=new ArrayList<>();
  List<Integer> accumStrides=new ArrayList<>();
  List<Integer> accumOffsets=new ArrayList<>();
  List<Integer> intervalStrides=new ArrayList<>();
  List<Integer> pointStrides=new ArrayList<>();
  List<Integer> pointOffsets=new ArrayList<>();
  int numPointIndexes=0;
  int shapeIndex=0;
  int strideIndex=0;
  List<Integer> prependNewAxes=new ArrayList<>();
  for (int i=0; i < indexes.length; i++) {
    INDArrayIndex idx=indexes[i];
    if (idx instanceof NDArrayIndexAll) {
      encounteredAll=true;
      if (i < arr.rank() && arr.size(i) == 1)       oneDimensionWithAllEncountered.add(i);
    }
    if (idx instanceof PointIndex) {
      pointOffsets.add(idx.offset());
      pointStrides.add(arr.stride(strideIndex));
      numPointIndexes++;
      shapeIndex++;
      strideIndex++;
      continue;
    }
 else     if (idx instanceof NewAxis) {
      if (encounteredAll) {
        prependNewAxes.add(i);
      }
 else       newAxesPrepend++;
      continue;
    }
 else     if (idx instanceof IntervalIndex && !(idx instanceof NDArrayIndexAll) || idx instanceof SpecifiedIndex) {
      if (idx instanceof IntervalIndex) {
        accumStrides.add(arr.stride(strideIndex) * idx.stride());
        intervalStrides.add(idx.stride());
        numIntervals++;
      }
 else       accumStrides.add(arr.stride(strideIndex));
      accumShape.add(idx.length());
      if (idx instanceof IntervalIndex) {
        accumOffsets.add(idx.offset());
      }
 else       accumOffsets.add(idx.offset());
      shapeIndex++;
      strideIndex++;
      continue;
    }
    accumShape.add(shape[shapeIndex++]);
    accumStrides.add(arr.stride(strideIndex++));
    accumOffsets.add(idx.offset());
  }
  while (shapeIndex < shape.length) {
    if (Shape.isVector(shape)) {
      accumShape.add(1);
      shapeIndex++;
    }
 else     accumShape.add(shape[shapeIndex++]);
  }
  int delta=(shape.length <= 2 ? shape.length : shape.length - numPointIndexes);
  boolean needsFilledIn=accumShape.size() != accumStrides.size() && accumOffsets.size() != accumShape.size();
  while (accumOffsets.size() < delta && needsFilledIn)   accumOffsets.add(0);
  while (accumShape.size() < 2) {
    if (Shape.isRowVectorShape(arr.shape()))     accumShape.add(0,1);
 else     accumShape.add(1);
  }
  while (strideIndex < accumShape.size()) {
    accumStrides.add(arr.stride(strideIndex++));
  }
  if (newAxesPrepend > 0) {
    for (int i=0; i < newAxesPrepend; i++) {
      accumShape.add(0,1);
      accumStrides.add(0,0);
      accumOffsets.add(0,0);
    }
  }
  int numAdded=0;
  for (int i=0; i < prependNewAxes.size(); i++) {
    accumShape.add(prependNewAxes.get(i) - numAdded,1);
    accumStrides.add(prependNewAxes.get(i) - numAdded,0);
    numAdded++;
  }
  int trailingZeroRemove=accumOffsets.size() - 1;
  while (accumOffsets.size() > accumShape.size()) {
    if (accumOffsets.get(trailingZeroRemove) == 0)     accumOffsets.remove(accumOffsets.size() - 1);
    trailingZeroRemove--;
  }
  if (accumStrides.size() < accumOffsets.size())   accumStrides.addAll(pointStrides);
  while (accumOffsets.size() < accumShape.size()) {
    if (Shape.isRowVectorShape(arr.shape()))     accumOffsets.add(0,0);
 else     accumOffsets.add(0);
  }
  if (Shape.isMatrix(shape) && indexes[0] instanceof PointIndex && indexes[1] instanceof NDArrayIndexAll) {
    Collections.reverse(accumShape);
  }
  if (arr.isMatrix() && indexes[0] instanceof PointIndex && indexes[1] instanceof IntervalIndex) {
    this.shapes=new int[2];
    shapes[0]=1;
    IntervalIndex idx=(IntervalIndex)indexes[1];
    shapes[1]=idx.length();
  }
 else   this.shapes=Ints.toArray(accumShape);
  boolean isColumnVector=Shape.isColumnVectorShape(this.shapes);
  while (accumStrides.size() < accumOffsets.size()) {
    if (!isColumnVector)     accumStrides.add(0,arr.elementStride());
 else     accumStrides.add(arr.elementStride());
  }
  this.strides=Ints.toArray(accumStrides);
  this.offsets=Ints.toArray(accumOffsets);
  if (numPointIndexes > 0 && !pointStrides.isEmpty()) {
    if (newAxesPrepend >= 1) {
      while (pointStrides.size() < accumOffsets.size()) {
        pointStrides.add(1);
      }
      for (int i=0; i < accumStrides.size(); i++) {
        if (accumStrides.get(i) == 0)         pointStrides.set(i,0);
      }
    }
    while (pointOffsets.size() < pointStrides.size()) {
      pointOffsets.add(0);
    }
    if (arr.isRowVector() && !intervalStrides.isEmpty() && pointOffsets.get(0) == 0 && !(indexes[1] instanceof IntervalIndex))     this.offset=indexes[1].offset();
 else     this.offset=ArrayUtil.dotProductLong(pointOffsets,pointStrides);
  }
 else {
    this.offset=0;
  }
  if (numIntervals > 0 && arr.rank() > 2) {
    boolean containsOne=false;
    for (int i=0; i < arr.rank(); i++) {
      if (arr.size(i) == 1) {
        containsOne=true;
        break;
      }
    }
    if (encounteredAll && !containsOne || anyHaveStrideOne(indexes))     this.offset+=ArrayUtil.dotProductLong(accumOffsets,accumStrides);
 else     this.offset+=ArrayUtil.dotProductLong(accumOffsets,accumStrides) / Math.max(1,numIntervals);
  }
 else   if (numIntervals > 0 && anyHaveStrideOne(indexes))   this.offset+=ArrayUtil.calcOffsetLong(accumShape,accumOffsets,accumStrides);
 else   this.offset+=ArrayUtil.calcOffsetLong(accumShape,accumOffsets,accumStrides) / Math.max(1,numIntervals);
}