Program: 63241
Project: 63241
Buggy source:
@Before public void setUp() throws Exception {
  createTestMetadata();
  logger.info("String_Node_Str" + this.getTestConfig());
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  ProjectManager.removeInstance(this.getTestConfig());
  DictionaryManager.removeInstance(this.getTestConfig());
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  MergeCuboidMapper mapper=new MergeCuboidMapper();
  mapDriver=MapDriver.newMapDriver(mapper);
  cubeManager=CubeManager.getInstance(this.getTestConfig());
  cube=cubeManager.getCube("String_Node_Str");
  dictionaryManager=DictionaryManager.getInstance(getTestConfig());
  lfn=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  lsi=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  ssc=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  DictionaryInfo sharedDict=makeSharedDict();
  boolean isFirstSegment=true;
  for (  CubeSegment segment : cube.getSegments()) {
    TableSignature signature=new TableSignature();
    signature.setSize(100);
    signature.setLastModifiedTime(System.currentTimeMillis());
    signature.setPath("String_Node_Str" + lfn.getName() + segment.getName());
    DictionaryInfo newDictInfo=new DictionaryInfo(lfn.getTable(),lfn.getColumn().getName(),lfn.getColumn().getZeroBasedIndex(),"String_Node_Str",signature,"String_Node_Str");
    List<byte[]> values=new ArrayList<byte[]>();
    values.add(new byte[]{97,97,97});
    if (isFirstSegment)     values.add(new byte[]{99,99,99});
 else     values.add(new byte[]{98,98,98});
    Dictionary<?> dict=DictionaryGenerator.buildDictionaryFromValueList(newDictInfo,values);
    dictionaryManager.trySaveNewDict(dict,newDictInfo);
    ((TrieDictionary)dict).dump(System.out);
    segment.putDictResPath(lfn,newDictInfo.getResourcePath());
    segment.putDictResPath(lsi,sharedDict.getResourcePath());
    segment.putDictResPath(ssc,sharedDict.getResourcePath());
    cubeManager.updateCube(cube);
    isFirstSegment=false;
  }
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  createTestMetadata();
  logger.info("String_Node_Str" + this.getTestConfig());
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  CubeRealizationManager.removeInstance(this.getTestConfig());
  DictionaryManager.removeInstance(this.getTestConfig());
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  MergeCuboidMapper mapper=new MergeCuboidMapper();
  mapDriver=MapDriver.newMapDriver(mapper);
  cubeManager=CubeManager.getInstance(this.getTestConfig());
  cube=cubeManager.getCube("String_Node_Str");
  dictionaryManager=DictionaryManager.getInstance(getTestConfig());
  lfn=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  lsi=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  ssc=cube.getDescriptor().findColumnRef("String_Node_Str","String_Node_Str");
  DictionaryInfo sharedDict=makeSharedDict();
  boolean isFirstSegment=true;
  for (  CubeSegment segment : cube.getSegments()) {
    TableSignature signature=new TableSignature();
    signature.setSize(100);
    signature.setLastModifiedTime(System.currentTimeMillis());
    signature.setPath("String_Node_Str" + lfn.getName() + segment.getName());
    DictionaryInfo newDictInfo=new DictionaryInfo(lfn.getTable(),lfn.getColumn().getName(),lfn.getColumn().getZeroBasedIndex(),"String_Node_Str",signature,"String_Node_Str");
    List<byte[]> values=new ArrayList<byte[]>();
    values.add(new byte[]{97,97,97});
    if (isFirstSegment)     values.add(new byte[]{99,99,99});
 else     values.add(new byte[]{98,98,98});
    Dictionary<?> dict=DictionaryGenerator.buildDictionaryFromValueList(newDictInfo,values);
    dictionaryManager.trySaveNewDict(dict,newDictInfo);
    ((TrieDictionary)dict).dump(System.out);
    segment.putDictResPath(lfn,newDictInfo.getResourcePath());
    segment.putDictResPath(lsi,sharedDict.getResourcePath());
    segment.putDictResPath(ssc,sharedDict.getResourcePath());
    cubeManager.updateCube(cube);
    isFirstSegment=false;
  }
}