Program: 147280
Project: 147280
Buggy source:
@Override public <T>Conditional<T> peek(FeatureExpr ctx,final int offset,Type t){
  if (!buffer.isEmpty()) {
    if (getBufferSize() > offset && Conditional.equivalentTo(bufferCTX,ctx)) {
      int pointer=offset;
      int n=0;
      while (n <= pointer) {
        Conditional value=buffer.get(n).value;
        Object type=value.getValue(true);
        if (type instanceof Integer) {
          if (n == offset) {
switch (t) {
case LONG:
              if (buffer.size() > n + 1) {
                final Conditional value2=buffer.get(n + 1).value;
                return value.mapr(new Function<Integer,Conditional<Long>>(){
                  @Override public Conditional<Long> apply(                  final Integer x1){
                    return value2.map(new Function<Integer,Long>(){
                      @Override public Long apply(                      Integer x2){
                        return Types.intsToLong(x1,x2);
                      }
                    }
);
                  }
                }
);
              }
 else {
                break;
              }
default :
            throw new RuntimeException("String_Node_Str" + type.getClass() + "String_Node_Str"+ t);
        }
      }
      n++;
      continue;
    }
    if (type instanceof Float) {
      if (n == offset) {
switch (t) {
case FLOAT:
          return value;
case INT:
        return value.map(new Function<Float,Integer>(){
          @Override public Integer apply(          Float x){
            return Types.floatToInt(x.floatValue());
          }
        }
);
default :
      break;
  }
}
n++;
continue;
}
if (type instanceof Double || type instanceof Long) {
if (n - pointer > 1) {
  n++;
  pointer--;
  continue;
}
 else {
  debufferAll();
  return super.peek(ctx,offset,t);
}
}
if (type instanceof Byte) {
if (n == offset) {
  return value.map(new Function<Byte,Integer>(){
    @Override public Integer apply(    Byte x){
      return (int)x.byteValue();
    }
  }
);
}
n++;
continue;
}
if (type instanceof Short) {
if (n == offset) {
  return value.map(new Function<Short,Integer>(){
    @Override public Integer apply(    Short x){
      return (int)x;
    }
  }
);
}
n++;
continue;
}
throw new RuntimeException("String_Node_Str" + type.getClass() + "String_Node_Str");
}
}
debufferAll();
}
return super.peek(ctx,offset,t);
}

Fixed version (ground truth):
@Override public <T>Conditional<T> peek(FeatureExpr ctx,final int offset,Type t){
  if (!buffer.isEmpty()) {
    if (getBufferSize() > offset && Conditional.equivalentTo(bufferCTX,ctx)) {
      int pointer=offset;
      int n=0;
      while (n <= pointer) {
        Conditional value=buffer.get(n).value;
        Object type=value.getValue(true);
        if (type instanceof Integer) {
          if (n == offset) {
switch (t) {
case LONG:
              if (buffer.size() > n + 1) {
                final Conditional value2=buffer.get(n + 1).value;
                return value.mapr(x1 -> value2.map(x2 -> Types.intsToLong((int)x1,(int)x2)));
              }
 else {
                break;
              }
case DOUBLE:
            if (buffer.size() > n + 1) {
              final Conditional value2=buffer.get(n + 1).value;
              return value.mapr(x1 -> value2.map(x2 -> Types.intsToDouble((int)x1,(int)x2)));
            }
 else {
              break;
            }
case FLOAT:
          return value.map(x1 -> Types.intToFloat((int)x1));
default :
        throw new RuntimeException("String_Node_Str" + type.getClass() + "String_Node_Str"+ t);
    }
  }
  n++;
  continue;
}
if (type instanceof Float) {
  if (n == offset) {
switch (t) {
case FLOAT:
      return value;
case INT:
    return value.map(x -> Types.floatToInt(((Float)x).floatValue()));
default :
  break;
}
}
n++;
continue;
}
if (type instanceof Double || type instanceof Long) {
if (n - pointer > 1) {
n++;
pointer--;
continue;
}
 else {
debufferAll();
return super.peek(ctx,offset,t);
}
}
if (type instanceof Byte) {
if (n == offset) {
return value.map(x -> (int)((Byte)x).byteValue());
}
n++;
continue;
}
if (type instanceof Short) {
if (n == offset) {
return value.map(x -> (int)x);
}
n++;
continue;
}
throw new RuntimeException("String_Node_Str" + type.getClass() + "String_Node_Str");
}
}
debufferAll();
}
return super.peek(ctx,offset,t);
}