Program: 51461
Project: 51461
Buggy source:
/** 
 * Tests   {@link mondrian.olap.FunTable#getFunInfoList()}, but more importantly, generates an HTML table of all implemented functions into a file called "functions.html". You can manually include that table in the <a href="http://mondrian.sourceforge.net/mdx.html">MDX specification</a>.
 */
public void testDumpFunctions() throws IOException {
  final List funInfoList=new ArrayList();
  funInfoList.addAll(BuiltinFunTable.instance().getFunInfoList());
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateMemberExactUdf())));
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateMemberUdf())));
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateStringUdf())));
  Collections.sort(funInfoList);
  final File file=new File("String_Node_Str");
  final FileOutputStream os=new FileOutputStream(file);
  final PrintWriter pw=new PrintWriter(os);
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  for (int i=0; i < funInfoList.size(); i++) {
    FunInfo funInfo=(FunInfo)funInfoList.get(i);
    pw.println("String_Node_Str");
    pw.print("String_Node_Str");
    printHtml(pw,funInfo.getName());
    pw.println("String_Node_Str");
    pw.print("String_Node_Str");
    if (funInfo.getDescription() != null) {
      printHtml(pw,funInfo.getDescription());
    }
    final String[] signatures=funInfo.getSignatures();
    if (signatures != null) {
      pw.println("String_Node_Str");
      for (int j=0; j < signatures.length; j++) {
        String signature=signatures[j];
        pw.print("String_Node_Str");
        printHtml(pw,signature);
        pw.println("String_Node_Str");
      }
    }
    pw.println("String_Node_Str");
    pw.println("String_Node_Str");
  }
  pw.println("String_Node_Str");
  pw.close();
}

Fixed version (ground truth):
/** 
 * Tests   {@link mondrian.olap.FunTable#getFunInfoList()}, but more importantly, generates an HTML table of all implemented functions into a file called "functions.html". You can manually include that table in the <a href="http://mondrian.sourceforge.net/mdx.html">MDX specification</a>.
 */
public void testDumpFunctions() throws IOException {
  final List funInfoList=new ArrayList();
  funInfoList.addAll(BuiltinFunTable.instance().getFunInfoList());
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateMemberExactUdf())));
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateMemberUdf())));
  funInfoList.add(new FunInfo(new UdfResolver(new CurrentDateStringUdf())));
  Collections.sort(funInfoList);
  final File file=new File("String_Node_Str");
  final FileOutputStream os=new FileOutputStream(file);
  final PrintWriter pw=new PrintWriter(os);
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  pw.println("String_Node_Str");
  for (int i=0; i < funInfoList.size(); i++) {
    FunInfo funInfo=(FunInfo)funInfoList.get(i);
    pw.println("String_Node_Str");
    pw.print("String_Node_Str");
    printHtml(pw,funInfo.getName());
    pw.println("String_Node_Str");
    pw.print("String_Node_Str");
    if (funInfo.getDescription() != null) {
      printHtml(pw,funInfo.getDescription());
    }
    pw.println();
    final String[] signatures=funInfo.getSignatures();
    if (signatures != null) {
      pw.println("String_Node_Str");
      for (int j=0; j < signatures.length; j++) {
        if (j > 0) {
          pw.println("String_Node_Str");
        }
        String signature=signatures[j];
        pw.print("String_Node_Str");
        printHtml(pw,signature);
      }
      pw.println();
    }
    pw.println("String_Node_Str");
    pw.println("String_Node_Str");
  }
  pw.println("String_Node_Str");
  pw.close();
}