nus-yam/ex-repair huggingface dataset:
Program: 44704
Project: 44704
Buggy source:
@Override public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  Packets.Interest interest=new Packets.Interest();
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String url=assemble(request.getRequestURL().toString());
  interest.getName().setName(url);
  try {
    logger.info("String_Node_Str" + url);
    Optional<Data> result=client.send(interest);
    if (result.isPresent()) {
      logger.info("String_Node_Str");
      response.getOutputStream().write(result.get().getContent());
    }
 else {
      logger.info("String_Node_Str");
      response.sendError(404);
    }
  }
 catch (  IllegalArgumentException|IllegalAccessException|InstantiationException e) {
    logger.error(e);
    response.sendError(500);
  }
}

Fixed version (ground truth):
@Override public void service(ServletRequest req,ServletResponse res) throws ServletException, IOException {
  Packets.Interest interest=new Packets.Interest();
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String url=assemble(request.getRequestURL().toString());
  interest.getName().setName(url);
  try {
    logger.info("String_Node_Str" + url + "String_Node_Str"+ req.getRemoteAddr());
    Optional<Data> result=client.send(interest);
    if (result.isPresent()) {
      logger.info("String_Node_Str");
      response.getOutputStream().write(result.get().getContent());
    }
 else {
      logger.info("String_Node_Str");
      response.sendError(404);
    }
  }
 catch (  IllegalArgumentException|IllegalAccessException|InstantiationException e) {
    logger.error(e);
    response.sendError(500);
  }
 finally {
    response.getOutputStream().close();
  }
}
Program: 44705
Project: 44705
Buggy source:
public static void main(String[] args) throws Exception {
  logger.info("String_Node_Str");
  Set<Flag<?>> options=ImmutableSet.of(Flag.of("String_Node_Str","String_Node_Str",true,"String_Node_Str"),Flag.of("String_Node_Str","String_Node_Str",true,8083),Flag.of("String_Node_Str","String_Node_Str",true,"String_Node_Str"));
  Flags flags=Flags.parse(options,args);
  final String host=flags.get("String_Node_Str");
  final int port=flags.get("String_Node_Str");
  final String entrypoint=flags.get("String_Node_Str");
  Proxy proxy=Guice.createInjector(new Module(InetSocketAddresses.parse(entrypoint))).getInstance(Proxy.class);
  proxy.bind(new InetSocketAddress(host,port));
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  logger.info("String_Node_Str");
  Proxy proxy=Guice.createInjector(new Module(),Flags.asModule(args)).getInstance(Proxy.class);
  proxy.bind(new InetSocketAddress(proxy.host,proxy.port));
}
Program: 44706
Project: 44706
Buggy source:
@Override protected void configure(){
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ExecutorService.class).toInstance(Executors.newFixedThreadPool(1,factory));
}

Fixed version (ground truth):
@Override protected void configure(){
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ExecutorService.class).toInstance(Executors.newFixedThreadPool(10,factory));
}
Program: 44707
Project: 44707
Buggy source:
@Override public void run(){
  while (running.get()) {
    try {
      Socket connection=socket.accept();
      logger.info("String_Node_Str");
      OutputStream stream=connection.getOutputStream();
      DataOutputStream out=new DataOutputStream(stream);
      Object request=Serializer.unserialize(connection.getInputStream());
      Handler<?> handler=handlers.get(request.getClass());
      if (handler == null) {
        throw new RuntimeException("String_Node_Str" + request.getClass());
      }
      handle(handler,request,out);
      stream.close();
      connection.close();
      logger.info("String_Node_Str");
    }
 catch (    IllegalArgumentException|IllegalAccessException|InstantiationException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
catch (    ConnectException e) {
      e.printStackTrace();
    }
catch (    SocketException e) {
      Preconditions.checkArgument(!running.get(),"String_Node_Str");
    }
catch (    IOException e) {
      e.printStackTrace();
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    OutputStream stream=connection.getOutputStream();
    logger.info("String_Node_Str");
    DataOutputStream out=new DataOutputStream(stream);
    Object request=Serializer.unserialize(connection.getInputStream());
    Handler<?> handler=handlers.get(request.getClass());
    if (handler == null) {
      throw new RuntimeException("String_Node_Str" + request.getClass());
    }
    handle(handler,request,out);
    stream.close();
    connection.close();
  }
 catch (  IllegalArgumentException|IllegalAccessException|InstantiationException e) {
    e.printStackTrace();
    logger.error("String_Node_Str",e);
  }
catch (  ConnectException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
    logger.error("String_Node_Str",e);
  }
 finally {
    logger.info("String_Node_Str");
    try {
      connection.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
      logger.error("String_Node_Str",e);
    }
  }
}
Program: 44708
Project: 44708
Buggy source:
public static Optional<String> get(String url) throws IOException {
  return get(new HttpGet(url));
}

Fixed version (ground truth):
public static Optional<String> get(String url) throws IOException {
  return get(new HttpGet(url),RequestConfig.custom());
}
Program: 44709
Project: 44709
Buggy source:
@Override protected void configure(){
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ExecutorService.class).toInstance(Executors.newFixedThreadPool(1,factory));
}

Fixed version (ground truth):
@Override protected void configure(){
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build();
  bind(ExecutorService.class).toInstance(Executors.newFixedThreadPool(10,factory));
}
Program: 44710
Project: 44710
Buggy source:
public static Server server(){
  return server(ImmutableMap.<String,Class<? extends Servlet>>builder().put("String_Node_Str",HelloWorldServlet.class).put("String_Node_Str",ServerErrorServlet.class).build());
}

Fixed version (ground truth):
public static Server server(String path,Class<? extends Servlet> servlet){
  return server(ImmutableMap.<String,Class<? extends Servlet>>builder().put(path,servlet).build());
}
Program: 44711
Project: 44711
Buggy source:
public void testRunnningAll() throws Exception {
  Server www=WorldWideWebServer.server();
  www.bind(InetSocketAddresses.parse("String_Node_Str"));
  Gateway.main(new String[]{"String_Node_Str","String_Node_Str"});
  Router.main(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  Proxy.main(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  Optional<String> content=WorldWideWeb.get(InetSocketAddresses.parse("String_Node_Str"),"String_Node_Str");
  assertTrue(content.isPresent());
  assertEquals("String_Node_Str",content.get());
}

Fixed version (ground truth):
public void testRunnningAll() throws Exception {
  Server www=WorldWideWebServer.server(WorldWideWebServer.defaultServlets());
  www.bind(InetSocketAddresses.parse("String_Node_Str"));
  Gateway.main(new String[]{"String_Node_Str","String_Node_Str"});
  Router.main(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  Proxy.main(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  Optional<String> content=WorldWideWeb.get(InetSocketAddresses.parse("String_Node_Str"),"String_Node_Str");
  assertTrue(content.isPresent());
  assertEquals("String_Node_Str",content.get());
}
Program: 44714
Project: 44714
Buggy source:
@Override protected void onDestroy(){
  Log.i(TAG,"String_Node_Str");
  unregisterReceiver(updateReceiver);
  unbindService(connection);
  super.onDestroy();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  Log.i(TAG,"String_Node_Str");
  unregisterReceiver(updateReceiver);
  super.onDestroy();
}
Program: 44715
Project: 44715
Buggy source:
public String getKey(){
  return keyView.getText().toString();
}

Fixed version (ground truth):
public String getKey(){
  EditText keyView=(EditText)getView().findViewById(R.id.key);
  return keyView.getText().toString();
}
Program: 44716
Project: 44716
Buggy source:
public String getValue(){
  return valueView.getText().toString();
}

Fixed version (ground truth):
public String getValue(){
  EditText valueView=(EditText)getView().findViewById(R.id.value);
  return valueView.getText().toString();
}
Program: 44717
Project: 44717
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.create_fragment,container,false);
  keyView=(EditText)rootView.findViewById(R.id.key);
  valueView=(EditText)rootView.findViewById(R.id.value);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.create_fragment,container,false);
}
Program: 44718
Project: 44718
Buggy source:
public void appendText(String text){
  mDisplay.append(text);
}

Fixed version (ground truth):
public void appendText(String text){
  TextView mDisplay=(TextView)getView().findViewById(R.id.serp);
  mDisplay.append(text);
}
Program: 44719
Project: 44719
Buggy source:
public void setText(String text){
  mDisplay.setText(text);
}

Fixed version (ground truth):
public void setText(String text){
  TextView mDisplay=(TextView)getView().findViewById(R.id.serp);
  mDisplay.setText(text);
}
Program: 44720
Project: 44720
Buggy source:
public static ArrayList<String> getKit(String kit) throws Exception {
  if (KitsMap.containsKey(kit)) {
    ArrayList<String> al=KitsMap.get(kit);
    return al;
  }
  throw new Exception("String_Node_Str" + kit);
}

Fixed version (ground truth):
public static ArrayList<Object> getKit(String kit) throws Exception {
  if (KitsMap.containsKey(kit)) {
    ArrayList<Object> al=KitsMap.get(kit);
    return al;
  }
  throw new Exception("String_Node_Str" + kit);
}
Program: 44722
Project: 44722
Buggy source:
public void onEnable(){
  setupPermissions();
  try {
    folder=this.getDataFolder();
    if (!folder.exists()) {
      folder.mkdirs();
    }
    loadConfig();
    loadItems();
    loadKits();
    if (KitsMap == null) {
      KitsMap=new HashMap<String,ArrayList<String>>();
      ArrayList<String> al=new ArrayList<String>();
      al.add("String_Node_Str");
      KitsMap.put("String_Node_Str",al);
    }
    System.out.println("String_Node_Str" + ConfigMap.size() + "String_Node_Str");
    System.out.println("String_Node_Str" + ItemsMap.size() + "String_Node_Str");
    System.out.println("String_Node_Str" + KitsMap.size() + "String_Node_Str");
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
  }
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Type.SIGN_CHANGE,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.BLOCK_PLACE,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.BLOCK_BREAK,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.PLAYER_INTERACT,playerListener,Priority.Monitor,this);
  PluginDescriptionFile pdfFile=this.getDescription();
  System.out.println(pdfFile.getName() + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}

Fixed version (ground truth):
public void onEnable(){
  setupPermissions();
  try {
    folder=this.getDataFolder();
    if (!folder.exists()) {
      folder.mkdirs();
    }
    loadConfig();
    loadItems();
    loadKits();
    if (KitsMap == null) {
      KitsMap=new HashMap<String,ArrayList<Object>>();
      ArrayList<Object> al=new ArrayList<Object>();
      al.add("String_Node_Str");
      KitsMap.put("String_Node_Str",al);
    }
    System.out.println("String_Node_Str" + ConfigMap.size() + "String_Node_Str");
    System.out.println("String_Node_Str" + ItemsMap.size() + "String_Node_Str");
    System.out.println("String_Node_Str" + KitsMap.size() + "String_Node_Str");
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
  }
  PluginManager pm=getServer().getPluginManager();
  pm.registerEvent(Type.SIGN_CHANGE,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.BLOCK_PLACE,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.BLOCK_BREAK,blockListener,Priority.Monitor,this);
  pm.registerEvent(Type.PLAYER_INTERACT,playerListener,Priority.Monitor,this);
  PluginDescriptionFile pdfFile=this.getDescription();
  System.out.println(pdfFile.getName() + "String_Node_Str" + pdfFile.getVersion()+ "String_Node_Str");
}
Program: 44723
Project: 44723
Buggy source:
@SuppressWarnings("String_Node_Str") public static void loadKits() throws IOException {
  File kitsFile=new File(folder,"String_Node_Str");
  if (!kitsFile.exists()) {
    kitsFile.createNewFile();
    InputStream res=SupplySign.class.getResourceAsStream("String_Node_Str");
    FileWriter tx=new FileWriter(kitsFile);
    for (int i=0; (i=res.read()) > 0; )     tx.write(i);
    tx.flush();
    tx.close();
    res.close();
  }
  BufferedReader rx=new BufferedReader(new FileReader(kitsFile));
  Yaml yaml=new Yaml();
  KitsMap.clear();
  try {
    KitsMap=(HashMap<String,ArrayList<String>>)yaml.load(rx);
  }
  finally {
    rx.close();
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void loadKits() throws IOException {
  File kitsFile=new File(folder,"String_Node_Str");
  if (!kitsFile.exists()) {
    kitsFile.createNewFile();
    InputStream res=SupplySign.class.getResourceAsStream("String_Node_Str");
    FileWriter tx=new FileWriter(kitsFile);
    for (int i=0; (i=res.read()) > 0; )     tx.write(i);
    tx.flush();
    tx.close();
    res.close();
  }
  BufferedReader rx=new BufferedReader(new FileReader(kitsFile));
  Yaml yaml=new Yaml();
  KitsMap.clear();
  try {
    KitsMap=(HashMap<String,ArrayList<Object>>)yaml.load(rx);
  }
  finally {
    rx.close();
  }
}
Program: 44725
Project: 44725
Buggy source:
public Console(CommandProcessor processor,InputStream in,PrintStream out,PrintStream err,Terminal term,Runnable closeCallback) throws Exception {
  this.in=in;
  this.out=out;
  this.err=err;
  this.queue=new ArrayBlockingQueue<Integer>(1024);
  this.terminal=term == null ? new UnsupportedTerminal() : term;
  this.consoleInput=new ConsoleInputStream();
  this.session=processor.createSession(this.consoleInput,this.out,this.err);
  this.session.put("String_Node_Str","String_Node_Str");
  this.closeCallback=closeCallback;
  reader=new ConsoleReader(this.consoleInput,new PrintWriter(this.out),getClass().getResourceAsStream("String_Node_Str"),this.terminal);
  final File file=getHistoryFile();
  file.getParentFile().mkdirs();
  reader.setHistory(new FileHistory(file));
  session.put("String_Node_Str",reader.getHistory());
  Completer completer=createCompleter();
  if (completer != null) {
    reader.addCompleter(new CompleterAsCompletor(completer));
  }
  if (Boolean.getBoolean("String_Node_Str")) {
    reader.setBellEnabled(false);
  }
  pipe=new Thread(new Pipe());
  pipe.setName("String_Node_Str");
  pipe.setDaemon(true);
}

Fixed version (ground truth):
public Console(CommandProcessor processor,InputStream in,PrintStream out,PrintStream err,Terminal term,Runnable closeCallback) throws Exception {
  this.in=in;
  this.out=out;
  this.err=err;
  this.queue=new ArrayBlockingQueue<Integer>(1024);
  this.terminal=term == null ? new UnsupportedTerminal() : term;
  this.consoleInput=new ConsoleInputStream();
  this.session=processor.createSession(this.consoleInput,this.out,this.err);
  this.session.put("String_Node_Str","String_Node_Str");
  this.closeCallback=closeCallback;
  reader=new ConsoleReader(this.consoleInput,new PrintWriter(this.out),getClass().getResourceAsStream("String_Node_Str"),this.terminal);
  final File file=getHistoryFile();
  file.getParentFile().mkdirs();
  if (file.exists() && file.canRead()) {
    reader.setHistory(new FileHistory(file){
      boolean failed=false;
      @Override public void flush() throws IOException {
        if (!failed) {
          try {
            super.flush();
          }
 catch (          IOException e) {
            failed=true;
            LOGGER.debug("String_Node_Str" + file,e);
          }
        }
      }
      @Override public void purge() throws IOException {
        if (!failed) {
          try {
            super.purge();
          }
 catch (          IOException e) {
            failed=true;
            LOGGER.debug("String_Node_Str" + file,e);
          }
        }
      }
    }
);
  }
  session.put("String_Node_Str",reader.getHistory());
  Completer completer=createCompleter();
  if (completer != null) {
    reader.addCompleter(new CompleterAsCompletor(completer));
  }
  if (Boolean.getBoolean("String_Node_Str")) {
    reader.setBellEnabled(false);
  }
  pipe=new Thread(new Pipe());
  pipe.setName("String_Node_Str");
  pipe.setDaemon(true);
}
Program: 44727
Project: 44727
Buggy source:
public void contextDestroyed(ServletContextEvent sce){
  try {
    System.err.println("String_Node_Str");
    if (main != null) {
      main.destroy(false);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void contextDestroyed(ServletContextEvent sce){
  try {
    System.err.println("String_Node_Str");
    if (main != null) {
      main.destroy();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 44728
Project: 44728
Buggy source:
public synchronized void init(){
  Configuration.setConfiguration(this);
}

Fixed version (ground truth):
public void init(){
  Configuration.setConfiguration(this);
}
Program: 44729
Project: 44729
Buggy source:
public synchronized void unregister(JaasRealm realm,Map<String,?> properties){
  for (Iterator<JaasRealm> it=realms.iterator(); it.hasNext(); ) {
    if (it.next() == realm) {
      it.remove();
    }
  }
}

Fixed version (ground truth):
public void unregister(JaasRealm realm,Map<String,?> properties){
  realms.remove(realm);
}
Program: 44730
Project: 44730
Buggy source:
public synchronized void refresh(){
}

Fixed version (ground truth):
public void refresh(){
}
Program: 44731
Project: 44731
Buggy source:
public synchronized void close(){
  realms.clear();
  Configuration.setConfiguration(null);
}

Fixed version (ground truth):
public void close(){
  realms.clear();
  Configuration.setConfiguration(null);
}
Program: 44732
Project: 44732
Buggy source:
public synchronized AppConfigurationEntry[] getAppConfigurationEntry(String name){
  JaasRealm realm=null;
  for (  JaasRealm r : realms) {
    if (r.getName().equals(name)) {
      if (realm == null || r.getRank() > realm.getRank()) {
        realm=r;
      }
    }
  }
  if (realm != null) {
    return realm.getEntries();
  }
  return null;
}

Fixed version (ground truth):
public AppConfigurationEntry[] getAppConfigurationEntry(String name){
  JaasRealm realm=null;
  for (  JaasRealm r : realms) {
    if (r.getName().equals(name)) {
      if (realm == null || r.getRank() > realm.getRank()) {
        realm=r;
      }
    }
  }
  if (realm != null) {
    return realm.getEntries();
  }
  return null;
}
Program: 44733
Project: 44733
Buggy source:
public synchronized void register(JaasRealm realm,Map<String,?> properties){
  realms.add(realm);
}

Fixed version (ground truth):
public void register(JaasRealm realm,Map<String,?> properties){
  realms.add(realm);
}
Program: 44734
Project: 44734
Buggy source:
@Test public void testCompleteArgumnets() throws Exception {
  CommandSession session=new DummyCommandSession();
  Completer comp=new ArgumentCompleter(session,new SimpleCommand(MyAction.class),"String_Node_Str");
  assertEquals(Arrays.asList("String_Node_Str"),complete(comp,"String_Node_Str"));
  assertEquals(Arrays.asList("String_Node_Str"),complete(comp,"String_Node_Str"));
  assertEquals(Arrays.asList("String_Node_Str"),complete(comp,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCompleteArgumnets() throws Exception {
  CommandSession session=new DummyCommandSession();
  Completer comp=new ArgumentCompleter(session,new SimpleCommand(MyAction.class),"String_Node_Str");
  assertEquals(Arrays.asList("String_Node_Str" + File.separator),complete(comp,"String_Node_Str"));
  assertEquals(Arrays.asList("String_Node_Str" + File.separator),complete(comp,"String_Node_Str"));
  assertEquals(Arrays.asList("String_Node_Str" + File.separator),complete(comp,"String_Node_Str"));
}
Program: 44735
Project: 44735
Buggy source:
@Override protected Object doExecute() throws Exception {
  Map<Constructor,List<Object>> matches=findMatchingConstructors(clazz,args,Arrays.asList(new ReifiedType[args.size()]));
  if (matches.size() == 1) {
    try {
      Map.Entry<Constructor,List<Object>> match=matches.entrySet().iterator().next();
      return newInstance(match.getKey(),match.getValue().toArray());
    }
 catch (    Throwable e) {
      throw new ComponentDefinitionException("String_Node_Str" + clazz.getName(),getRealCause(e));
    }
  }
 else   if (matches.size() == 0) {
    throw new ComponentDefinitionException("String_Node_Str" + clazz.getName() + "String_Node_Str"+ args+ "String_Node_Str");
  }
 else {
    throw new ComponentDefinitionException("String_Node_Str" + clazz.getName() + "String_Node_Str"+ args+ "String_Node_Str"+ matches.keySet());
  }
}

Fixed version (ground truth):
@Override protected Object doExecute() throws Exception {
  if (args == null) {
    args=Collections.emptyList();
  }
  Map<Constructor,List<Object>> matches=findMatchingConstructors(clazz,args,Arrays.asList(new ReifiedType[args.size()]));
  if (matches.size() == 1) {
    try {
      Map.Entry<Constructor,List<Object>> match=matches.entrySet().iterator().next();
      return newInstance(match.getKey(),match.getValue().toArray());
    }
 catch (    Throwable e) {
      throw new ComponentDefinitionException("String_Node_Str" + clazz.getName(),getRealCause(e));
    }
  }
 else   if (matches.size() == 0) {
    throw new ComponentDefinitionException("String_Node_Str" + clazz.getName() + "String_Node_Str"+ args+ "String_Node_Str");
  }
 else {
    throw new ComponentDefinitionException("String_Node_Str" + clazz.getName() + "String_Node_Str"+ args+ "String_Node_Str"+ matches.keySet());
  }
}
Program: 44736
Project: 44736
Buggy source:
protected void doExecute(ConfigurationAdmin admin) throws Exception {
  Configuration[] configs=admin.listConfigurations(query);
  for (  Configuration config : configs) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + config.getPid());
    if (config.getFactoryPid() != null) {
      System.out.println("String_Node_Str" + config.getFactoryPid());
    }
    System.out.println("String_Node_Str" + config.getBundleLocation());
    if (config.getProperties() != null) {
      System.out.println("String_Node_Str");
      Dictionary props=config.getProperties();
      for (Enumeration e=props.keys(); e.hasMoreElements(); ) {
        Object key=e.nextElement();
        System.out.println("String_Node_Str" + key + "String_Node_Str"+ props.get(key));
      }
    }
  }
}

Fixed version (ground truth):
protected void doExecute(ConfigurationAdmin admin) throws Exception {
  Configuration[] configs=admin.listConfigurations(query);
  if (configs != null) {
    for (    Configuration config : configs) {
      System.out.println("String_Node_Str");
      System.out.println("String_Node_Str" + config.getPid());
      if (config.getFactoryPid() != null) {
        System.out.println("String_Node_Str" + config.getFactoryPid());
      }
      System.out.println("String_Node_Str" + config.getBundleLocation());
      if (config.getProperties() != null) {
        System.out.println("String_Node_Str");
        Dictionary props=config.getProperties();
        for (Enumeration e=props.keys(); e.hasMoreElements(); ) {
          Object key=e.nextElement();
          System.out.println("String_Node_Str" + key + "String_Node_Str"+ props.get(key));
        }
      }
    }
  }
}
Program: 44739
Project: 44739
Buggy source:
@Override public void initialize(Subject sub,CallbackHandler handler,Map sharedState,Map options){
  super.initialize(sub,handler,options);
  usersFile=(String)options.get(USER_FILE) + "String_Node_Str";
  if (debug) {
    LOG.debug("String_Node_Str" + debug + "String_Node_Str"+ usersFile);
  }
}

Fixed version (ground truth):
public void initialize(Subject sub,CallbackHandler handler,Map sharedState,Map options){
  super.initialize(sub,handler,options);
  usersFile=(String)options.get(USER_FILE) + "String_Node_Str";
  if (debug) {
    LOG.debug("String_Node_Str" + debug + "String_Node_Str"+ usersFile);
  }
}
Program: 44740
Project: 44740
Buggy source:
public void init(){
  createListener();
}

Fixed version (ground truth):
public void init(){
  getListener();
}
Program: 44741
Project: 44741
Buggy source:
public BundleStateListener getListener(){
  if (listener == null) {
    listener=createListener();
  }
  return listener;
}

Fixed version (ground truth):
public synchronized BundleStateListener getListener(){
  if (listener == null) {
    listener=createListener();
  }
  return listener;
}
Program: 44742
Project: 44742
Buggy source:
public void setFeaturesServiceRegistry(FeaturesRegistry featuresRegistry){
  this.featuresRegistry=featuresRegistry;
}

Fixed version (ground truth):
public void setFeaturesServiceRegistry(FeaturesRegistry featuresRegistry){
  this.featuresRegistry=featuresRegistry;
  this.featuresRegistry.setFeaturesService(this);
}
Program: 44743
Project: 44743
Buggy source:
public void init() throws Exception {
  if (managementAgent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (namingStrategy == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void init() throws Exception {
  if (managementAgent == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (namingStrategy == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (mbeanServer != null) {
    registerMBeanServer(mbeanServer,null);
  }
}
Program: 44744
Project: 44744
Buggy source:
public void registerMBeanServer(MBeanServer mbeanServer,Map props) throws Exception {
  if (mbeanServer != null) {
    mbeanServerInitialized=true;
  }
  managementAgent.register(this,namingStrategy.getObjectName(this));
  for (  ManagedRepository repository : repositories.values()) {
    managementAgent.register(repository,namingStrategy.getObjectName(repository));
  }
  for (  ManagedFeature feature : availableFeatures.values()) {
    managementAgent.register(feature,namingStrategy.getObjectName(feature));
  }
  for (  ManagedFeature feature : installedFeatures.values()) {
    installedFeatures.put(feature.getId(),feature);
    managementAgent.register(feature,namingStrategy.getObjectName(feature,true));
  }
}

Fixed version (ground truth):
public void registerMBeanServer(MBeanServer mbeanServer,Map props) throws Exception {
  if (mbeanServer != null) {
    this.mbeanServer=mbeanServer;
  }
  if (managementAgent == null) {
    return;
  }
  mbeanServerInitialized=true;
  managementAgent.register(this,namingStrategy.getObjectName(this));
  for (  ManagedRepository repository : repositories.values()) {
    managementAgent.register(repository,namingStrategy.getObjectName(repository));
  }
  for (  ManagedFeature feature : availableFeatures.values()) {
    managementAgent.register(feature,namingStrategy.getObjectName(feature));
  }
  for (  ManagedFeature feature : installedFeatures.values()) {
    installedFeatures.put(feature.getId(),feature);
    managementAgent.register(feature,namingStrategy.getObjectName(feature,true));
  }
}
Program: 44745
Project: 44745
Buggy source:
public void bundleChanged(BundleEvent event){
  if (event.getType() == BundleEvent.RESOLVED) {
    executor.execute(new Runnable(){
      public void run(){
        retryPendingStartBundles();
      }
    }
);
  }
}

Fixed version (ground truth):
public void bundleChanged(BundleEvent event){
  if (event.getType() == BundleEvent.RESOLVED) {
    executor.execute(new Runnable(){
      public void run(){
        retryPendingStartBundles();
      }
    }
);
  }
 else   if (event.getType() == BundleEvent.UNINSTALLED) {
    pendingStartBundles.remove(event.getBundle());
  }
}
Program: 44746
Project: 44746
Buggy source:
private void rescheduleStart(Bundle bundle){
synchronized (pendingStartBundles) {
    pendingStartBundles.add(bundle);
    if (bundleListener == null) {
      bundleListener=new BundleListener(){
        public void bundleChanged(        BundleEvent event){
          if (event.getType() == BundleEvent.RESOLVED) {
            executor.execute(new Runnable(){
              public void run(){
                retryPendingStartBundles();
              }
            }
);
          }
        }
      }
;
      getContext().addBundleListener(bundleListener);
    }
  }
}

Fixed version (ground truth):
private void rescheduleStart(Bundle bundle){
synchronized (pendingStartBundles) {
    pendingStartBundles.add(bundle);
    if (bundleListener == null) {
      bundleListener=new BundleListener(){
        public void bundleChanged(        BundleEvent event){
          if (event.getType() == BundleEvent.RESOLVED) {
            executor.execute(new Runnable(){
              public void run(){
                retryPendingStartBundles();
              }
            }
);
          }
 else           if (event.getType() == BundleEvent.UNINSTALLED) {
            pendingStartBundles.remove(event.getBundle());
          }
        }
      }
;
      getContext().addBundleListener(bundleListener);
    }
  }
}
Program: 44747
Project: 44747
Buggy source:
public <P extends Page>P getPage(String url) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
  String hostAddress=MessageFormat.format("String_Node_Str",getServer().getPort());
  P page=webClient.getPage(hostAddress + url);
  return page;
}

Fixed version (ground truth):
public <P extends Page>P getPage(String url) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
  String hostAddress=MessageFormat.format("String_Node_Str",getServer().getPort());
  P page=webClient.<P>getPage(hostAddress + url);
  return page;
}
Program: 44748
Project: 44748
Buggy source:
public <P extends Page>P getPage(String url) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
  return environment.getPage(url);
}

Fixed version (ground truth):
public <P extends Page>P getPage(String url) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
  return environment.<P>getPage(url);
}
Program: 44749
Project: 44749
Buggy source:
public Integer getPermission(Integer func){
  Integer n=this.permissions.get(func);
  if (n == null)   return MAX_LEVEL;
  return n;
}

Fixed version (ground truth):
public Integer getPermission(Integer func){
  Integer n=this.permissions.get(new Long(func));
  if (n == null)   return MAX_LEVEL;
  return n;
}
Program: 44750
Project: 44750
Buggy source:
@Override public Player getUserPlayer(User user,Long server){
  UserServer userServer;
  Player player;
  try {
    userServer=userServerDAO.findByUserAndServer(user.getKey(),server);
  }
 catch (  EntityDoesNotExistsException e) {
    log.trace("String_Node_Str",server.toString(),user.getLoginId());
    return null;
  }
  if (userServer.getPlayer() == null || userServer.getPlayer().equals(0)) {
    log.trace("String_Node_Str",user.getLoginId());
    return null;
  }
  try {
    player=playerDAO.get(userServer.getPlayer());
  }
 catch (  EntityDoesNotExistsException e) {
    log.trace("String_Node_Str",userServer.getPlayer());
    return null;
  }
  return player;
}

Fixed version (ground truth):
@Override public Player getUserPlayer(User user,Long server){
  UserServer userServer;
  Player player;
  try {
    userServer=userServerDAO.findByUserAndServer(user.getKey(),server);
  }
 catch (  EntityDoesNotExistsException e) {
    log.warn("String_Node_Str",server.toString(),user.getLoginId());
    return null;
  }
  if (userServer.getPlayer() == null || userServer.getPlayer().equals(0)) {
    log.warn("String_Node_Str",user.getLoginId());
    return null;
  }
  try {
    player=playerDAO.get(userServer.getPlayer());
  }
 catch (  EntityDoesNotExistsException e) {
    log.warn("String_Node_Str",userServer.getPlayer());
    return null;
  }
  return player;
}
Program: 44751
Project: 44751
Buggy source:
@Override public boolean hasPermission(Long server,Integer level){
  Subject subject=this.getCurrentUser();
  if (!subject.isAuthenticated())   return false;
  if (subject.isSuperAdmin())   return true;
  Player player=getSubjectPlayer(server);
  if (player != null && player.getLevel() != null && player.getLevel().intValue() >= level.intValue()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasPermission(Long server,Integer level){
  Subject subject=this.getCurrentUser();
  if (!subject.isAuthenticated())   return false;
  if (subject.isSuperAdmin())   return true;
  Player player=getSubjectPlayer(server);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str",player.getKey(),player.getLevel());
    log.debug("String_Node_Str",level);
  }
  if (player != null && player.getLevel() != null && player.getLevel().intValue() >= level.intValue()) {
    return true;
  }
  return false;
}
Program: 44752
Project: 44752
Buggy source:
protected void createCache(String namespace){
  try {
    this.cacheImpl=CacheFactory.getInstance().getCache("String_Node_Str");
  }
 catch (  UnavailableCacheException e) {
    this.cacheImpl=null;
  }
}

Fixed version (ground truth):
protected void createCache(String namespace){
  try {
    this.cacheImpl=CacheFactory.getInstance().getCache(namespace);
  }
 catch (  UnavailableCacheException e) {
    this.cacheImpl=null;
  }
}
Program: 44753
Project: 44753
Buggy source:
@Override public User get(String loginId) throws EntityDoesNotExistsException {
  User user=(User)cacheGet(loginId);
  if (user != null)   return user;
  user=this.impl.get(loginId);
  cacheUser(user);
  return user;
}

Fixed version (ground truth):
@Override public User get(String loginId) throws EntityDoesNotExistsException {
  User user=(User)cacheGet("String_Node_Str" + loginId);
  if (user != null)   return user;
  user=this.impl.get(loginId);
  cacheUser(user);
  return user;
}
Program: 44754
Project: 44754
Buggy source:
private void cacheUser(User user){
  cachePut(user.getLoginId(),user,10);
  cachePut("String_Node_Str" + user.getKey().toString(),user,10);
}

Fixed version (ground truth):
private void cacheUser(User user){
  cachePut("String_Node_Str" + user.getLoginId(),user,10);
  cachePut("String_Node_Str" + user.getKey().toString(),user,10);
}
Program: 44755
Project: 44755
Buggy source:
@Override public Subject getCurrentUser(){
  return context.getSubject();
}

Fixed version (ground truth):
@Override public Subject getCurrentUser(){
  try {
    return getContext().getSubject();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e.getClass().getName(),e.getMessage());
    return new AnonymousSubject();
  }
}
Program: 44756
Project: 44756
Buggy source:
private void saveLocal(Subject subject){
  context.setSubject(subject);
}

Fixed version (ground truth):
private void saveLocal(Subject subject){
  try {
    getContext().setSubject(subject);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e.getClass().getName(),e.getMessage());
  }
}
Program: 44757
Project: 44757
Buggy source:
@Override public void cleanUp(){
  try {
    context.removeSubject();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Override public void cleanUp(){
  try {
    getContext().removeSubject();
  }
 catch (  Exception e) {
  }
}
Program: 44759
Project: 44759
Buggy source:
/** 
 * Updates the name of a server given its uid. <p> Invoked by the servers when they change their public server name.
 * @param key the server uid.
 * @param name the server's new name.
 * @param version plugin version number
 * @param permission allowed actions for server admins
 * @param remoteAddr the server's remote address.
 * @since 0.5
 */
public void updateName(String key,String name,String version,Integer permission,String remoteAddr){
  try {
    Server server=ServerManager.getAuthorizedServer(key,remoteAddr,name);
    server.setName(name);
    server.setPermission(permission);
    server.setUpdated(new Date());
    server.setPluginVersion(version);
    serverDAO.save(server);
  }
 catch (  UnauthorizedUpdateException e) {
    try {
      MailManager.getInstance().sendAdminMail("String_Node_Str",e.getMessage(),null);
    }
 catch (    Exception me) {
      log.error(me.getMessage());
    }
    log.error(e.getMessage());
  }
catch (  Exception e) {
    log.error(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.error(w.getBuffer().toString());
  }
}

Fixed version (ground truth):
/** 
 * Updates the name of a server given its uid. <p> Invoked by the servers when they change their public server name.
 * @param key the server uid.
 * @param name the server's new name.
 * @param version plugin version number
 * @param permission allowed actions for server admins
 * @param remoteAddr the server's remote address.
 * @since 0.5
 */
public void updateName(String key,String name,String version,Integer permission,String remoteAddr){
  try {
    Server server=ServerManager.getAuthorizedServer(key,remoteAddr,name);
    server.setName(name);
    server.setRemotePermission(permission);
    server.setUpdated(new Date());
    server.setPluginVersion(version);
    serverDAO.save(server);
  }
 catch (  UnauthorizedUpdateException e) {
    try {
      MailManager.getInstance().sendAdminMail("String_Node_Str",e.getMessage(),null);
    }
 catch (    Exception me) {
      log.error(me.getMessage());
    }
    log.error(e.getMessage());
  }
catch (  Exception e) {
    log.error(e.getMessage());
    StringWriter w=new StringWriter();
    e.printStackTrace(new PrintWriter(w));
    log.error(w.getBuffer().toString());
  }
}
Program: 44760
Project: 44760
Buggy source:
public void addServer(String name,String admin,String uid,String ip,boolean disabled){
  Server server=new Server();
  server.setAdminEmail(admin);
  server.setCreated(new Date());
  server.setUid(uid);
  server.setName(name);
  server.setOnlinePlayers(0);
  server.setAddress(ip);
  server.setDisabled(disabled);
  server.setPermission(0);
  server.setMaxBanDuration(RemotePermissions.DEFAULT_MAXBAN);
  server.setTotalPlayers(0);
  serverDAO.save(server);
}

Fixed version (ground truth):
public void addServer(String name,String admin,String uid,String ip,boolean disabled){
  Server server=new Server();
  server.setAdminEmail(admin);
  server.setCreated(new Date());
  server.setUid(uid);
  server.setName(name);
  server.setOnlinePlayers(0);
  server.setAddress(ip);
  server.setDisabled(disabled);
  server.setRemotePermission(0);
  server.setMaxBanDuration(RemotePermissions.DEFAULT_MAXBAN);
  server.setTotalPlayers(0);
  serverDAO.save(server);
}
Program: 44761
Project: 44761
Buggy source:
public Integer getAdminLevel(){
  if (this.permissions == null || this.permissions.size() == 0)   return 100;
  List<Integer> levels=new ArrayList<Integer>(this.permissions.values());
  Collections.sort(levels);
  return levels.get(0);
}

Fixed version (ground truth):
public Integer getAdminLevel(){
  if (this.permissions == null || this.permissions.size() == 0)   return MAX_LEVEL;
  List<Integer> levels=new ArrayList<Integer>(this.permissions.values());
  Collections.sort(levels);
  return levels.get(0);
}
Program: 44762
Project: 44762
Buggy source:
public Integer getPermission(){
  return permission;
}

Fixed version (ground truth):
public Integer getPermission(Integer func){
  Integer n=this.permissions.get(func);
  if (n == null)   return MAX_LEVEL;
  return n;
}
Program: 44764
Project: 44764
Buggy source:
private void loadServer(Server server,ResultSet rs) throws SQLException {
  server.setKey(rs.getLong("String_Node_Str"));
  server.setUid(rs.getString("String_Node_Str"));
  server.setName(rs.getString("String_Node_Str"));
  server.setAdminEmail(rs.getString("String_Node_Str"));
  server.setCreated(rs.getTimestamp("String_Node_Str"));
  server.setUpdated(rs.getTimestamp("String_Node_Str"));
  server.setOnlinePlayers(rs.getInt("String_Node_Str"));
  server.setAddress(rs.getString("String_Node_Str"));
  server.setPluginVersion(rs.getString("String_Node_Str"));
  server.setMaxLevel(rs.getInt("String_Node_Str"));
  server.setDirty(rs.getBoolean("String_Node_Str"));
  server.setPermission(rs.getInt("String_Node_Str"));
  server.setDisabled(rs.getBoolean("String_Node_Str"));
  server.setTotalPlayers(rs.getInt("String_Node_Str"));
  server.setMaxBanDuration(rs.getLong("String_Node_Str"));
}

Fixed version (ground truth):
private void loadServer(Server server,ResultSet rs) throws SQLException {
  server.setKey(rs.getLong("String_Node_Str"));
  server.setUid(rs.getString("String_Node_Str"));
  server.setName(rs.getString("String_Node_Str"));
  server.setAdminEmail(rs.getString("String_Node_Str"));
  server.setCreated(rs.getTimestamp("String_Node_Str"));
  server.setUpdated(rs.getTimestamp("String_Node_Str"));
  server.setOnlinePlayers(rs.getInt("String_Node_Str"));
  server.setAddress(rs.getString("String_Node_Str"));
  server.setPluginVersion(rs.getString("String_Node_Str"));
  server.setMaxLevel(rs.getInt("String_Node_Str"));
  server.setDirty(rs.getBoolean("String_Node_Str"));
  server.setRemotePermission(rs.getInt("String_Node_Str"));
  server.setDisabled(rs.getBoolean("String_Node_Str"));
  server.setTotalPlayers(rs.getInt("String_Node_Str"));
  server.setMaxBanDuration(rs.getLong("String_Node_Str"));
}
Program: 44768
Project: 44768
Buggy source:
public void saveServerPermissions(Server server,List<ServerPermission> perm){
  if (server.getPermissions() == null)   server.setPermissions(new HashMap<Long,Integer>(4));
  for (  ServerPermission p : perm) {
    server.getPermissions().put(p.getFuncId().longValue(),p.getLevel());
  }
  serverDAO.savePermissions(server);
}

Fixed version (ground truth):
public void saveServerPermissions(Server server,List<ServerPermission> perm){
  if (server.getPermissions() == null)   server.setPermissions(new HashMap<Integer,Integer>(4));
  for (  ServerPermission p : perm) {
    server.getPermissions().put(p.getFuncId(),p.getLevel());
  }
  serverDAO.savePermissions(server);
}
Program: 44769
Project: 44769
Buggy source:
@Override public String toString(){
  StringBuilder b=new StringBuilder();
  b.append(this.nickname);
  b.append("String_Node_Str");
  b.append(guid);
  b.append("String_Node_Str");
  b.append("String_Node_Str").append(this.server);
  return b.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder b=new StringBuilder();
  b.append(this.nickname);
  b.append("String_Node_Str").append(guid).append("String_Node_Str");
  b.append("String_Node_Str").append(level);
  b.append("String_Node_Str").append(level);
  b.append("String_Node_Str").append(server);
  return b.toString();
}
Program: 44770
Project: 44770
Buggy source:
public void setPermissions(Map<Long,Integer> permissions){
  this.permissions=permissions;
}

Fixed version (ground truth):
public void setPermissions(Map<Integer,Integer> permissions){
  this.permissions=permissions;
}
Program: 44771
Project: 44771
Buggy source:
public Map<Long,Integer> getPermissions(){
  return permissions;
}

Fixed version (ground truth):
public Map<Integer,Integer> getPermissions(){
  return permissions;
}
Program: 44772
Project: 44772
Buggy source:
@Override public void savePermissions(Server server){
  String sqlI="String_Node_Str";
  String sqlU="String_Node_Str";
  String sql="String_Node_Str";
  Connection conn=null;
  try {
    conn=ConnectionFactory.getMasterConnection();
    PreparedStatement st;
    ResultSet rs;
    for (    Entry<Long,Integer> entry : server.getPermissions().entrySet()) {
      st=conn.prepareStatement(sql);
      st.setLong(1,server.getKey());
      st.setInt(2,entry.getKey().intValue());
      rs=st.executeQuery();
      if (rs.next()) {
        st=conn.prepareStatement(sqlU);
        st.setInt(1,entry.getValue());
        st.setLong(2,server.getKey());
        st.setInt(3,entry.getKey().intValue());
      }
 else {
        st=conn.prepareStatement(sqlI);
        st.setLong(1,server.getKey());
        st.setInt(2,entry.getKey().intValue());
        st.setInt(3,entry.getValue());
      }
      st.executeUpdate();
    }
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
catch (  IOException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
 finally {
    try {
      if (conn != null)       conn.close();
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
@Override public void savePermissions(Server server){
  String sqlI="String_Node_Str";
  String sqlU="String_Node_Str";
  String sql="String_Node_Str";
  Connection conn=null;
  try {
    conn=ConnectionFactory.getMasterConnection();
    PreparedStatement st;
    ResultSet rs;
    for (    Entry<Integer,Integer> entry : server.getPermissions().entrySet()) {
      st=conn.prepareStatement(sql);
      st.setLong(1,server.getKey());
      st.setInt(2,entry.getKey());
      rs=st.executeQuery();
      if (rs.next()) {
        st=conn.prepareStatement(sqlU);
        st.setInt(1,entry.getValue());
        st.setLong(2,server.getKey());
        st.setInt(3,entry.getKey());
      }
 else {
        st=conn.prepareStatement(sqlI);
        st.setLong(1,server.getKey());
        st.setInt(2,entry.getKey());
        st.setInt(3,entry.getValue());
      }
      st.executeUpdate();
    }
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
catch (  IOException e) {
    logger.error("String_Node_Str",e.getMessage());
  }
 finally {
    try {
      if (conn != null)       conn.close();
    }
 catch (    Exception e) {
    }
  }
}