nus-yam/ex-repair huggingface dataset:
Program: 6272
Project: 6272
Buggy source:
@Override public ProcessController<YarnApplicationReport> submit(YarnLaunchContext context,Resource capability){
  ContainerLaunchContext launchContext=context.getLaunchContext();
  appSubmissionContext.setAMContainerSpec(launchContext);
  appSubmissionContext.setResource(adjustMemory(response,capability));
  appSubmissionContext.setMaxAppAttempts(2);
  try {
    yarnClient.submitApplication(appSubmissionContext);
    return new ProcessControllerImpl(yarnClient,appId);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",appId,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public ProcessController<YarnApplicationReport> submit(YarnLaunchContext context){
  ContainerLaunchContext launchContext=context.getLaunchContext();
  appSubmissionContext.setAMContainerSpec(launchContext);
  appSubmissionContext.setResource(capability);
  appSubmissionContext.setMaxAppAttempts(2);
  try {
    yarnClient.submitApplication(appSubmissionContext);
    return new ProcessControllerImpl(yarnClient,appId);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",appId,e);
    throw Throwables.propagate(e);
  }
}
Program: 6273
Project: 6273
Buggy source:
/** 
 * Constructs a   {@link Schema} from the "key":"schema" pair.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param key The json property name that need to match.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} object representing the schema of the json input.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readInnerSchema(JsonReader reader,String key,Set<String> knownRecords) throws IOException {
  if (!key.equals(reader.nextName())) {
    throw new IOException("String_Node_Str" + key + "String_Node_Str");
  }
  return read(reader,knownRecords);
}

Fixed version (ground truth):
/** 
 * Constructs a   {@link Schema} from the "key":"schema" pair.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param key The json property name that need to match.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} object representing the schema of the json input.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readInnerSchema(JsonReader reader,String key,Map<String,Schema> knownRecords) throws IOException {
  if (!key.equals(reader.nextName())) {
    throw new IOException("String_Node_Str" + key + "String_Node_Str");
  }
  return read(reader,knownRecords);
}
Program: 6274
Project: 6274
Buggy source:
/** 
 * Reads json value and convert it into   {@link Schema} object.
 * @param reader Source of json
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} reflecting the json.
 * @throws IOException Any error during reading.
 */
private Schema read(JsonReader reader,Set<String> knownRecords) throws IOException {
  JsonToken token=reader.peek();
switch (token) {
case NULL:
    return null;
case STRING:
{
    String name=reader.nextString();
    if (knownRecords.contains(name)) {
      return Schema.recordOf(name);
    }
    return Schema.of(Schema.Type.valueOf(name.toUpperCase()));
  }
case BEGIN_ARRAY:
return readUnion(reader,knownRecords);
case BEGIN_OBJECT:
{
reader.beginObject();
String name=reader.nextName();
if (!"String_Node_Str".equals(name)) {
  throw new IOException("String_Node_Str");
}
Schema.Type schemaType=Schema.Type.valueOf(reader.nextString().toUpperCase());
Schema schema;
switch (schemaType) {
case ENUM:
  schema=readEnum(reader);
break;
case ARRAY:
schema=readArray(reader,knownRecords);
break;
case MAP:
schema=readMap(reader,knownRecords);
break;
case RECORD:
schema=readRecord(reader,knownRecords);
break;
default :
schema=Schema.of(schemaType);
}
reader.endObject();
return schema;
}
}
throw new IOException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reads json value and convert it into   {@link Schema} object.
 * @param reader Source of json
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} reflecting the json.
 * @throws IOException Any error during reading.
 */
private Schema read(JsonReader reader,Map<String,Schema> knownRecords) throws IOException {
  JsonToken token=reader.peek();
switch (token) {
case NULL:
    return null;
case STRING:
{
    String name=reader.nextString();
    if (knownRecords.containsKey(name)) {
      Schema schema=knownRecords.get(name);
      return schema == null ? Schema.recordOf(name) : schema;
    }
    return Schema.of(Schema.Type.valueOf(name.toUpperCase()));
  }
case BEGIN_ARRAY:
return readUnion(reader,knownRecords);
case BEGIN_OBJECT:
{
reader.beginObject();
String name=reader.nextName();
if (!"String_Node_Str".equals(name)) {
  throw new IOException("String_Node_Str");
}
Schema.Type schemaType=Schema.Type.valueOf(reader.nextString().toUpperCase());
Schema schema;
switch (schemaType) {
case ENUM:
  schema=readEnum(reader);
break;
case ARRAY:
schema=readArray(reader,knownRecords);
break;
case MAP:
schema=readMap(reader,knownRecords);
break;
case RECORD:
schema=readRecord(reader,knownRecords);
break;
default :
schema=Schema.of(schemaType);
}
reader.endObject();
return schema;
}
}
throw new IOException("String_Node_Str");
}
Program: 6275
Project: 6275
Buggy source:
/** 
 * Constructs   {@link Schema.Type#MAP MAP} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#MAP MAP}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readMap(JsonReader reader,Set<String> knownRecords) throws IOException {
  return Schema.mapOf(readInnerSchema(reader,"String_Node_Str",knownRecords),readInnerSchema(reader,"String_Node_Str",knownRecords));
}

Fixed version (ground truth):
/** 
 * Constructs   {@link Schema.Type#MAP MAP} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#MAP MAP}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readMap(JsonReader reader,Map<String,Schema> knownRecords) throws IOException {
  return Schema.mapOf(readInnerSchema(reader,"String_Node_Str",knownRecords),readInnerSchema(reader,"String_Node_Str",knownRecords));
}
Program: 6276
Project: 6276
Buggy source:
/** 
 * Constructs   {@link Schema.Type#RECORD RECORD} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#RECORD RECORD}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readRecord(JsonReader reader,Set<String> knownRecords) throws IOException {
  if (!"String_Node_Str".equals(reader.nextName())) {
    throw new IOException("String_Node_Str");
  }
  String recordName=reader.nextString();
  if (!"String_Node_Str".equals(reader.nextName())) {
    throw new IOException("String_Node_Str");
  }
  knownRecords.add(recordName);
  List<Schema.Field> fieldBuilder=new ArrayList<>();
  reader.beginArray();
  while (reader.peek() != JsonToken.END_ARRAY) {
    reader.beginObject();
    if (!"String_Node_Str".equals(reader.nextName())) {
      throw new IOException("String_Node_Str");
    }
    String fieldName=reader.nextString();
    fieldBuilder.add(Schema.Field.of(fieldName,readInnerSchema(reader,"String_Node_Str",knownRecords)));
    reader.endObject();
  }
  reader.endArray();
  return Schema.recordOf(recordName,fieldBuilder);
}

Fixed version (ground truth):
/** 
 * Constructs   {@link Schema.Type#RECORD RECORD} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#RECORD RECORD}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readRecord(JsonReader reader,Map<String,Schema> knownRecords) throws IOException {
  if (!"String_Node_Str".equals(reader.nextName())) {
    throw new IOException("String_Node_Str");
  }
  String recordName=reader.nextString();
  if (!"String_Node_Str".equals(reader.nextName())) {
    throw new IOException("String_Node_Str");
  }
  knownRecords.put(recordName,null);
  List<Schema.Field> fieldBuilder=new ArrayList<>();
  reader.beginArray();
  while (reader.peek() != JsonToken.END_ARRAY) {
    reader.beginObject();
    if (!"String_Node_Str".equals(reader.nextName())) {
      throw new IOException("String_Node_Str");
    }
    String fieldName=reader.nextString();
    fieldBuilder.add(Schema.Field.of(fieldName,readInnerSchema(reader,"String_Node_Str",knownRecords)));
    reader.endObject();
  }
  reader.endArray();
  Schema schema=Schema.recordOf(recordName,fieldBuilder);
  knownRecords.put(recordName,schema);
  return schema;
}
Program: 6277
Project: 6277
Buggy source:
/** 
 * Constructs   {@link Schema.Type#ARRAY ARRAY} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#ARRAY ARRAY}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readArray(JsonReader reader,Set<String> knownRecords) throws IOException {
  return Schema.arrayOf(readInnerSchema(reader,"String_Node_Str",knownRecords));
}

Fixed version (ground truth):
/** 
 * Constructs   {@link Schema.Type#ARRAY ARRAY} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#ARRAY ARRAY}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readArray(JsonReader reader,Map<String,Schema> knownRecords) throws IOException {
  return Schema.arrayOf(readInnerSchema(reader,"String_Node_Str",knownRecords));
}
Program: 6278
Project: 6278
Buggy source:
/** 
 * Constructs   {@link Schema.Type#UNION UNION} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#UNION UNION}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readUnion(JsonReader reader,Set<String> knownRecords) throws IOException {
  List<Schema> unionSchemas=new ArrayList<>();
  reader.beginArray();
  while (reader.peek() != JsonToken.END_ARRAY) {
    unionSchemas.add(read(reader,knownRecords));
  }
  reader.endArray();
  return Schema.unionOf(unionSchemas);
}

Fixed version (ground truth):
/** 
 * Constructs   {@link Schema.Type#UNION UNION} type schema from the json input.
 * @param reader The {@link JsonReader} for streaming json input tokens.
 * @param knownRecords Set of record name already encountered during the reading.
 * @return A {@link Schema} of type {@link Schema.Type#UNION UNION}.
 * @throws IOException When fails to construct a valid schema from the input.
 */
private Schema readUnion(JsonReader reader,Map<String,Schema> knownRecords) throws IOException {
  List<Schema> unionSchemas=new ArrayList<>();
  reader.beginArray();
  while (reader.peek() != JsonToken.END_ARRAY) {
    unionSchemas.add(read(reader,knownRecords));
  }
  reader.endArray();
  return Schema.unionOf(unionSchemas);
}
Program: 6280
Project: 6280
Buggy source:
public static void main(String[] args){
  try {
    UpgradeTool upgradeTool=new UpgradeTool();
    upgradeTool.doMain(args);
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str",t);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    UpgradeTool upgradeTool=new UpgradeTool();
    upgradeTool.doMain(args);
    LOG.info("String_Node_Str");
  }
 catch (  Throwable t) {
    LOG.error("String_Node_Str",t);
    System.exit(1);
  }
}
Program: 6281
Project: 6281
Buggy source:
private void performCoprocessorUpgrade() throws Exception {
  LOG.info("String_Node_Str");
  dsUpgrade.upgrade();
  LOG.info("String_Node_Str");
  queueAdmin.upgrade();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
}

Fixed version (ground truth):
private void performCoprocessorUpgrade() throws Exception {
  LOG.info("String_Node_Str");
  dsUpgrade.upgrade();
  LOG.info("String_Node_Str");
  queueAdmin.upgrade();
}
Program: 6282
Project: 6282
Buggy source:
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  datasetBasedTimeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  upgradeBusinessMetadataDatasetSpec();
  LOG.info("String_Node_Str");
  metadataStore.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
}

Fixed version (ground truth):
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
  LOG.info("String_Node_Str");
  datasetBasedTimeScheduleStore.upgrade();
  LOG.info("String_Node_Str");
  upgradeBusinessMetadataDatasetSpec();
  LOG.info("String_Node_Str");
  metadataStore.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
}
Program: 6284
Project: 6284
Buggy source:
/** 
 * Create Notification feed for stream's heartbeats, if it does not already exist.
 */
private void createHeartbeatsFeed() throws NotificationFeedException {
  Id.NotificationFeed streamHeartbeatsFeed=new Id.NotificationFeed.Builder().setNamespaceId(Id.Namespace.SYSTEM.getId()).setCategory(Constants.Notification.Stream.STREAM_INTERNAL_FEED_CATEGORY).setName(Constants.Notification.Stream.STREAM_HEARTBEAT_FEED_NAME).setDescription("String_Node_Str").build();
  while (true) {
    try {
      feedManager.getFeed(streamHeartbeatsFeed);
      return;
    }
 catch (    NotificationFeedNotFoundException e) {
      feedManager.createFeed(streamHeartbeatsFeed);
      return;
    }
catch (    NotificationFeedException e) {
      waitBeforeRetryHeartbeatsFeedOperation();
    }
  }
}

Fixed version (ground truth):
/** 
 * Create Notification feed for stream's heartbeats, if it does not already exist.
 */
private void createHeartbeatsFeed() throws NotificationFeedException {
  Id.NotificationFeed streamHeartbeatsFeed=new Id.NotificationFeed.Builder().setNamespaceId(Id.Namespace.SYSTEM.getId()).setCategory(Constants.Notification.Stream.STREAM_INTERNAL_FEED_CATEGORY).setName(Constants.Notification.Stream.STREAM_HEARTBEAT_FEED_NAME).setDescription("String_Node_Str").build();
  LOG.debug("String_Node_Str");
  boolean isRetry=false;
  while (true) {
    try {
      feedManager.getFeed(streamHeartbeatsFeed);
      LOG.debug("String_Node_Str");
      return;
    }
 catch (    NotificationFeedNotFoundException notFoundException) {
      if (!isRetry) {
        LOG.debug("String_Node_Str");
      }
      feedManager.createFeed(streamHeartbeatsFeed);
      LOG.info("String_Node_Str");
      return;
    }
catch (    NotificationFeedException e) {
      if (!isRetry) {
        LOG.warn("String_Node_Str" + "String_Node_Str",e);
      }
 else {
        LOG.debug("String_Node_Str",e);
      }
      isRetry=true;
      waitBeforeRetryHeartbeatsFeedOperation();
    }
  }
}
Program: 6285
Project: 6285
Buggy source:
private void waitBeforeRetryHeartbeatsFeedOperation(){
  LOG.info("String_Node_Str");
  try {
    TimeUnit.SECONDS.sleep(1);
  }
 catch (  InterruptedException ie) {
    Thread.currentThread().interrupt();
    throw Throwables.propagate(ie);
  }
}

Fixed version (ground truth):
private void waitBeforeRetryHeartbeatsFeedOperation(){
  try {
    TimeUnit.SECONDS.sleep(1);
  }
 catch (  InterruptedException ie) {
    Thread.currentThread().interrupt();
    throw Throwables.propagate(ie);
  }
}
Program: 6286
Project: 6286
Buggy source:
@Override protected void initialize() throws Exception {
  createHeartbeatsFeed();
  heartbeatPublisher.startAndWait();
  resourceCoordinatorClient.startAndWait();
  coordinationSubscription=resourceCoordinatorClient.subscribe(discoverableSupplier.get().getName(),new StreamsLeaderHandler());
  heartbeatsSubscriptionExecutor=Executors.newSingleThreadExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  heartbeatsSubscription=subscribeToHeartbeatsFeed();
  leaderListenerCancellable=addLeaderListener(new StreamLeaderListener(){
    @Override public void leaderOf(    Set<Id.Stream> streamIds){
      aggregate(streamIds);
    }
  }
);
  performLeaderElection();
}

Fixed version (ground truth):
@Override protected void initialize() throws Exception {
  LOG.info("String_Node_Str");
  createHeartbeatsFeed();
  heartbeatPublisher.startAndWait();
  resourceCoordinatorClient.startAndWait();
  coordinationSubscription=resourceCoordinatorClient.subscribe(discoverableSupplier.get().getName(),new StreamsLeaderHandler());
  heartbeatsSubscriptionExecutor=Executors.newSingleThreadExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  heartbeatsSubscription=subscribeToHeartbeatsFeed();
  leaderListenerCancellable=addLeaderListener(new StreamLeaderListener(){
    @Override public void leaderOf(    Set<Id.Stream> streamIds){
      aggregate(streamIds);
    }
  }
);
  performLeaderElection();
  LOG.info("String_Node_Str");
}
Program: 6287
Project: 6287
Buggy source:
/** 
 * Delete a namespace from the underlying system Can perform operations such as deleting directories, deleting namespaces, etc. The default implementation deletes the namespace directory on the filesystem. Subclasses can override to add more logic such as delete namespaces in HBase, etc.
 * @param namespaceId {@link Id.Namespace} for the namespace to delete
 * @throws IOException if there are errors while deleting the namespace
 */
protected void delete(Id.Namespace namespaceId) throws IOException, ExploreException, SQLException {
  Location namespaceHome=namespacedLocationFactory.get(namespaceId);
  if (namespaceHome.exists() && !namespaceHome.delete(true)) {
    throw new IOException(String.format("String_Node_Str",namespaceHome,namespaceId.getId()));
  }
 else {
    LOG.warn(String.format("String_Node_Str",namespaceHome,namespaceId));
  }
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    exploreFacade.removeNamespace(namespaceId);
  }
}

Fixed version (ground truth):
/** 
 * Delete a namespace from the underlying system Can perform operations such as deleting directories, deleting namespaces, etc. The default implementation deletes the namespace directory on the filesystem. Subclasses can override to add more logic such as delete namespaces in HBase, etc.
 * @param namespaceId {@link Id.Namespace} for the namespace to delete
 * @throws IOException if there are errors while deleting the namespace
 */
protected void delete(Id.Namespace namespaceId) throws IOException, ExploreException, SQLException {
  Location namespaceHome=namespacedLocationFactory.get(namespaceId);
  if (namespaceHome.exists()) {
    if (!namespaceHome.delete(true)) {
      throw new IOException(String.format("String_Node_Str",namespaceHome,namespaceId.getId()));
    }
  }
 else {
    LOG.warn(String.format("String_Node_Str",namespaceHome,namespaceId));
  }
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    exploreFacade.removeNamespace(namespaceId);
  }
}
Program: 6290
Project: 6290
Buggy source:
private Set<String> getTags(Id.NamespacedId entityId,@Nullable MetadataScope scope) throws NotFoundException {
  return (scope == null) ? metadataAdmin.getTags(entityId) : metadataAdmin.getTags(scope,entityId);
}

Fixed version (ground truth):
private Set<String> getTags(Id.NamespacedId entityId,@Nullable String scope) throws NotFoundException, BadRequestException {
  return (scope == null) ? metadataAdmin.getTags(entityId) : metadataAdmin.getTags(validateScope(scope),entityId);
}
Program: 6291
Project: 6291
Buggy source:
@GET @Path("String_Node_Str") public void getAppProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(app,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getAppProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(app,scope));
}
Program: 6292
Project: 6292
Buggy source:
@GET @Path("String_Node_Str") public void getProgramTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getTags(program,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getProgramTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getTags(program,scope));
}
Program: 6293
Project: 6293
Buggy source:
@GET @Path("String_Node_Str") public void getViewMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(view,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getViewMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(view,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6294
Project: 6294
Buggy source:
@GET @Path("String_Node_Str") public void getDatasetMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.DatasetInstance datasetInstance=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(datasetInstance,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getDatasetMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.DatasetInstance datasetInstance=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(datasetInstance,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6295
Project: 6295
Buggy source:
@GET @Path("String_Node_Str") public void getProgramProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(program,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getProgramProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(program,scope));
}
Program: 6296
Project: 6296
Buggy source:
private Set<MetadataRecord> getMetadata(Id.NamespacedId entityId,@Nullable MetadataScope scope) throws NotFoundException {
  return (scope == null) ? metadataAdmin.getMetadata(entityId) : metadataAdmin.getMetadata(scope,entityId);
}

Fixed version (ground truth):
private Set<MetadataRecord> getMetadata(Id.NamespacedId entityId,@Nullable String scope) throws NotFoundException, BadRequestException {
  return (scope == null) ? metadataAdmin.getMetadata(entityId) : metadataAdmin.getMetadata(validateScope(scope),entityId);
}
Program: 6297
Project: 6297
Buggy source:
@GET @Path("String_Node_Str") public void getStreamTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getTags(stream,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getStreamTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getTags(stream,scope));
}
Program: 6298
Project: 6298
Buggy source:
private Map<String,String> getProperties(Id.NamespacedId entityId,@Nullable MetadataScope scope) throws NotFoundException {
  return (scope == null) ? metadataAdmin.getProperties(entityId) : metadataAdmin.getProperties(scope,entityId);
}

Fixed version (ground truth):
private Map<String,String> getProperties(Id.NamespacedId entityId,@Nullable String scope) throws NotFoundException, BadRequestException {
  return (scope == null) ? metadataAdmin.getProperties(entityId) : metadataAdmin.getProperties(validateScope(scope),entityId);
}
Program: 6299
Project: 6299
Buggy source:
@GET @Path("String_Node_Str") public void getStreamMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") MetadataScope scope) throws Exception {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(stream,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getStreamMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(stream,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6300
Project: 6300
Buggy source:
@GET @Path("String_Node_Str") public void getAppMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(app,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getAppMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(app,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6301
Project: 6301
Buggy source:
@GET @Path("String_Node_Str") public void getViewProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(view,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getViewProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(view,scope));
}
Program: 6302
Project: 6302
Buggy source:
@GET @Path("String_Node_Str") public void getStreamProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(stream,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getStreamProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream stream=Id.Stream.from(namespaceId,streamId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(stream,scope));
}
Program: 6303
Project: 6303
Buggy source:
@GET @Path("String_Node_Str") public void getArtifactProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getProperties(artifactId,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getArtifactProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getProperties(artifactId,scope));
}
Program: 6304
Project: 6304
Buggy source:
@GET @Path("String_Node_Str") public void getProgramMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(program,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getProgramMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String programType,@PathParam("String_Node_Str") String programId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Program program=Id.Program.from(Id.Application.from(namespaceId,appId),ProgramType.valueOfCategoryName(programType),programId);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(program,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6305
Project: 6305
Buggy source:
@GET @Path("String_Node_Str") public void getAppTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getTags(app,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getAppTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Application app=Id.Application.from(namespaceId,appId);
  responder.sendJson(HttpResponseStatus.OK,getTags(app,scope));
}
Program: 6306
Project: 6306
Buggy source:
@GET @Path("String_Node_Str") public void getDatasetTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.DatasetInstance dataset=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getTags(dataset,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getDatasetTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.DatasetInstance dataset=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getTags(dataset,scope));
}
Program: 6307
Project: 6307
Buggy source:
@GET @Path("String_Node_Str") public void getArtifactTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") MetadataScope scope) throws BadRequestException, NotFoundException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getTags(artifactId,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getArtifactTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") String scope) throws BadRequestException, NotFoundException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getTags(artifactId,scope));
}
Program: 6308
Project: 6308
Buggy source:
@GET @Path("String_Node_Str") public void getArtifactMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(artifactId,scope),SET_METADATA_RECORD_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getArtifactMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersionStr,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.from(namespaceId),artifactName,artifactVersionStr);
  responder.sendJson(HttpResponseStatus.OK,getMetadata(artifactId,scope),SET_METADATA_RECORD_TYPE,GSON);
}
Program: 6309
Project: 6309
Buggy source:
@GET @Path("String_Node_Str") public void getDatasetProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.DatasetInstance datasetInstance=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(datasetInstance,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getDatasetProperties(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String datasetId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.DatasetInstance datasetInstance=Id.DatasetInstance.from(namespaceId,datasetId);
  responder.sendJson(HttpResponseStatus.OK,getProperties(datasetInstance,scope));
}
Program: 6310
Project: 6310
Buggy source:
@GET @Path("String_Node_Str") public void getViewTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") MetadataScope scope) throws NotFoundException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getTags(view,scope));
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getViewTags(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String streamId,@PathParam("String_Node_Str") String viewId,@QueryParam("String_Node_Str") String scope) throws NotFoundException, BadRequestException {
  Id.Stream.View view=Id.Stream.View.from(namespaceId,streamId,viewId);
  responder.sendJson(HttpResponseStatus.OK,getTags(view,scope));
}
Program: 6312
Project: 6312
Buggy source:
/** 
 * If empty, start our own CDAP standalone instance for testing. If not empty, use the provided remote CDAP instance for testing.
 */
protected String getInstanceURI(){
  return System.getProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reads the CDAP instance URI from the system property "instanceUri". "instanceUri" should be specified in the format [host]:[port]. Defaults to "localhost:10000".
 */
protected String getInstanceURI(){
  return System.getProperty("String_Node_Str","String_Node_Str");
}
Program: 6314
Project: 6314
Buggy source:
@Override public void run(){
  try {
    Location configLocation=getConfigLocation(streamId);
    if (!configLocation.exists()) {
      return;
    }
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false,null);
    if (!configLocation.delete()) {
      LOG.debug("String_Node_Str",streamLocation);
    }
    metadataStore.removeMetadata(streamId);
    List<Id.Stream.View> views=viewAdmin.list(streamId);
    for (    Id.Stream.View view : views) {
      viewAdmin.delete(view);
    }
    Location deleted=StreamUtils.getDeletedLocation(getStreamBaseLocation(streamId.getNamespace()));
    Locations.mkdirsIfNotExists(deleted);
    streamLocation.renameTo(deleted.append(streamId.getId() + System.currentTimeMillis()));
    streamMetaStore.removeStream(streamId);
    metadataStore.removeMetadata(streamId);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Location configLocation=getConfigLocation(streamId);
    if (!configLocation.exists()) {
      return;
    }
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false,null);
    List<Id.Stream.View> views=viewAdmin.list(streamId);
    for (    Id.Stream.View view : views) {
      viewAdmin.delete(view);
    }
    if (!configLocation.delete()) {
      LOG.debug("String_Node_Str",streamLocation);
    }
    metadataStore.removeMetadata(streamId);
    Location deleted=StreamUtils.getDeletedLocation(getStreamBaseLocation(streamId.getNamespace()));
    Locations.mkdirsIfNotExists(deleted);
    streamLocation.renameTo(deleted.append(streamId.getId() + System.currentTimeMillis()));
    streamMetaStore.removeStream(streamId);
    metadataStore.removeMetadata(streamId);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 6315
Project: 6315
Buggy source:
private void doDrop(final Id.Stream streamId,final Location streamLocation) throws Exception {
  streamCoordinatorClient.deleteStream(streamId,new Runnable(){
    @Override public void run(){
      try {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          return;
        }
        alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false,null);
        if (!configLocation.delete()) {
          LOG.debug("String_Node_Str",streamLocation);
        }
        metadataStore.removeMetadata(streamId);
        List<Id.Stream.View> views=viewAdmin.list(streamId);
        for (        Id.Stream.View view : views) {
          viewAdmin.delete(view);
        }
        Location deleted=StreamUtils.getDeletedLocation(getStreamBaseLocation(streamId.getNamespace()));
        Locations.mkdirsIfNotExists(deleted);
        streamLocation.renameTo(deleted.append(streamId.getId() + System.currentTimeMillis()));
        streamMetaStore.removeStream(streamId);
        metadataStore.removeMetadata(streamId);
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}

Fixed version (ground truth):
private void doDrop(final Id.Stream streamId,final Location streamLocation) throws Exception {
  streamCoordinatorClient.deleteStream(streamId,new Runnable(){
    @Override public void run(){
      try {
        Location configLocation=getConfigLocation(streamId);
        if (!configLocation.exists()) {
          return;
        }
        alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false,null);
        List<Id.Stream.View> views=viewAdmin.list(streamId);
        for (        Id.Stream.View view : views) {
          viewAdmin.delete(view);
        }
        if (!configLocation.delete()) {
          LOG.debug("String_Node_Str",streamLocation);
        }
        metadataStore.removeMetadata(streamId);
        Location deleted=StreamUtils.getDeletedLocation(getStreamBaseLocation(streamId.getNamespace()));
        Locations.mkdirsIfNotExists(deleted);
        streamLocation.renameTo(deleted.append(streamId.getId() + System.currentTimeMillis()));
        streamMetaStore.removeStream(streamId);
        metadataStore.removeMetadata(streamId);
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}
Program: 6316
Project: 6316
Buggy source:
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") String target) throws Exception {
  MetadataSearchTargetType metadataSearchTargetType;
  if (target != null) {
    metadataSearchTargetType=MetadataSearchTargetType.valueOf(target);
  }
 else {
    metadataSearchTargetType=null;
  }
  Set<MetadataSearchResultRecord> results=metadataAdmin.searchMetadata(namespaceId,searchQuery,metadataSearchTargetType);
  responder.sendJson(HttpResponseStatus.OK,results,SET_METADATA_SEARCH_RESULT_TYPE,GSON);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void searchMetadata(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@QueryParam("String_Node_Str") String searchQuery,@QueryParam("String_Node_Str") String target) throws Exception {
  MetadataSearchTargetType metadataSearchTargetType;
  if (target != null) {
    metadataSearchTargetType=MetadataSearchTargetType.valueOf(target.toUpperCase());
  }
 else {
    metadataSearchTargetType=null;
  }
  Set<MetadataSearchResultRecord> results=metadataAdmin.searchMetadata(namespaceId,searchQuery,metadataSearchTargetType);
  responder.sendJson(HttpResponseStatus.OK,results,SET_METADATA_SEARCH_RESULT_TYPE,GSON);
}
Program: 6317
Project: 6317
Buggy source:
/** 
 * Store indexes for a   {@link MetadataEntry}
 * @param targetId the {@link Id.NamespacedId} from which the metadata indexes has to be stored
 * @param entry the {@link MetadataEntry} which has to be indexed
 */
private void storeIndexes(Id.NamespacedId targetId,MetadataEntry entry){
  Set<String> indexes=Sets.newHashSet(Arrays.asList(VALUE_SPLIT_PATTERN.split(entry.getValue())));
  indexes.add(entry.getValue());
  for (  String index : indexes) {
    indexedTable.put(getIndexPut(targetId,entry.getKey(),entry.getKey() + KEYVALUE_SEPARATOR + index));
    indexedTable.put(getIndexPut(targetId,entry.getKey(),index));
  }
}

Fixed version (ground truth):
/** 
 * Store indexes for a   {@link MetadataEntry}
 * @param targetId the {@link Id.NamespacedId} from which the metadata indexes has to be stored
 * @param entry the {@link MetadataEntry} which has to be indexed
 */
private void storeIndexes(Id.NamespacedId targetId,MetadataEntry entry){
  Set<String> valueIndexes=new HashSet<>();
  if (entry.getValue().contains(TAGS_SEPARATOR)) {
    valueIndexes.addAll(Arrays.asList(TAGS_SEPARATOR_PATTERN.split(entry.getValue())));
  }
 else {
    valueIndexes.add(entry.getValue());
  }
  Set<String> indexes=Sets.newHashSet();
  for (  String index : valueIndexes) {
    indexes.addAll(Arrays.asList(VALUE_SPLIT_PATTERN.split(index)));
  }
  indexes.addAll(valueIndexes);
  for (  String index : indexes) {
    indexedTable.put(getIndexPut(targetId,entry.getKey(),entry.getKey() + KEYVALUE_SEPARATOR + index));
    indexedTable.put(getIndexPut(targetId,entry.getKey(),index));
  }
}