Program: 80382
Project: 80382
Buggy source:
/** 
 * @return a byte array with the vector tile
 */
public byte[] encode(){
  VectorTile.Tile.Builder tileBuilder=VectorTile.Tile.newBuilder();
  for (  Map.Entry<String,Layer> e : layers.entrySet()) {
    String layerName=e.getKey();
    Layer layer=e.getValue();
    VectorTile.Tile.Layer.Builder layerBuilder=VectorTile.Tile.Layer.newBuilder();
    layerBuilder.setVersion(1);
    layerBuilder.setName(layerName);
    layerBuilder.addAllKeys(layer.keys());
    VectorTile.Tile.Value.Builder valueBuilder=VectorTile.Tile.Value.newBuilder();
    for (    Object value : layer.values()) {
      if (value instanceof String) {
        valueBuilder.setStringValue((String)value);
      }
 else       if (value instanceof Integer) {
        valueBuilder.setIntValue(((Integer)value).intValue());
      }
 else       if (value instanceof Float) {
        valueBuilder.setFloatValue(((Float)value).floatValue());
      }
 else       if (value instanceof Double) {
        valueBuilder.setDoubleValue(((Double)value).doubleValue());
      }
 else {
        valueBuilder.setStringValue(value.toString());
      }
      layerBuilder.addValues(valueBuilder.build());
    }
    layerBuilder.setExtent(extent);
    for (    Feature feature : layer.features) {
      Geometry geometry=feature.geometry;
      VectorTile.Tile.Feature.Builder featureBuilder=VectorTile.Tile.Feature.newBuilder();
      featureBuilder.addAllTags(feature.tags);
      featureBuilder.setType(toGeomType(geometry));
      featureBuilder.addAllGeometry(commands(geometry));
      layerBuilder.addFeatures(featureBuilder.build());
    }
    tileBuilder.addLayers(layerBuilder.build());
  }
  return tileBuilder.build().toByteArray();
}

Fixed version (ground truth):
/** 
 * @return a byte array with the vector tile
 */
public byte[] encode(){
  VectorTile.Tile.Builder tileBuilder=VectorTile.Tile.newBuilder();
  for (  Map.Entry<String,Layer> e : layers.entrySet()) {
    String layerName=e.getKey();
    Layer layer=e.getValue();
    VectorTile.Tile.Layer.Builder layerBuilder=VectorTile.Tile.Layer.newBuilder();
    layerBuilder.setVersion(1);
    layerBuilder.setName(layerName);
    layerBuilder.addAllKeys(layer.keys());
    for (    Object value : layer.values()) {
      VectorTile.Tile.Value.Builder valueBuilder=VectorTile.Tile.Value.newBuilder();
      if (value instanceof String) {
        valueBuilder.setStringValue((String)value);
      }
 else       if (value instanceof Integer) {
        valueBuilder.setSintValue(((Integer)value).intValue());
      }
 else       if (value instanceof Long) {
        valueBuilder.setSintValue(((Long)value).longValue());
      }
 else       if (value instanceof Float) {
        valueBuilder.setFloatValue(((Float)value).floatValue());
      }
 else       if (value instanceof Double) {
        valueBuilder.setDoubleValue(((Double)value).doubleValue());
      }
 else {
        valueBuilder.setStringValue(value.toString());
      }
      layerBuilder.addValues(valueBuilder.build());
    }
    layerBuilder.setExtent(extent);
    for (    Feature feature : layer.features) {
      Geometry geometry=feature.geometry;
      VectorTile.Tile.Feature.Builder featureBuilder=VectorTile.Tile.Feature.newBuilder();
      featureBuilder.addAllTags(feature.tags);
      featureBuilder.setType(toGeomType(geometry));
      featureBuilder.addAllGeometry(commands(geometry));
      layerBuilder.addFeatures(featureBuilder.build());
    }
    tileBuilder.addLayers(layerBuilder.build());
  }
  return tileBuilder.build().toByteArray();
}