nus-yam/ex-repair huggingface dataset:
Program: 175423
Project: 175423
Buggy source:
/** 
 * Show a dialog with the idea's text and note allows to delete or edit the idea
 */
private void showIdeaDialog(){
  SpannableString text=new SpannableString(mDbHelper.getTextById(mIdRecycler));
  text.setSpan(new AbsoluteSizeSpan(24,true),0,text.length(),0);
  String note=mDbHelper.getNoteById(mIdRecycler);
  new LovelyStandardDialog(MainActivity.getInstance()).setTopColorRes(getPriorityColor()).setIcon(R.drawable.ic_bulb).setTitle(text).setMessage(note).setPositiveButtonColorRes(R.color.md_pink_a200).setPositiveButton(R.string.ok,null).setNeutralButton(R.string.delete,new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mTabNumber == 4) {
        mRecyclerView.muteCellToDelete();
      }
 else {
        mRecyclerView.sendCellToTab(-1);
      }
    }
  }
).setNeutralButtonColorRes(R.color.md_pink_a200).setNegativeButton(R.string.edit,new View.OnClickListener(){
    @Override public void onClick(    View v){
      editIdeaDialog();
    }
  }
).setNegativeButtonColorRes(R.color.md_pink_a200).show();
}

Fixed version (ground truth):
/** 
 * Show a dialog with the idea's text and note allows to delete or edit the idea
 */
private void showIdeaDialog(){
  mDetailedIdeaDialog=new LovelyCustomDialog(MainActivity.getInstance(),R.style.EditTextTintTheme).setView(R.layout.detailed_idea_form).setTopColor(getPriorityColor()).setIcon(R.drawable.ic_bulb).setListener(R.id.editButton,new View.OnClickListener(){
    @Override public void onClick(    View v){
      editIdeaDialog();
      mDetailedIdeaDialog.dismiss();
    }
  }
).setListener(R.id.deleteButton,new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mTabNumber == 4) {
        mRecyclerView.muteCellToDelete();
      }
 else {
        mRecyclerView.sendCellToTab(-1);
      }
      mDetailedIdeaDialog.dismiss();
    }
  }
).setListener(R.id.okButton,new View.OnClickListener(){
    @Override public void onClick(    View v){
      mDetailedIdeaDialog.dismiss();
    }
  }
).show();
  TextView title=(TextView)mDetailedIdeaDialog.findViewById(R.id.idea_dialog_title);
  title.setText(R.string.detailed_idea);
  RadioGroup radioGroup=(RadioGroup)mDetailedIdeaDialog.findViewById(R.id.radioGroup);
  mIdeaField=(EditText)mDetailedIdeaDialog.findViewById(R.id.editText);
  mNoteField=(EditText)mDetailedIdeaDialog.findViewById(R.id.editNote);
  mIdeaField.append(mDbHelper.getTextById(mIdRecycler));
  mNoteField.setText(mDbHelper.getNoteById(mIdRecycler));
  mNoteField.setEnabled(false);
  mIdeaField.setEnabled(false);
  RadioButton radio=null;
switch (mPriority) {
case 1:
    radio=(RadioButton)mDetailedIdeaDialog.findViewById(R.id.radioButton1);
  break;
case 2:
radio=(RadioButton)mDetailedIdeaDialog.findViewById(R.id.radioButton2);
break;
case 3:
radio=(RadioButton)mDetailedIdeaDialog.findViewById(R.id.radioButton3);
break;
}
radio.setChecked(true);
for (int i=0; i < radioGroup.getChildCount(); i++) {
radioGroup.getChildAt(i).setEnabled(false);
}
}
Program: 175424
Project: 175424
Buggy source:
private void goToMainActivity(){
  Intent i=new Intent(MyIntro.this,MainActivity.class);
  startActivity(i);
}

Fixed version (ground truth):
private void goToMainActivity(){
  Intent i=new Intent(MyIntro.this,MainActivity.class);
  i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
  startActivity(i);
}
Program: 175425
Project: 175425
Buggy source:
@Override public void onAnimationEnd(Animation animation){
  FloatingActionButton fab3=(FloatingActionButton)findViewById(R.id.item_p3);
  RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)fab3.getLayoutParams();
  params.setMargins(0,0,RADII,0);
  fab3.setLayoutParams(params);
  fab3.clearAnimation();
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animation animation){
  RelativeLayout.LayoutParams params=(RelativeLayout.LayoutParams)fab3.getLayoutParams();
  params.setMargins(0,0,RADIUS,0);
  fab3.setLayoutParams(params);
  fab3.clearAnimation();
  IdeaMenuItemListener.setReady(true);
}
Program: 175427
Project: 175427
Buggy source:
@Override public void run(){
  droppedView.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
@Override public void run(){
  MainActivity.getInstance().rebootIdeaMenuItems();
}
Program: 175431
Project: 175431
Buggy source:
@Override public View getChildView(int groupPosition,int childPosition,boolean isLastChild,View view,ViewGroup viewGroup){
  ViewHolder holder=new ViewHolder();
  holder.id=childPosition;
  holder.priority=groupPosition;
  MyRecyclerView horizontal_recycler_view;
  if (view == null) {
    view=inflater.inflate(R.layout.child_layout,viewGroup,false);
    horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
    ArrayList<Pair<Integer,String>> ideas=readIdeas(groupPosition);
    Pair<Integer,String> pair=ideas.get(childPosition);
    HorizontalAdapter horizontalAdapter=new HorizontalAdapter(pair.second,1);
    horizontal_recycler_view.setTag(pair.first);
    LinearLayoutManager horizontalLayoutManager=new LinearLayoutManager(inflater.getContext(),LinearLayoutManager.HORIZONTAL,false);
    horizontalLayoutManager.scrollToPositionWithOffset(1,0);
    horizontal_recycler_view.setLayoutManager(horizontalLayoutManager);
    horizontal_recycler_view.setAdapter(horizontalAdapter);
  }
  horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
  ArrayList<Pair<Integer,String>> ideas=readIdeas(groupPosition);
  Pair<Integer,String> pair=ideas.get(childPosition);
  HorizontalAdapter horizontalAdapter=(HorizontalAdapter)horizontal_recycler_view.getAdapter();
  horizontalAdapter.editText(pair.second);
  horizontalAdapter.notifyDataSetChanged();
  horizontal_recycler_view.setTag(pair.first);
  return view;
}

Fixed version (ground truth):
@Override public View getChildView(int groupPosition,int childPosition,boolean isLastChild,View view,ViewGroup viewGroup){
  view=inflater.inflate(R.layout.child_layout,viewGroup,false);
  MyRecyclerView horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
  ArrayList<Pair<Integer,String>> ideas=readIdeas(groupPosition);
  Pair<Integer,String> pair=ideas.get(childPosition);
  HorizontalAdapter horizontalAdapter=new HorizontalAdapter(pair.second,1);
  horizontal_recycler_view.setTag(pair.first);
  LinearLayoutManager horizontalLayoutManager=new LinearLayoutManager(inflater.getContext(),LinearLayoutManager.HORIZONTAL,false);
  horizontalLayoutManager.scrollToPositionWithOffset(1,0);
  horizontal_recycler_view.setLayoutManager(horizontalLayoutManager);
  horizontal_recycler_view.setAdapter(horizontalAdapter);
  horizontal_recycler_view.setUp();
  return view;
}
Program: 175432
Project: 175432
Buggy source:
@Override public View getView(int position,View view,ViewGroup parent){
  MyRecyclerView horizontal_recycler_view;
  if (view == null) {
    view=inflater.inflate(R.layout.child_layout,parent,false);
    horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
    ArrayList<Pair<Integer,String>> ideas=readIdeas();
    Pair<Integer,String> pair=ideas.get(position);
    HorizontalAdapter horizontalAdapter;
    if (mLater)     horizontalAdapter=new HorizontalAdapter(pair.second,2);
 else     horizontalAdapter=new HorizontalAdapter(pair.second,3);
    horizontal_recycler_view.setTag(pair.first);
    LinearLayoutManager horizontalLayoutManager=new LinearLayoutManager(inflater.getContext(),LinearLayoutManager.HORIZONTAL,false);
    horizontalLayoutManager.scrollToPositionWithOffset(1,0);
    horizontal_recycler_view.setLayoutManager(horizontalLayoutManager);
    horizontal_recycler_view.setAdapter(horizontalAdapter);
  }
  horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
  ArrayList<Pair<Integer,String>> ideas=readIdeas();
  Pair<Integer,String> pair=ideas.get(position);
  HorizontalAdapter horizontalAdapter=(HorizontalAdapter)horizontal_recycler_view.getAdapter();
  horizontalAdapter.editText(pair.second);
  horizontalAdapter.notifyDataSetChanged();
  horizontal_recycler_view.setTag(pair.first);
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View view,ViewGroup parent){
  view=inflater.inflate(R.layout.child_layout,parent,false);
  MyRecyclerView horizontal_recycler_view=(MyRecyclerView)view.findViewById(R.id.horizontal_recycler_view);
  ArrayList<Pair<Integer,String>> ideas=readIdeas();
  Pair<Integer,String> pair=ideas.get(position);
  HorizontalAdapter horizontalAdapter;
  if (mLater)   horizontalAdapter=new HorizontalAdapter(pair.second,2);
 else   horizontalAdapter=new HorizontalAdapter(pair.second,3);
  horizontal_recycler_view.setTag(pair.first);
  LinearLayoutManager horizontalLayoutManager=new LinearLayoutManager(inflater.getContext(),LinearLayoutManager.HORIZONTAL,false);
  horizontalLayoutManager.scrollToPositionWithOffset(1,0);
  horizontal_recycler_view.setLayoutManager(horizontalLayoutManager);
  horizontal_recycler_view.setAdapter(horizontalAdapter);
  horizontal_recycler_view.setUp();
  return view;
}
Program: 175434
Project: 175434
Buggy source:
public MyRecyclerView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
}

Fixed version (ground truth):
public MyRecyclerView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  isActivated=false;
}
Program: 175435
Project: 175435
Buggy source:
@Override public void onScrollStateChanged(int state){
  LinearLayoutManager manager=(LinearLayoutManager)this.getLayoutManager();
  int width=manager.getChildAt(0).getWidth();
  double limLeft=0.4d * width;
  double limRight=0.6d * width;
  if (state != RecyclerView.SCROLL_STATE_DRAGGING && !isActivated) {
    View child;
    int first=manager.findFirstVisibleItemPosition();
    int last=manager.findLastVisibleItemPosition();
    int left, right;
    if ((child=manager.getChildAt(0)) != null && first == 0) {
      right=child.getRight();
      if (right > limLeft) {
        isActivated=true;
        smoothScrollToPosition(0);
      }
 else       smoothScrollToPosition(1);
    }
 else     if ((child=manager.getChildAt(1)) != null && last == 2) {
      left=child.getLeft();
      if (left < limRight) {
        isActivated=true;
        smoothScrollToPosition(2);
      }
 else       smoothScrollToPosition(1);
    }
  }
 else   if (isActivated && state == RecyclerView.SCROLL_STATE_IDLE) {
    int first=manager.findFirstVisibleItemPosition();
    if ((manager.getChildAt(0)) != null && first == 0) {
      int tagId=(int)this.getTag();
      editEntry(true,tagId);
    }
 else {
      int tagId=(int)this.getTag();
      editEntry(false,tagId);
    }
  }
}

Fixed version (ground truth):
@Override public void onScrollStateChanged(int state){
  int tab=mAdapter.getTabNumber();
switch (tab) {
case 1:
    stateChangedIdea(state);
  break;
case 2:
stateChangeOther(state);
break;
case 3:
stateChangeOther(state);
break;
}
}
Program: 175436
Project: 175436
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  mDbHelper=DatabaseHelper.getInstance(this);
  mDatabase=mDbHelper.getWritableDatabase();
  mSectionsPagerAdapter=new SectionsPagerAdapter(getSupportFragmentManager());
  mViewPager=(NonSwipeableViewPager)findViewById(R.id.container);
  mViewPager.setAdapter(mSectionsPagerAdapter);
  scrollTillEnd();
  TabLayout tabLayout=(TabLayout)findViewById(R.id.tabLayout);
  tabLayout.setupWithViewPager(mViewPager);
  tabLayout.removeAllTabs();
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  FloatingActionButton fab=(FloatingActionButton)findViewById(R.id.fab);
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      newIdeaDialog();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar);
  setSupportActionBar(toolbar);
  mDbHelper=DatabaseHelper.getInstance(this);
  mDatabase=mDbHelper.getWritableDatabase();
  mSectionsPagerAdapter=new SectionsPagerAdapter(getSupportFragmentManager());
  mViewPager=(NonSwipeableViewPager)findViewById(R.id.container);
  mViewPager.setAdapter(mSectionsPagerAdapter);
  TabLayout tabLayout=(TabLayout)findViewById(R.id.tabLayout);
  tabLayout.setupWithViewPager(mViewPager);
  tabLayout.removeAllTabs();
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  tabLayout.addTab(tabLayout.newTab().setText("String_Node_Str"));
  FloatingActionButton fab=(FloatingActionButton)findViewById(R.id.fab);
  fab.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      newIdeaDialog();
    }
  }
);
}
Program: 175437
Project: 175437
Buggy source:
@Override public void connect(ServerInfo target,Callback<Boolean> callback){
}

Fixed version (ground truth):
@Override public void connect(ServerInfo target,Callback<Boolean> callback,Reason reason){
  callback.done(false,null);
}
Program: 175438
Project: 175438
Buggy source:
private static String loadHeader(){
  StringBuilder header=new StringBuilder();
  try {
    @Cleanup BufferedReader reader=new BufferedReader(new InputStreamReader(BungeeChat.getInstance().getResourceAsStream(CONFIG_FILE_NAME),StandardCharsets.UTF_8));
    do {
      line=reader.readLine();
      header.append(line).append('\n');
    }
 while (line.startsWith("String_Node_Str"));
  }
 catch (  IOException e) {
    LoggerHelper.error("String_Node_Str",e);
  }
  return header.toString();
}

Fixed version (ground truth):
private static String loadHeader(){
  StringBuilder header=new StringBuilder();
  try {
    @Cleanup BufferedReader reader=new BufferedReader(new InputStreamReader(BungeeChat.getInstance().getResourceAsStream(CONFIG_FILE_NAME),StandardCharsets.UTF_8));
    String line;
    do {
      line=reader.readLine();
      header.append(line).append('\n');
    }
 while (line.startsWith("String_Node_Str"));
  }
 catch (  IOException e) {
    LoggerHelper.error("String_Node_Str",e);
  }
  return header.toString();
}
Program: 175439
Project: 175439
Buggy source:
@SneakyThrows(ManagedProcessException.class) public static void startDatabase(){
  final int limit=100;
  int count=0;
  String actualBaseDir;
  String actualDataDir;
  do {
    actualBaseDir=baseDir + count;
  }
 while ((++count < limit) && (new File(actualBaseDir)).exists());
  Preconditions.checkElementIndex(count,limit,"String_Node_Str" + limit);
  actualDataDir=actualBaseDir + "String_Node_Str";
  final DBConfiguration config=DBConfigurationBuilder.newBuilder().setPort(0).setSocket(localhost).setBaseDir(actualBaseDir).setDataDir(actualDataDir).build();
  databaseInstance=DB.newEmbeddedDB(config);
  databaseInstance.start();
  port=databaseInstance.getConfiguration().getPort();
  host=localhost + ':' + port;
  databaseInstance.createDB("String_Node_Str");
}

Fixed version (ground truth):
@SneakyThrows(ManagedProcessException.class) @SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public static void startDatabase(){
  final int limit=100;
  int count=0;
  String actualBaseDir;
  String actualDataDir;
  do {
    actualBaseDir=baseDir + count;
  }
 while ((++count < limit) && (new File(actualBaseDir)).exists());
  Preconditions.checkElementIndex(count,limit,"String_Node_Str" + limit);
  actualDataDir=actualBaseDir + "String_Node_Str";
  final DBConfiguration config=DBConfigurationBuilder.newBuilder().setPort(0).setSocket(localhost).setBaseDir(actualBaseDir).setDataDir(actualDataDir).build();
  databaseInstance=DB.newEmbeddedDB(config);
  databaseInstance.start();
  port=databaseInstance.getConfiguration().getPort();
  host=localhost + ':' + port;
  databaseInstance.createDB("String_Node_Str");
}
Program: 175440
Project: 175440
Buggy source:
public static Connection getDatabaseInstance() throws SQLException {
  return DriverManager.getConnection("String_Node_Str" + host + "String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public static Connection getDatabaseInstance() throws SQLException {
  return DriverManager.getConnection("String_Node_Str" + host + "String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 175441
Project: 175441
Buggy source:
public static void deinitBungeeChat() throws IOException {
  FileUtils.deleteDirectory(bungeeChat.getConfigFolder());
  bungeeChat.getConfigFolder().mkdirs();
}

Fixed version (ground truth):
public static void deinitBungeeChat() throws IOException {
  FileUtils.deleteDirectory(bungeeChat.getConfigFolder());
  Preconditions.checkState(bungeeChat.getConfigFolder().mkdirs(),"String_Node_Str");
}
Program: 175442
Project: 175442
Buggy source:
private static void cleanTempDir(){
  if (tempDir.exists()) {
    for (    File f : tempDir.listFiles()) {
      f.delete();
    }
    tempDir.delete();
  }
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") private static void cleanTempDir(){
  if (tempDir.exists()) {
    final File[] files=tempDir.listFiles();
    if (files != null) {
      for (      File f : files) {
        f.delete();
      }
    }
    tempDir.delete();
  }
}
Program: 175443
Project: 175443
Buggy source:
@Before public void setUp(){
  tempDir.mkdirs();
}

Fixed version (ground truth):
@Before public void setUp(){
  Preconditions.checkState(tempDir.mkdirs(),"String_Node_Str");
}
Program: 175444
Project: 175444
Buggy source:
@AfterClass public static void tearDownClass(){
  cleanTempDir();
  tempDir.delete();
}

Fixed version (ground truth):
@AfterClass public static void tearDownClass(){
  cleanTempDir();
}
Program: 175446
Project: 175446
Buggy source:
public static Predicate<BungeeChatAccount> getGlobalPredicate(){
  final Config section=BungeecordModuleManager.GLOBAL_CHAT_MODULE.getModuleSection().atPath("String_Node_Str");
  if (!section.getBoolean("String_Node_Str"))   return account -> true;
 else {
    List<String> allowedServers=section.getStringList("String_Node_Str");
    return account -> allowedServers.contains(account.getServerName());
  }
}

Fixed version (ground truth):
public static Predicate<BungeeChatAccount> getGlobalPredicate(){
  final Config section=BungeecordModuleManager.GLOBAL_CHAT_MODULE.getModuleSection().getConfig("String_Node_Str");
  if (!section.getBoolean("String_Node_Str"))   return account -> true;
 else {
    List<String> allowedServers=section.getStringList("String_Node_Str");
    return account -> allowedServers.contains(account.getServerName());
  }
}
Program: 175447
Project: 175447
Buggy source:
protected void load(){
  Config defaultConfig=ConfigFactory.parseReader(new InputStreamReader(BungeeChat.getInstance().getResourceAsStream(CONFIG_FILE_NAME)),PARSE_OPTIONS);
  if (CONFIG_FILE.exists()) {
    Config fileConfig=ConfigFactory.parseFile(CONFIG_FILE,PARSE_OPTIONS);
    config=fileConfig.withFallback(defaultConfig);
  }
 else {
    config=defaultConfig;
  }
  save();
}

Fixed version (ground truth):
protected void load(){
  Config defaultConfig=ConfigFactory.parseReader(new InputStreamReader(BungeeChat.getInstance().getResourceAsStream(CONFIG_FILE_NAME)),PARSE_OPTIONS);
  if (CONFIG_FILE.exists()) {
    Config fileConfig=ConfigFactory.parseFile(CONFIG_FILE,PARSE_OPTIONS);
    config=fileConfig.withFallback(defaultConfig);
  }
 else {
    config=defaultConfig;
  }
  config=config.resolve();
  save();
}
Program: 175448
Project: 175448
Buggy source:
public static Predicate<? super BungeeChatAccount> getLocalPredicate(String serverName){
  return account -> serverName.equals(account.getServerName());
}

Fixed version (ground truth):
public static Predicate<BungeeChatAccount> getLocalPredicate(String serverName){
  return account -> serverName.equals(account.getServerName());
}
Program: 175449
Project: 175449
Buggy source:
public static void sendLocalMessage(BungeeChatContext context) throws InvalidContextError {
  context.require(BungeeChatContext.HAS_SENDER,BungeeChatContext.HAS_MESSAGE);
  Optional<BungeeChatAccount> account=context.getSender();
  Optional<String> finalMessage=preProcessMessage(context,Format.LOCAL_CHAT);
  String localServerName=context.getSender().get().getServerName();
  Predicate<? super BungeeChatAccount> isLocal=getLocalPredicate(localServerName);
  sendToMatchingPlayers(finalMessage,isLocal);
  ChatLoggingManager.logMessage(ChannelType.LOCAL,context);
  if (ModuleManager.isModuleActive(BungeecordModuleManager.SPY_MODULE)) {
    String localSpyMessage=preProcessMessage(context,account,Format.LOCAL_SPY,false).get();
    Predicate<? super BungeeChatAccount> isNotLocal=isLocal.negate();
    sendToMatchingPlayers(localSpyMessage,BungeeChatAccount::hasLocalSpyEnabled,isNotLocal);
  }
}

Fixed version (ground truth):
public static void sendLocalMessage(BungeeChatContext context) throws InvalidContextError {
  context.require(BungeeChatContext.HAS_SENDER,BungeeChatContext.HAS_MESSAGE);
  Optional<BungeeChatAccount> account=context.getSender();
  Optional<String> finalMessage=preProcessMessage(context,Format.LOCAL_CHAT);
  String localServerName=context.getSender().get().getServerName();
  Predicate<BungeeChatAccount> isLocal=getLocalPredicate(localServerName);
  sendToMatchingPlayers(finalMessage,isLocal);
  ChatLoggingManager.logMessage(ChannelType.LOCAL,context);
  if (ModuleManager.isModuleActive(BungeecordModuleManager.SPY_MODULE)) {
    String localSpyMessage=preProcessMessage(context,account,Format.LOCAL_SPY,false).get();
    Predicate<BungeeChatAccount> isNotLocal=isLocal.negate();
    sendToMatchingPlayers(localSpyMessage,BungeeChatAccount::hasLocalSpyEnabled,isNotLocal);
  }
}
Program: 175450
Project: 175450
Buggy source:
public static Predicate<? super BungeeChatAccount> getGlobalPredicate(){
  final Configuration section=BungeecordModuleManager.GLOBAL_CHAT_MODULE.getModuleSection().getSection("String_Node_Str");
  if (!section.getBoolean("String_Node_Str"))   return account -> true;
 else {
    List<String> allowedServers=section.getStringList("String_Node_Str");
    return account -> allowedServers.contains(account.getServerName());
  }
}

Fixed version (ground truth):
public static Predicate<BungeeChatAccount> getGlobalPredicate(){
  final Configuration section=BungeecordModuleManager.GLOBAL_CHAT_MODULE.getModuleSection().getSection("String_Node_Str");
  if (!section.getBoolean("String_Node_Str"))   return account -> true;
 else {
    List<String> allowedServers=section.getStringList("String_Node_Str");
    return account -> allowedServers.contains(account.getServerName());
  }
}
Program: 175451
Project: 175451
Buggy source:
@SafeVarargs @SuppressWarnings("String_Node_Str") public static void sendToMatchingPlayers(String finalMessage,Predicate<? super BungeeChatAccount>... playerFilters){
  Predicate<? super BungeeChatAccount> playerFiler=Arrays.stream(playerFilters).reduce(acc -> true,Predicate::and);
  AccountManager.getPlayerAccounts().stream().filter(playerFiler).forEach(account -> BungeecordAccountManager.getCommandSender(account).get().sendMessage(finalMessage));
}

Fixed version (ground truth):
@SafeVarargs @SuppressWarnings("String_Node_Str") public static void sendToMatchingPlayers(String finalMessage,Predicate<BungeeChatAccount>... playerFilters){
  Predicate<BungeeChatAccount> playerFiler=Arrays.stream(playerFilters).reduce(Predicate::and).orElse(acc -> true);
  AccountManager.getPlayerAccounts().stream().filter(playerFiler).forEach(account -> BungeecordAccountManager.getCommandSender(account).get().sendMessage(finalMessage));
}
Program: 175454
Project: 175454
Buggy source:
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer player=(ProxiedPlayer)e.getSender();
  Optional<BungeeChatAccount> bungeeChatAccountOptional=AccountManager.getAccount(player.getUniqueId());
  ChannelType c=bungeeChatAccountOptional.get().getChannelType();
  if ((c.equals(ChannelType.GLOBAL) && !BungeecordModuleManager.isModuleActive(BungeecordModuleManager.GLOBAL_CHAT_MODULE)) || (c.equals(ChannelType.STAFF) && !BungeecordModuleManager.isModuleActive(BungeecordModuleManager.STAFF_CHAT_MODULE))) {
    e.setCancelled(true);
    bungeeChatAccountOptional.get().setChannelType(ChannelType.LOCAL);
    player.sendMessage(Message.BACK_TO_LOCAL.get());
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST) public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer player=(ProxiedPlayer)e.getSender();
  Optional<BungeeChatAccount> bungeeChatAccountOptional=AccountManager.getAccount(player.getUniqueId());
  ChannelType c=bungeeChatAccountOptional.get().getChannelType();
  if ((c.equals(ChannelType.GLOBAL) && (!BungeecordModuleManager.isModuleActive(BungeecordModuleManager.GLOBAL_CHAT_MODULE) || !PermissionManager.hasPermission(player,Permission.COMMAND_GLOBAL))) || (c.equals(ChannelType.STAFF) && (!BungeecordModuleManager.isModuleActive(BungeecordModuleManager.STAFF_CHAT_MODULE) || !PermissionManager.hasPermission(player,Permission.COMMAND_STAFFCHAT)))) {
    e.setCancelled(true);
    bungeeChatAccountOptional.get().setChannelType(ChannelType.LOCAL);
    player.sendMessage(Message.BACK_TO_LOCAL.get());
  }
}
Program: 175456
Project: 175456
Buggy source:
@EventHandler(priority=EventPriority.LOW) public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer sender=(ProxiedPlayer)e.getSender();
  String message=e.getMessage();
  if ((BungeecordAccountManager.getAccount(sender).get().getChannelType() == ChannelType.STAFF) && !ChatUtils.isCommand(message)) {
    if (!PermissionManager.hasPermission(sender,Permission.COMMAND_STAFFCHAT)) {
      BungeecordAccountManager.getAccount(sender).get().setChannelType(ChannelType.LOCAL);
      return;
    }
    e.setCancelled(true);
    MessagesService.sendStaffMessage(sender,message);
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer sender=(ProxiedPlayer)e.getSender();
  String message=e.getMessage();
  if ((BungeecordAccountManager.getAccount(sender).get().getChannelType() == ChannelType.STAFF) && !ChatUtils.isCommand(message)) {
    e.setCancelled(true);
    MessagesService.sendStaffMessage(sender,message);
  }
}
Program: 175457
Project: 175457
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void execute(CommandSender sender,String[] args){
  if (PermissionManager.hasPermission(sender,Permission.COMMAND_TOGGLE_MESSAGE)) {
    if (!(sender instanceof ProxiedPlayer)) {
      sender.sendMessage(Message.NOT_A_PLAYER.get());
    }
 else {
      BungeeChatAccount player=BungeecordAccountManager.getAccount(sender).get();
      player.toggleVanished();
      if (player.isVanished()) {
        sender.sendMessage(Message.ENABLE_VANISH.get());
      }
 else {
        sender.sendMessage(Message.DISABLE_VANISH.get());
      }
    }
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void execute(CommandSender sender,String[] args){
  if (PermissionManager.hasPermission(sender,Permission.COMMAND_VANISH)) {
    if (!(sender instanceof ProxiedPlayer)) {
      sender.sendMessage(Message.NOT_A_PLAYER.get());
    }
 else {
      BungeeChatAccount player=BungeecordAccountManager.getAccount(sender).get();
      player.toggleVanished();
      if (player.isVanished()) {
        sender.sendMessage(Message.ENABLE_VANISH.get());
      }
 else {
        sender.sendMessage(Message.DISABLE_VANISH.get());
      }
    }
  }
}
Program: 175458
Project: 175458
Buggy source:
public void onEnable(boolean prinLoadScreen){
  Config.load();
  PlaceHolders.registerPlaceholders();
  AccountManager.setAccountStorage(new AccountFileStorage());
  if (CONFIG_VERSION != Config.get().getDouble("String_Node_Str")) {
    LoggerHelper.info("String_Node_Str");
    LoggerHelper.info("String_Node_Str");
    return;
  }
  bungeeChatCommand=new BungeeChatCommand();
  bungeecordAccountManager=new BungeecordAccountManager();
  ProxyServer.getInstance().getPluginManager().registerCommand(this,bungeeChatCommand);
  ProxyServer.getInstance().getPluginManager().registerListener(this,bungeecordAccountManager);
  Configuration permissionsManager=Config.get().getSection("String_Node_Str");
  BungeecordModuleManager.registerPluginModules();
  ModuleManager.enableModules();
  HookManager.addHook(storedDataHookName,new StoredDataHook());
  HookManager.addHook(defaultHookName,new DefaultHook(permissionsManager.getString("String_Node_Str"),permissionsManager.getString("String_Node_Str")));
  if (prinLoadScreen) {
    loadScreen();
  }
}

Fixed version (ground truth):
public void onEnable(boolean prinLoadScreen){
  Config.load();
  PlaceHolders.registerPlaceholders();
  AccountManager.setAccountStorage(new AccountFileStorage());
  if (CONFIG_VERSION != Config.get().getDouble("String_Node_Str")) {
    LoggerHelper.info("String_Node_Str");
    LoggerHelper.info("String_Node_Str");
    return;
  }
  bungeeChatCommand=new BungeeChatCommand();
  bungeecordAccountManager=new BungeecordAccountManager();
  channelTypeCorrectorListener=new ChannelTypeCorrectorListener();
  ProxyServer.getInstance().getPluginManager().registerCommand(this,bungeeChatCommand);
  ProxyServer.getInstance().getPluginManager().registerListener(this,bungeecordAccountManager);
  ProxyServer.getInstance().getPluginManager().registerListener(this,channelTypeCorrectorListener);
  Configuration permissionsManager=Config.get().getSection("String_Node_Str");
  BungeecordModuleManager.registerPluginModules();
  ModuleManager.enableModules();
  HookManager.addHook(storedDataHookName,new StoredDataHook());
  HookManager.addHook(defaultHookName,new DefaultHook(permissionsManager.getString("String_Node_Str"),permissionsManager.getString("String_Node_Str")));
  if (prinLoadScreen) {
    loadScreen();
  }
}
Program: 175459
Project: 175459
Buggy source:
@Override public void onDisable(){
  HookManager.removeHook(defaultHookName);
  HookManager.removeHook(storedDataHookName);
  ModuleManager.disableModules();
  ProxyServer.getInstance().getPluginManager().unregisterListener(bungeecordAccountManager);
  ProxyServer.getInstance().getPluginManager().unregisterCommand(bungeeChatCommand);
  ProxyServer.getInstance().getPluginManager().unregisterListeners(this);
  ProxyServer.getInstance().getPluginManager().unregisterCommands(this);
  PlaceHolderManager.clear();
  ModuleManager.clearActiveModules();
}

Fixed version (ground truth):
@Override public void onDisable(){
  HookManager.removeHook(defaultHookName);
  HookManager.removeHook(storedDataHookName);
  ModuleManager.disableModules();
  ProxyServer.getInstance().getPluginManager().unregisterListener(bungeecordAccountManager);
  ProxyServer.getInstance().getPluginManager().unregisterCommand(bungeeChatCommand);
  ProxyServer.getInstance().getPluginManager().unregisterListener(channelTypeCorrectorListener);
  ProxyServer.getInstance().getPluginManager().unregisterListeners(this);
  ProxyServer.getInstance().getPluginManager().unregisterCommands(this);
  PlaceHolderManager.clear();
  ModuleManager.clearActiveModules();
}
Program: 175460
Project: 175460
Buggy source:
@EventHandler public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer sender=(ProxiedPlayer)e.getSender();
  BungeeChatAccount account=BungeecordAccountManager.getAccount(sender).get();
  String message=e.getMessage();
  if (((account.getChannelType() == ChannelType.NONE) || (account.getChannelType() == ChannelType.LOCAL)) && !ChatUtils.isCommand(message)) {
    e.setCancelled(true);
    MessagesService.sendLocalMessage(sender,message);
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerChat(ChatEvent e){
  if (e.isCancelled())   return;
  if (!(e.getSender() instanceof ProxiedPlayer))   return;
  ProxiedPlayer sender=(ProxiedPlayer)e.getSender();
  BungeeChatAccount account=BungeecordAccountManager.getAccount(sender).get();
  String message=e.getMessage();
  if (account.getChannelType() == ChannelType.LOCAL && !ChatUtils.isCommand(message)) {
    e.setCancelled(true);
    MessagesService.sendLocalMessage(sender,message);
  }
}
Program: 175461
Project: 175461
Buggy source:
public static void sendChannelMessage(BungeeChatContext context,ChannelType channel) throws InvalidContextError {
  context.require(BungeeChatContext.HAS_SENDER,BungeeChatContext.HAS_MESSAGE);
switch (channel) {
case GLOBAL:
    sendGlobalMessage(context);
  break;
case LOCAL:
sendLocalMessage(context);
break;
case STAFF:
sendStaffMessage(context);
break;
case HELP:
sendHelpMessage(context);
break;
case GROUP:
break;
case NONE:
default :
break;
}
}

Fixed version (ground truth):
public static void sendChannelMessage(BungeeChatContext context,ChannelType channel) throws InvalidContextError {
  context.require(BungeeChatContext.HAS_SENDER,BungeeChatContext.HAS_MESSAGE);
switch (channel) {
case GLOBAL:
    sendGlobalMessage(context);
  break;
case LOCAL:
sendLocalMessage(context);
break;
case STAFF:
sendStaffMessage(context);
break;
case HELP:
sendHelpMessage(context);
break;
case GROUP:
break;
default :
break;
}
}
Program: 175462
Project: 175462
Buggy source:
@Override public boolean isContextApplicable(BungeeChatContext context){
  for (  Predicate<? super BungeeChatContext> requirement : requirements) {
    if (requirement.test(context))     return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isContextApplicable(BungeeChatContext context){
  for (  Predicate<? super BungeeChatContext> requirement : requirements) {
    if (!requirement.test(context))     return false;
  }
  return true;
}
Program: 175463
Project: 175463
Buggy source:
@Override public void onEnable(){
  instance=this;
  BungeeChatInstaceHolder.setInstance(instance);
  Config.load();
  if (CONFIG_VERSION != Config.get().getDouble("String_Node_Str")) {
    Logger.info("String_Node_Str");
    Logger.info("String_Node_Str");
    return;
  }
  ProxyServer.getInstance().getPluginManager().registerCommand(this,new ReloadCommand());
  ProxyServer.getInstance().getPluginManager().registerListener(this,new AccountManager());
  ModuleManager.enableModules();
  loadScreen();
}

Fixed version (ground truth):
@Override public void onEnable(){
  instance=this;
  BungeeChatInstaceHolder.setInstance(instance);
  Config.load();
  PlaceHolders.registerPlaceholders();
  if (CONFIG_VERSION != Config.get().getDouble("String_Node_Str")) {
    Logger.info("String_Node_Str");
    Logger.info("String_Node_Str");
    return;
  }
  ProxyServer.getInstance().getPluginManager().registerCommand(this,new ReloadCommand());
  ProxyServer.getInstance().getPluginManager().registerListener(this,new AccountManager());
  ModuleManager.enableModules();
  loadScreen();
}
Program: 175464
Project: 175464
Buggy source:
/** 
 * Gives a general answer to a general user input.
 * @param phrase given in input
 * @return  a BrainResponse instance, containing a general answer
 * @see com.github.bot.curiosone.core.nlp.Phrase The Sentence Phrase
 * @see com.github.bot.curiosone.core.nlp.BrainResponse The BrainResponse Class
 */
public static BrainResponse getAnswer(Phrase phrase){
  List<Token> tokenList=phrase.getTokens();
  if (tokenList.size() == 1) {
    return new BrainResponse(phrase.getText() + CONSTANTS[randomIndex(CONSTANTS)],"String_Node_Str");
  }
 else {
    long count=tokenList.stream().map(Token::isKnown).filter(x -> !x).count();
    if (count > tokenList.size() / 2) {
      return new BrainResponse(ENGLISH_ANSWERS[randomIndex(ENGLISH_ANSWERS)],"String_Node_Str");
    }
  }
  return new BrainResponse(GENERAL_ANSWERS[randomIndex(GENERAL_ANSWERS)],"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Gives a general answer to a general user input.
 * @param phrase given in input
 * @return  a BrainResponse instance, containing a general answer
 * @see com.github.bot.curiosone.core.nlp.Phrase The Sentence Phrase
 * @see com.github.bot.curiosone.core.extraction.BrainResponse The BrainResponse Class
 */
public static BrainResponse getAnswer(Phrase phrase){
  List<Token> tokenList=phrase.getTokens();
  if (tokenList.size() == 1) {
    return new BrainResponse(phrase.getText() + CONSTANTS[randomIndex(CONSTANTS)],"String_Node_Str");
  }
 else {
    long count=tokenList.stream().map(Token::isKnown).filter(x -> !x).count();
    if (count > tokenList.size() / 2) {
      return new BrainResponse(ENGLISH_ANSWERS[randomIndex(ENGLISH_ANSWERS)],"String_Node_Str");
    }
  }
  return new BrainResponse(GENERAL_ANSWERS[randomIndex(GENERAL_ANSWERS)],"String_Node_Str");
}
Program: 175465
Project: 175465
Buggy source:
/** 
 * @return  the lexical category for this meaning.
 */
public LEX getLEX(){
  return lex;
}

Fixed version (ground truth):
/** 
 * Gets the Lexical category for this Meaning.
 * @return  the Lexical category for this Meaning
 */
public LEX getLEX(){
  return lex;
}
Program: 175466
Project: 175466
Buggy source:
/** 
 * @return  the part of speech type for this meaning.
 */
public POS getPOS(){
  return pos;
}

Fixed version (ground truth):
/** 
 * Gets the Part of Speech type for this Meaning.
 * @return  the Part of Speech type for this Meaning
 */
public POS getPOS(){
  return pos;
}
Program: 175467
Project: 175467
Buggy source:
/** 
 * @return  frequency for this meaning.
 */
public int getFrequency(){
  return freq;
}

Fixed version (ground truth):
/** 
 * Gets the frequency for this Meaning.
 * @return  frequency for this Meaning
 */
public int getFrequency(){
  return freq;
}
Program: 175468
Project: 175468
Buggy source:
/** 
 * Compares this Meaning to the other meaning.
 * @param other the other Meaning to be compared against
 * @return a negative value if this is ordered before other;a positive value if this is ordered after other; zero if this and other are ordered together.
 */
@Override public int compareTo(Meaning other){
  return this.freq - other.freq;
}

Fixed version (ground truth):
/** 
 * Compares this Meaning to the other Meaning.
 * @param other the other Meaning to be compared against
 * @return a negative value if this is ordered before other;a positive value if this is ordered after other; zero if this and other are ordered together.
 */
@Override public int compareTo(Meaning other){
  return this.freq - other.freq;
}
Program: 175469
Project: 175469
Buggy source:
/** 
 * Constructs this Meaning instance with a given POS, LEX and a default frequency.
 * @param pos the part of speech type for this new meaning
 * @param lex the lexical category for this new meaning
 */
public Meaning(POS pos,LEX lex){
  this.pos=pos;
  this.lex=lex;
  this.freq=0;
}

Fixed version (ground truth):
/** 
 * Constructs this Meaning instance with a given POS, LEX and a default frequency.
 * @param pos the part of speech type for this new Meaning
 * @param lex the lexical category for this new Meaning
 */
public Meaning(POS pos,LEX lex){
  this.pos=pos;
  this.lex=lex;
  this.freq=0;
}
Program: 175470
Project: 175470
Buggy source:
/** 
 * Sets the frequency for this meaning.
 * @param frequency the frequency value to be set. Must be a positive integer
 * @throws IllegalArgumentException if negative frequency is passed
 */
public void setFrequency(int frequency){
  if (frequency < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  freq=frequency;
}

Fixed version (ground truth):
/** 
 * Sets the frequency for this Meaning.
 * @param frequency the frequency value to be set. Must be a positive integer
 * @throws IllegalArgumentException if negative frequency is passed
 */
public void setFrequency(int frequency){
  if (frequency < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  freq=frequency;
}
Program: 175471
Project: 175471
Buggy source:
/** 
 * @return  the subject of this SemanticQuery.
 */
public String getSubject(){
  return subject;
}

Fixed version (ground truth):
/** 
 * Gets the subject of this SemanticQuery.
 * @return  the subject of this SemanticQuery
 */
public String getSubject(){
  return subject;
}
Program: 175472
Project: 175472
Buggy source:
/** 
 * @return  the object of this SemanticQuery.
 */
public String getObject(){
  return object;
}

Fixed version (ground truth):
/** 
 * Gets the object of this SemanticQuery.
 * @return  the object of this SemanticQuery
 */
public String getObject(){
  return object;
}
Program: 175473
Project: 175473
Buggy source:
/** 
 * @return  the verb of this SemanticQuery.
 */
public String getVerb(){
  return verb;
}

Fixed version (ground truth):
/** 
 * Gets the verb of this SemanticQuery.
 * @return  the verb of this SemanticQuery
 */
public String getVerb(){
  return verb;
}
Program: 175474
Project: 175474
Buggy source:
/** 
 * @return  a List containing all the adjectives of this SemanticQuery.
 */
public List<String> getAdjectives(){
  return objAdjectives;
}

Fixed version (ground truth):
/** 
 * Gets the adjectives of this SemanticQuery.
 * @return  a List containing all the adjectives of this SemanticQuery
 */
public List<String> getAdjectives(){
  return objAdjectives;
}
Program: 175475
Project: 175475
Buggy source:
/** 
 * @return  the relation of this SemanticQuery.
 */
public SemanticRelationType getRelation(){
  return relation;
}

Fixed version (ground truth):
/** 
 * Gets the relation of this SemanticQuery.
 * @return  the relation of this SemanticQuery
 */
public SemanticRelationType getRelation(){
  return relation;
}
Program: 175476
Project: 175476
Buggy source:
/** 
 * Private constructor. Loads the Semantic Network in memory.
 * @throws IOException if there is a problem with the input file.
 */
private SemanticNetwork() throws IOException {
  this.grafo=new HashMap<>();
  List<String> lines=new ArrayList<>();
  lines=Files.readAllLines(this.percorso);
  for (  String linea : lines) {
    String[] linee=linea.split("String_Node_Str");
    Vertex source=new Concept(linee[0]);
    Vertex target=new Concept(linee[2]);
    SemanticRelationType type=SemanticRelationType.valueOf(linee[1].trim());
    SemanticRelation arco=new SemanticRelation(source,target,type,Integer.parseInt(linee[3]));
    this.add(arco);
  }
}

Fixed version (ground truth):
/** 
 * Private constructor. Loads the Semantic Network in memory.
 * @throws IOException if there is a problem with the input file
 */
private SemanticNetwork() throws IOException {
  this.grafo=new HashMap<>();
  List<String> lines=new ArrayList<>();
  lines=Files.readAllLines(this.percorso);
  for (  String linea : lines) {
    String[] linee=linea.split("String_Node_Str");
    Vertex source=new Concept(linee[0]);
    Vertex target=new Concept(linee[2]);
    SemanticRelationType type=SemanticRelationType.valueOf(linee[1].trim());
    SemanticRelation arco=new SemanticRelation(source,target,type,Integer.parseInt(linee[3]));
    this.add(arco);
  }
}
Program: 175477
Project: 175477
Buggy source:
/** 
 * @return  a Set containg all the Semantis Relations outgoing from the given Vertex.
 */
@Override public Set<Edge> outgoingEdges(Vertex v){
  Set<Edge> outgoingEdges=new HashSet<>();
  if (containsVertex(v)) {
    for (    Edge arco : grafo.get(v)) {
      if (arco.getSource().equals(v)) {
        outgoingEdges.add(arco);
      }
    }
  }
  return outgoingEdges;
}

Fixed version (ground truth):
/** 
 * Gets all the outgoing Edges from the given Vertex.
 * @return  a Set containg all the Semantis Relations outgoing from the given Vertex
 */
@Override public Set<Edge> outgoingEdges(Vertex v){
  Set<Edge> outgoingEdges=new HashSet<>();
  if (containsVertex(v)) {
    for (    Edge arco : grafo.get(v)) {
      if (arco.getSource().equals(v)) {
        outgoingEdges.add(arco);
      }
    }
  }
  return outgoingEdges;
}
Program: 175478
Project: 175478
Buggy source:
/** 
 * @return  a Set containing all the Edges of this SemanticNetwork.
 */
@Override public Set<Edge> edgeSet(){
  Set<Edge> archi=new HashSet<>();
  for (  Set<Edge> archiTemp : grafo.values()) {
    archi.addAll(archiTemp);
  }
  return archi;
}

Fixed version (ground truth):
/** 
 * Gets all the Edges of this SemanticNetwork.
 * @return  a Set containing all the Edges of this SemanticNetwork
 */
@Override public Set<Edge> edgeSet(){
  Set<Edge> archi=new HashSet<>();
  for (  Set<Edge> archiTemp : grafo.values()) {
    archi.addAll(archiTemp);
  }
  return archi;
}
Program: 175479
Project: 175479
Buggy source:
/** 
 * @return  a Set containg all the Semantis Relations incoming from the given Vertex.
 */
@Override public Set<Edge> incomingEdges(Vertex v){
  Set<Edge> incomingEdges=new HashSet<>();
  if (containsVertex(v)) {
    for (    Edge arco : grafo.get(v)) {
      if (arco.getTarget().equals(v)) {
        incomingEdges.add(arco);
      }
    }
  }
  return incomingEdges;
}

Fixed version (ground truth):
/** 
 * Gets all the incoming Edges to the given Vertex.
 * @return  a Set containg all the Semantis Relations coming to the given Vertex
 */
@Override public Set<Edge> incomingEdges(Vertex v){
  Set<Edge> incomingEdges=new HashSet<>();
  if (containsVertex(v)) {
    for (    Edge arco : grafo.get(v)) {
      if (arco.getTarget().equals(v)) {
        incomingEdges.add(arco);
      }
    }
  }
  return incomingEdges;
}
Program: 175480
Project: 175480
Buggy source:
/** 
 * @return  the Map representation of this Semantic Network.
 */
@Override public Map<Vertex,Set<Edge>> getGrafo(){
  return grafo;
}

Fixed version (ground truth):
/** 
 * Gets the Map representation of this Semantic Network.
 * @return  the Map representation of this Semantic Network
 */
@Override public Map<Vertex,Set<Edge>> getGrafo(){
  return grafo;
}
Program: 175481
Project: 175481
Buggy source:
/** 
 * @return  a String representation of this SemanticNetwork.
 */
@Override public String toString(){
  return grafo.toString();
}

Fixed version (ground truth):
/** 
 * Returns a String representation of this SemanticNetwork.
 * @return  a String representation of this SemanticNetwork
 */
@Override public String toString(){
  return grafo.toString();
}
Program: 175482
Project: 175482
Buggy source:
/** 
 * @return  the Semantic Network.
 */
public static SemanticNetwork getInstance() throws IOException {
  if (curiosoneSemanticNetwork == null) {
    curiosoneSemanticNetwork=new SemanticNetwork();
  }
  return curiosoneSemanticNetwork;
}

Fixed version (ground truth):
/** 
 * Gets the Singleton instance.
 * @return  the Semantic Network
 */
public static SemanticNetwork getInstance() throws IOException {
  if (curiosoneSemanticNetwork == null) {
    curiosoneSemanticNetwork=new SemanticNetwork();
  }
  return curiosoneSemanticNetwork;
}
Program: 175483
Project: 175483
Buggy source:
/** 
 * @return  a Set containing all the Vertices of this SemanticNetwork.
 */
@Override public Set<Vertex> vertexSet(){
  return grafo.keySet();
}

Fixed version (ground truth):
/** 
 * Gets all the Vertices of this SemanticNetwork.
 * @return  a Set containing all the Vertices of this SemanticNetwork
 */
@Override public Set<Vertex> vertexSet(){
  return grafo.keySet();
}
Program: 175484
Project: 175484
Buggy source:
/** 
 * @return  the first element of this Pair.
 */
public F getFirst(){
  return first;
}

Fixed version (ground truth):
/** 
 * Gets the first element of this Pair.
 * @return  the first element of this Pair
 */
public F getFirst(){
  return first;
}
Program: 175485
Project: 175485
Buggy source:
/** 
 * @return  the second element of this Pair.
 */
public S getSecond(){
  return second;
}

Fixed version (ground truth):
/** 
 * Gets the second element of this Pair.
 * @return  the second element of this Pair
 */
public S getSecond(){
  return second;
}