Program: 5536
Project: 5536
Buggy source:
/** 
 * Update artifact properties using an update function. Functions will receive an immutable map.
 * @param artifactId the id of the artifact to add
 * @param updateFunction the function used to update existing properties
 * @throws ArtifactNotFoundException if the artifact does not exist
 * @throws IOException if there was an exception writing the properties to the metastore
 */
public void updateArtifactProperties(final Id.Artifact artifactId,final Function<Map<String,String>,Map<String,String>> updateFunction) throws ArtifactNotFoundException, IOException {
  try {
    transactional.execute(new TxRunnable(){
      @Override public void run(      DatasetContext context) throws Exception {
        ArtifactCell artifactCell=new ArtifactCell(artifactId);
        Table metaTable=getMetaTable(context);
        byte[] existingMetaBytes=metaTable.get(artifactCell.rowkey,artifactCell.column);
        if (existingMetaBytes == null) {
          throw new ArtifactNotFoundException(artifactId.toEntityId());
        }
        ArtifactData old=GSON.fromJson(Bytes.toString(existingMetaBytes),ArtifactData.class);
        ArtifactMeta updatedMeta=new ArtifactMeta(old.meta.getClasses(),old.meta.getUsableBy(),updateFunction.apply(old.meta.getProperties()));
        ArtifactData updatedData=new ArtifactData(locationFactory.create(old.locationURI),updatedMeta);
        metaTable.put(artifactCell.rowkey,artifactCell.column,Bytes.toBytes(GSON.toJson(updatedData)));
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e,ArtifactNotFoundException.class,IOException.class);
  }
}

Fixed version (ground truth):
/** 
 * Update artifact properties using an update function. Functions will receive an immutable map.
 * @param artifactId the id of the artifact to add
 * @param updateFunction the function used to update existing properties
 * @throws ArtifactNotFoundException if the artifact does not exist
 * @throws IOException if there was an exception writing the properties to the metastore
 */
public void updateArtifactProperties(final Id.Artifact artifactId,final Function<Map<String,String>,Map<String,String>> updateFunction) throws ArtifactNotFoundException, IOException {
  try {
    transactional.execute(new TxRunnable(){
      @Override public void run(      DatasetContext context) throws Exception {
        ArtifactCell artifactCell=new ArtifactCell(artifactId);
        Table metaTable=getMetaTable(context);
        byte[] existingMetaBytes=metaTable.get(artifactCell.rowkey,artifactCell.column);
        if (existingMetaBytes == null) {
          throw new ArtifactNotFoundException(artifactId.toEntityId());
        }
        ArtifactData old=GSON.fromJson(Bytes.toString(existingMetaBytes),ArtifactData.class);
        ArtifactMeta updatedMeta=new ArtifactMeta(old.meta.getClasses(),old.meta.getUsableBy(),updateFunction.apply(old.meta.getProperties()));
        ArtifactData updatedData=new ArtifactData(Locations.getCompatibleLocation(locationFactory,old.locationPath,old.locationURI),updatedMeta);
        metaTable.put(artifactCell.rowkey,artifactCell.column,Bytes.toBytes(GSON.toJson(updatedData)));
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e,ArtifactNotFoundException.class,IOException.class);
  }
}