nus-yam/ex-repair huggingface dataset:
Program: 44071
Project: 44071
Buggy source:
/** 
 * Gets the start tags.
 * @param title the title
 * @param currLocFromBase the curr loc from base
 * @return the start tags
 */
public static String getStartTags(String title,String currLocFromBase){
  List<String> cssList=new ArrayList<String>();
  cssList.add("String_Node_Str");
  if (Context.getContext().getCssFilePath() != null && !Utils.isEmpty(Context.getContext().getCssFilePath())) {
    cssList.add("String_Node_Str");
  }
  String relPath="String_Node_Str";
  if (currLocFromBase != null && "String_Node_Str".equals(currLocFromBase)) {
    System.out.println(currLocFromBase);
  }
  if (currLocFromBase != null) {
    String[] folders=currLocFromBase.split("String_Node_Str");
    for (    String folder : folders) {
      relPath=relPath + "String_Node_Str";
    }
  }
  String tag="String_Node_Str" + title + "String_Node_Str";
  for (  String css : cssList) {
    tag+="String_Node_Str" + relPath + "String_Node_Str"+ css+ "String_Node_Str";
  }
  tag+="String_Node_Str";
  return tag;
}

Fixed version (ground truth):
/** 
 * Gets the start tags.
 * @param title the title
 * @param currLocFromBase the curr loc from base
 * @return the start tags
 */
public static String getStartTags(String title,String currLocFromBase){
  List<String> cssList=new ArrayList<String>();
  cssList.add("String_Node_Str");
  if (Context.getContext().getCssFilePath() != null && !Utils.isEmpty(Context.getContext().getCssFilePath())) {
    cssList.add("String_Node_Str");
  }
  String relPath="String_Node_Str";
  if (currLocFromBase != null) {
    if (currLocFromBase.startsWith("String_Node_Str")) {
      currLocFromBase=currLocFromBase.substring(1);
    }
    String[] folders=currLocFromBase.split("String_Node_Str");
    for (    String folder : folders) {
      relPath=relPath + "String_Node_Str";
    }
  }
  String tag="String_Node_Str" + title + "String_Node_Str";
  for (  String css : cssList) {
    tag+="String_Node_Str" + relPath + "String_Node_Str"+ css+ "String_Node_Str";
  }
  tag+="String_Node_Str";
  return tag;
}
Program: 44072
Project: 44072
Buggy source:
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  String xsdPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
  XSDParser parser=new XSDParserImpl();
  xsdIntf=parser.parse(xsdPath);
}

Fixed version (ground truth):
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  String xsdPath=this.getClass().getClassLoader().getResource("String_Node_Str").toExternalForm();
  ConfigurationReader.loadDefaultConfiguration();
  Context.getContext().addParser("String_Node_Str",new TestAnnoParserClass());
  XSDParser parser=new XSDParserImpl();
  xsdIntf=parser.parse(xsdPath);
}
Program: 44073
Project: 44073
Buggy source:
public static StringBuffer processDeprication(ParsedAnnotationInfo annInfo){
  String deprVersion=getFirstAnnotationValue(annInfo,"String_Node_Str");
  String deprDetails=getFirstAnnotationValue(annInfo,"String_Node_Str");
  String useInstead=getFirstAnnotationValue(annInfo,"String_Node_Str");
  StringBuffer result=null;
  if (!Utils.isEmpty(deprVersion)) {
    result=new StringBuffer();
    result.append("String_Node_Str" + deprVersion + Constants.HTML_BR);
    result.append("String_Node_Str" + deprDetails + Constants.HTML_BR);
    result.append("String_Node_Str" + useInstead + Constants.HTML_BR);
  }
  return result;
}

Fixed version (ground truth):
public static StringBuffer processDeprication(ParsedAnnotationInfo annInfo){
  String deprVersion=getFirstAnnotationValue(annInfo,"String_Node_Str");
  String deprDetails=getFirstAnnotationValue(annInfo,"String_Node_Str");
  String useInstead=getFirstAnnotationValue(annInfo,"String_Node_Str");
  StringBuffer result=null;
  if (!Utils.isEmpty(deprVersion)) {
    result=new StringBuffer();
    result.append("String_Node_Str" + deprVersion + Constants.HTML_BR);
    if (!Utils.isEmpty(deprDetails)) {
      result.append("String_Node_Str" + deprDetails + Constants.HTML_BR);
    }
    if (!Utils.isEmpty(useInstead)) {
      result.append("String_Node_Str" + useInstead + Constants.HTML_BR);
    }
  }
  return result;
}
Program: 44074
Project: 44074
Buggy source:
/** 
 * Adds the footer.
 * @param html the html
 */
private void addFooter(StringBuffer html){
  logger.entering("String_Node_Str","String_Node_Str",html);
  String content=getFooterInformation();
  html.append(getTextInDiv(content,"String_Node_Str"));
  html.append(HtmlUtils.getEndTags());
  logger.exiting("String_Node_Str","String_Node_Str",html);
}

Fixed version (ground truth):
/** 
 * Adds the footer.
 * @param html the html
 * @throws OutputFormatterException 
 */
private void addFooter(StringBuffer html,boolean isType,boolean isComplexType,String typeName) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String content=getFooterInformation(isType,isComplexType,typeName);
  html.append(getTextInDiv(content,"String_Node_Str"));
  html.append(HtmlUtils.getEndTags());
  logger.exiting("String_Node_Str","String_Node_Str",html);
}
Program: 44075
Project: 44075
Buggy source:
/** 
 * Gets the footer information. This method can be over ridden to supply Footer.
 * @return the footer information
 */
protected String getFooterInformation(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Gets the footer information. This method can be over ridden to supply Footer.
 * @return the footer information
 * @throws OutputFormatterException 
 */
protected String getFooterInformation(boolean isType,boolean isComplex,String typeName) throws OutputFormatterException {
  String parameterName=isType ? (isComplex ? "String_Node_Str" : "String_Node_Str") : "String_Node_Str";
  String headerFile=outputGenaratorParam.getParameters().get(parameterName);
  if (headerFile != null) {
    try {
      String header=Utils.getFileAsString(Utils.convertToURL(headerFile).openStream()).toString();
      String version=outputGenaratorParam.getParameters().get("String_Node_Str");
      header=header.replaceAll("String_Node_Str",version);
      header=header.replaceAll("String_Node_Str",typeName);
      header="String_Node_Str" + header;
      return header;
    }
 catch (    IOException e) {
      throw new OutputFormatterException(e);
    }
  }
  return "String_Node_Str";
}
Program: 44077
Project: 44077
Buggy source:
public void completeProcessing() throws OutputFormatterException {
  if (packageServicesMap != null && !packageServicesMap.isEmpty()) {
    createAllPackagesFile();
    createAllPackagesDescriptionFile();
    createIndividualPackageFiles();
    createAllClassesFile();
    createIndexFile();
  }
}

Fixed version (ground truth):
public void completeProcessing() throws OutputFormatterException {
  if (packageServicesMap != null && !packageServicesMap.isEmpty()) {
    createAllPackagesFile();
    createAllPackagesDescriptionFile();
    createIndividualPackageFiles();
    createAllClassesFile();
    createIndexFile();
    createTreeFiles();
  }
}
Program: 44078
Project: 44078
Buggy source:
/** 
 * Creates the all packages description file.
 * @throws OutputFormatterException
 */
private void createAllPackagesDescriptionFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  addFooter(html);
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all packages description file.
 * @throws OutputFormatterException
 */
private void createAllPackagesDescriptionFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}
Program: 44081
Project: 44081
Buggy source:
private void writePackageTree(WSDLDocInterface wsdlDoc) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str"));
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + wsdlDoc.getPackageName()+ Constants.HTML_H3_END);
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html);
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir(),"String_Node_Str" + Constants.DOT_HTML);
  System.out.println(root);
}

Fixed version (ground truth):
private void writePackageTree(List<XSDDocInterface> wsdlDoc) throws OutputFormatterException {
  Node root=getTypesInTree(wsdlDoc);
  StringBuffer html=new StringBuffer();
  html.append(Constants.HTML_H3_START + "String_Node_Str" + currentPackageName+ Constants.HTML_H3_END);
  html.append(Constants.HTML_HR);
  html.append(Constants.HTML_H3_START + "String_Node_Str" + Constants.HTML_H3_END);
  html.append("String_Node_Str");
  writeTree(root,html);
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir() + File.separator + currentPackageName,"String_Node_Str" + Constants.DOT_HTML);
}
Program: 44082
Project: 44082
Buggy source:
/** 
 * Builds the header.
 * @param html the html
 */
private void buildHeader(StringBuffer html){
  logger.entering("String_Node_Str","String_Node_Str",html);
  String relPath="String_Node_Str";
  if (currentPackageName != null) {
    String[] folders=currentPackageName.split("String_Node_Str");
    for (    String folder : folders) {
      relPath=relPath + "String_Node_Str";
    }
  }
  html.append(HtmlUtils.getAnchorTag(null,relPath + "String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str") + Constants.NBSP_TWICE);
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str",null,"String_Node_Str"));
  html.append(Constants.HTML_HR);
  html.append(HtmlUtils.getAnchorTag("String_Node_Str",null,null,null));
  html.append(getTableTagWithStyle("String_Node_Str"));
  html.append(getTableRowTagWithStyle("String_Node_Str"));
  html.append(getTableDataTagWithStyle("String_Node_Str"));
  html.append("String_Node_Str");
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str" + Constants.OPERATION_SUMMARY_HREF,Constants.OPERATIONS_LABEL,Constants.OPERATIONS_LABEL));
  html.append(Constants.HTML_TABLE_TD_END);
  html.append(getTableDataTagWithStyle("String_Node_Str"));
  html.append("String_Node_Str");
  html.append(HtmlUtils.getAnchorTag(null,"String_Node_Str" + Constants.OPERATIONS_DETAIL_HREF,Constants.OPERATIONS_LABEL,Constants.OPERATIONS_LABEL));
  html.append(Constants.HTML_TABLE_TD_END);
  html.append(Constants.HTML_TABLE_TR_END);
  html.append(Constants.HTML_TABLE_END);
  html.append(Constants.HTML_HR);
  logger.exiting("String_Node_Str","String_Node_Str",html);
}

Fixed version (ground truth):
/** 
 * Builds the header.
 * @param html the html
 * @throws OutputFormatterException 
 */
private void buildHeader(StringBuffer html,boolean isType,boolean isComplex,String typeName) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",html);
  String parameterName=isType ? (isComplex ? "String_Node_Str" : "String_Node_Str") : "String_Node_Str";
  String headerFile=outputGenaratorParam.getParameters().get(parameterName);
  if (headerFile != null) {
    try {
      String header=Utils.getFileAsString(Utils.convertToURL(headerFile).openStream()).toString();
      String version=outputGenaratorParam.getParameters().get("String_Node_Str");
      header=header.replaceAll("String_Node_Str",version);
      if (typeName != null) {
        header=header.replaceAll("String_Node_Str",typeName);
      }
      html.append(header);
    }
 catch (    IOException e) {
      throw new OutputFormatterException(e);
    }
  }
  logger.exiting("String_Node_Str","String_Node_Str",html);
}
Program: 44083
Project: 44083
Buggy source:
private Node getTypesInTree(WSDLDocInterface wsdlDoc){
  XSDDocInterface xsdDocument=((WSDLDocument)wsdlDoc).getXsdDocument();
  List<ComplexType> complexTypes=xsdDocument.getAllComplexTypes();
  Node root=new Node();
  root.setName("String_Node_Str");
  root.setLevel(0);
  for (  ComplexType type : complexTypes) {
    Node node=new Node();
    node.setName(type.getName());
    node.setOriginalParent(type.getParentType());
    getParent(root,node,type.getParentType());
    if (!node.isNodeAdded()) {
      if (root.getChildren() == null) {
        root.setChildren(new TreeSet<Node>());
      }
      node.setParent(root);
      node.setLevel(root.getLevel() + 1);
      root.getChildren().add(node);
    }
    normalizeTree(type,root,node);
  }
  return root;
}

Fixed version (ground truth):
private Node getTypesInTree(List<XSDDocInterface> wsdlDoc){
  List<ComplexType> complexTypes=new ArrayList<ComplexType>();
  for (  XSDDocInterface xsdDocument : wsdlDoc) {
    if (xsdDocument.getAllComplexTypes() != null) {
      complexTypes.addAll(xsdDocument.getAllComplexTypes());
    }
  }
  Node root=new Node();
  root.setName("String_Node_Str");
  root.setLevel(0);
  for (  ComplexType type : complexTypes) {
    Node node=new Node();
    node.setName(type.getName());
    node.setOriginalParent(type.getParentType());
    getParent(root,node,type.getParentType());
    if (!node.isNodeAdded()) {
      if (root.getChildren() == null) {
        root.setChildren(new TreeSet<Node>());
      }
      node.setParent(root);
      node.setLevel(root.getLevel() + 1);
      root.getChildren().add(node);
    }
    normalizeTree(type,root,node);
  }
  return root;
}
Program: 44084
Project: 44084
Buggy source:
private void writeTree(Node root,StringBuffer html){
  Set<Node> children=root.getChildren();
  if (children != null) {
    html.append("String_Node_Str");
    for (    Node node : children) {
      if (node.isFlag()) {
        html.append("String_Node_Str");
        html.append(HtmlUtils.getAnchorTag("String_Node_Str","String_Node_Str" + currentPackageName + "String_Node_Str"+ node.getName()+ Constants.DOT_HTML,"String_Node_Str",node.getName()) + Constants.HTML_BR);
        writeTree(node,html);
      }
    }
    if (children.size() != 0) {
      html.append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void writeTree(Node root,StringBuffer html){
  Set<Node> children=root.getChildren();
  if (children != null) {
    html.append("String_Node_Str");
    for (    Node node : children) {
      if (node.isFlag()) {
        html.append("String_Node_Str");
        html.append(HtmlUtils.getAnchorTag("String_Node_Str","String_Node_Str" + node.getName() + Constants.DOT_HTML,"String_Node_Str",node.getName()) + Constants.HTML_BR);
        writeTree(node,html);
      }
    }
    if (children.size() != 0) {
      html.append("String_Node_Str");
    }
  }
}
Program: 44091
Project: 44091
Buggy source:
/** 
 * Gets the start tags.
 * @param title the title
 * @param currLocFromBase the curr loc from base
 * @return the start tags
 */
public static String getStartTags(String title,String currLocFromBase){
  List<String> cssList=new ArrayList<String>();
  cssList.add("String_Node_Str");
  if (Context.getContext().getCssFilePath() != null && !Utils.isEmpty(Context.getContext().getCssFilePath())) {
    cssList.add("String_Node_Str");
  }
  String relPath="String_Node_Str";
  if (currLocFromBase != null) {
    String[] folders=currLocFromBase.split("String_Node_Str");
    for (    String folder : folders) {
      relPath=relPath + "String_Node_Str";
    }
  }
  String tag="String_Node_Str" + title + "String_Node_Str";
  for (  String css : cssList) {
    tag+="String_Node_Str" + relPath + "String_Node_Str"+ css+ "String_Node_Str";
  }
  tag+="String_Node_Str";
  return tag;
}

Fixed version (ground truth):
/** 
 * Gets the start tags.
 * @param title the title
 * @param currLocFromBase the curr loc from base
 * @return the start tags
 */
public static String getStartTags(String title,String currLocFromBase){
  List<String> cssList=new ArrayList<String>();
  cssList.add("String_Node_Str");
  if (Context.getContext().getCssFilePath() != null && !Utils.isEmpty(Context.getContext().getCssFilePath())) {
    cssList.add("String_Node_Str");
  }
  String relPath="String_Node_Str";
  if (currLocFromBase != null && "String_Node_Str".equals(currLocFromBase)) {
    System.out.println(currLocFromBase);
  }
  if (currLocFromBase != null) {
    String[] folders=currLocFromBase.split("String_Node_Str");
    for (    String folder : folders) {
      relPath=relPath + "String_Node_Str";
    }
  }
  String tag="String_Node_Str" + title + "String_Node_Str";
  for (  String css : cssList) {
    tag+="String_Node_Str" + relPath + "String_Node_Str"+ css+ "String_Node_Str";
  }
  tag+="String_Node_Str";
  return tag;
}
Program: 44092
Project: 44092
Buggy source:
/** 
 * Creates the all classes file.
 */
private void createAllClassesFile(){
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,"String_Node_Str" + SEPARATOR + packageName+ SEPARATOR+ className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all classes file.
 * @throws OutputFormatterException 
 */
private void createAllClassesFile() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,"String_Node_Str" + SEPARATOR + packageName+ SEPARATOR+ className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}
Program: 44093
Project: 44093
Buggy source:
public void generateWsdlOutput(WSDLDocInterface wsdlDoc,OutputGenaratorParam outputGenaratorParam){
  logger.entering("String_Node_Str","String_Node_Str",new Object[]{wsdlDoc,outputGenaratorParam});
  String packageName=wsdlDoc.getPackageName();
  this.outputGenaratorParam=outputGenaratorParam;
  if (packageName == null) {
    packageName="String_Node_Str";
  }
  currentTypesFolderPath=getCurrentOutputDir() + File.separator + packageName+ File.separator+ "String_Node_Str"+ File.separator;
  writeCssFiles();
  logger.logp(Level.INFO,"String_Node_Str","String_Node_Str","String_Node_Str");
  List<PortType> portTypes=wsdlDoc.getPortTypes();
  for (  PortType portType : portTypes) {
    StringBuffer html=new StringBuffer();
    html.append(HtmlUtils.getStartTags(wsdlDoc.getServiceName(),packageName));
    buildHeader(html);
    html.append(Constants.HTML_BR);
    buildPortType(html,portType,wsdlDoc);
    html.append(Constants.HTML_BR);
    buildOperationTable(html,portType,wsdlDoc);
    html.append(Constants.HTML_BR);
    buildOperationDetails(html,portType,wsdlDoc);
    addFooter(html);
    html.append(HtmlUtils.getEndTags());
    String outputDir=getCurrentOutputDir() + File.separator;
    writeFile(html,outputDir + File.separator + packageName,wsdlDoc.getServiceName() + Constants.DOT_HTML);
  }
  addPackageToServiceMap(packageName,wsdlDoc.getServiceName());
  processedTypes=new ArrayList<AbstractType>();
  logger.exiting("String_Node_Str","String_Node_Str",new Object[]{wsdlDoc,outputGenaratorParam});
}

Fixed version (ground truth):
public void generateWsdlOutput(WSDLDocInterface wsdlDoc,OutputGenaratorParam outputGenaratorParam) throws OutputFormatterException {
  logger.entering("String_Node_Str","String_Node_Str",new Object[]{wsdlDoc,outputGenaratorParam});
  String packageName=wsdlDoc.getPackageName();
  this.outputGenaratorParam=outputGenaratorParam;
  if (packageName == null) {
    packageName="String_Node_Str";
  }
  currentTypesFolderPath=getCurrentOutputDir() + File.separator + packageName+ File.separator+ "String_Node_Str"+ File.separator;
  writeCssFiles();
  logger.logp(Level.INFO,"String_Node_Str","String_Node_Str","String_Node_Str");
  List<PortType> portTypes=wsdlDoc.getPortTypes();
  for (  PortType portType : portTypes) {
    StringBuffer html=new StringBuffer();
    html.append(HtmlUtils.getStartTags(wsdlDoc.getServiceName(),packageName));
    buildHeader(html);
    html.append(Constants.HTML_BR);
    buildPortType(html,portType,wsdlDoc);
    html.append(Constants.HTML_BR);
    buildOperationTable(html,portType,wsdlDoc);
    html.append(Constants.HTML_BR);
    buildOperationDetails(html,portType,wsdlDoc);
    addFooter(html);
    html.append(HtmlUtils.getEndTags());
    String outputDir=getCurrentOutputDir() + File.separator;
    writeFile(html,outputDir + File.separator + packageName,wsdlDoc.getServiceName() + Constants.DOT_HTML);
  }
  addPackageToServiceMap(packageName,wsdlDoc.getServiceName());
  processedTypes=new ArrayList<AbstractType>();
  logger.exiting("String_Node_Str","String_Node_Str",new Object[]{wsdlDoc,outputGenaratorParam});
}
Program: 44094
Project: 44094
Buggy source:
/** 
 * Write css files.
 */
private void writeCssFiles(){
  InputStream is=this.getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    BufferedReader br=new BufferedReader(new InputStreamReader(is));
    StringBuffer sb=new StringBuffer();
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append(line);
    }
    String outputDir=getCurrentOutputDir();
    writeFile(sb,outputDir + File.separator + "String_Node_Str","String_Node_Str");
    if (Context.getContext().getCssFilePath() != null) {
      sb=new StringBuffer();
      while ((line=br.readLine()) != null) {
        sb.append(line);
      }
      writeFile(sb,outputDir + File.separator + "String_Node_Str","String_Node_Str");
    }
  }
 catch (  IOException e) {
    logger.severe(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Write css files.
 * @throws OutputFormatterException 
 */
private void writeCssFiles() throws OutputFormatterException {
  InputStream is=this.getClass().getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    BufferedReader br=new BufferedReader(new InputStreamReader(is));
    StringBuffer sb=new StringBuffer();
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append(line);
    }
    String outputDir=getCurrentOutputDir();
    writeFile(sb,outputDir + File.separator + "String_Node_Str","String_Node_Str");
    if (Context.getContext().getCssFilePath() != null) {
      sb=new StringBuffer();
      while ((line=br.readLine()) != null) {
        sb.append(line);
      }
      writeFile(sb,outputDir + File.separator + "String_Node_Str","String_Node_Str");
    }
  }
 catch (  IOException e) {
    logger.severe(e.getMessage());
  }
}
Program: 44095
Project: 44095
Buggy source:
public void completeProcessing(){
  if (packageServicesMap != null && !packageServicesMap.isEmpty()) {
    createAllPackagesFile();
    createAllPackagesDescriptionFile();
    createIndividualPackageFiles();
    createAllClassesFile();
    createIndexFile();
  }
}

Fixed version (ground truth):
public void completeProcessing() throws OutputFormatterException {
  if (packageServicesMap != null && !packageServicesMap.isEmpty()) {
    createAllPackagesFile();
    createAllPackagesDescriptionFile();
    createIndividualPackageFiles();
    createAllClassesFile();
    createIndexFile();
  }
}
Program: 44096
Project: 44096
Buggy source:
/** 
 * Creates the index file.
 */
private void createIndexFile(){
  StringBuffer html=new StringBuffer(200);
  html.append("String_Node_Str");
  html.append("String_Node_Str");
  html.append("String_Node_Str" + Constants.PACKAGES.toLowerCase() + Constants.DOT_HTML+ "String_Node_Str");
  html.append("String_Node_Str" + Constants.ALLCLASSES.toLowerCase() + Constants.DOT_HTML+ "String_Node_Str"+ Constants.CLASSESFRAME+ "String_Node_Str");
  html.append("String_Node_Str");
  html.append("String_Node_Str" + Constants.PACKAGES.toLowerCase() + Constants.INDEX+ Constants.DOT_HTML+ "String_Node_Str"+ Constants.CLASSFRAME+ "String_Node_Str");
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir(),Constants.INDEX + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the index file.
 * @throws OutputFormatterException 
 */
private void createIndexFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer(200);
  html.append("String_Node_Str");
  html.append("String_Node_Str");
  html.append("String_Node_Str" + Constants.PACKAGES.toLowerCase() + Constants.DOT_HTML+ "String_Node_Str");
  html.append("String_Node_Str" + Constants.ALLCLASSES.toLowerCase() + Constants.DOT_HTML+ "String_Node_Str"+ Constants.CLASSESFRAME+ "String_Node_Str");
  html.append("String_Node_Str");
  html.append("String_Node_Str" + Constants.PACKAGES.toLowerCase() + Constants.INDEX+ Constants.DOT_HTML+ "String_Node_Str"+ Constants.CLASSFRAME+ "String_Node_Str");
  html.append("String_Node_Str");
  writeFile(html,getCurrentOutputDir(),Constants.INDEX + Constants.DOT_HTML);
}
Program: 44097
Project: 44097
Buggy source:
/** 
 * Creates the all packages file.
 */
private void createAllPackagesFile(){
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.PACKAGES,null));
  Set<String> set=packageServicesMap.keySet();
  html.append(Constants.HTML_BOLD_START + Constants.PACKAGES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    html.append(HtmlUtils.getAnchorTag(packageName,"String_Node_Str" + SEPARATOR + packageName+ SEPARATOR+ Constants.ALLCLASSES+ Constants.DOT_HTML,null,packageName,Constants.CLASSESFRAME,null) + Constants.HTML_BR);
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all packages file.
 * @throws OutputFormatterException 
 */
private void createAllPackagesFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.PACKAGES,null));
  Set<String> set=packageServicesMap.keySet();
  html.append(Constants.HTML_BOLD_START + Constants.PACKAGES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    html.append(HtmlUtils.getAnchorTag(packageName,"String_Node_Str" + SEPARATOR + packageName+ SEPARATOR+ Constants.ALLCLASSES+ Constants.DOT_HTML,null,packageName,Constants.CLASSESFRAME,null) + Constants.HTML_BR);
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.DOT_HTML);
}
Program: 44098
Project: 44098
Buggy source:
/** 
 * Creates the all packages description file.
 */
private void createAllPackagesDescriptionFile(){
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  addFooter(html);
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all packages description file.
 * @throws OutputFormatterException 
 */
private void createAllPackagesDescriptionFile() throws OutputFormatterException {
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(getTextInDiv("String_Node_Str","String_Node_Str"));
  html.append(Constants.HTML_BR);
  addFooter(html);
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.PACKAGES.toLowerCase() + Constants.INDEX + Constants.DOT_HTML);
}
Program: 44100
Project: 44100
Buggy source:
/** 
 * Write file.
 * @param html the html
 * @param dir the dir
 * @param fileName the file name
 */
private void writeFile(StringBuffer html,String dir,String fileName){
  try {
    File file=new File(dir);
    file.mkdirs();
    FileWriter fw=new FileWriter(dir + File.separator + fileName);
    fw.write(html.toString());
    fw.flush();
    fw.close();
  }
 catch (  IOException e) {
    new OutputFormatterException(e);
  }
}

Fixed version (ground truth):
/** 
 * Write file.
 * @param html the html
 * @param dir the dir
 * @param fileName the file name
 * @throws OutputFormatterException 
 */
private void writeFile(StringBuffer html,String dir,String fileName) throws OutputFormatterException {
  try {
    File file=new File(dir);
    file.mkdirs();
    FileWriter fw=new FileWriter(dir + File.separator + fileName);
    fw.write(html.toString());
    fw.flush();
    fw.close();
  }
 catch (  IOException e) {
    throw new OutputFormatterException(e);
  }
}
Program: 44101
Project: 44101
Buggy source:
/** 
 * Creates the individual package files.
 */
private void createIndividualPackageFiles(){
  Set<String> set=packageServicesMap.keySet();
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    StringBuffer html=new StringBuffer();
    html.append(HtmlUtils.getStartTags(Constants.CLASSES,packageName));
    html.append(Constants.HTML_BOLD_START + Constants.CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,className + Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
    html.append(HtmlUtils.getEndTags());
    writeFile(html,getCurrentOutputDir() + packageName,Constants.ALLCLASSES + Constants.DOT_HTML);
  }
}

Fixed version (ground truth):
/** 
 * Creates the individual package files.
 * @throws OutputFormatterException 
 */
private void createIndividualPackageFiles() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    StringBuffer html=new StringBuffer();
    html.append(HtmlUtils.getStartTags(Constants.CLASSES,packageName));
    html.append(Constants.HTML_BOLD_START + Constants.CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,className + Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
    html.append(HtmlUtils.getEndTags());
    writeFile(html,getCurrentOutputDir() + packageName,Constants.ALLCLASSES + Constants.DOT_HTML);
  }
}
Program: 44105
Project: 44105
Buggy source:
/** 
 * Gets the help text.
 * @return the help text
 */
private static String getHelpText(){
  String help=null;
  InputStream is=Main.class.getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    BufferedReader br=new BufferedReader(new InputStreamReader(is));
    StringBuffer sb=new StringBuffer();
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append(line + System.getProperty("String_Node_Str"));
    }
    help=sb.toString();
  }
 catch (  IOException e) {
    Logger.getLogger(Main.class.getName()).throwing(Main.class.getName(),"String_Node_Str",e);
  }
  return help;
}

Fixed version (ground truth):
/** 
 * Gets the help text.
 * @return text displayed when help option is supplied.
 */
private static String getHelpText(){
  String help=null;
  InputStream is=Main.class.getClassLoader().getResourceAsStream("String_Node_Str");
  try {
    BufferedReader br=new BufferedReader(new InputStreamReader(is));
    StringBuffer sb=new StringBuffer();
    String line="String_Node_Str";
    while ((line=br.readLine()) != null) {
      sb.append(line + System.getProperty("String_Node_Str"));
    }
    help=sb.toString();
  }
 catch (  IOException e) {
    Logger.getLogger(Main.class.getName()).throwing(Main.class.getName(),"String_Node_Str",e);
  }
  return help;
}
Program: 44106
Project: 44106
Buggy source:
/** 
 * Removes the empty values.
 * @param documentval the documentval
 * @return the list
 */
private static List<String> removeEmptyValues(String[] documentval){
  List<String> retList=new ArrayList<String>();
  for (  String value : documentval) {
    if (value != null && !Utils.isEmpty(value)) {
      retList.add(value);
    }
  }
  return retList;
}

Fixed version (ground truth):
/** 
 * Removes any empty values supplied as documents.
 * @param documentval the documentval
 * @return the list
 */
private static List<String> removeEmptyValues(String[] documentval){
  List<String> retList=new ArrayList<String>();
  for (  String value : documentval) {
    if (value != null && !Utils.isEmpty(value)) {
      retList.add(value);
    }
  }
  return retList;
}
Program: 44107
Project: 44107
Buggy source:
/** 
 * Gets the all operations.
 * @return the all operations
 */
public List<OperationHolder> getAllOperations();

Fixed version (ground truth):
/** 
 * Gets the all wsdl operations.
 * @return the all operations
 */
public List<OperationHolder> getAllOperations();
Program: 44108
Project: 44108
Buggy source:
/** 
 * Gets the port types.
 * @return the port types
 */
public List<PortType> getPortTypes();

Fixed version (ground truth):
/** 
 * Gets all the port types defined in WSDL.
 * @return the port types
 */
public List<PortType> getPortTypes();
Program: 44109
Project: 44109
Buggy source:
/** 
 * Gets the package name.
 * @return the package name
 */
public String getPackageName();

Fixed version (ground truth):
/** 
 * Gets the package name of the WSDL. Package name is the local part of the WSDL Service URL.
 * @return the package name
 */
public String getPackageName();
Program: 44110
Project: 44110
Buggy source:
/** 
 * Gets the annotations.
 * @return the annotations
 */
public ParsedAnnotationInfo getAnnotations();

Fixed version (ground truth):
/** 
 * Gets the annotations on the WSDL. Typically returns the annotation defined on the service element.
 * @return the annotations
 */
public ParsedAnnotationInfo getAnnotations();
Program: 44111
Project: 44111
Buggy source:
/** 
 * Gets the complete remote path.
 * @return the complete remote path
 */
public String getCompleteRemotePath();

Fixed version (ground truth):
/** 
 * Gets the complete remote address of the service endpoint.
 * @return the complete remote path
 */
public String getCompleteRemotePath();
Program: 44112
Project: 44112
Buggy source:
/** 
 * Creates the all classes file.
 * @throws OutputFormatterException
 */
private void createAllClassesFile() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,"String_Node_Str" + SEPARATOR + packageName+ SEPARATOR+ className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}

Fixed version (ground truth):
/** 
 * Creates the all classes file.
 * @throws OutputFormatterException
 */
private void createAllClassesFile() throws OutputFormatterException {
  Set<String> set=packageServicesMap.keySet();
  StringBuffer html=new StringBuffer();
  html.append(HtmlUtils.getStartTags(Constants.ALL_CLASSES,null));
  html.append(Constants.HTML_BOLD_START + Constants.ALL_CLASSES + Constants.HTML_BOLD_END+ Constants.HTML_BR);
  for (  String packageName : set) {
    List<String> list=packageServicesMap.get(packageName);
    for (    String className : list) {
      html.append(HtmlUtils.getAnchorTag(className,packageName + SEPARATOR + className+ Constants.DOT_HTML,null,className,Constants.CLASSFRAME,null) + Constants.HTML_BR);
    }
  }
  html.append(HtmlUtils.getEndTags());
  writeFile(html,getCurrentOutputDir(),Constants.ALLCLASSES + Constants.DOT_HTML);
}
Program: 44116
Project: 44116
Buggy source:
private void printToFileIfApplicable(Object doc,OutputGenaratorParam outputGenaratorParam,String fileName) throws WsdlDocException {
  if (outputGenaratorParam.getParameters() != null) {
    if (outputGenaratorParam.getParameters().get("String_Node_Str") != null && "String_Node_Str".equals(outputGenaratorParam.getParameters().get("String_Node_Str"))) {
      String outFile=outputGenaratorParam.getParameters().get("String_Node_Str");
      if (outFile != null) {
        try {
          writeFile(doc.toString(),outFile,fileName);
        }
 catch (        IOException e) {
          throw new WsdlDocException(e);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void printToFileIfApplicable(Object doc,OutputGenaratorParam outputGenaratorParam,String fileName) throws WsdlDocException {
  if (outputGenaratorParam.getParameters() != null) {
    if (outputGenaratorParam.getParameters().get("String_Node_Str") != null && "String_Node_Str".equals(outputGenaratorParam.getParameters().get("String_Node_Str"))) {
      String outFile=outputGenaratorParam.getOutputDir();
      if (outFile != null) {
        try {
          writeFile(doc.toString(),outFile,fileName);
        }
 catch (        IOException e) {
          throw new WsdlDocException(e);
        }
      }
    }
  }
}
Program: 44117
Project: 44117
Buggy source:
/** 
 * Construct a new instance. <p/> If the   {@code skipLevelFilterCheck} is set to {@code true} it's the responsibility of the subclass to checkwhether the record is  {@link #isLoggable(java.util.logging.LogRecord) loggable} or not.
 * @param skipLevelFilterCheck {@code true} if the {@link #isLoggable(java.util.logging.LogRecord)} should beskipped, otherwise  {@code false}
 */
protected ExtHandler(final boolean skipLevelFilterCheck){
  handlersUpdater.clear(this);
  super.setErrorManager(DEFAULT_ERROR_MANAGER);
  this.skipLevelFilterCheck=skipLevelFilterCheck;
}

Fixed version (ground truth):
/** 
 * Construct a new instance.
 */
protected ExtHandler(){
  handlersUpdater.clear(this);
  super.setErrorManager(DEFAULT_ERROR_MANAGER);
}
Program: 44118
Project: 44118
Buggy source:
/** 
 * Publish an   {@code ExtLogRecord}. <p/> The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here. <p/> The   {@code ExtHandler} is responsible for formatting the message, when and if necessary. The formatting shouldinclude localization.
 * @param record the log record to publish
 */
public final void publish(final ExtLogRecord record){
  if (enabled && record != null) {
    if (skipLevelFilterCheck || isLoggable(record)) {
      doPublish(record);
    }
  }
}

Fixed version (ground truth):
/** 
 * Publish an   {@code ExtLogRecord}. <p/> The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here. <p/> The   {@code ExtHandler} is responsible for formatting the message, when and if necessary. The formatting shouldinclude localization.
 * @param record the log record to publish
 */
public void publish(final ExtLogRecord record){
  if (enabled && record != null && isLoggable(record)) {
    doPublish(record);
  }
}
Program: 44119
Project: 44119
Buggy source:
/** 
 * Construct a new instance.
 * @param limit the queue length to use
 */
public QueueHandler(final int limit){
  super(true);
  if (limit < 1) {
    throw badQueueLength();
  }
  this.limit=limit;
}

Fixed version (ground truth):
/** 
 * Construct a new instance.
 * @param limit the queue length to use
 */
public QueueHandler(final int limit){
  if (limit < 1) {
    throw badQueueLength();
  }
  this.limit=limit;
}
Program: 44120
Project: 44120
Buggy source:
protected MultiHandler(){
  super(true);
}

Fixed version (ground truth):
protected MultiHandler(){
}
Program: 44121
Project: 44121
Buggy source:
@Test public void testSetNullEncodingOnOutputStream() throws Exception {
  handler=new OutputStreamHandler(NO_FORMATTER);
  handler.setWriter(out);
  handler.setEncoding(null);
  handler.publish(AbstractHandlerTest.createLogRecord("String_Node_Str"));
  assertThat(out.toString(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testSetNullEncodingOnOutputStream() throws Exception {
  handler=new OutputStreamHandler(NO_FORMATTER);
  handler.setWriter(out);
  handler.setEncoding(null);
  handler.publish(new ExtLogRecord(Level.INFO,"String_Node_Str",getClass().getName()));
  assertThat(out.toString(),is("String_Node_Str"));
}
Program: 44122
Project: 44122
Buggy source:
@Test public void testSetEncodingOnOutputStream() throws Exception {
  handler=new ConsoleHandler(Target.CONSOLE,NO_FORMATTER);
  handler.setWriter(out);
  handler.setEncoding("String_Node_Str");
  assertThat(handler.getEncoding(),is("String_Node_Str"));
  handler.publish(AbstractHandlerTest.createLogRecord("String_Node_Str"));
  assertThat(out.toString(),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testSetEncodingOnOutputStream() throws Exception {
  handler=new ConsoleHandler(Target.CONSOLE,NO_FORMATTER);
  handler.setWriter(out);
  handler.setEncoding("String_Node_Str");
  assertThat(handler.getEncoding(),is("String_Node_Str"));
  handler.publish(new ExtLogRecord(Level.INFO,"String_Node_Str",getClass().getName()));
  assertThat(out.toString(),is("String_Node_Str"));
}
Program: 44123
Project: 44123
Buggy source:
/** 
 * Set the target encoding.
 * @param encoding the new encoding
 * @throws SecurityException if you do not have sufficient permission to invoke this operation
 * @throws java.io.UnsupportedEncodingException if the specified encoding is not supported
 */
public void setEncoding(final String encoding) throws SecurityException, UnsupportedEncodingException {
synchronized (outputLock) {
    super.setEncoding(encoding);
    final OutputStream outputStream=this.outputStream;
    updateWriter(outputStream,encoding);
  }
}

Fixed version (ground truth):
/** 
 * Set the target encoding.
 * @param encoding the new encoding
 * @throws SecurityException if you do not have sufficient permission to invoke this operation
 * @throws java.io.UnsupportedEncodingException if the specified encoding is not supported
 */
public void setEncoding(final String encoding) throws SecurityException, UnsupportedEncodingException {
synchronized (outputLock) {
    super.setEncoding(encoding);
    if (this.outputStream != null) {
      final OutputStream outputStream=this.outputStream;
      updateWriter(outputStream,encoding);
    }
  }
}
Program: 44124
Project: 44124
Buggy source:
private void calcNextRollover(final long fromTime){
  if (period == Period.NEVER) {
    nextRollover=Long.MAX_VALUE;
    return;
  }
  nextSuffix=format.format(new Date(fromTime));
  final Calendar calendar=Calendar.getInstance(timeZone);
  calendar.setTimeInMillis(fromTime);
  final Period period=this.period;
switch (period) {
default :
case YEAR:
    calendar.set(Calendar.MONTH,0);
case MONTH:
  calendar.set(Calendar.DAY_OF_MONTH,0);
calendar.clear(Calendar.WEEK_OF_MONTH);
case WEEK:
if (period == Period.WEEK) {
calendar.set(Calendar.DAY_OF_WEEK,0);
}
 else {
calendar.clear(Calendar.DAY_OF_WEEK);
}
calendar.clear(Calendar.DAY_OF_WEEK_IN_MONTH);
case DAY:
calendar.set(Calendar.HOUR_OF_DAY,0);
case HALF_DAY:
calendar.set(Calendar.HOUR,0);
case HOUR:
calendar.set(Calendar.MINUTE,0);
case MINUTE:
calendar.set(Calendar.SECOND,0);
calendar.set(Calendar.MILLISECOND,0);
}
switch (period) {
case YEAR:
calendar.add(Calendar.YEAR,1);
break;
case MONTH:
calendar.add(Calendar.MONTH,1);
break;
case WEEK:
calendar.add(Calendar.WEEK_OF_YEAR,1);
break;
case DAY:
calendar.add(Calendar.DAY_OF_MONTH,1);
break;
case HALF_DAY:
calendar.add(Calendar.AM_PM,1);
break;
case HOUR:
calendar.add(Calendar.HOUR_OF_DAY,1);
break;
case MINUTE:
calendar.add(Calendar.MINUTE,1);
break;
}
nextRollover=calendar.getTimeInMillis();
}

Fixed version (ground truth):
private void calcNextRollover(final long fromTime){
  if (period == Period.NEVER) {
    nextRollover=Long.MAX_VALUE;
    return;
  }
  nextSuffix=format.format(new Date(fromTime));
  final Calendar calendar=Calendar.getInstance(timeZone);
  calendar.setTimeInMillis(fromTime);
  final Period period=this.period;
switch (period) {
default :
case YEAR:
    calendar.set(Calendar.MONTH,0);
case MONTH:
  calendar.set(Calendar.DAY_OF_MONTH,0);
calendar.clear(Calendar.WEEK_OF_MONTH);
case WEEK:
if (period == Period.WEEK) {
calendar.set(Calendar.DAY_OF_WEEK,calendar.getFirstDayOfWeek());
}
 else {
calendar.clear(Calendar.DAY_OF_WEEK);
}
calendar.clear(Calendar.DAY_OF_WEEK_IN_MONTH);
case DAY:
calendar.set(Calendar.HOUR_OF_DAY,0);
case HALF_DAY:
if (period == Period.HALF_DAY) {
calendar.set(Calendar.HOUR,0);
}
 else {
calendar.set(Calendar.HOUR,0);
calendar.set(Calendar.AM_PM,0);
}
case HOUR:
calendar.set(Calendar.MINUTE,0);
case MINUTE:
calendar.set(Calendar.SECOND,0);
calendar.set(Calendar.MILLISECOND,0);
}
switch (period) {
case YEAR:
calendar.add(Calendar.YEAR,1);
break;
case MONTH:
calendar.add(Calendar.MONTH,1);
break;
case WEEK:
calendar.add(Calendar.WEEK_OF_YEAR,1);
break;
case DAY:
calendar.add(Calendar.DAY_OF_MONTH,1);
break;
case HALF_DAY:
calendar.add(Calendar.AM_PM,1);
break;
case HOUR:
calendar.add(Calendar.HOUR_OF_DAY,1);
break;
case MINUTE:
calendar.add(Calendar.MINUTE,1);
break;
}
nextRollover=calendar.getTimeInMillis();
}