nus-yam/ex-repair huggingface dataset:
Program: 79739
Project: 79739
Buggy source:
/** 
 * Populate the map containing the headers keys and values based on the   {@link FilterConfig}.   {@inheritDoc}
 */
@Override public void init(FilterConfig config) throws ServletException {
  if (config != null) {
    Enumeration<String> initParams=config.getInitParameterNames();
    while (initParams.hasMoreElements()) {
      String headerKey=initParams.nextElement();
      headerKeyValues.put(headerKey,config.getInitParameter(headerKey));
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes the filter based on the   {@link FilterConfig}. The "excludes" init parameter is used to prevent the filter from setting the headers when accessing certain URIs. Any other init parameter specified in web.xml will be handled as a headername-headervalue pair that should be added to the HttpServletResponse.  {@inheritDoc}
 */
@Override public void init(FilterConfig config) throws ServletException {
  if (config != null) {
    contextPathLength=config.getServletContext().getContextPath().length();
    Enumeration<String> initParams=config.getInitParameterNames();
    while (initParams.hasMoreElements()) {
      String key=initParams.nextElement();
      String value=config.getInitParameter(key);
      if (EXCLUDES.equals(key)) {
        excludes.addAll(Arrays.asList(value.split("String_Node_Str")));
      }
 else {
        headerKeyValues.put(key,value);
      }
    }
  }
}
Program: 79740
Project: 79740
Buggy source:
/** 
 * Set HTTP Headers based on the values in the filterConfig init-parameters.  {@inheritDoc}
 */
@Override public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain filterChain) throws IOException, ServletException {
  HttpServletResponse httpServletResponse=(HttpServletResponse)servletResponse;
  HttpServletRequest httpServleRequest=(HttpServletRequest)servletRequest;
  for (  Map.Entry<String,String> entry : headerKeyValues.entrySet()) {
    httpServletResponse.addHeader(entry.getKey(),entry.getValue());
  }
  filterChain.doFilter(httpServleRequest,httpServletResponse);
}

Fixed version (ground truth):
/** 
 * Set HTTP Headers based on the values in the filterConfig init-parameters.  {@inheritDoc}
 */
@Override public void doFilter(ServletRequest servletRequest,ServletResponse servletResponse,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest httpServletRequest=(HttpServletRequest)servletRequest;
  HttpServletResponse httpServletResponse=(HttpServletResponse)servletResponse;
  if (!excludes.contains(httpServletRequest.getRequestURI().substring(contextPathLength))) {
    for (    Map.Entry<String,String> entry : headerKeyValues.entrySet()) {
      httpServletResponse.addHeader(entry.getKey(),entry.getValue());
    }
  }
  filterChain.doFilter(httpServletRequest,httpServletResponse);
}
Program: 79745
Project: 79745
Buggy source:
void updateSessionForFailover(){
  if (!isNoSession() || stateless) {
    return;
  }
  getSession().setIsISStored(true);
}

Fixed version (ground truth):
void updateSessionForFailover(){
  if (stateless || isNoSession()) {
    return;
  }
  getSession().setIsISStored(true);
}
Program: 79746
Project: 79746
Buggy source:
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (location == null) {
    location=endpoint.getLocation();
  }
  return location;
}

Fixed version (ground truth):
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (StringUtils.isBlank(location)) {
    location=endpoint.getLocation();
  }
  return location;
}
Program: 79747
Project: 79747
Buggy source:
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (location == null) {
    location=endpoint.getLocation();
  }
  return location;
}

Fixed version (ground truth):
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (StringUtils.isBlank(location)) {
    location=endpoint.getLocation();
  }
  return location;
}
Program: 79748
Project: 79748
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 79750
Project: 79750
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 79751
Project: 79751
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}
Program: 79752
Project: 79752
Buggy source:
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 * @param factor   acceleration factor
 */
public AccelerateTimeService(long initTime,int factor){
  this.initTime=initTime;
  this.factor=factor;
  this.systemTimeAtInitialization=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 */
public AccelerateTimeService(long initTime){
  this.clock=new AtomicLong(initTime);
}
Program: 79753
Project: 79753
Buggy source:
@Override public long now(){
  long deltaTimeFromInitTime=System.currentTimeMillis() - systemTimeAtInitialization;
  return deltaTimeFromInitTime * factor + initTime;
}

Fixed version (ground truth):
@Override public long now(){
  return incrementTime(INCR_TIME_MS);
}
Program: 79754
Project: 79754
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 79756
Project: 79756
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 79757
Project: 79757
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}
Program: 79758
Project: 79758
Buggy source:
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 * @param factor   acceleration factor
 */
public AccelerateTimeService(long initTime,int factor){
  this.initTime=initTime;
  this.factor=factor;
  this.systemTimeAtInitialization=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 */
public AccelerateTimeService(long initTime){
  this.clock=new AtomicLong(initTime);
}
Program: 79759
Project: 79759
Buggy source:
@Override public long now(){
  long deltaTimeFromInitTime=System.currentTimeMillis() - systemTimeAtInitialization;
  return deltaTimeFromInitTime * factor + initTime;
}

Fixed version (ground truth):
@Override public long now(){
  return incrementTime(INCR_TIME_MS);
}
Program: 79760
Project: 79760
Buggy source:
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println(TimeZone.getDefault().getDisplayName());
  System.out.println(TimeZone.getDefault().getID());
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}

Fixed version (ground truth):
@Test public void rotationInDSTDateOctober() throws Exception {
  Calendar calDSTOctober=Calendar.getInstance();
  calDSTOctober.set(Calendar.YEAR,2015);
  calDSTOctober.set(Calendar.MONTH,Calendar.OCTOBER);
  calDSTOctober.set(Calendar.DAY_OF_MONTH,26);
  calDSTOctober.set(Calendar.HOUR_OF_DAY,1);
  calDSTOctober.set(Calendar.MINUTE,58);
  calDSTOctober.set(Calendar.SECOND,0);
  calDSTOctober.set(Calendar.MILLISECOND,0);
  long fakeInitTime=calDSTOctober.getTimeInMillis();
  System.out.println("String_Node_Str" + dateFormat.format(calDSTOctober.getTime()) + "String_Node_Str");
  rotation(fakeInitTime);
}
Program: 79762
Project: 79762
Buggy source:
public void run(){
  try {
    while (System.currentTimeMillis() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    while (accelerateClock.now() - initTime < testDuration) {
      String dateInStringWithMs=dateFormatWithMs.format(new Date(accelerateClock.now()));
      debug.message("String_Node_Str" + dateInStringWithMs,null);
    }
  }
 catch (  Exception e) {
    this.ex=e;
  }
}
Program: 79763
Project: 79763
Buggy source:
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    StringBuilder bugReport=new StringBuilder();
    bugReport.append("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
    File dir=new File(debugDirectory);
    File[] files=dir.listFiles(new FileFilter(){
      @Override public boolean accept(      File pathname){
        return true;
      }
    }
);
    bugReport.append("String_Node_Str");
    for (    File file : files) {
      bugReport.append("String_Node_Str" + file.getName() + "String_Node_Str");
    }
    Assert.fail(bugReport.toString());
  }
}

Fixed version (ground truth):
/** 
 * Check the file status
 * @param isCreated true if you want to check that the file exist, false for the contrary
 * @param logName   log file name
 */
protected void checkLogFileStatus(boolean isCreated,String logName){
  String fullPath=debugDirectory + File.separator + logName;
  if (isCreated != isFileExist(logName)) {
    failAndPrintFolderStatusReport("String_Node_Str" + fullPath + "String_Node_Str"+ isCreated+ "String_Node_Str");
  }
}
Program: 79764
Project: 79764
Buggy source:
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 * @param factor   acceleration factor
 */
public AccelerateTimeService(long initTime,int factor){
  this.initTime=initTime;
  this.factor=factor;
  this.systemTimeAtInitialization=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param initTime when the time acceleration should started, in MS from epoch
 */
public AccelerateTimeService(long initTime){
  this.clock=new AtomicLong(initTime);
}
Program: 79765
Project: 79765
Buggy source:
@Override public long now(){
  long deltaTimeFromInitTime=System.currentTimeMillis() - systemTimeAtInitialization;
  return deltaTimeFromInitTime * factor + initTime;
}

Fixed version (ground truth):
@Override public long now(){
  return incrementTime(INCR_TIME_MS);
}
Program: 79766
Project: 79766
Buggy source:
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (location == null) {
    location=endpoint.getLocation();
  }
  return location;
}

Fixed version (ground truth):
private static String getResponseLocation(SingleLogoutServiceElement endpoint){
  String location=endpoint.getResponseLocation();
  if (StringUtils.isBlank(location)) {
    location=endpoint.getLocation();
  }
  return location;
}
Program: 79767
Project: 79767
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 79768
Project: 79768
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 79770
Project: 79770
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 79771
Project: 79771
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 79773
Project: 79773
Buggy source:
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.buildModuleInstanceForService(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}

Fixed version (ground truth):
/** 
 * Implements methods in <code>com.sun.identity.sm.ServiceListener</code>.
 * @param serviceName
 * @param version
 * @param orgName
 * @param groupName
 * @param serviceComponent
 * @param type
 */
public void organizationConfigChanged(String serviceName,String version,String orgName,String groupName,String serviceComponent,int type){
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str" + serviceName + "String_Node_Str"+ version+ "String_Node_Str"+ orgName+ "String_Node_Str"+ groupName+ "String_Node_Str"+ serviceComponent+ "String_Node_Str"+ type);
  }
synchronized (authLevelMap) {
    authLevelMap.remove(orgName);
  }
  if (AuthD.revisionNumber < ISAuthConstants.AUTHSERVICE_REVISION7_0 && serviceName.equals(CORE_AUTH)) {
synchronized (supportedModulesMap) {
      supportedModulesMap.remove(orgName);
    }
  }
  AMAuthenticationManager.updateModuleInstanceTable(orgName,serviceName);
  updateAuthConfiguration(serviceName,orgName,serviceComponent);
}
Program: 79774
Project: 79774
Buggy source:
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    if ((this.realm != null) && ((this.realm).length() != 0)) {
      this.realm=(this.realm).toLowerCase();
    }
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (MODULE_INSTANCE_TABLE.get(realm) == null) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructs an instance of <code>AMAuthenticationManager</code> for the specified realm to manage the authentication module instances available to this realm.
 * @param token Single sign on token of the user identity on whose behalf the operations are performed.
 * @param org The realm in which the module instance management is performed.
 * @throws AMConfigurationException if Service Management related error occurs.
 */
public AMAuthenticationManager(SSOToken token,String org) throws AMConfigurationException {
  try {
    SMSEntry.validateToken(token);
    this.token=token;
    this.realm=com.sun.identity.sm.DNMapper.orgNameToDN(org);
    orgServiceConfig=getOrgServiceConfig();
    if (orgServiceConfig == null) {
      throw new AMConfigurationException(BUNDLE_NAME,"String_Node_Str",new Object[]{realm});
    }
synchronized (AMAuthenticationManager.class) {
      if (!MODULE_INSTANCE_TABLE.containsKey(realm)) {
        buildModuleInstanceTable(token,realm);
      }
    }
  }
 catch (  SMSException e) {
    throw new AMConfigurationException(e);
  }
catch (  Exception ee) {
    String installTime=SystemProperties.get(AdminTokenAction.AMADMIN_MODE);
    if ((installTime != null) && installTime.equalsIgnoreCase("String_Node_Str")) {
      DEBUG.error("String_Node_Str",ee);
    }
  }
}
Program: 79776
Project: 79776
Buggy source:
/** 
 * Convert from a Token using the serialised JSON blob to generate the JsonValue.
 * @param token Token to be converted back to its original format.
 * @return Non null JsonValue.
 * @throws IllegalArgumentException If the object wrapped inside the Tokenwas not an instance of a Map.
 */
public JsonValue fromToken(Token token){
  if (token == null) {
    return null;
  }
  String data=blobUtils.getBlobAsString(token);
  JsonValue r;
  try {
    r=new JsonValue(serialisation.deserialise(data,Map.class));
    Set<String> keys=new HashSet<String>(r.keys());
    for (    String key : keys) {
      List<String> x=r.get(key).asList(String.class);
      Set<String> set=new HashSet<String>(x);
      r.remove(key);
      r.add(key,set);
    }
  }
 catch (  RuntimeException e) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  return r;
}

Fixed version (ground truth):
/** 
 * Convert from a Token using the serialised JSON blob to generate the JsonValue.
 * @param token Token to be converted back to its original format.
 * @return Non null JsonValue.
 * @throws IllegalArgumentException If the object wrapped inside the Tokenwas not an instance of a Map.
 */
public JsonValue fromToken(Token token){
  if (token == null) {
    return null;
  }
  String data=blobUtils.getBlobAsString(token);
  if (data == null) {
    return null;
  }
  JsonValue r;
  try {
    r=new JsonValue(serialisation.deserialise(data,Map.class));
    Set<String> keys=new HashSet<String>(r.keys());
    for (    String key : keys) {
      List<String> x=r.get(key).asList(String.class);
      Set<String> set=new HashSet<String>(x);
      r.remove(key);
      r.add(key,set);
    }
  }
 catch (  IllegalStateException e) {
    return null;
  }
  return r;
}
Program: 79777
Project: 79777
Buggy source:
/** 
 * Get the BaseURLProvider for a realm.
 * @param realm The realm.
 * @return The BaseURLProvider.
 */
public BaseURLProvider get(String realm){
  String realmDN=DNMapper.orgNameToDN(realm);
  BaseURLProvider cached=providers.get(realmDN);
  if (cached != null) {
    return cached;
  }
  return create(realmDN);
}

Fixed version (ground truth):
/** 
 * Get the BaseURLProvider for a realm.
 * @param request The Http Servlet Request.
 * @param realm The realm.
 * @return The BaseURLProvider.
 */
public BaseURLProvider get(HttpServletRequest request,String realm){
  String realmDN=DNMapper.orgNameToDN(realm);
  BaseURLProvider cached=providers.get(realmDN);
  if (cached != null) {
    return cached;
  }
  return create(request,realmDN);
}
Program: 79778
Project: 79778
Buggy source:
private synchronized BaseURLProvider create(String realmDN){
  if (!providers.containsKey(realmDN)) {
    debug.message("String_Node_Str",realmDN);
    OpenAMSettingsImpl settings=new OpenAMSettingsImpl(SERVICE_NAME,SERVICE_VERSION);
    try {
      BaseURLProvider provider;
      if (settings.hasConfig(realmDN)) {
        ProviderType providerType=ProviderType.valueOf(settings.getStringSetting(realmDN,PROVIDER_TYPE));
        provider=providerType.getProvider();
        provider.init(settings,realmDN);
        provider.setContextPath(settings.getStringSetting(realmDN,CONTEXT_PATH));
      }
 else {
        provider=new RequestValuesBaseURLProvider();
      }
      providers.put(realmDN,provider);
    }
 catch (    SMSException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
catch (    SSOException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
  }
  return providers.get(realmDN);
}

Fixed version (ground truth):
private synchronized BaseURLProvider create(HttpServletRequest request,String realmDN){
  if (!providers.containsKey(realmDN)) {
    debug.message("String_Node_Str",realmDN);
    OpenAMSettingsImpl settings=new OpenAMSettingsImpl(SERVICE_NAME,SERVICE_VERSION);
    try {
      BaseURLProvider provider;
      if (settings.hasConfig(realmDN)) {
        ProviderType providerType=ProviderType.valueOf(settings.getStringSetting(realmDN,PROVIDER_TYPE));
        provider=providerType.getProvider();
        provider.init(settings,realmDN);
        provider.setContextPath(settings.getStringSetting(realmDN,CONTEXT_PATH));
      }
 else {
        provider=new RequestValuesBaseURLProvider();
        provider.setContextPath(request.getContextPath());
      }
      providers.put(realmDN,provider);
    }
 catch (    SMSException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
catch (    SSOException e) {
      debug.error("String_Node_Str",realmDN,e);
      throw new IllegalStateException(e);
    }
  }
  return providers.get(realmDN);
}
Program: 79781
Project: 79781
Buggy source:
boolean isSuperUser(String userId){
  return sessionService.get().isSuperUser(userId);
}

Fixed version (ground truth):
protected boolean isSuperUser(String userId){
  return sessionService.get().isSuperUser(userId);
}
Program: 79782
Project: 79782
Buggy source:
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}

Fixed version (ground truth):
/** 
 * Lets through any request which is coming from a verifiable administrator.
 */
protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String userId=getUserId(context);
    if (isSuperUser(userId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + userId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}
Program: 79783
Project: 79783
Buggy source:
String getUserId(ServerContext context) throws ResourceException {
  SSOTokenContext tokenContext=context.asContext(SSOTokenContext.class);
  try {
    SSOToken token=tokenContext.getCallerSSOToken();
    return token.getProperty(Constants.UNIVERSAL_IDENTIFIER);
  }
 catch (  SSOException e) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str",e);
    }
    throw new ForbiddenException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected String getUserId(ServerContext context) throws ResourceException {
  SSOTokenContext tokenContext=context.asContext(SSOTokenContext.class);
  try {
    SSOToken token=tokenContext.getCallerSSOToken();
    return token.getProperty(Constants.UNIVERSAL_IDENTIFIER);
  }
 catch (  SSOException e) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str",e);
    }
    throw new ForbiddenException(e.getMessage(),e);
  }
}
Program: 79784
Project: 79784
Buggy source:
/** 
 * Prevents access to   {@link org.forgerock.openam.forgerockrest.cts.CoreTokenResource} unless thisREST endpoint has been explicitly enabled. If the endpoint has been explicitly enabled, it defers to {@link org.forgerock.openam.rest.authz.AdminOnlyAuthzModule} to ensure that the SSO Token belongs toa user with Administrator-level access.
 */
@Override Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  if (!enabled) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str");
    }
    return Promises.newSuccessfulPromise(AuthorizationResult.failure("String_Node_Str"));
  }
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str");
  }
  return super.authorize(context);
}

Fixed version (ground truth):
/** 
 * Prevents access to   {@link org.forgerock.openam.forgerockrest.cts.CoreTokenResource} unless thisREST endpoint has been explicitly enabled. If the endpoint has been explicitly enabled, it defers to {@link org.forgerock.openam.rest.authz.AdminOnlyAuthzModule} to ensure that the SSO Token belongs toa user with Administrator-level access.
 */
@Override protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  if (!enabled) {
    if (debug.messageEnabled()) {
      debug.message("String_Node_Str");
    }
    return Promises.newSuccessfulPromise(AuthorizationResult.failure("String_Node_Str"));
  }
  if (debug.messageEnabled()) {
    debug.message("String_Node_Str");
  }
  return super.authorize(context);
}
Program: 79785
Project: 79785
Buggy source:
private String getUserIdFromUri(ServerContext context) throws InternalServerErrorException {
  String username=context.asContext(RouterContext.class).getUriTemplateVariables().get("String_Node_Str");
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  return IdUtils.getIdentity(username,realm).getUniversalId();
}

Fixed version (ground truth):
protected String getUserIdFromUri(ServerContext context) throws InternalServerErrorException {
  String username=context.asContext(RouterContext.class).getUriTemplateVariables().get("String_Node_Str");
  String realm=context.asContext(RealmContext.class).getResolvedRealm();
  return IdUtils.getIdentity(username,realm).getUniversalId();
}
Program: 79786
Project: 79786
Buggy source:
/** 
 * Authorizes caller if they are either a super user or they are making a request to a resource they "own", i.e. demo making a call to /json/users/demo/uma/resourceset.
 * @param context The request context.
 * @return The authorization result.
 */
@Override Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String loggedInUserId=getUserId(context);
    if (isSuperUser(loggedInUserId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else     if (loggedInUserId.equalsIgnoreCase(getUserIdFromUri(context))) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.warningEnabled()) {
        debug.warning("String_Node_Str" + loggedInUserId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str" + loggedInUserId + "String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}

Fixed version (ground truth):
/** 
 * Authorizes caller if they are either a super user or they are making a request to a resource they "own", i.e. demo making a call to /json/users/demo/uma/resourceset.
 * @param context The request context.
 * @return The authorization result.
 */
@Override protected Promise<AuthorizationResult,ResourceException> authorize(ServerContext context){
  try {
    String loggedInUserId=getUserId(context);
    if (isSuperUser(loggedInUserId)) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else     if (loggedInUserId.equalsIgnoreCase(getUserIdFromUri(context))) {
      if (debug.messageEnabled()) {
        debug.message("String_Node_Str" + loggedInUserId + "String_Node_Str");
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessPermitted());
    }
 else {
      if (debug.warningEnabled()) {
        debug.warning("String_Node_Str" + loggedInUserId);
      }
      return Promises.newSuccessfulPromise(AuthorizationResult.accessDenied("String_Node_Str" + loggedInUserId + "String_Node_Str"));
    }
  }
 catch (  ResourceException e) {
    return Promises.newFailedPromise(e);
  }
}
Program: 79787
Project: 79787
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 79790
Project: 79790
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 79791
Project: 79791
Buggy source:
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(String prefix,String msg,Throwable th) throws IOException ;

Fixed version (ground truth):
/** 
 * Write message into file
 * @param prefix Message prefix
 * @param msg    Message to be recorded.
 * @param th     the optional <code>java.lang.Throwable</code> which ifpresent will be used to record the stack trace.
 * @throws IOException
 */
public void writeIt(StringBuilder prefix,String msg,Throwable th) throws IOException ;
Program: 79792
Project: 79792
Buggy source:
/** 
 * Compute the final log file name (prefix and suffix)
 * @param fileName the log file name base
 * @return the complete log file name
 */
private String wrapFilename(String fileName){
  StringBuilder newFileName=new StringBuilder();
  if (debugPrefix != null) {
    newFileName.append(debugPrefix);
  }
  newFileName.append(fileName);
synchronized (suffixDateFormat) {
    if (suffixDateFormat != null && rotationInterval > 0) {
      newFileName.append(suffixDateFormat.format(new Date(clock.now())));
    }
  }
  return newFileName.toString();
}

Fixed version (ground truth):
/** 
 * Compute the final log file name (prefix and suffix)
 * @param fileName the log file name base
 * @return the complete log file name
 */
private String wrapFilename(String fileName){
  StringBuilder newFileName=new StringBuilder();
  if (debugPrefix != null) {
    newFileName.append(debugPrefix);
  }
  newFileName.append(fileName);
  if (suffixDateFormat != null && rotationInterval > 0) {
synchronized (suffixDateFormat) {
      newFileName.append(suffixDateFormat.format(new Date(clock.now())));
    }
  }
  return newFileName.toString();
}