Program: 65752
Project: 65752
Buggy source:
/** 
 * @param n
 * @param result
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @throws DataException
 */
private static void populateDimLevels(Node grandpa,Node n,Set<IDimLevel> result) throws CoreException {
  if (n == null)   return;
  if (n.getFirstChild() != null && (n.getType() == Token.GETPROP || n.getType() == Token.GETELEM)) {
    if (n.getFirstChild().getFirstChild() != null && (n.getFirstChild().getFirstChild().getType() == Token.GETPROP || n.getFirstChild().getFirstChild().getType() == Token.GETELEM)) {
      Node dim=n.getFirstChild().getFirstChild();
      if ("String_Node_Str".equals(dim.getFirstChild().getString())) {
        String dimName=dim.getLastChild().getString();
        String levelName=dim.getNext().getString();
        String attr=n.getLastChild().getString();
        DimLevel dimLevel=new DimLevel(dimName,levelName,attr);
        if (!result.contains(dimLevel))         result.add(dimLevel);
      }
    }
 else     if (n.getFirstChild() != null && n.getFirstChild().getType() == Token.NAME) {
      if ("String_Node_Str".equals(n.getFirstChild().getString())) {
        if (n.getLastChild() != null && n.getNext() != null) {
          String dimName=n.getLastChild().getString();
          String levelName=n.getNext().getString();
          String attr=null;
          if (grandpa != null && grandpa.getNext() != null && grandpa.getNext().getType() == Token.STRING) {
            attr=grandpa.getNext().getString();
          }
          DimLevel dimLevel=new DimLevel(dimName,levelName,attr);
          if (!result.contains(dimLevel))           result.add(dimLevel);
        }
      }
    }
  }
  populateDimLevels(grandpa,n.getFirstChild(),result);
  populateDimLevels(grandpa,n.getLastChild(),result);
}

Fixed version (ground truth):
/** 
 * @param n
 * @param result
 * @param bindings
 * @param onlyFromDirectReferenceExpr
 * @throws DataException
 */
private static void populateDimLevels(Node grandpa,Node n,Set<IDimLevel> result) throws CoreException {
  if (n == null)   return;
  if (n.getFirstChild() != null && (n.getType() == Token.GETPROP || n.getType() == Token.GETELEM)) {
    if (n.getFirstChild().getFirstChild() != null && (n.getFirstChild().getFirstChild().getType() == Token.GETPROP || n.getFirstChild().getFirstChild().getType() == Token.GETELEM)) {
      Node dim=n.getFirstChild().getFirstChild();
      if ("String_Node_Str".equals(dim.getFirstChild().getString())) {
        String dimName=dim.getLastChild().getString();
        String levelName=dim.getNext().getString();
        String attr=n.getLastChild().getString();
        DimLevel dimLevel=new DimLevel(dimName,levelName,attr);
        if (!result.contains(dimLevel))         result.add(dimLevel);
      }
    }
 else     if (n.getFirstChild() != null && n.getFirstChild().getType() == Token.NAME) {
      if ("String_Node_Str".equals(n.getFirstChild().getString())) {
        if (n.getLastChild() != null && n.getNext() != null) {
          String dimName=n.getLastChild().getString();
          String levelName=n.getNext().getString();
          String attr=null;
          if (grandpa != null && grandpa.getNext() != null && grandpa.getNext().getType() == Token.STRING) {
            attr=grandpa.getNext().getString();
          }
          DimLevel dimLevel=new DimLevel(dimName,levelName,attr);
          if (!result.contains(dimLevel))           result.add(dimLevel);
        }
      }
    }
  }
  populateDimLevels(grandpa,n.getFirstChild(),result);
  populateDimLevels(grandpa,n.getLastChild(),result);
  populateDimLevels(grandpa,n.getNext(),result);
}