nus-yam/ex-repair huggingface dataset:
Program: 29441
Project: 29441
Buggy source:
public final void addNotificationListener(final ObjectName objectName,final ObjectName objectName1,final NotificationFilter notificationFilter,final Object obj) throws InstanceNotFoundException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).addNotificationListener(objectName,objectName1,notificationFilter,obj);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().addNotificationListener(objectName,objectName1,notificationFilter,obj);
 else       getInstanceConnection(svr).addNotificationListener(objectName,objectName1,notificationFilter,obj);
    }
  }
 catch (  IOException ioex) {
    throw new InstanceNotFoundException(ioex.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public final void addNotificationListener(final ObjectName objectName,final ObjectName objectName1,final NotificationFilter notificationFilter,final Object obj) throws InstanceNotFoundException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).addNotificationListener(objectName,objectName1,notificationFilter,obj);
      return;
    }
    for (    String svr : result.getInstances()) {
      if ("String_Node_Str".equals(svr))       getDelegateMBeanServer().addNotificationListener(objectName,objectName1,notificationFilter,obj);
 else       getInstanceConnection(svr).addNotificationListener(objectName,objectName1,notificationFilter,obj);
    }
  }
 catch (  IOException ioex) {
    throw new InstanceNotFoundException(ioex.getLocalizedMessage());
  }
}
Program: 29442
Project: 29442
Buggy source:
private ReplicationInfo getInstance(final ObjectName o) throws InstanceNotFoundException {
  return getTargets(o);
}

Fixed version (ground truth):
private DynamicInterceptor.ReplicationInfo getInstance(final ObjectName o) throws InstanceNotFoundException {
  return getTargets(o);
}
Program: 29443
Project: 29443
Buggy source:
public final void removeNotificationListener(final ObjectName objectName,final ObjectName objectName1,final NotificationFilter notificationFilter,final Object obj) throws InstanceNotFoundException, ListenerNotFoundException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).removeNotificationListener(objectName,objectName1,notificationFilter,obj);
      return;
    }
    for (    String svr : result.getInstances()) {
      if (svr.equals("String_Node_Str"))       getDelegateMBeanServer().removeNotificationListener(objectName,objectName1,notificationFilter,obj);
 else       getInstanceConnection(svr).removeNotificationListener(objectName,objectName1,notificationFilter,obj);
    }
  }
 catch (  IOException ioex) {
    throw new InstanceNotFoundException(ioex.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public final void removeNotificationListener(final ObjectName objectName,final ObjectName objectName1,final NotificationFilter notificationFilter,final Object obj) throws InstanceNotFoundException, ListenerNotFoundException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance()) {
      getInstanceConnection(result.getInstances().get(0)).removeNotificationListener(objectName,objectName1,notificationFilter,obj);
      return;
    }
    for (    String svr : result.getInstances()) {
      if (svr.equals("String_Node_Str"))       getDelegateMBeanServer().removeNotificationListener(objectName,objectName1,notificationFilter,obj);
 else       getInstanceConnection(svr).removeNotificationListener(objectName,objectName1,notificationFilter,obj);
    }
  }
 catch (  IOException ioex) {
    throw new InstanceNotFoundException(ioex.getLocalizedMessage());
  }
}
Program: 29444
Project: 29444
Buggy source:
public final MBeanInfo getMBeanInfo(final ObjectName objectName) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).getMBeanInfo(objectName);
 else     return getDelegateMBeanServer().getMBeanInfo(objectName);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}

Fixed version (ground truth):
public final MBeanInfo getMBeanInfo(final ObjectName objectName) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
  if (objectName == null)   throw new InstanceNotFoundException();
  DynamicInterceptor.ReplicationInfo result=getInstance(objectName);
  try {
    if (result.isTargetAnInstance())     return getInstanceConnection(result.getInstances().get(0)).getMBeanInfo(objectName);
 else     return getDelegateMBeanServer().getMBeanInfo(objectName);
  }
 catch (  IOException ioex) {
    throw new ReflectionException(ioex);
  }
}
Program: 29445
Project: 29445
Buggy source:
/** 
 * Get list of all supplemental commands, map it to various commands and cache this list
 */
private Map<String,List<ServiceHandle<?>>> getSupplementalCommandsList(){
  if (supplementalCommandsMap != null)   return supplementalCommandsMap;
synchronized (this) {
    if (supplementalCommandsMap != null)     return supplementalCommandsMap;
    supplementalCommandsMap=new ConcurrentHashMap<String,List<ServiceHandle<?>>>();
    List<ServiceHandle<?>> supplementals=habitat.getAllServiceHandles(Supplemental.class);
    for (    ServiceHandle<?> handle : supplementals) {
      ActiveDescriptor<?> inh=handle.getActiveDescriptor();
      String commandName=getOne("String_Node_Str",inh.getMetadata());
      if (supplementalCommandsMap.containsKey(commandName)) {
        supplementalCommandsMap.get(commandName).add(handle);
      }
 else {
        ArrayList<ServiceHandle<?>> inhList=new ArrayList<ServiceHandle<?>>();
        inhList.add(handle);
        supplementalCommandsMap.put(commandName,inhList);
      }
    }
  }
  return supplementalCommandsMap;
}

Fixed version (ground truth):
/** 
 * Get list of all supplemental commands, map it to various commands and cache this list
 */
private synchronized Map<String,List<ServiceHandle<?>>> getSupplementalCommandsList(){
  if (supplementalCommandsMap != null)   return supplementalCommandsMap;
  supplementalCommandsMap=new ConcurrentHashMap<String,List<ServiceHandle<?>>>();
  List<ServiceHandle<?>> supplementals=habitat.getAllServiceHandles(Supplemental.class);
  for (  ServiceHandle<?> handle : supplementals) {
    ActiveDescriptor<?> inh=handle.getActiveDescriptor();
    String commandName=getOne("String_Node_Str",inh.getMetadata());
    if (supplementalCommandsMap.containsKey(commandName)) {
      supplementalCommandsMap.get(commandName).add(handle);
    }
 else {
      ArrayList<ServiceHandle<?>> inhList=new ArrayList<ServiceHandle<?>>();
      inhList.add(handle);
      supplementalCommandsMap.put(commandName,inhList);
    }
  }
  return supplementalCommandsMap;
}
Program: 29446
Project: 29446
Buggy source:
public List<Map.Entry> applyOverrideRules(List<Map.Entry> nodes){
  HashMap<String,Map.Entry> store=new HashMap<String,Map.Entry>();
  for (int i=0; i < nodes.size(); i++) {
    Map.Entry<Dom,String> currentNode=nodes.get(i);
    Map.Entry<Dom,String> storedNode=store.get(currentNode.getValue());
    if (storedNode == null) {
      store.put(currentNode.getValue(),currentNode);
      continue;
    }
    int storedNodePrecedenceLevel=getPrecedenceLevel(storedNode.getKey());
    int currNodePrecedenceLevel=getPrecedenceLevel(currentNode.getKey());
    if (storedNodePrecedenceLevel < currNodePrecedenceLevel)     store.put(currentNode.getValue(),currentNode);
  }
  List<Map.Entry> finalList=new ArrayList<Map.Entry>();
  for (  String key : store.keySet()) {
    finalList.add(store.get(key));
  }
  store.clear();
  return finalList;
}

Fixed version (ground truth):
public List<Map.Entry> applyOverrideRules(List<Map.Entry> nodes){
  HashMap<String,Map.Entry> store=new HashMap<String,Map.Entry>();
  for (int i=0; i < nodes.size(); i++) {
    Map.Entry<Dom,String> currentNode=nodes.get(i);
    Map.Entry<Dom,String> storedNode=store.get(currentNode.getValue());
    if (storedNode == null) {
      store.put(currentNode.getValue(),currentNode);
      continue;
    }
    int storedNodePrecedenceLevel=getPrecedenceLevel(storedNode.getKey());
    int currNodePrecedenceLevel=getPrecedenceLevel(currentNode.getKey());
    if (storedNodePrecedenceLevel < currNodePrecedenceLevel)     store.put(currentNode.getValue(),currentNode);
  }
  List<Map.Entry> finalList=new ArrayList<Map.Entry>();
  finalList.addAll(store.values());
  store.clear();
  return finalList;
}
Program: 29448
Project: 29448
Buggy source:
private InjectionResolver<Param> getInjector(AdminCommand command,ParameterMap parameters,MultiMap<String,File> map){
  CommandModel model;
  try {
    CommandModelProvider c=CommandModelProvider.class.cast(command);
    model=c.getModel();
  }
 catch (  ClassCastException e) {
    model=new CommandModelImpl(command.getClass());
  }
  return new MapInjectionResolver(model,parameters,map);
}

Fixed version (ground truth):
private InjectionResolver<Param> getInjector(AdminCommand command,ParameterMap parameters,MultiMap<String,File> map){
  CommandModel model=command instanceof CommandModelProvider ? CommandModelProvider.class.cast(command).getModel() : new CommandModelImpl(command.getClass());
  return new MapInjectionResolver(model,parameters,map);
}
Program: 29449
Project: 29449
Buggy source:
/** 
 * Get list of all supplemental commands, map it to various commands and cache this list
 */
private Map<String,List<ServiceHandle<?>>> getSupplementalCommandsList(){
  if (supplementalCommandsMap != null)   return supplementalCommandsMap;
synchronized (this) {
    if (supplementalCommandsMap != null)     return supplementalCommandsMap;
    supplementalCommandsMap=new ConcurrentHashMap<String,List<ServiceHandle<?>>>();
    List<ServiceHandle<?>> supplementals=habitat.getAllServiceHandles(Supplemental.class);
    for (    ServiceHandle<?> handle : supplementals) {
      ActiveDescriptor<?> inh=handle.getActiveDescriptor();
      String commandName=getOne("String_Node_Str",inh.getMetadata());
      if (supplementalCommandsMap.containsKey(commandName)) {
        supplementalCommandsMap.get(commandName).add(handle);
      }
 else {
        ArrayList<ServiceHandle<?>> inhList=new ArrayList<ServiceHandle<?>>();
        inhList.add(handle);
        supplementalCommandsMap.put(commandName,inhList);
      }
    }
  }
  return supplementalCommandsMap;
}

Fixed version (ground truth):
/** 
 * Get list of all supplemental commands, map it to various commands and cache this list
 */
private synchronized Map<String,List<ServiceHandle<?>>> getSupplementalCommandsList(){
  if (supplementalCommandsMap != null)   return supplementalCommandsMap;
  supplementalCommandsMap=new ConcurrentHashMap<String,List<ServiceHandle<?>>>();
  List<ServiceHandle<?>> supplementals=habitat.getAllServiceHandles(Supplemental.class);
  for (  ServiceHandle<?> handle : supplementals) {
    ActiveDescriptor<?> inh=handle.getActiveDescriptor();
    String commandName=getOne("String_Node_Str",inh.getMetadata());
    if (supplementalCommandsMap.containsKey(commandName)) {
      supplementalCommandsMap.get(commandName).add(handle);
    }
 else {
      ArrayList<ServiceHandle<?>> inhList=new ArrayList<ServiceHandle<?>>();
      inhList.add(handle);
      supplementalCommandsMap.put(commandName,inhList);
    }
  }
  return supplementalCommandsMap;
}
Program: 29450
Project: 29450
Buggy source:
public List<Map.Entry> applyOverrideRules(List<Map.Entry> nodes){
  HashMap<String,Map.Entry> store=new HashMap<String,Map.Entry>();
  for (int i=0; i < nodes.size(); i++) {
    Map.Entry<Dom,String> currentNode=nodes.get(i);
    Map.Entry<Dom,String> storedNode=store.get(currentNode.getValue());
    if (storedNode == null) {
      store.put(currentNode.getValue(),currentNode);
      continue;
    }
    int storedNodePrecedenceLevel=getPrecedenceLevel(storedNode.getKey());
    int currNodePrecedenceLevel=getPrecedenceLevel(currentNode.getKey());
    if (storedNodePrecedenceLevel < currNodePrecedenceLevel)     store.put(currentNode.getValue(),currentNode);
  }
  List<Map.Entry> finalList=new ArrayList<Map.Entry>();
  for (  String key : store.keySet()) {
    finalList.add(store.get(key));
  }
  store.clear();
  return finalList;
}

Fixed version (ground truth):
public List<Map.Entry> applyOverrideRules(List<Map.Entry> nodes){
  HashMap<String,Map.Entry> store=new HashMap<String,Map.Entry>();
  for (int i=0; i < nodes.size(); i++) {
    Map.Entry<Dom,String> currentNode=nodes.get(i);
    Map.Entry<Dom,String> storedNode=store.get(currentNode.getValue());
    if (storedNode == null) {
      store.put(currentNode.getValue(),currentNode);
      continue;
    }
    int storedNodePrecedenceLevel=getPrecedenceLevel(storedNode.getKey());
    int currNodePrecedenceLevel=getPrecedenceLevel(currentNode.getKey());
    if (storedNodePrecedenceLevel < currNodePrecedenceLevel)     store.put(currentNode.getValue(),currentNode);
  }
  List<Map.Entry> finalList=new ArrayList<Map.Entry>();
  finalList.addAll(store.entrySet());
  store.clear();
  return finalList;
}
Program: 29451
Project: 29451
Buggy source:
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  Properties p=System.getProperties();
  System.out.println("String_Node_Str");
  LocalServiceRegistry reg=LocalServiceRegistry.getLocalRegistry();
}

Fixed version (ground truth):
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  System.out.println("String_Node_Str");
}
Program: 29452
Project: 29452
Buggy source:
public void showServiceTagAttributes(){
  Properties data=System.getProperties();
  showAttribute(ServiceTag.PRODUCT_NAME);
  showAttribute(ServiceTag.PRODUCT_VERSION);
  showAttribute(ServiceTag.PRODUCT_URN);
  showAttribute(ServiceTag.PRODUCT_PARENT);
  showAttribute(ServiceTag.PRODUCT_PARENT_URN);
  showAttribute(ServiceTag.PRODUCT_DEFINED_INST_ID);
  showAttribute(ServiceTag.CONTAINER);
  showAttribute(ServiceTag.SOURCE);
  showAttribute(ServiceTag.INSTANCE_URN);
  showAttribute(ServiceTag.STATUS);
  showAttribute(ServiceTag.REGISTRATION_STATUS);
  showAttribute(ServiceTag.SERVICE_TAG);
}

Fixed version (ground truth):
public void showServiceTagAttributes(){
  showAttribute(ServiceTag.PRODUCT_NAME);
  showAttribute(ServiceTag.PRODUCT_VERSION);
  showAttribute(ServiceTag.PRODUCT_URN);
  showAttribute(ServiceTag.PRODUCT_PARENT);
  showAttribute(ServiceTag.PRODUCT_PARENT_URN);
  showAttribute(ServiceTag.PRODUCT_DEFINED_INST_ID);
  showAttribute(ServiceTag.CONTAINER);
  showAttribute(ServiceTag.SOURCE);
  showAttribute(ServiceTag.INSTANCE_URN);
  showAttribute(ServiceTag.STATUS);
  showAttribute(ServiceTag.REGISTRATION_STATUS);
  showAttribute(ServiceTag.SERVICE_TAG);
}
Program: 29453
Project: 29453
Buggy source:
/** 
 * Restart of the application server : All running services are stopped. LookupManager is flushed. Client code that started us should notice the special return value and restart us.
 */
protected final void doExecute(AdminCommandContext context){
  try {
    if (registry == null)     throw new NullPointerException(new LocalStringsImpl(getClass()).get("String_Node_Str","String_Node_Str"));
    init(context);
    if (!verbose) {
      reincarnate();
    }
    GlassFish gfKernel=glassfishProvider.get();
    if (gfKernel != null) {
      gfKernel.stop();
    }
  }
 catch (  Exception e) {
    context.getLogger().severe(strings.get("String_Node_Str",e));
  }
  int ret=RESTART_NORMAL;
  if (debug != null)   ret=debug ? RESTART_DEBUG_ON : RESTART_DEBUG_OFF;
  System.exit(ret);
}

Fixed version (ground truth):
/** 
 * Restart of the application server : All running services are stopped. LookupManager is flushed. Client code that started us should notice the special return value and restart us.
 */
protected final void doExecute(AdminCommandContext context){
  try {
    if (registry == null)     throw new NullPointerException(new LocalStringsImpl(getClass()).get("String_Node_Str","String_Node_Str"));
    init(context);
    GlassFish gfKernel=glassfishProvider.get();
    while (gfKernel == null) {
      Thread.sleep(1000);
      gfKernel=glassfishProvider.get();
    }
    if (!verbose) {
      reincarnate();
    }
    gfKernel.stop();
  }
 catch (  Exception e) {
    context.getLogger().severe(strings.get("String_Node_Str",e));
  }
  int ret=RESTART_NORMAL;
  if (debug != null)   ret=debug ? RESTART_DEBUG_ON : RESTART_DEBUG_OFF;
  System.exit(ret);
}
Program: 29454
Project: 29454
Buggy source:
/** 
 * Shutdown of the server :  All running services are stopped.  LookupManager is flushed.
 */
protected final void doExecute(ServiceLocator habitat,ServerEnvironment env,Logger logger,boolean force){
  try {
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
    GlassFish gfKernel=habitat.getService(GlassFish.class);
    if (gfKernel != null) {
      gfKernel.stop();
    }
  }
 catch (  Throwable t) {
  }
  if (force)   System.exit(0);
 else   deletePidFile(env);
}

Fixed version (ground truth):
/** 
 * Shutdown of the server :  All running services are stopped.  LookupManager is flushed.
 */
protected final void doExecute(ServiceLocator habitat,ServerEnvironment env,Logger logger,boolean force){
  try {
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str"));
    GlassFish gfKernel=habitat.getService(GlassFish.class);
    while (gfKernel == null) {
      Thread.sleep(1000);
      gfKernel=habitat.getService(GlassFish.class);
    }
    if (gfKernel != null) {
      gfKernel.stop();
    }
  }
 catch (  Throwable t) {
  }
  if (force)   System.exit(0);
 else   deletePidFile(env);
}
Program: 29455
Project: 29455
Buggy source:
/** 
 * Gets the property name of the method passed. It strips the first three  charaters (size of "set") of the method name and converts the first  character (for the string after stripping) to upper case and returns  that string.
 */
private String getPropName(Method method){
  if (method == null) {
    return null;
  }
  String methodName=method.getName();
  int length="String_Node_Str".length();
  String retValue=methodName.substring(length,length + 1).toUpperCase() + methodName.substring(length + 1);
  return retValue;
}

Fixed version (ground truth):
/** 
 * Gets the property name of the method passed. It strips the first three  charaters (size of "set") of the method name and converts the first  character (for the string after stripping) to upper case and returns  that string.
 */
private String getPropName(Method method){
  if (method == null) {
    return null;
  }
  String methodName=method.getName();
  int length="String_Node_Str".length();
  String retValue=methodName.substring(length,length + 1).toUpperCase(Locale.getDefault()) + methodName.substring(length + 1);
  return retValue;
}
Program: 29456
Project: 29456
Buggy source:
public static final ConnectorTimerProxy getProxy(){
  if (connectorTimer == null) {
synchronized (ConnectorTimerProxy.class) {
      if (connectorTimer == null) {
        connectorTimer=new ConnectorTimerProxy(true);
      }
    }
  }
  return connectorTimer;
}

Fixed version (ground truth):
public static final ConnectorTimerProxy getProxy(){
synchronized (ConnectorTimerProxy.class) {
    if (connectorTimer == null) {
      connectorTimer=new ConnectorTimerProxy(true);
    }
  }
  return connectorTimer;
}
Program: 29457
Project: 29457
Buggy source:
/** 
 * Handle any exception occured during scheduling timer.  In case of unchecked exceptions, the timer is recreated to be used  by the subsequent requests for scheduling.
 * @param ex exception that was caught
 */
private void handleTimerException(Exception ex){
  _logger.log(Level.WARNING,"String_Node_Str",ex.getMessage());
  _logger.info("String_Node_Str");
  timer=null;
  timer=getTimer();
}

Fixed version (ground truth):
/** 
 * Handle any exception occured during scheduling timer.  In case of unchecked exceptions, the timer is recreated to be used  by the subsequent requests for scheduling.
 * @param ex exception that was caught
 */
private void handleTimerException(Exception ex){
  _logger.log(Level.WARNING,"String_Node_Str",ex.getMessage());
  _logger.info("String_Node_Str");
  timerException=true;
  timer=getTimer();
}
Program: 29458
Project: 29458
Buggy source:
private Timer getTimer(){
synchronized (getTimerLock) {
    if (timer == null) {
      ClassLoader loader=null;
      try {
        loader=Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(ConnectorRuntime.getRuntime().getConnectorClassLoader());
        timer=new Timer("String_Node_Str",true);
      }
  finally {
        Thread.currentThread().setContextClassLoader(loader);
      }
    }
  }
  return timer;
}

Fixed version (ground truth):
private Timer getTimer(){
synchronized (getTimerLock) {
    if (timer == null || timerException) {
      ClassLoader loader=null;
      try {
        loader=Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(ConnectorRuntime.getRuntime().getConnectorClassLoader());
        timer=new Timer("String_Node_Str",true);
      }
  finally {
        Thread.currentThread().setContextClassLoader(loader);
        timerException=false;
      }
    }
  }
  return timer;
}
Program: 29459
Project: 29459
Buggy source:
protected void performLazyEnlistment() throws SQLException {
  try {
    this.lazyEnlistCm_.lazyEnlist(mc);
  }
 catch (  ResourceException re) {
    String msg=sm.getString("String_Node_Str",re.getMessage() + "String_Node_Str");
    SQLException sqle=new SQLException(msg);
    sqle.initCause(re);
    throw sqle;
  }
}

Fixed version (ground truth):
protected void performLazyEnlistment() throws SQLException {
  try {
    if (lazyEnlistCm_ != null) {
      lazyEnlistCm_.lazyEnlist(mc);
    }
  }
 catch (  ResourceException re) {
    String msg=sm.getString("String_Node_Str",re.getMessage() + "String_Node_Str");
    SQLException sqle=new SQLException(msg);
    sqle.initCause(re);
    throw sqle;
  }
}
Program: 29460
Project: 29460
Buggy source:
protected void performLazyAssociation() throws SQLException {
  if (mc == null) {
    try {
      this.lazyAssocCm_.associateConnection(this,mcf_,cxReqInfo_);
    }
 catch (    ResourceException re) {
      String msg=sm.getString("String_Node_Str",re.getMessage() + "String_Node_Str");
      SQLException sqle=new SQLException(msg);
      sqle.initCause(re);
      throw sqle;
    }
  }
}

Fixed version (ground truth):
protected void performLazyAssociation() throws SQLException {
  if (mc == null) {
    try {
      if (lazyAssocCm_ != null) {
        lazyAssocCm_.associateConnection(this,mcf_,cxReqInfo_);
      }
    }
 catch (    ResourceException re) {
      String msg=sm.getString("String_Node_Str",re.getMessage() + "String_Node_Str");
      SQLException sqle=new SQLException(msg);
      sqle.initCause(re);
      throw sqle;
    }
  }
}
Program: 29461
Project: 29461
Buggy source:
private void registerDSDReferredByApplication(String appName,DataSourceDefinitionDescriptor dsd){
  if (!dsd.isDeployed()) {
    DataSourceDefinitionProxy proxy=dataSourceDefinitionProxyProvider.get();
    ResourceNamingService resourceNamingService=resourceNamingServiceProvider.get();
    proxy.setDescriptor(dsd);
    String moduleName=null;
    if (dsd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      dsd.setResourceId(appName);
    }
    if (dsd.getName().startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX) || dsd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      ResourceInfo resourceInfo=new ResourceInfo(dsd.getName(),appName,moduleName);
      try {
        resourceNamingService.publishObject(resourceInfo,proxy,true);
        dsd.setDeployed(true);
      }
 catch (      NamingException e) {
        Object params[]=new Object[]{appName,dsd.getName(),e};
        _logger.log(Level.WARNING,"String_Node_Str",params);
      }
    }
  }
}

Fixed version (ground truth):
private void registerDSDReferredByApplication(String appName,DataSourceDefinitionDescriptor dsd){
  if (!dsd.isDeployed()) {
    DataSourceDefinitionProxy proxy=dataSourceDefinitionProxyProvider.get();
    ResourceNamingService resourceNamingService=resourceNamingServiceProvider.get();
    proxy.setDescriptor(dsd);
    String dsdName=dsd.getName();
    if (dsdName.startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      dsd.setResourceId(appName);
    }
    if (dsdName.startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX) || dsdName.startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
      ResourceInfo resourceInfo=new ResourceInfo(dsdName,appName,null);
      try {
        resourceNamingService.publishObject(resourceInfo,proxy,true);
        dsd.setDeployed(true);
      }
 catch (      NamingException e) {
        Object params[]=new Object[]{appName,dsdName,e};
        _logger.log(Level.WARNING,"String_Node_Str",params);
      }
    }
  }
}
Program: 29462
Project: 29462
Buggy source:
@ManagedAttribute(id="String_Node_Str") public CountStatistic getNumPotentialConnLeakCount(){
  return numPotentialConnLeak.getStatistic();
}

Fixed version (ground truth):
/** 
 * When a connection leak is observed, the monitoring statistics are displayed to the server.log. This method helps in segregating the statistics based on LOW/HIGH monitoring levels and displaying them.
 * @param poolName
 * @param stackTrace
 */
@ManagedAttribute(id="String_Node_Str") public CountStatistic getNumPotentialConnLeakCount(){
  return numPotentialConnLeak.getStatistic();
}
Program: 29464
Project: 29464
Buggy source:
private void doInclude(ServletRequest request,ServletResponse response) throws ServletException, IOException {
  State state=new State(request,response,DispatcherType.INCLUDE);
  wrapResponse(state);
  if (name != null) {
    ApplicationHttpRequest wrequest=wrapRequest(state);
    wrequest.setAttribute(Globals.NAMED_DISPATCHER_ATTR,name);
    if (servletPath != null)     wrequest.setServletPath(servletPath);
    wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,getCombinedPath());
    try {
      invoke(state.outerRequest,state.outerResponse,state);
    }
  finally {
      wrequest.recycle();
      unwrapRequest(state);
      unwrapResponse(state);
    }
  }
 else {
    ApplicationHttpRequest wrequest=wrapRequest(state);
    wrequest.initSpecialAttributes(requestURI,context.getPath(),servletPath,pathInfo,queryString);
    wrequest.setQueryParams(queryString);
    wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,getCombinedPath());
    try {
      invoke(state.outerRequest,state.outerResponse,state);
    }
  finally {
      wrequest.recycle();
      unwrapRequest(state);
      unwrapResponse(state);
    }
  }
}

Fixed version (ground truth):
private void doInclude(ServletRequest request,ServletResponse response) throws ServletException, IOException {
  State state=new State(request,response,DispatcherType.INCLUDE);
  wrapResponse(state);
  if (name != null) {
    ApplicationHttpRequest wrequest=(ApplicationHttpRequest)wrapRequest(state);
    wrequest.setAttribute(Globals.NAMED_DISPATCHER_ATTR,name);
    if (servletPath != null)     wrequest.setServletPath(servletPath);
    wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,getCombinedPath());
    try {
      invoke(state.outerRequest,state.outerResponse,state);
    }
  finally {
      recycleRequestWrapper(state);
      unwrapRequest(state);
      unwrapResponse(state);
    }
  }
 else {
    ApplicationHttpRequest wrequest=(ApplicationHttpRequest)wrapRequest(state);
    wrequest.initSpecialAttributes(requestURI,context.getPath(),servletPath,pathInfo,queryString);
    wrequest.setQueryParams(queryString);
    wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,getCombinedPath());
    try {
      invoke(state.outerRequest,state.outerResponse,state);
    }
  finally {
      recycleRequestWrapper(state);
      unwrapRequest(state);
      unwrapResponse(state);
    }
  }
}
Program: 29467
Project: 29467
Buggy source:
/** 
 * Create and return a response wrapper that has been inserted in the appropriate spot in the response chain.
 */
private ServletResponse wrapResponse(State state){
  ServletResponse previous=null;
  ServletResponse current=state.outerResponse;
  while (current != null) {
    if (!(current instanceof ServletResponseWrapper))     break;
    if (current instanceof ApplicationHttpResponse)     break;
    if (current instanceof ApplicationResponse)     break;
    if (current instanceof org.apache.catalina.Response)     break;
    previous=current;
    current=((ServletResponseWrapper)current).getResponse();
  }
  ServletResponse wrapper=null;
  if ((current instanceof ApplicationHttpResponse) || (current instanceof HttpResponse) || (current instanceof HttpServletResponse))   wrapper=new ApplicationHttpResponse((HttpServletResponse)current,DispatcherType.INCLUDE == state.dispatcherType);
 else   wrapper=new ApplicationResponse(current,DispatcherType.INCLUDE == state.dispatcherType);
  if (previous == null)   state.outerResponse=wrapper;
 else   ((ServletResponseWrapper)previous).setResponse(wrapper);
  state.wrapResponse=wrapper;
  return (wrapper);
}

Fixed version (ground truth):
/** 
 * Create and return a response wrapper that has been inserted in the appropriate spot in the response chain.
 */
private ServletResponse wrapResponse(State state){
  ServletResponse previous=null;
  ServletResponse current=state.outerResponse;
  while (current != null) {
    if (state.hresponse == null && (current instanceof HttpServletResponse)) {
      state.hresponse=(HttpServletResponse)current;
      if (DispatcherType.INCLUDE != state.dispatcherType)       return null;
    }
    if (!(current instanceof ServletResponseWrapper))     break;
    if (current instanceof ApplicationHttpResponse)     break;
    if (current instanceof ApplicationResponse)     break;
    previous=current;
    current=((ServletResponseWrapper)current).getResponse();
  }
  ServletResponse wrapper=null;
  if ((current instanceof ApplicationHttpResponse) || (current instanceof HttpResponse) || (current instanceof HttpServletResponse))   wrapper=new ApplicationHttpResponse((HttpServletResponse)current,DispatcherType.INCLUDE == state.dispatcherType);
 else   wrapper=new ApplicationResponse(current,DispatcherType.INCLUDE == state.dispatcherType);
  if (previous == null)   state.outerResponse=wrapper;
 else   ((ServletResponseWrapper)previous).setResponse(wrapper);
  state.wrapResponse=wrapper;
  return (wrapper);
}
Program: 29468
Project: 29468
Buggy source:
/** 
 * Create and return a request wrapper that has been inserted in the appropriate spot in the request chain.
 */
private ApplicationHttpRequest wrapRequest(State state){
  ServletRequest previous=null;
  ServletRequest current=state.outerRequest;
  while (current != null) {
    if ("String_Node_Str".equals(current.getClass().getName())) {
      break;
    }
    if (!(current instanceof ServletRequestWrapper)) {
      break;
    }
    if (current instanceof ApplicationHttpRequest) {
      break;
    }
    previous=current;
    current=((ServletRequestWrapper)current).getRequest();
  }
  HttpServletRequest hcurrent=(HttpServletRequest)current;
  boolean crossContext=!(context.getPath().equals(hcurrent.getContextPath()));
  crossContextFlag=Boolean.valueOf(crossContext);
  ApplicationHttpRequest wrapper=new ApplicationHttpRequest(hcurrent,context,crossContext,state.dispatcherType);
  if (previous == null) {
    state.outerRequest=wrapper;
  }
 else {
    ((ServletRequestWrapper)previous).setRequest(wrapper);
  }
  state.wrapRequest=wrapper;
  return wrapper;
}

Fixed version (ground truth):
/** 
 * Create and return a request wrapper that has been inserted in the appropriate spot in the request chain.
 */
private ServletRequest wrapRequest(State state){
  ServletRequest previous=null;
  ServletRequest current=state.outerRequest;
  while (current != null) {
    if (state.hrequest == null && (current instanceof HttpServletRequest)) {
      state.hrequest=(HttpServletRequest)current;
    }
    if ("String_Node_Str".equals(current.getClass().getName())) {
      break;
    }
    if (!(current instanceof ServletRequestWrapper)) {
      break;
    }
    if (current instanceof ApplicationHttpRequest) {
      break;
    }
    if (current instanceof ApplicationRequest) {
      break;
    }
    previous=current;
    current=((ServletRequestWrapper)current).getRequest();
  }
  ServletRequest wrapper=null;
  if ((current instanceof ApplicationHttpRequest) || (current instanceof Request) || (current instanceof HttpServletRequest)) {
    HttpServletRequest hcurrent=(HttpServletRequest)current;
    boolean crossContext=false;
    if ((state.outerRequest instanceof ApplicationHttpRequest) || (state.outerRequest instanceof Request) || (state.outerRequest instanceof HttpServletRequest)) {
      HttpServletRequest houterRequest=(HttpServletRequest)state.outerRequest;
      Object contextPath=houterRequest.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH);
      if (contextPath == null) {
        contextPath=houterRequest.getContextPath();
      }
      crossContext=!(context.getPath().equals(contextPath));
    }
    crossContextFlag=Boolean.valueOf(crossContext);
    wrapper=new ApplicationHttpRequest(hcurrent,context,crossContext,state.dispatcherType);
  }
 else {
    wrapper=new ApplicationRequest(current);
  }
  if (previous == null) {
    state.outerRequest=wrapper;
  }
 else {
    ((ServletRequestWrapper)previous).setRequest(wrapper);
  }
  state.wrapRequest=wrapper;
  return wrapper;
}
Program: 29469
Project: 29469
Buggy source:
/** 
 * Get a target bundle descriptor based on an input bundle descriptor and a relative uri from the perspective of the input bundle descriptor.
 * @param origin            bundle descriptor within this application
 * @param relativeTargetUri relative uri from the given bundle descriptorto another bundle within the application.
 * @return target BundleDescriptor or null if not found.
 */
public BundleDescriptor getRelativeBundle(BundleDescriptor origin,String relativeTargetUri){
  String targetBundleUri=getTargetUri(origin,relativeTargetUri);
  BundleDescriptor targetBundle=null;
  if (targetBundleUri != null) {
    Descriptor module=getModuleByUri(targetBundleUri);
    targetBundle=(module instanceof BundleDescriptor) ? (BundleDescriptor)module : null;
  }
  return targetBundle;
}

Fixed version (ground truth):
/** 
 * Get a target bundle descriptor based on an input bundle descriptor and a relative uri from the perspective of the input bundle descriptor.
 * @param origin            bundle descriptor within this application
 * @param relativeTargetUri relative uri from the given bundle descriptorto another bundle within the application.
 * @return target BundleDescriptor or null if not found.
 */
public BundleDescriptor getRelativeBundle(BundleDescriptor origin,String relativeTargetUri){
  String targetBundleUri=getTargetUri(origin,relativeTargetUri);
  BundleDescriptor targetBundle=null;
  if (targetBundleUri != null) {
    targetBundle=getModuleByUri(targetBundleUri);
  }
  return targetBundle;
}
Program: 29470
Project: 29470
Buggy source:
/** 
 * Internal method. This method is used to find referenced PU with a given name. It does not accept null or empty unit name.
 * @param unitName
 * @return
 */
private PersistenceUnitDescriptor findReferencedPU0(String unitName){
  int separatorIndex=unitName.lastIndexOf(PERSISTENCE_UNIT_NAME_SEPARATOR);
  if (separatorIndex != -1) {
    String unqualifiedUnitName=unitName.substring(separatorIndex + 1);
    String path=unitName.substring(0,separatorIndex);
    String puRoot=getTargetUri(this,path);
    final PersistenceUnitsDescriptor pus=getApplication().getExtensionsDescriptors(PersistenceUnitsDescriptor.class,puRoot);
    if (pus != null) {
      for (      PersistenceUnitDescriptor pu : pus.getPersistenceUnitDescriptors()) {
        if (pu.getName().equals(unqualifiedUnitName)) {
          return pu;
        }
      }
    }
  }
 else {
    Map<String,PersistenceUnitDescriptor> visiblePUs=getVisiblePUs();
    PersistenceUnitDescriptor result=visiblePUs.get(unitName);
    if (result != null)     return result;
    int sameNamedEarScopedPUCount=0;
    for (    String s : visiblePUs.keySet()) {
      int idx=s.lastIndexOf(PERSISTENCE_UNIT_NAME_SEPARATOR);
      if (idx != -1 && s.substring(idx + 1).matches(unitName)) {
        result=visiblePUs.get(s);
        sameNamedEarScopedPUCount++;
      }
    }
    if (sameNamedEarScopedPUCount == 1) {
      return result;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Internal method. This method is used to find referenced PU with a given name. It does not accept null or empty unit name.
 * @param unitName
 * @return
 */
private PersistenceUnitDescriptor findReferencedPU0(String unitName){
  int separatorIndex=unitName.lastIndexOf(PERSISTENCE_UNIT_NAME_SEPARATOR);
  if (separatorIndex != -1) {
    String unqualifiedUnitName=unitName.substring(separatorIndex + 1);
    String path=unitName.substring(0,separatorIndex);
    String puRoot=getTargetUri(this,path);
    final PersistenceUnitsDescriptor pus=getApplication().getExtensionsDescriptors(PersistenceUnitsDescriptor.class,puRoot);
    if (pus != null) {
      for (      PersistenceUnitDescriptor pu : pus.getPersistenceUnitDescriptors()) {
        if (pu.getName().equals(unqualifiedUnitName)) {
          return pu;
        }
      }
    }
  }
 else {
    Map<String,PersistenceUnitDescriptor> visiblePUs=getVisiblePUs();
    PersistenceUnitDescriptor result=visiblePUs.get(unitName);
    if (result != null)     return result;
    int sameNamedEarScopedPUCount=0;
    Set<Map.Entry<String,PersistenceUnitDescriptor>> entrySet=visiblePUs.entrySet();
    Iterator<Map.Entry<String,PersistenceUnitDescriptor>> entryIt=entrySet.iterator();
    while (entryIt.hasNext()) {
      Map.Entry<String,PersistenceUnitDescriptor> entry=entryIt.next();
      String s=entry.getKey();
      int idx=s.lastIndexOf(PERSISTENCE_UNIT_NAME_SEPARATOR);
      if (idx != -1 && s.substring(idx + 1).matches(unitName)) {
        result=entry.getValue();
        sameNamedEarScopedPUCount++;
      }
    }
    if (sameNamedEarScopedPUCount == 1) {
      return result;
    }
  }
  return null;
}
Program: 29471
Project: 29471
Buggy source:
/** 
 * get value for licenseRequired
 */
public String getLicenseRequiredValue(){
  if (licenseRequired.booleanValue() == true)   return new String("String_Node_Str");
 else   return new String("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * get value for licenseRequired
 */
public String getLicenseRequiredValue(){
  if (licenseRequired.booleanValue() == true)   return "String_Node_Str";
 else   return "String_Node_Str";
}
Program: 29472
Project: 29472
Buggy source:
/** 
 * set value for licenseRequired
 */
public void setLicenseRequired(String licenseRequired){
  if (licenseRequired.equals("String_Node_Str"))   this.licenseRequired=Boolean.TRUE;
 else   if (licenseRequired.equals("String_Node_Str"))   this.licenseRequired=Boolean.FALSE;
 else   this.licenseRequired=Boolean.FALSE;
}

Fixed version (ground truth):
/** 
 * set value for licenseRequired
 */
public void setLicenseRequired(String licenseRequired){
  if (licenseRequired.equals("String_Node_Str"))   this.licenseRequired=Boolean.TRUE;
 else   if (licenseRequired.equals("String_Node_Str"))   this.licenseRequired=Boolean.FALSE;
}
Program: 29474
Project: 29474
Buggy source:
public String getAppJndiName(){
  String modName=enclosingBundle.getModuleDescriptor().getModuleName();
  StringBuffer javaAppPrefix=new StringBuffer("String_Node_Str");
  javaAppPrefix.append(modName);
  javaAppPrefix.append("String_Node_Str");
  String componentName=isNamed() ? name : "String_Node_Str" + beanClassName;
  javaAppPrefix.append(componentName);
  return javaAppPrefix.toString();
}

Fixed version (ground truth):
public String getAppJndiName(){
  if (enclosingBundle == null)   return null;
  String modName=enclosingBundle.getModuleDescriptor().getModuleName();
  StringBuffer javaAppPrefix=new StringBuffer("String_Node_Str");
  javaAppPrefix.append(modName);
  javaAppPrefix.append("String_Node_Str");
  String componentName=isNamed() ? name : "String_Node_Str" + beanClassName;
  javaAppPrefix.append(componentName);
  return javaAppPrefix.toString();
}
Program: 29475
Project: 29475
Buggy source:
public String getGlobalJndiName(){
  String appName=null;
  Application app=enclosingBundle.getApplication();
  if (!app.isVirtual()) {
    appName=enclosingBundle.getApplication().getAppName();
  }
  String modName=enclosingBundle.getModuleDescriptor().getModuleName();
  StringBuffer javaGlobalPrefix=new StringBuffer("String_Node_Str");
  if (appName != null) {
    javaGlobalPrefix.append(appName);
    javaGlobalPrefix.append("String_Node_Str");
  }
  javaGlobalPrefix.append(modName);
  javaGlobalPrefix.append("String_Node_Str");
  String componentName=isNamed() ? name : "String_Node_Str" + beanClassName;
  javaGlobalPrefix.append(componentName);
  return javaGlobalPrefix.toString();
}

Fixed version (ground truth):
public String getGlobalJndiName(){
  String appName=null;
  if (enclosingBundle == null)   return null;
  Application app=enclosingBundle.getApplication();
  if (!app.isVirtual()) {
    appName=enclosingBundle.getApplication().getAppName();
  }
  String modName=enclosingBundle.getModuleDescriptor().getModuleName();
  StringBuffer javaGlobalPrefix=new StringBuffer("String_Node_Str");
  if (appName != null) {
    javaGlobalPrefix.append(appName);
    javaGlobalPrefix.append("String_Node_Str");
  }
  javaGlobalPrefix.append(modName);
  javaGlobalPrefix.append("String_Node_Str");
  String componentName=isNamed() ? name : "String_Node_Str" + beanClassName;
  javaGlobalPrefix.append(componentName);
  return javaGlobalPrefix.toString();
}
Program: 29476
Project: 29476
Buggy source:
private boolean stringArrayEquals(String[] s1,String[] s2){
  if (s1 == null && s2 == null) {
    return true;
  }
  if (s1 == null && s2 != null) {
    return false;
  }
  if (s2 == null && s1 != null) {
    return false;
  }
  if (s1.length == s2.length) {
    for (int i=0; i < s1.length; i++) {
      if (!s1[i].equals(s2[i])) {
        return false;
      }
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean stringArrayEquals(String[] s1,String[] s2){
  if (s1 == null && s2 == null) {
    return true;
  }
  if (s1 == null || s2 == null) {
    return false;
  }
  if (s1.length == s2.length) {
    for (int i=0; i < s1.length; i++) {
      if (!s1[i].equals(s2[i])) {
        return false;
      }
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 29477
Project: 29477
Buggy source:
/** 
 * Performs a conversion from the style1 style2 and style3 (no interface symbol) to method descriptors of style3 with an interface symbol.
 */
public Vector doStyleConversion(EjbDescriptor ejbDescriptor,Collection allMethods){
  Vector v=new Vector();
  if (getStyle() == 1) {
    for (Iterator itr=allMethods.iterator(); itr.hasNext(); ) {
      MethodDescriptor next=(MethodDescriptor)itr.next();
      if (this.getEjbName() != null && this.getEjbName().length() > 0) {
        next.setEjbName(ejbDescriptor.getName());
      }
      if (!next.isExact()) {
      }
      if (this.getDescription() != null && this.getDescription().length() > 0) {
        next.setDescription(this.getDescription());
      }
      if (getEjbClassSymbol() == null) {
        v.addElement(next);
      }
 else       if (this.getEjbClassSymbol().equals(next.getEjbClassSymbol())) {
        v.addElement(next);
      }
    }
  }
 else   if (this.getParameterClassNames() == null) {
    v.addAll(this.getMethodDescriptorsOfName(this.getName(),allMethods));
  }
 else {
    if (getEjbClassSymbol() == null) {
      v.addAll(this.getMethodDescriptorsOfNameAndParameters(this.getName(),this.getParameterClassNames(),allMethods));
    }
 else {
      v.addElement(this);
    }
  }
  return v;
}

Fixed version (ground truth):
/** 
 * Performs a conversion from the style1 style2 and style3 (no interface symbol) to method descriptors of style3 with an interface symbol.
 */
public Vector doStyleConversion(EjbDescriptor ejbDescriptor,Collection allMethods){
  Vector v=new Vector();
  if (getStyle() == 1) {
    for (Iterator itr=allMethods.iterator(); itr.hasNext(); ) {
      MethodDescriptor next=(MethodDescriptor)itr.next();
      if (this.getEjbName() != null && this.getEjbName().length() > 0) {
        next.setEjbName(ejbDescriptor.getName());
      }
      if (this.getDescription() != null && this.getDescription().length() > 0) {
        next.setDescription(this.getDescription());
      }
      if (getEjbClassSymbol() == null) {
        v.addElement(next);
      }
 else       if (this.getEjbClassSymbol().equals(next.getEjbClassSymbol())) {
        v.addElement(next);
      }
    }
  }
 else   if (this.getParameterClassNames() == null) {
    v.addAll(this.getMethodDescriptorsOfName(this.getName(),allMethods));
  }
 else {
    if (getEjbClassSymbol() == null) {
      v.addAll(this.getMethodDescriptorsOfNameAndParameters(this.getName(),this.getParameterClassNames(),allMethods));
    }
 else {
      v.addElement(this);
    }
  }
  return v;
}
Program: 29478
Project: 29478
Buggy source:
public static String fixParamClassName(String param){
  if (param.charAt(0) == '[') {
    int dimensions=param.lastIndexOf('[') + 1;
    char code=param.charAt(dimensions);
    String newparam=null;
switch (code) {
case 'B':
      newparam="String_Node_Str";
    break;
case 'C':
  newparam="String_Node_Str";
break;
case 'D':
newparam="String_Node_Str";
break;
case 'F':
newparam="String_Node_Str";
break;
case 'I':
newparam="String_Node_Str";
break;
case 'J':
newparam="String_Node_Str";
break;
case 'S':
newparam="String_Node_Str";
break;
case 'Z':
newparam="String_Node_Str";
break;
case 'L':
newparam=param.substring(dimensions + 1);
}
for (int j=0; j < dimensions; j++) newparam+="String_Node_Str";
return newparam;
}
 else {
return param;
}
}

Fixed version (ground truth):
public static String fixParamClassName(String param){
  if (param.charAt(0) == '[') {
    int dimensions=param.lastIndexOf('[') + 1;
    char code=param.charAt(dimensions);
    String newparam=null;
switch (code) {
case 'B':
      newparam="String_Node_Str";
    break;
case 'C':
  newparam="String_Node_Str";
break;
case 'D':
newparam="String_Node_Str";
break;
case 'F':
newparam="String_Node_Str";
break;
case 'I':
newparam="String_Node_Str";
break;
case 'J':
newparam="String_Node_Str";
break;
case 'S':
newparam="String_Node_Str";
break;
case 'Z':
newparam="String_Node_Str";
break;
case 'L':
newparam=param.substring(dimensions + 1);
break;
default :
newparam=null;
}
StringBuffer buf=new StringBuffer();
buf.append(newparam);
for (int j=0; j < dimensions; j++) buf.append("String_Node_Str");
newparam=buf.toString();
return newparam;
}
 else {
return param;
}
}
Program: 29479
Project: 29479
Buggy source:
/** 
 * @return an ecluded method permission. Methods associated with such a method permission cannot be invoked by anyone.
 */
public static MethodPermission getExcludedMethodPermission(){
  if (excluded == null) {
    excluded=new MethodPermission();
    excluded.isExcluded=true;
  }
  return excluded;
}

Fixed version (ground truth):
/** 
 * @return an ecluded method permission. Methods associated with such a method permission cannot be invoked by anyone.
 */
public static synchronized MethodPermission getExcludedMethodPermission(){
  if (excluded == null) {
    excluded=new MethodPermission();
    excluded.isExcluded=true;
  }
  return excluded;
}