Program: 5507
Project: 5507
Buggy source:
/** 
 * Get all application classes that belong to the specified namespace of the specified classname. Results are returned as a sorted map from artifact to application classes in that artifact. Map entries are sorted by the artifact.
 * @param namespace the namespace from which to get application classes
 * @param className the classname of application classes to get
 * @return an unmodifiable map of artifact the application classes in that artifact.The map will never be null. If there are no application classes, an empty map will be returned.
 */
public SortedMap<ArtifactDescriptor,ApplicationClass> getApplicationClasses(final NamespaceId namespace,final String className){
  try {
    return Transactions.execute(transactional,new TxCallable<SortedMap<ArtifactDescriptor,ApplicationClass>>(){
      @Override public SortedMap<ArtifactDescriptor,ApplicationClass> call(      DatasetContext context) throws Exception {
        SortedMap<ArtifactDescriptor,ApplicationClass> result=Maps.newTreeMap();
        Row row=getMetaTable(context).get(new AppClassKey(namespace,className).getRowKey());
        if (!row.isEmpty()) {
          for (          Map.Entry<byte[],byte[]> column : row.getColumns().entrySet()) {
            ArtifactColumn artifactColumn=ArtifactColumn.parse(column.getKey());
            AppData appData=GSON.fromJson(Bytes.toString(column.getValue()),AppData.class);
            ArtifactDescriptor artifactDescriptor=new ArtifactDescriptor(artifactColumn.artifactId.toArtifactId(),Locations.getCompatibleLocation(locationFactory,appData.artifactLocationPath,appData.artifactLocationURI));
            result.put(artifactDescriptor,appData.appClass);
          }
        }
        return Collections.unmodifiableSortedMap(result);
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Get all application classes that belong to the specified namespace of the specified classname. Results are returned as a sorted map from artifact to application classes in that artifact. Map entries are sorted by the artifact.
 * @param namespace the namespace from which to get application classes
 * @param className the classname of application classes to get
 * @return an unmodifiable map of artifact the application classes in that artifact.The map will never be null. If there are no application classes, an empty map will be returned.
 */
public SortedMap<ArtifactDescriptor,ApplicationClass> getApplicationClasses(final NamespaceId namespace,final String className){
  try {
    return Transactions.execute(transactional,new TxCallable<SortedMap<ArtifactDescriptor,ApplicationClass>>(){
      @Override public SortedMap<ArtifactDescriptor,ApplicationClass> call(      DatasetContext context) throws Exception {
        SortedMap<ArtifactDescriptor,ApplicationClass> result=Maps.newTreeMap();
        Row row=getMetaTable(context).get(new AppClassKey(namespace,className).getRowKey());
        if (!row.isEmpty()) {
          for (          Map.Entry<byte[],byte[]> column : row.getColumns().entrySet()) {
            ArtifactColumn artifactColumn=ArtifactColumn.parse(column.getKey());
            AppData appData=GSON.fromJson(Bytes.toString(column.getValue()),AppData.class);
            ArtifactDescriptor artifactDescriptor=new ArtifactDescriptor(artifactColumn.artifactId.toArtifactId(),Locations.getLocationFromAbsolutePath(locationFactory,appData.getArtifactLocationPath()));
            result.put(artifactDescriptor,appData.appClass);
          }
        }
        return Collections.unmodifiableSortedMap(result);
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    throw Transactions.propagate(e);
  }
}