nus-yam/ex-repair huggingface dataset:
Program: 46675
Project: 46675
Buggy source:
/** 
 * リクエストボディとして送信すべき値を文字列として取得する. OAuth 関係のパラメータを含めるかどうかは引数によって決める.
 * @param includeOAuthParams OAuth 関係のパラメータをクエリパラメータに含めるかどうか. 含める場合は true
 * @return リクエストボディとして送信すべき文字列
 */
public String getRequestBodyString(boolean includeOAuthParams){
  ParamList paramList=new ParamList();
  if (includeOAuthParams && mOauthParams != null)   paramList.addAll(mOauthParams);
  if (mReqBodyParams != null)   paramList.addAll(mReqBodyParams);
  if (paramList.size() == 0)   return "String_Node_Str";
  Param[] params=paramList.toArray(new Param[paramList.size()]);
  return toNormalizationString(params);
}

Fixed version (ground truth):
/** 
 * リクエストボディとして送信すべき値を文字列として取得する. OAuth 関係のパラメータを含めるかどうかは引数によって決める.
 * @param includeOAuthParams OAuth 関係のパラメータをクエリパラメータに含めるかどうか. 含める場合は true
 * @return リクエストボディとして送信すべき文字列
 */
public String getRequestBodyString(boolean includeOAuthParams){
  ParamList paramList=new ParamList();
  if (includeOAuthParams) {
    if (mOauthParams != null)     paramList.addAll(mOauthParams);
    paramList.add(new Param("String_Node_Str",mSignature));
  }
  if (mReqBodyParams != null)   paramList.addAll(mReqBodyParams);
  if (paramList.size() == 0)   return "String_Node_Str";
  Param[] params=paramList.toArray(new Param[paramList.size()]);
  return toNormalizationString(params);
}
Program: 46676
Project: 46676
Buggy source:
/** 
 * クエリパラメータを含んだ URL を文字列として返す. OAuth 関係のパラメータを含めるかどうかは引数によって決める.
 * @param includeOAuthParams OAuth 関係のパラメータをクエリパラメータに含めるかどうか. 含める場合は true
 * @return クエリパラメータを含んだ URL の文字列表現
 */
public String getUrlStringIncludeQueryParams(boolean includeOAuthParams){
  ParamList paramList=new ParamList();
  if (includeOAuthParams && mOauthParams != null)   paramList.addAll(mOauthParams);
  if (mUrlQueryParams != null)   paramList.addAll(mUrlQueryParams);
  if (paramList.size() == 0)   return mUrlStr;
  Param[] params=paramList.toArray(new Param[paramList.size()]);
  return mUrlStr + "String_Node_Str" + toNormalizationString(params);
}

Fixed version (ground truth):
/** 
 * クエリパラメータを含んだ URL を文字列として返す. OAuth 関係のパラメータを含めるかどうかは引数によって決める.
 * @param includeOAuthParams OAuth 関係のパラメータをクエリパラメータに含めるかどうか. 含める場合は true
 * @return クエリパラメータを含んだ URL の文字列表現
 */
public String getUrlStringIncludeQueryParams(boolean includeOAuthParams){
  ParamList paramList=new ParamList();
  if (includeOAuthParams) {
    if (mOauthParams != null)     paramList.addAll(mOauthParams);
    paramList.add(new Param("String_Node_Str",mSignature));
  }
  if (mUrlQueryParams != null)   paramList.addAll(mUrlQueryParams);
  if (paramList.size() == 0)   return mUrlStr;
  Param[] params=paramList.toArray(new Param[paramList.size()]);
  return mUrlStr + "String_Node_Str" + toNormalizationString(params);
}
Program: 46678
Project: 46678
Buggy source:
/** 
 * The OAuth 1.0 Protocol の仕様に合う形で文字列をパーセントエンコードする. パーセントエンコードの対象になるのは 'A'-'Z', 'a'-'z', '0'-'9', '-', '.', '_', '~' を除く全ての文字である.
 * @param str パーセントエンコードの対象文字列
 * @return str をパーセントエンコードした文字列
 */
static public String encode(String str){
  String encodedStr=null;
  ByteArrayOutputStream os=null;
  try {
    os=new ByteArrayOutputStream();
    for (    byte b : str.getBytes(Charset.forName("String_Node_Str"))) {
      if (b < 0 || NEED_ENCODE[b]) {
        os.write(37);
        os.write(BS[(b >> 4) & 0x0F]);
        os.write(BS[b & 0x0F]);
      }
 else {
        os.write(b);
      }
    }
    encodedStr=os.toString();
  }
  finally {
    try {
      if (os != null)       os.close();
    }
 catch (    IOException err) {
      err.printStackTrace();
    }
  }
  return encodedStr;
}

Fixed version (ground truth):
/** 
 * Encodes a character string using percent-encoding method for OAuth 1.0 Protocol.
 * @param str the character string to encode
 * @return The resulting encoded character string.
 */
public static String encode(String str){
  ByteArrayOutputStream os=new ByteArrayOutputStream(str.length());
  for (  byte b : str.getBytes(StandardCharsets.UTF_8)) {
    if (b < 0 || NEED_ENCODE[b]) {
      os.write(37);
      os.write(BS[(b >> 4) & 0x0F]);
      os.write(BS[b & 0x0F]);
    }
 else {
      os.write(b);
    }
  }
  return new String(os.toByteArray(),StandardCharsets.US_ASCII);
}
Program: 46679
Project: 46679
Buggy source:
public JsonArray(){
  super();
}

Fixed version (ground truth):
public JsonArray(){
  super();
  ID=new Object();
}
Program: 46680
Project: 46680
Buggy source:
public JsonObject(){
  super();
}

Fixed version (ground truth):
public JsonObject(){
  super();
  ID=new Object();
}
Program: 46681
Project: 46681
Buggy source:
public int next(){
  int cp=str.codePointAt(index);
  index+=Character.charCount(cp);
  return cp;
}

Fixed version (ground truth):
public int next(){
  if (length <= index) {
    return -1;
  }
  int cp=str.codePointAt(index);
  index+=Character.charCount(cp);
  return cp;
}
Program: 46682
Project: 46682
Buggy source:
static public JsonValue parse(String jsonStr){
  Tokenizer t=new Tokenizer(jsonStr);
  Token token=t.getNextToken();
  if (token == null) {
    throw new RuntimeException("String_Node_Str" + jsonStr + "String_Node_Str");
  }
  JsonValue val=null;
  if (token.type == Token.TokenType.BEGIN_ARRAY) {
    val=parseArray(t,new JsonArray());
  }
 else   if (token.type == Token.TokenType.BEGIN_OBJECT) {
    val=parseObject(t,new JsonObject());
  }
 else {
    throw new RuntimeException();
  }
  if ((token=t.getNextToken()) != null) {
    throw new RuntimeException();
  }
  return val;
}

Fixed version (ground truth):
static public JsonValue parse(String jsonStr){
  Tokenizer t=new Tokenizer(jsonStr);
  Token token=t.getNextToken();
  if (token == null) {
    throw new InvalidJsonException("String_Node_Str" + jsonStr + "String_Node_Str");
  }
  JsonValue val=null;
  if (token.type == Token.TokenType.BEGIN_ARRAY) {
    val=parseArray(t,new JsonArray());
  }
 else   if (token.type == Token.TokenType.BEGIN_OBJECT) {
    val=parseObject(t,new JsonObject());
  }
 else {
    throw new InvalidJsonException("String_Node_Str" + jsonStr + "String_Node_Str");
  }
  if ((token=t.getNextToken()) != null) {
    throw new RuntimeException();
  }
  return val;
}
Program: 46683
Project: 46683
Buggy source:
static private void serializeJObject(StringBuilder sb,JsonObject jobject){
  sb.append("String_Node_Str");
  String[] keys=jobject.keySet().toArray(new String[0]);
  if (keys.length != 0) {
    String key=keys[0];
    serializeJString(sb,key);
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,jobject.get(key));
  }
  for (int i=1; i < keys.length; i++) {
    sb.append("String_Node_Str");
    String key=keys[i];
    serializeJString(sb,key);
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,jobject.get(key));
  }
  sb.append("String_Node_Str");
}

Fixed version (ground truth):
static private void serializeJObject(StringBuilder sb,JsonObject jobject,Set<Object> ancestorIdSet){
  if (ancestorIdSet.contains(jobject.ID)) {
    throw new InvalidJsonException("String_Node_Str");
  }
  ancestorIdSet.add(jobject.ID);
  sb.append("String_Node_Str");
  String[] keys=jobject.keySet().toArray(new String[0]);
  if (keys.length != 0) {
    String key=keys[0];
    serializeJString(sb,key);
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,jobject.get(key),ancestorIdSet);
  }
  for (int i=1; i < keys.length; i++) {
    sb.append("String_Node_Str");
    String key=keys[i];
    serializeJString(sb,key);
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,jobject.get(key),ancestorIdSet);
  }
  sb.append("String_Node_Str");
  ancestorIdSet.remove(jobject.ID);
}
Program: 46684
Project: 46684
Buggy source:
static public String serialize(JsonValue jvalue){
  if (jvalue.valueType() != ValueType.ARRAY_VALUE && jvalue.valueType() != ValueType.OBJECT_VALUE) {
    throw new RuntimeException();
  }
  StringBuilder sb=new StringBuilder();
  serializeAnyJValue(sb,jvalue);
  return sb.toString();
}

Fixed version (ground truth):
static public String serialize(JsonValue jvalue){
  if (jvalue.valueType() != ValueType.ARRAY_VALUE && jvalue.valueType() != ValueType.OBJECT_VALUE) {
    throw new InvalidJsonException(ERRMSG_NOT_OBJ_OR_ARR_SERIALIZATION);
  }
  StringBuilder sb=new StringBuilder();
  serializeAnyJValue(sb,jvalue,new HashSet<Object>());
  return sb.toString();
}
Program: 46685
Project: 46685
Buggy source:
static void serializeAnyJValue(StringBuilder sb,JsonValue jvalue){
switch (jvalue.valueType()) {
case OBJECT_VALUE:
    serializeJObject(sb,jvalue.objectValue());
  break;
case ARRAY_VALUE:
serializeJArray(sb,jvalue.arrayValue());
break;
case STRING_VALUE:
serializeJString(sb,jvalue.stringValue());
break;
case NUMBER_VALUE:
serializeJNumber(sb,jvalue.numberValue());
break;
case BOOLEAN_VALUE:
sb.append(jvalue.booleanValue() ? "String_Node_Str" : "String_Node_Str");
break;
case NULL_VALUE:
sb.append("String_Node_Str");
break;
default :
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
static void serializeAnyJValue(StringBuilder sb,JsonValue jvalue,Set<Object> ancestorIdSet){
switch (jvalue.valueType()) {
case OBJECT_VALUE:
    serializeJObject(sb,jvalue.objectValue(),ancestorIdSet);
  break;
case ARRAY_VALUE:
serializeJArray(sb,jvalue.arrayValue(),ancestorIdSet);
break;
case STRING_VALUE:
serializeJString(sb,jvalue.stringValue());
break;
case NUMBER_VALUE:
serializeJNumber(sb,jvalue.numberValue());
break;
case BOOLEAN_VALUE:
sb.append(jvalue.booleanValue() ? "String_Node_Str" : "String_Node_Str");
break;
case NULL_VALUE:
sb.append("String_Node_Str");
break;
default :
throw new InvalidJsonException("String_Node_Str" + jvalue.valueType() + "String_Node_Str");
}
}
Program: 46686
Project: 46686
Buggy source:
static private void serializeJArray(StringBuilder sb,JsonArray jarray){
  sb.append("String_Node_Str");
  JsonValue[] vs=jarray.toArray(new JsonValue[0]);
  if (vs.length != 0) {
    serializeAnyJValue(sb,vs[0]);
  }
  for (int i=1; i < vs.length; i++) {
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,vs[i]);
  }
  sb.append("String_Node_Str");
}

Fixed version (ground truth):
static private void serializeJArray(StringBuilder sb,JsonArray jarray,Set<Object> ancestorIdSet){
  if (ancestorIdSet.contains(jarray.ID)) {
    throw new InvalidJsonException("String_Node_Str");
  }
  ancestorIdSet.add(jarray.ID);
  sb.append("String_Node_Str");
  JsonValue[] vs=jarray.toArray(new JsonValue[0]);
  if (vs.length != 0) {
    serializeAnyJValue(sb,vs[0],ancestorIdSet);
  }
  for (int i=1; i < vs.length; i++) {
    sb.append("String_Node_Str");
    serializeAnyJValue(sb,vs[i],ancestorIdSet);
  }
  sb.append("String_Node_Str");
  ancestorIdSet.remove(jarray.ID);
}
Program: 46688
Project: 46688
Buggy source:
public void characters(char[] characters,int startIndex,int length){
  String characters=new String(characters,startIndex,length).trim();
  String trimedCharacters=characters.replace("String_Node_Str","String_Node_Str");
  if (!"String_Node_Str".equals(trimedCharacters)) {
    setCurrentItemAttribute(characters);
  }
}

Fixed version (ground truth):
public void characters(char[] chars,int startIndex,int length){
  String characters=new String(chars,startIndex,length).trim();
  String trimedCharacters=characters.replace("String_Node_Str","String_Node_Str");
  if (!"String_Node_Str".equals(trimedCharacters)) {
    setCurrentItemAttribute(characters);
  }
}
Program: 46689
Project: 46689
Buggy source:
public R317LoginDecoder(ReactorSession session){
  super(session);
  loginRequestDecoder=new R317LoginRequestDecoder(session);
  new LoginRequestConsumer();
}

Fixed version (ground truth):
public R317LoginDecoder(ReactorSession session){
  super(session);
  loginRequestDecoder=new R317LoginRequestDecoder(session);
  loginBlockDecoder=new R317LoginBlockDecoder(session);
  new LoginRequestConsumer();
}
Program: 46690
Project: 46690
Buggy source:
@Override public void execute() throws IOException {
  selector.selectNow();
  for (  SelectionKey selectionKey : selector.selectedKeys()) {
    produce(new ReactorEvent(selector,selectionKey));
  }
}

Fixed version (ground truth):
@Override public void execute() throws IOException {
  selector.selectNow();
  for (  SelectionKey selectionKey : selector.selectedKeys()) {
    produce(new ReactorEvent(selector,selectionKey));
  }
  selector.selectedKeys().clear();
}
Program: 46691
Project: 46691
Buggy source:
public static void serveRead(ReactorSession session) throws IOException {
  ByteBuffer buffer=session.getInBuffer();
  SocketChannel socketChannel=(SocketChannel)session.getSelectionKey().channel();
  int amount=socketChannel.read(buffer);
  if (amount == -1) {
    session.disconnect();
    return;
  }
  if (amount == 0) {
    return;
  }
  buffer.flip();
  Message message=null;
  if ((message=session.getDecoder().decode(buffer)) == null) {
    buffer.flip();
    buffer.compact();
    return;
  }
  session.produce(message);
}

Fixed version (ground truth):
public static void serveRead(ReactorSession session) throws IOException {
  ByteBuffer buffer=session.getInBuffer();
  SocketChannel socketChannel=(SocketChannel)session.getSelectionKey().channel();
  int amount=socketChannel.read(buffer);
  if (amount == -1) {
    session.disconnect();
    return;
  }
  if (amount == 0) {
    return;
  }
  buffer.flip();
  Message message=null;
  if ((message=session.getDecoder().decode(buffer)) == null) {
    buffer.flip();
    buffer.compact();
    return;
  }
  buffer.clear();
  session.produce(message);
}
Program: 46692
Project: 46692
Buggy source:
private void updateTimeSeries(int node,int batt){
switch (node) {
case 1:
    this.battNode1.add(new Second(),batt);
  break;
case 2:
this.battNode2.add(new Second(),batt);
break;
case 3:
this.battNode3.add(new Second(),batt);
break;
case 4:
this.battNode4.add(new Second(),batt);
break;
case 5:
this.battNode5.add(new Second(),batt);
break;
default :
break;
}
}

Fixed version (ground truth):
private void updateTimeSeries(int node,int batt){
switch (node) {
case 1:
    this.battNode1.addOrUpdate(new Second(),batt);
  break;
case 2:
this.battNode2.addOrUpdate(new Second(),batt);
break;
case 3:
this.battNode3.addOrUpdate(new Second(),batt);
break;
case 4:
this.battNode4.addOrUpdate(new Second(),batt);
break;
case 5:
this.battNode5.addOrUpdate(new Second(),batt);
break;
default :
break;
}
}
Program: 46693
Project: 46693
Buggy source:
public void populate(String[] arrs){
  nickname=arrs[0];
  datetime=new Date(Integer.parseInt(arrs[1]) * 1000);
  message=arrs[2];
}

Fixed version (ground truth):
public void populate(String[] arrs){
  nickname=arrs[0];
  datetime=new Date(Long.parseLong(arrs[1]) * 1000);
  message=arrs[2];
}
Program: 46694
Project: 46694
Buggy source:
@Override public void widgetSelected(SelectionEvent event){
  TableItem item=table.getSelection()[0];
  String text=item.getText(2);
  Matcher matcher=linkPattern.matcher(text);
  if (matcher.matches()) {
    String link=matcher.group();
    Program.launch(link);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent event){
  TableItem item=table.getSelection()[0];
  String text=item.getText(2);
  Matcher matcher=linkPattern.matcher(text);
  if (matcher.find()) {
    String link=matcher.group();
    Program.launch(link);
  }
}
Program: 46696
Project: 46696
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View v=convertView;
  if (v == null) {
    LayoutInflater vi=(LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v=vi.inflate(R.layout.list_item,null);
  }
  String s=items.get(position);
  if (s != null) {
    TextView tt=(TextView)v.findViewById(R.id.listText);
    if (tt != null) {
      tt.setText(s);
    }
  }
  return v;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View v=convertView;
  if (v == null) {
    LayoutInflater vi=(LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v=vi.inflate(R.layout.list_item,null);
  }
  String s=items.get(position);
  if (s != null) {
    TextView tt=(TextView)v.findViewById(R.id.listText);
    if (tt != null) {
      tt.setText(Html.fromHtml(s));
    }
  }
  return v;
}
Program: 46697
Project: 46697
Buggy source:
public String getStringFromSingleElement(String tag,Element root){
  Element e=(Element)root.getElementsByTagName(tag).item(0);
  return e.getFirstChild().getNodeValue();
}

Fixed version (ground truth):
public String getStringFromSingleElement(String tag,Element root){
  Element e=(Element)root.getElementsByTagName(tag).item(0);
  Node n=(Node)e;
  return this.buildText(n);
}
Program: 46698
Project: 46698
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.product);
  initMap();
  Bundle recdData=getIntent().getExtras();
  Product p=(Product)recdData.getSerializable("String_Node_Str");
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(breadCrumb);
  TextView t=(TextView)findViewById(R.id.title);
  t.setText(p.getName());
  t=(TextView)findViewById(R.id.price);
  t.setText(Product.CURRENCY + "String_Node_Str" + p.getPrice());
  Object obj=fetch(p.getImgSrc());
  if (obj != null) {
    Drawable img=Drawable.createFromStream((InputStream)obj,"String_Node_Str");
    ImageView imgView=(ImageView)findViewById(R.id.image);
    imgView.setImageDrawable(img);
  }
  String[] fields;
switch (p.getCategoryId()) {
case 1:
    fields=dvd_fields;
  break;
case 2:
fields=book_fields;
break;
default :
fields=dvd_fields;
}
int i=0;
for (String fieldName : fields) {
t=(TextView)findViewById(textFieldIds[i]);
String value=p.getProperty(fieldName);
t.setText(getText(translationsId.get(fieldName)) + "String_Node_Str" + value);
if (value != null) {
i++;
}
}
for (; i < textFieldIds.length; i++) {
t=(TextView)findViewById(textFieldIds[i]);
t.setText("String_Node_Str");
}
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.product);
  initMap();
  Bundle recdData=getIntent().getExtras();
  Product p=(Product)recdData.getSerializable("String_Node_Str");
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(Html.fromHtml(breadCrumb));
  TextView t=(TextView)findViewById(R.id.title);
  t.setText(p.getName());
  t=(TextView)findViewById(R.id.price);
  t.setText(Product.CURRENCY + "String_Node_Str" + p.getPrice());
  Object obj=fetch(p.getImgSrc());
  if (obj != null) {
    Drawable img=Drawable.createFromStream((InputStream)obj,"String_Node_Str");
    ImageView imgView=(ImageView)findViewById(R.id.image);
    imgView.setImageDrawable(img);
  }
  String[] fields;
switch (p.getCategoryId()) {
case 1:
    fields=dvd_fields;
  break;
case 2:
fields=book_fields;
break;
default :
fields=dvd_fields;
}
int i=0;
for (String fieldName : fields) {
t=(TextView)findViewById(textFieldIds[i]);
String value=p.getProperty(fieldName);
t.setText(getText(translationsId.get(fieldName)) + "String_Node_Str" + value);
if (value != null) {
i++;
}
}
for (; i < textFieldIds.length; i++) {
t=(TextView)findViewById(textFieldIds[i]);
t.setText("String_Node_Str");
}
}
Program: 46699
Project: 46699
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Bundle recdData=getIntent().getExtras();
  currList=(List<Product>)recdData.getSerializable("String_Node_Str");
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(breadCrumb);
  String[] products=getProductNames();
  setListAdapter(new CustomAdapter(this,R.layout.list_item,products));
  ListView lv=getListView();
  lv.setTextFilterEnabled(true);
  Animation a=AnimationUtils.makeInAnimation(getBaseContext(),false);
  a.setDuration(500);
  lv.setAnimation(a);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Bundle recdData=getIntent().getExtras();
  currList=(List<Product>)recdData.getSerializable("String_Node_Str");
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(Html.fromHtml(breadCrumb));
  String[] products=getProductNames();
  setListAdapter(new CustomAdapter(this,R.layout.list_item,products));
  ListView lv=getListView();
  lv.setTextFilterEnabled(true);
  Animation a=AnimationUtils.makeInAnimation(getBaseContext(),false);
  a.setDuration(500);
  lv.setAnimation(a);
}
Program: 46700
Project: 46700
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Bundle recdData=getIntent().getExtras();
  int catPos=Integer.parseInt(recdData.getString("String_Node_Str"));
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(breadCrumb + "String_Node_Str");
  CategoryManager catManager=CategoryManager.getInstance();
  setListAdapter(new CustomAdapter(this,R.layout.list_item,catManager.getSubCategoryNames(catPos)));
  ListView lv=getListView();
  lv.setTextFilterEnabled(true);
  Animation a=AnimationUtils.makeInAnimation(getBaseContext(),false);
  a.setDuration(500);
  lv.setAnimation(a);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Bundle recdData=getIntent().getExtras();
  int catPos=Integer.parseInt(recdData.getString("String_Node_Str"));
  String breadCrumb=recdData.getString("String_Node_Str");
  setTitle(Html.fromHtml(breadCrumb + "String_Node_Str"));
  CategoryManager catManager=CategoryManager.getInstance();
  setListAdapter(new CustomAdapter(this,R.layout.list_item,catManager.getSubCategoryNames(catPos)));
  ListView lv=getListView();
  lv.setTextFilterEnabled(true);
  Animation a=AnimationUtils.makeInAnimation(getBaseContext(),false);
  a.setDuration(500);
  lv.setAnimation(a);
}
Program: 46701
Project: 46701
Buggy source:
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  Bundle b=getIntent().getExtras();
  int latitude=new Integer(b.getString("String_Node_Str"));
  int longitude=new Integer(b.getString("String_Node_Str"));
  setContentView(R.layout.map);
  MapView mapView=(MapView)findViewById(R.id.mapview);
  mapView.setBuiltInZoomControls(true);
  MapController myMapController=mapView.getController();
  GeoPoint point=new GeoPoint(latitude * 1000000,longitude * 1000000);
  myMapController.setCenter(point);
  myMapController.setZoom(10);
  List<Overlay> mapOverlays=mapView.getOverlays();
  Drawable drawable=this.getResources().getDrawable(R.drawable.map_pin);
  OrderOverlay itemizedoverlay=new OrderOverlay(drawable);
  OverlayItem overlayitem=new OverlayItem(point,"String_Node_Str","String_Node_Str");
  itemizedoverlay.addOverlay(overlayitem);
  mapOverlays.add(itemizedoverlay);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  Bundle b=getIntent().getExtras();
  int latitude=new Integer(b.getString("String_Node_Str"));
  int longitude=new Integer(b.getString("String_Node_Str"));
  setContentView(R.layout.map);
  MapView mapView=(MapView)findViewById(R.id.mapview);
  mapView.setBuiltInZoomControls(true);
  MapController myMapController=mapView.getController();
  GeoPoint point=new GeoPoint(latitude * 1000000,longitude * 1000000);
  myMapController.setCenter(point);
  myMapController.setZoom(10);
  List<Overlay> mapOverlays=mapView.getOverlays();
  Drawable drawable=this.getResources().getDrawable(R.drawable.map_pin);
  OrderOverlay itemizedoverlay=new OrderOverlay(drawable,this);
  OverlayItem overlayitem=new OverlayItem(point,"String_Node_Str","String_Node_Str");
  itemizedoverlay.addOverlay(overlayitem);
  mapOverlays.add(itemizedoverlay);
}
Program: 46702
Project: 46702
Buggy source:
@Override protected boolean onTap(int index){
  OverlayItem item=mOverlays.get(index);
  AlertDialog.Builder dialog=new AlertDialog.Builder(mContext);
  dialog.setTitle(item.getTitle());
  dialog.setMessage(item.getSnippet());
  dialog.show();
  return true;
}

Fixed version (ground truth):
@Override protected boolean onTap(int index){
  OverlayItem item=mOverlays.get(index);
  AlertDialog.Builder dialog=new AlertDialog.Builder(this.mContext);
  dialog.setTitle(item.getTitle());
  dialog.setMessage(item.getSnippet());
  dialog.show();
  return true;
}
Program: 46703
Project: 46703
Buggy source:
public OrderOverlay(Drawable defaultMarker,Context context){
  super(defaultMarker);
  mContext=context;
}

Fixed version (ground truth):
public OrderOverlay(Drawable defaultMarker,Context context){
  super(boundCenterBottom(defaultMarker));
  this.mContext=context;
}
Program: 46704
Project: 46704
Buggy source:
@Override public void onPlayerBucketFill(PlayerBucketFillEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!permissionsResolver.isAllowedToInteractWithBlock(event.getPlayer(),event.getPlayer().getLocation().getBlock())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@Override public void onPlayerBucketFill(PlayerBucketFillEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!permissionsResolver.isAllowedToInteractWithBlock(event.getPlayer(),event.getBlockClicked())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}
Program: 46705
Project: 46705
Buggy source:
@Override public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!permissionsResolver.isAllowedToInteractWithBlock(event.getPlayer(),event.getPlayer().getLocation().getBlock())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@Override public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!permissionsResolver.isAllowedToInteractWithBlock(event.getPlayer(),event.getBlockClicked())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}
Program: 46706
Project: 46706
Buggy source:
/** 
 * Checks if the player is allowed to interact with the passed block.
 * @param player          player to check
 * @param blockToInteract the block to interact
 * @return true, if the player is allowed to interact
 */
public boolean isAllowedToInteractWithBlock(Player player,Block blockToInteract){
  if (isTrustedPlayer(player) || isAdmin(player)) {
    return true;
  }
  Inhabitant inhabitant=nation.getInhabitant(player.getName());
  Residence residencesAtLocation=nation.getResidence(blockToInteract.getLocation());
  return residencesAtLocation != null && canBuildAndDestroy(residencesAtLocation,inhabitant);
}

Fixed version (ground truth):
/** 
 * Checks if the player is allowed to interact with the passed block.
 * @param player          player to check
 * @param blockToInteract the block to interact
 * @return true, if the player is allowed to interact
 */
public boolean isAllowedToInteractWithBlock(Player player,Block blockToInteract){
  if (isTrustedPlayer(player) || isAdmin(player)) {
    return true;
  }
  Inhabitant inhabitant=nation.getInhabitant(player.getName());
  Residence residencesAtLocation=nation.getResidence(blockToInteract.getLocation());
  return residencesAtLocation == null || canBuildAndDestroy(residencesAtLocation,inhabitant);
}
Program: 46708
Project: 46708
Buggy source:
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str");
  if (!(translationFile.exists() && translationFile.canRead())) {
    translationFile=new File("String_Node_Str");
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
  }
  translations=new Configuration(translationFile);
  translations.load();
}

Fixed version (ground truth):
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str");
  if (!(translationFile.exists() && translationFile.canRead())) {
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
    translations=Bukkit.getServer().getPluginManager().getPlugin("String_Node_Str").getConfiguration();
  }
 else {
    translations=new Configuration(translationFile);
    translations.load();
  }
}
Program: 46710
Project: 46710
Buggy source:
public void run(){
  try {
    plugin.info("String_Node_Str");
    plugin.info("String_Node_Str",residenceSignPackages.size());
    List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.remove(0);
    plugin.info("String_Node_Str",residenceSignsToCheck.size());
    for (    ResidenceSign residenceSign : residenceSignsToCheck) {
      plugin.info("String_Node_Str",residenceSign.getWorld(),residenceSign.getX(),residenceSign.getY(),residenceSign.getZ(),residenceSign.getResidenceId());
      Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
      if (!(residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN))) {
        invalidResidences.add(getResidence(residenceSign.getResidenceId()));
      }
    }
    if (!residenceSignPackages.isEmpty()) {
      plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this,5);
    }
 else {
      invalidResidenceListener.invalidResidencesFound(invalidResidences);
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (residenceSignPackages == null) {
      List<ResidenceSign> residenceSigns=getDatabase().find(ResidenceSign.class).findList();
      plugin.info("String_Node_Str",residenceSigns.size());
      residenceSignPackages=new LinkedList<List<ResidenceSign>>();
      for (int index=0; index < residenceSigns.size(); index+=5) {
        List<ResidenceSign> residenceSignPackage=residenceSigns.subList(index,index + Math.min(residenceSigns.size() - index,5));
        residenceSignPackage.add(residenceSignPackage);
      }
      plugin.info("String_Node_Str",residenceSignPackages.size());
    }
    plugin.info("String_Node_Str");
    plugin.info("String_Node_Str",residenceSignPackages.size());
    List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.remove(0);
    plugin.info("String_Node_Str",residenceSignsToCheck.size());
    for (    ResidenceSign residenceSign : residenceSignsToCheck) {
      plugin.info("String_Node_Str",residenceSign.getWorld(),residenceSign.getX(),residenceSign.getY(),residenceSign.getZ(),residenceSign.getResidenceId());
      Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
      if (!(residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN))) {
        invalidResidences.add(getResidence(residenceSign.getResidenceId()));
      }
    }
    if (!residenceSignPackages.isEmpty()) {
      plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this,5);
    }
 else {
      invalidResidenceListener.invalidResidencesFound(invalidResidences);
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 46711
Project: 46711
Buggy source:
/** 
 * Returns a manager for the town.
 * @param town the manager for the town.
 * @return the town.
 */
public TownManager getTownManager(Town town){
  return new PersistTownManager(this,town);
}

Fixed version (ground truth):
/** 
 * Returns a manager for the town.
 * @param town the manager for the town.
 * @return the town.
 */
public TownManager getTownManager(Town town){
  if (town != null) {
    return new PersistTownManager(this,town);
  }
 else {
    return wildnessManager;
  }
}
Program: 46712
Project: 46712
Buggy source:
/** 
 * Creates a new Nation for the passed plugin.
 * @param plugin the plugin to create the nation.
 */
public PersistNation(MyResidence plugin){
  this.plugin=plugin;
}

Fixed version (ground truth):
/** 
 * Creates a new Nation for the passed plugin.
 * @param plugin the plugin to create the nation.
 */
public PersistNation(MyResidence plugin){
  this.plugin=plugin;
  this.wildnessManager=new PersistWildnessManager(this);
}
Program: 46713
Project: 46713
Buggy source:
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File(Translate.class.getClassLoader().getResource("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str").toExternalForm());
  if (!(translationFile.exists() && translationFile.canRead())) {
    translationFile=new File(Translate.class.getClassLoader().getResource("String_Node_Str").toExternalForm());
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
  }
  translations=new Configuration(translationFile);
  translations.load();
}

Fixed version (ground truth):
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str");
  if (!(translationFile.exists() && translationFile.canRead())) {
    translationFile=new File("String_Node_Str");
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
  }
  translations=new Configuration(translationFile);
  translations.load();
}
Program: 46714
Project: 46714
Buggy source:
/** 
 * Checks if the session has major rights in the town.
 * @param town the town to check.
 * @return true, if the session has enough rights.
 */
public boolean hasMajorRights(Town town){
  return nation.getTownManager(town).isMajor(nation.getInhabitant(getPlayerId())) || player.hasPermission("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Checks if the session has major rights in the town.
 * @param town the town to check.
 * @return true, if the session has enough rights.
 */
public boolean hasMajorRights(Town town){
  return nation.getTownManager(town).isMajor(nation.getInhabitant(getPlayerId())) || hasPermission("String_Node_Str");
}
Program: 46715
Project: 46715
Buggy source:
/** 
 * Checks if the session has owner rights for the residence.
 * @param residence the residence to check.
 * @return true, if the session has enough rights.
 */
public boolean hasResidenceOwnerRights(Residence residence){
  return getPlayerId() == residence.getOwnerId() || player.hasPermission("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Checks if the session has owner rights for the residence.
 * @param residence the residence to check.
 * @return true, if the session has enough rights.
 */
public boolean hasResidenceOwnerRights(Residence residence){
  return getPlayerId() == residence.getOwnerId() || hasPermission("String_Node_Str");
}
Program: 46716
Project: 46716
Buggy source:
public void searchInvalidResidences(final InvalidResidenceListener invalidResidenceListener){
  final List<List<ResidenceSign>> residenceSignPackages=new LinkedList<List<ResidenceSign>>();
  final List<Residence> invalidResidences=new LinkedList<Residence>();
  List<ResidenceSign> residenceSigns=getDatabase().find(ResidenceSign.class).findList();
  while (!residenceSigns.isEmpty()) {
    List<ResidenceSign> residenceSignPackage=residenceSigns.subList(0,Math.min(residenceSigns.size(),5));
    residenceSignPackages.add(residenceSignPackage);
    residenceSigns.removeAll(residenceSignPackage);
  }
  plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
    public void run(){
      List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.get(0);
      residenceSignPackages.remove(residenceSignsToCheck);
      for (      ResidenceSign residenceSign : residenceSignsToCheck) {
        Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
        if (!residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN)) {
          invalidResidences.add(getResidence(residenceSign.getResidenceId()));
        }
      }
      if (!residenceSignPackages.isEmpty()) {
        plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this);
      }
 else {
        invalidResidenceListener.invalidResidencesFound(invalidResidences);
      }
    }
  }
);
}

Fixed version (ground truth):
public void searchInvalidResidences(final InvalidResidenceListener invalidResidenceListener){
  final List<List<ResidenceSign>> residenceSignPackages=new LinkedList<List<ResidenceSign>>();
  final List<Residence> invalidResidences=new LinkedList<Residence>();
  List<ResidenceSign> residenceSigns=getDatabase().find(ResidenceSign.class).findList();
  while (!residenceSigns.isEmpty()) {
    List<ResidenceSign> residenceSignPackage=residenceSigns.subList(0,Math.min(residenceSigns.size(),5));
    residenceSignPackages.add(residenceSignPackage);
    residenceSigns.removeAll(residenceSignPackage);
  }
  plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
    public void run(){
      List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.get(0);
      residenceSignPackages.remove(residenceSignsToCheck);
      for (      ResidenceSign residenceSign : residenceSignsToCheck) {
        Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
        if (!(residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN))) {
          invalidResidences.add(getResidence(residenceSign.getResidenceId()));
        }
      }
      if (!residenceSignPackages.isEmpty()) {
        plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this);
      }
 else {
        invalidResidenceListener.invalidResidencesFound(invalidResidences);
      }
    }
  }
);
}
Program: 46717
Project: 46717
Buggy source:
public void run(){
  List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.get(0);
  residenceSignPackages.remove(residenceSignsToCheck);
  for (  ResidenceSign residenceSign : residenceSignsToCheck) {
    Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
    if (!residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN)) {
      invalidResidences.add(getResidence(residenceSign.getResidenceId()));
    }
  }
  if (!residenceSignPackages.isEmpty()) {
    plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this);
  }
 else {
    invalidResidenceListener.invalidResidencesFound(invalidResidences);
  }
}

Fixed version (ground truth):
public void run(){
  List<ResidenceSign> residenceSignsToCheck=residenceSignPackages.get(0);
  residenceSignPackages.remove(residenceSignsToCheck);
  for (  ResidenceSign residenceSign : residenceSignsToCheck) {
    Block residenceSignBlock=plugin.getServer().getWorld(residenceSign.getWorld()).getBlockAt(residenceSign.getX(),residenceSign.getY(),residenceSign.getZ());
    if (!(residenceSignBlock.getType().equals(Material.SIGN_POST) || residenceSignBlock.getType().equals(Material.WALL_SIGN))) {
      invalidResidences.add(getResidence(residenceSign.getResidenceId()));
    }
  }
  if (!residenceSignPackages.isEmpty()) {
    plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,this);
  }
 else {
    invalidResidenceListener.invalidResidencesFound(invalidResidences);
  }
}
Program: 46718
Project: 46718
Buggy source:
/** 
 * Setups the commands.
 */
private void setupCommands(){
  final MyResidence plugin=this;
  commands=new CommandsManager<Player>(){
    @Override public boolean hasPermission(    Player player,    String permission){
      return player.hasPermission(permission);
    }
  }
;
  commands.register(GeneralCommands.class);
  commands.register(MapCommand.class);
  commands.register(HomeCommands.class);
  commands.register(LikeCommands.class);
}

Fixed version (ground truth):
/** 
 * Setups the commands.
 */
private void setupCommands(){
  final MyResidence plugin=this;
  commands=new CommandsManager<Player>(){
    @Override public boolean hasPermission(    Player player,    String permission){
      return nation.getPermissionsResolver().hasPermission(player,permission);
    }
  }
;
  commands.register(GeneralCommands.class);
  commands.register(MapCommand.class);
  commands.register(HomeCommands.class);
  commands.register(LikeCommands.class);
}
Program: 46719
Project: 46719
Buggy source:
@Override public boolean hasPermission(Player player,String permission){
  return player.hasPermission(permission);
}

Fixed version (ground truth):
@Override public boolean hasPermission(Player player,String permission){
  return nation.getPermissionsResolver().hasPermission(player,permission);
}
Program: 46720
Project: 46720
Buggy source:
/** 
 * Checks if the session is a session of an Administrator.
 * @param player player to check the permissions for.
 * @return true, if the player owns the trusted permission.
 */
public boolean isTrustedPlayer(Player player){
  return player.hasPermission(TRUSTED_PERMISSION);
}

Fixed version (ground truth):
/** 
 * Checks if the session is a session of an Administrator.
 * @param player player to check the permissions for.
 * @return true, if the player owns the trusted permission.
 */
public boolean isTrustedPlayer(Player player){
  return hasPermission(player,TRUSTED_PERMISSION);
}
Program: 46721
Project: 46721
Buggy source:
/** 
 * Checks if the session is a session of an Administrator.
 * @param player player to check the permissions for.
 * @return true, if the player owns the administrator permission.
 */
public boolean isAdmin(Player player){
  return player.hasPermission(ADMIN_PERMISSION);
}

Fixed version (ground truth):
/** 
 * Checks if the session is a session of an Administrator.
 * @param player player to check the permissions for.
 * @return true, if the player owns the administrator permission.
 */
public boolean isAdmin(Player player){
  return hasPermission(player,ADMIN_PERMISSION);
}
Program: 46725
Project: 46725
Buggy source:
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str");
  if (!(translationFile.exists() && translationFile.canRead())) {
    translationFile=new File("String_Node_Str");
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
  }
  translations=new Configuration(translationFile);
}

Fixed version (ground truth):
/** 
 * Loads the translations from file system.
 * @param languageCode the code of the language to retrieve. (for example de or en).
 */
public static void load(String languageCode){
  File translationFile=new File(Translate.class.getClassLoader().getResource("String_Node_Str" + languageCode.toLowerCase() + "String_Node_Str").toExternalForm());
  if (!(translationFile.exists() && translationFile.canRead())) {
    translationFile=new File(Translate.class.getClassLoader().getResource("String_Node_Str").toExternalForm());
    Logger.getLogger("String_Node_Str").warning("String_Node_Str" + "String_Node_Str");
  }
  translations=new Configuration(translationFile);
}
Program: 46726
Project: 46726
Buggy source:
@Override public void onBlockBreak(BlockBreakEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (permissionsResolver.isAllowedToDestroyBlockAt(event.getPlayer(),event.getBlock())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}

Fixed version (ground truth):
@Override public void onBlockBreak(BlockBreakEvent event){
  if (event.isCancelled()) {
    return;
  }
  if (!permissionsResolver.isAllowedToDestroyBlockAt(event.getPlayer(),event.getBlock())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setCancelled(true);
  }
}
Program: 46727
Project: 46727
Buggy source:
@Override public void onBlockPlace(BlockPlaceEvent event){
  if (event.isCancelled() || !event.canBuild()) {
    return;
  }
  if (permissionsResolver.isAllowedToPlaceBlockAt(event.getPlayer(),event.getBlockPlaced())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setBuild(false);
  }
}

Fixed version (ground truth):
@Override public void onBlockPlace(BlockPlaceEvent event){
  if (event.isCancelled() || !event.canBuild()) {
    return;
  }
  if (!permissionsResolver.isAllowedToPlaceBlockAt(event.getPlayer(),event.getBlockPlaced())) {
    Chat.sendMessage(event.getPlayer(),Translate.get("String_Node_Str"));
    event.setBuild(false);
  }
}
Program: 46728
Project: 46728
Buggy source:
/** 
 * Setups the commands.
 */
private void setupCommands(){
  commands=new CommandsManager<Player>(){
    @Override public boolean hasPermission(    Player player,    String permission){
      return hasPermission(player,permission);
    }
  }
;
  commands.register(GeneralCommands.class);
  commands.register(MapCommand.class);
  commands.register(HomeCommands.class);
  commands.register(LikeCommands.class);
}

Fixed version (ground truth):
/** 
 * Setups the commands.
 */
private void setupCommands(){
  final MyResidence plugin=this;
  commands=new CommandsManager<Player>(){
    @Override public boolean hasPermission(    Player player,    String permission){
      return plugin.hasPermission(player,permission);
    }
  }
;
  commands.register(GeneralCommands.class);
  commands.register(MapCommand.class);
  commands.register(HomeCommands.class);
  commands.register(LikeCommands.class);
}
Program: 46729
Project: 46729
Buggy source:
@Override public boolean hasPermission(Player player,String permission){
  return hasPermission(player,permission);
}

Fixed version (ground truth):
@Override public boolean hasPermission(Player player,String permission){
  return plugin.hasPermission(player,permission);
}
Program: 46730
Project: 46730
Buggy source:
public void run(){
  nation.getDatabase().delete(residenceToRemove);
  nation.getDatabase().delete(residenceArea);
  nation.getDatabase().delete(residenceSign);
  Chat.sendMessage(player,"String_Node_Str",residenceToRemove);
  plugin.getEventManager().callEvent(new ResidenceRemovedEvent(session,residenceToRemove));
}

Fixed version (ground truth):
public void run(){
  plugin.getEventManager().callEvent(new ResidenceRemovedEvent(session,residenceToRemove));
  nation.getDatabase().delete(residenceToRemove);
  nation.getDatabase().delete(residenceArea);
  nation.getDatabase().delete(residenceSign);
  Chat.sendMessage(player,"String_Node_Str",residenceToRemove);
}
Program: 46732
Project: 46732
Buggy source:
/** 
 * @return the sign of the residence. 
 */
Block getSign();

Fixed version (ground truth):
/** 
 * @return the sign of the residence. 
 */
Block getSign() throws ResidenceSignMissingException ;
Program: 46733
Project: 46733
Buggy source:
/** 
 * Removes the session of the passed player.
 * @param player the player who's session should be removed.
 */
public void close(Player player){
  sessionMap.remove(sessionMap.get(player));
}

Fixed version (ground truth):
/** 
 * Removes the session of the passed player.
 * @param player the player who's session should be removed.
 */
public void close(Player player){
  sessionMap.remove(player);
}