Program: 63329
Project: 63329
Buggy source:
private void checkLoopTableConsistency(CubeInstance cube,List<CubeSegment> newSegments) throws CubeIntegrityException {
  CubeSegment cubeSeg=newSegments.get(0);
  DictionaryManager dictMgr=DictionaryManager.getInstance(cube.getConfig());
  List<CubeSegment> segmentList=cube.getMergingSegments(cubeSeg);
  HashSet<TblColRef> cols=new HashSet<TblColRef>();
  for (  DimensionDesc dim : cube.getDescriptor().getDimensions()) {
    for (    TblColRef col : dim.getColumnRefs()) {
      try {
        if (cubeSeg.getCubeDesc().getRowkey().isUseDictionary(col) && !cube.getDescriptor().getFactTable().equalsIgnoreCase((String)dictMgr.decideSourceData(cube.getDescriptor(),col,null)[0])) {
          cols.add(col);
        }
      }
 catch (      IOException e) {
        throw new CubeIntegrityException("String_Node_Str");
      }
    }
  }
  for (  TblColRef col : cols) {
    String dictOfFirstSegment=null;
    for (    CubeSegment segment : segmentList) {
      String temp=segment.getDictResPath(col);
      if (temp == null) {
        throw new CubeIntegrityException("String_Node_Str" + col + "String_Node_Str"+ segment);
      }
      if (dictOfFirstSegment == null) {
        dictOfFirstSegment=temp;
      }
 else {
        if (!dictOfFirstSegment.equalsIgnoreCase(temp)) {
          throw new CubeIntegrityException("String_Node_Str");
        }
      }
    }
  }
  CubeSegment firstSegment=null;
  for (  CubeSegment segment : segmentList) {
    if (firstSegment == null) {
      firstSegment=segment;
    }
 else {
      Collection<String> a=firstSegment.getSnapshots().values();
      Collection<String> b=segment.getSnapshots().values();
      if ((a.size() == b.size()) && a.containsAll(b)) {
      }
 else {
        throw new CubeIntegrityException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
private void checkLoopTableConsistency(CubeInstance cube,List<CubeSegment> newSegments) throws CubeIntegrityException {
  CubeSegment cubeSeg=newSegments.get(0);
  DictionaryManager dictMgr=DictionaryManager.getInstance(cube.getConfig());
  List<CubeSegment> segmentList=cube.getMergingSegments(cubeSeg);
  HashSet<TblColRef> cols=new HashSet<TblColRef>();
  for (  DimensionDesc dim : cube.getDescriptor().getDimensions()) {
    for (    TblColRef col : dim.getColumnRefs()) {
      try {
        if (cubeSeg.getCubeDesc().getRowkey().isUseDictionary(col) && !cube.getDescriptor().getFactTable().equalsIgnoreCase((String)dictMgr.decideSourceData(cube.getDescriptor(),col,null)[0])) {
          cols.add(col);
        }
      }
 catch (      IOException e) {
        throw new CubeIntegrityException("String_Node_Str");
      }
    }
  }
  for (  TblColRef col : cols) {
    String dictOfFirstSegment=null;
    for (    CubeSegment segment : segmentList) {
      String temp=segment.getDictResPath(col);
      if (temp == null) {
        throw new CubeIntegrityException("String_Node_Str" + col + "String_Node_Str"+ segment);
      }
      if (dictOfFirstSegment == null) {
        dictOfFirstSegment=temp;
      }
 else {
        if (!dictOfFirstSegment.equalsIgnoreCase(temp)) {
          throw new CubeIntegrityException("String_Node_Str");
        }
      }
    }
  }
  CubeSegment firstSegment=null;
  for (  CubeSegment segment : segmentList) {
    if (firstSegment == null) {
      firstSegment=segment;
    }
 else {
      Collection<String> a=firstSegment.getSnapshots().values();
      Collection<String> b=segment.getSnapshots().values();
      if (!((a.size() == b.size()) && a.containsAll(b)))       throw new CubeIntegrityException("String_Node_Str");
    }
  }
}