nus-yam/ex-repair huggingface dataset:
Program: 25914
Project: 25914
Buggy source:
public static List<String> ids(JSONArray a) throws ApiException {
  try {
    List<String> ids=new ArrayList<String>();
    for (int i=0; i < a.length(); i++) {
      ids.add(a.getString(i));
    }
    return ids;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
  }
}

Fixed version (ground truth):
public static List<String> ids(JSONArray a) throws ApiException {
  try {
    List<String> ids=new ArrayList<String>();
    for (int i=0; i < a.length(); i++) {
      ids.add(a.getString(i));
    }
    return ids;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
  }
}
Program: 25915
Project: 25915
Buggy source:
public static List<Search> trends(JSONObject o) throws ApiException {
  List<Search> ts=new ArrayList<Search>();
  try {
    JSONArray a=o.getJSONArray(TRENDS);
    for (int i=0; i < a.length(); i++) {
      Search t=trend(a.getJSONObject(i));
      ts.add(t);
    }
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_PARSE_FAILED,e.getMessage(),e.getCause());
  }
  return ts;
}

Fixed version (ground truth):
public static List<Search> trends(JSONObject o) throws ApiException {
  List<Search> ts=new ArrayList<Search>();
  try {
    JSONArray a=o.getJSONArray(TRENDS);
    for (int i=0; i < a.length(); i++) {
      Search t=trend(a.getJSONObject(i));
      ts.add(t);
    }
  }
 catch (  JSONException e) {
    if (App.DEBUG) {
      Log.e(TAG,e.getMessage());
    }
    throw new ApiException(ERROR_JSON_EXCEPTION,e.getMessage(),e.getCause());
  }
  return ts;
}
Program: 25916
Project: 25916
Buggy source:
public static Photo parse(JSONObject o) throws ApiException {
  if (o == null) {
    return null;
  }
  try {
    Photo p=new Photo();
    p.imageUrl=o.getString(StatusInfo.PHOTO_IMAGE_URL);
    p.largeUrl=o.getString(StatusInfo.PHOTO_LARGE_URL);
    p.thumbUrl=o.getString(StatusInfo.PHOTO_THUMB_URL);
    return p;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
}

Fixed version (ground truth):
public static Photo parse(JSONObject o) throws ApiException {
  if (o == null) {
    return null;
  }
  try {
    Photo p=new Photo();
    p.imageUrl=o.getString(StatusInfo.PHOTO_IMAGE_URL);
    p.largeUrl=o.getString(StatusInfo.PHOTO_LARGE_URL);
    p.thumbUrl=o.getString(StatusInfo.PHOTO_THUMB_URL);
    return p;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
}
Program: 25918
Project: 25918
Buggy source:
public static List<Status> parseStatuses(JSONArray a,int type) throws ApiException {
  if (a == null) {
    return null;
  }
  if (App.DEBUG) {
    log("String_Node_Str" + a.length());
  }
  try {
    List<Status> statuses=new ArrayList<Status>();
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      Status s=Status.parse(o,type);
      statuses.add(s);
    }
    return statuses;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
}

Fixed version (ground truth):
public static List<Status> parseStatuses(JSONArray a,int type) throws ApiException {
  if (a == null) {
    return null;
  }
  if (App.DEBUG) {
    log("String_Node_Str" + a.length());
  }
  try {
    List<Status> statuses=new ArrayList<Status>();
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      Status s=Status.parse(o,type);
      statuses.add(s);
    }
    return statuses;
  }
 catch (  JSONException e) {
    if (App.DEBUG)     e.printStackTrace();
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
}
Program: 25919
Project: 25919
Buggy source:
public static List<User> parseUsers(JSONArray a) throws ApiException {
  if (a == null) {
    return null;
  }
  List<User> users=new ArrayList<User>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      User u=parse(o);
      users.add(u);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e);
  }
  return users;
}

Fixed version (ground truth):
public static List<User> parseUsers(JSONArray a) throws ApiException {
  if (a == null) {
    return null;
  }
  List<User> users=new ArrayList<User>();
  try {
    for (int i=0; i < a.length(); i++) {
      JSONObject o=a.getJSONObject(i);
      User u=parse(o);
      users.add(u);
    }
  }
 catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e);
  }
  return users;
}
Program: 25920
Project: 25920
Buggy source:
public static User parse(JSONObject o) throws ApiException {
  if (null == o) {
    return null;
  }
  try {
    User user=new User();
    user.id=o.getString(BasicColumns.ID);
    user.screenName=o.getString(UserInfo.SCREEN_NAME);
    user.location=o.getString(UserInfo.LOCATION);
    user.gender=o.getString(UserInfo.GENDER);
    user.birthday=o.getString(UserInfo.BIRTHDAY);
    user.description=o.getString(UserInfo.DESCRIPTION);
    user.profileImageUrl=o.getString(UserInfo.PROFILE_IMAGE_URL);
    user.url=o.getString(UserInfo.URL);
    user.protect=o.getBoolean(UserInfo.PROTECTED);
    user.followersCount=o.getInt(UserInfo.FOLLOWERS_COUNT);
    user.friendsCount=o.getInt(UserInfo.FRIENDS_COUNT);
    user.favouritesCount=o.getInt(UserInfo.FAVORITES_COUNT);
    user.statusesCount=o.getInt(UserInfo.STATUSES_COUNT);
    user.following=o.getBoolean(UserInfo.FOLLOWING);
    user.createdAt=Parser.date(o.getString(BasicColumns.CREATED_AT));
    user.type=Commons.TYPE_NONE;
    user.ownerId=App.me.userId;
    return user;
  }
 catch (  Exception e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e.getMessage(),e);
  }
}

Fixed version (ground truth):
public static User parse(JSONObject o) throws ApiException {
  if (null == o) {
    return null;
  }
  try {
    User user=new User();
    user.id=o.getString(BasicColumns.ID);
    user.screenName=o.getString(UserInfo.SCREEN_NAME);
    user.location=o.getString(UserInfo.LOCATION);
    user.gender=o.getString(UserInfo.GENDER);
    user.birthday=o.getString(UserInfo.BIRTHDAY);
    user.description=o.getString(UserInfo.DESCRIPTION);
    user.profileImageUrl=o.getString(UserInfo.PROFILE_IMAGE_URL);
    user.url=o.getString(UserInfo.URL);
    user.protect=o.getBoolean(UserInfo.PROTECTED);
    user.followersCount=o.getInt(UserInfo.FOLLOWERS_COUNT);
    user.friendsCount=o.getInt(UserInfo.FRIENDS_COUNT);
    user.favouritesCount=o.getInt(UserInfo.FAVORITES_COUNT);
    user.statusesCount=o.getInt(UserInfo.STATUSES_COUNT);
    user.following=o.getBoolean(UserInfo.FOLLOWING);
    user.createdAt=Parser.date(o.getString(BasicColumns.CREATED_AT));
    user.type=Commons.TYPE_NONE;
    user.ownerId=App.me.userId;
    return user;
  }
 catch (  Exception e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
}
Program: 25921
Project: 25921
Buggy source:
public HttpResponse exec(NetRequest cr) throws IOException {
  signRequest(cr);
  return executeImpl(cr.request);
}

Fixed version (ground truth):
public HttpResponse exec(NetRequest cr) throws IOException {
  if (TextUtils.isEmpty(cr.url)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  signRequest(cr);
  return executeImpl(cr.request);
}
Program: 25922
Project: 25922
Buggy source:
private NetRequest(Builder builder){
  if (TextUtils.isEmpty(builder.url)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.post=builder.post;
  this.headers=builder.headers;
  this.params=builder.params;
  if (post) {
    this.url=builder.url;
    this.request=new HttpPost(url);
    if (!Utils.isEmpty(params)) {
      if (NetHelper.containsFile(params)) {
        entity=NetHelper.encodeMultipart(params);
      }
 else {
        entity=NetHelper.encodeForPost(params);
      }
      ((HttpPost)request).setEntity(entity);
    }
 else {
      entity=null;
    }
  }
 else {
    this.entity=null;
    if (Utils.isEmpty(params)) {
      this.url=builder.url;
    }
 else {
      this.url=builder.url + "String_Node_Str" + NetHelper.encodeForGet(params);
      ;
    }
    this.request=new HttpGet(url);
  }
  NetHelper.setHeaders(request,headers);
}

Fixed version (ground truth):
private NetRequest(Builder builder){
  this.post=builder.post;
  this.headers=builder.headers;
  this.params=builder.params;
  if (post) {
    this.url=builder.url;
    this.request=new HttpPost(url);
    if (!Utils.isEmpty(params)) {
      if (NetHelper.containsFile(params)) {
        entity=NetHelper.encodeMultipart(params);
      }
 else {
        entity=NetHelper.encodeForPost(params);
      }
      ((HttpPost)request).setEntity(entity);
    }
 else {
      entity=null;
    }
  }
 else {
    this.entity=null;
    if (Utils.isEmpty(params)) {
      this.url=builder.url;
    }
 else {
      this.url=builder.url + "String_Node_Str" + NetHelper.encodeForGet(params);
      ;
    }
    this.request=new HttpGet(url);
  }
  NetHelper.setHeaders(request,headers);
}
Program: 25923
Project: 25923
Buggy source:
public final JSONObject getJSONObject() throws ApiException {
  try {
    return new JSONObject(getContent());
  }
 catch (  IOException e) {
    throw new ApiException(ResponseCode.ERROR_NOT_CONNECTED,e);
  }
catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e);
  }
}

Fixed version (ground truth):
public final JSONObject getJSONObject() throws ApiException {
  try {
    return new JSONObject(getContent());
  }
 catch (  IOException e) {
    throw new ApiException(ResponseCode.ERROR_IO_EXCEPTION,e.getMessage(),e);
  }
catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
}
Program: 25924
Project: 25924
Buggy source:
public final JSONArray getJSONArray() throws ApiException {
  try {
    return new JSONArray(getContent());
  }
 catch (  IOException e) {
    throw new ApiException(ResponseCode.ERROR_NOT_CONNECTED,e);
  }
catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_PARSE_FAILED,e);
  }
}

Fixed version (ground truth):
public final JSONArray getJSONArray() throws ApiException {
  try {
    return new JSONArray(getContent());
  }
 catch (  IOException e) {
    throw new ApiException(ResponseCode.ERROR_IO_EXCEPTION,e.getMessage(),e);
  }
catch (  JSONException e) {
    throw new ApiException(ResponseCode.ERROR_JSON_EXCEPTION,e.getMessage(),e);
  }
}
Program: 25925
Project: 25925
Buggy source:
@Override protected void signRequest(final NetRequest cr){
  if (mOAuth != null) {
    mOAuth.signRequest(cr.request,cr.params);
  }
}

Fixed version (ground truth):
@Override protected void signRequest(final NetRequest cr){
  if (mOAuth != null) {
    mOAuth.signRequest(cr.request,cr.getParams());
  }
}
Program: 25927
Project: 25927
Buggy source:
private void handleError(ApiException e){
  if (receiver != null) {
    String message=e.getMessage();
    if (e.statusCode == ResponseCode.ERROR_NOT_CONNECTED || e.statusCode >= 500) {
      message=getString(R.string.connection_error_msg);
    }
    Bundle b=new Bundle();
    b.putInt(Commons.EXTRA_ERROR_CODE,e.statusCode);
    b.putString(Commons.EXTRA_ERROR_MESSAGE,message);
    receiver.send(Commons.RESULT_CODE_ERROR,b);
  }
}

Fixed version (ground truth):
private void handleError(ApiException e){
  if (receiver != null) {
    String message=e.getMessage();
    if (e.statusCode == ResponseCode.ERROR_IO_EXCEPTION || e.statusCode >= 500) {
      message=getString(R.string.connection_error_msg);
    }
    Bundle b=new Bundle();
    b.putInt(Commons.EXTRA_ERROR_CODE,e.statusCode);
    b.putString(Commons.EXTRA_ERROR_MESSAGE,message);
    receiver.send(Commons.RESULT_CODE_ERROR,b);
  }
}
Program: 25928
Project: 25928
Buggy source:
public static Bitmap compressImage(String path,int maxDim){
  BitmapFactory.Options bfo=new BitmapFactory.Options();
  bfo.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,bfo);
  int w=bfo.outWidth;
  BitmapFactory.Options optsDownSample=new BitmapFactory.Options();
  int sampleSize=1;
  while (w / sampleSize > maxDim) {
    sampleSize+=1;
  }
  optsDownSample.inSampleSize=sampleSize;
  Bitmap bmpt=BitmapFactory.decodeFile(path,optsDownSample);
  Matrix m=new Matrix();
  if (bmpt.getWidth() > maxDim || bmpt.getHeight() > maxDim) {
    float scale=1.0f;
    float s1=(float)bmpt.getWidth() / (float)maxDim;
    float s2=(float)bmpt.getHeight() / (float)maxDim;
    if (s1 > s2) {
      scale=s1;
    }
 else {
      scale=s2;
    }
    m.postScale(scale,scale);
  }
  int sdk=new Integer(Build.VERSION.SDK).intValue();
  if (sdk > 4) {
    int rotation=getExifOrientation(path);
    if (rotation != 0) {
      m.postRotate(rotation);
    }
  }
  return Bitmap.createBitmap(bmpt,0,0,bmpt.getWidth(),bmpt.getHeight(),m,true);
}

Fixed version (ground truth):
public static Bitmap compressImage(String path,int maxDim){
  BitmapFactory.Options bfo=new BitmapFactory.Options();
  bfo.inJustDecodeBounds=true;
  BitmapFactory.decodeFile(path,bfo);
  int w=bfo.outWidth;
  BitmapFactory.Options optsDownSample=new BitmapFactory.Options();
  int sampleSize=1;
  while (w / sampleSize > maxDim) {
    sampleSize+=1;
  }
  optsDownSample.inSampleSize=sampleSize;
  Bitmap bitmap=BitmapFactory.decodeFile(path,optsDownSample);
  if (bitmap != null) {
    int bw=bitmap.getWidth();
    int bh=bitmap.getHeight();
    Matrix m=new Matrix();
    if (bw > maxDim || bh > maxDim) {
      float scale=1.0f;
      float s1=(float)bw / (float)maxDim;
      float s2=(float)bh / (float)maxDim;
      if (s1 > s2) {
        scale=s1;
      }
 else {
        scale=s2;
      }
      m.postScale(scale,scale);
    }
    int sdk=new Integer(Build.VERSION.SDK).intValue();
    if (sdk > 4) {
      int rotation=getExifOrientation(path);
      if (rotation != 0) {
        m.postRotate(rotation);
      }
    }
    return Bitmap.createBitmap(bitmap,0,0,bw,bh,m,true);
  }
  return null;
}
Program: 25929
Project: 25929
Buggy source:
public synchronized void updateAccountInfo(final User u,final OAuthToken otoken){
  if (DEBUG) {
    Log.d("String_Node_Str","String_Node_Str");
  }
  userId=u.id;
  userScreenName=u.screenName;
  Editor editor=sp.edit();
  editor.putString(getString(R.string.option_userid),u.id);
  editor.putString(getString(R.string.option_username),u.screenName);
  editor.putString(getString(R.string.option_profile_image),u.profileImageUrl);
  if (token != null) {
    token=otoken;
    verified=true;
    editor.putString(getString(R.string.option_oauth_token),token.getToken());
    editor.putString(getString(R.string.option_oauth_token_secret),token.getTokenSecret());
  }
  editor.commit();
}

Fixed version (ground truth):
public synchronized void updateAccountInfo(final User u,final OAuthToken otoken){
  if (DEBUG) {
    Log.d("String_Node_Str","String_Node_Str");
  }
  setOAuthToken(otoken);
  userId=u.id;
  userScreenName=u.screenName;
  Editor editor=sp.edit();
  editor.putString(getString(R.string.option_userid),u.id);
  editor.putString(getString(R.string.option_username),u.screenName);
  editor.putString(getString(R.string.option_profile_image),u.profileImageUrl);
  editor.putString(getString(R.string.option_oauth_token),token.getToken());
  editor.putString(getString(R.string.option_oauth_token_secret),token.getTokenSecret());
  editor.commit();
}
Program: 25930
Project: 25930
Buggy source:
public synchronized void removeAccountInfo(){
  if (DEBUG) {
    Log.d("String_Node_Str","String_Node_Str");
  }
  verified=false;
  userId=null;
  userScreenName=null;
  token=null;
  Editor editor=sp.edit();
  editor.remove(getString(R.string.option_userid));
  editor.remove(getString(R.string.option_username));
  editor.remove(getString(R.string.option_profile_image));
  editor.remove(getString(R.string.option_oauth_token));
  editor.remove(getString(R.string.option_oauth_token_secret));
  editor.commit();
  ((FanFouApi)api).setOAuthToken(null);
}

Fixed version (ground truth):
public synchronized void removeAccountInfo(){
  if (DEBUG) {
    Log.d("String_Node_Str","String_Node_Str");
  }
  setOAuthToken(null);
  userId=null;
  userScreenName=null;
  Editor editor=sp.edit();
  editor.remove(getString(R.string.option_userid));
  editor.remove(getString(R.string.option_username));
  editor.remove(getString(R.string.option_profile_image));
  editor.remove(getString(R.string.option_oauth_token));
  editor.remove(getString(R.string.option_oauth_token_secret));
  editor.commit();
}
Program: 25931
Project: 25931
Buggy source:
protected void onMenuLogoutClick(){
  final ConfirmDialog dialog=new ConfirmDialog(this,"String_Node_Str","String_Node_Str");
  dialog.setClickListener(new ConfirmDialog.AbstractClickHandler(){
    @Override public void onButton1Click(){
      IntentHelper.goLoginPage(mContext);
      finish();
    }
  }
);
  dialog.show();
}

Fixed version (ground truth):
protected void onMenuLogoutClick(){
  final ConfirmDialog dialog=new ConfirmDialog(this,"String_Node_Str","String_Node_Str");
  dialog.setClickListener(new ConfirmDialog.AbstractClickHandler(){
    @Override public void onButton1Click(){
      App.me.setOAuthToken(null);
      IntentHelper.goLoginPage(mContext);
      finish();
    }
  }
);
  dialog.show();
}
Program: 25932
Project: 25932
Buggy source:
@Override public void onButton1Click(){
  IntentHelper.goLoginPage(mContext);
  finish();
}

Fixed version (ground truth):
@Override public void onButton1Click(){
  App.me.setOAuthToken(null);
  IntentHelper.goLoginPage(mContext);
  finish();
}
Program: 25935
Project: 25935
Buggy source:
@Override public Cursor runQuery(CharSequence constraint){
  String where=BasicColumns.TYPE + "String_Node_Str" + type+ "String_Node_Str"+ BasicColumns.OWNER_ID+ "String_Node_Str"+ App.me.userId+ "String_Node_Str"+ UserInfo.SCREEN_NAME+ "String_Node_Str"+ constraint+ "String_Node_Str"+ BasicColumns.ID+ "String_Node_Str"+ constraint+ "String_Node_Str";
  ;
  return managedQuery(UserInfo.CONTENT_URI,UserInfo.COLUMNS,where,null,null);
}

Fixed version (ground truth):
@Override public Cursor runQuery(CharSequence constraint){
  String where=BasicColumns.TYPE + "String_Node_Str" + type+ "String_Node_Str"+ BasicColumns.OWNER_ID+ "String_Node_Str"+ userId+ "String_Node_Str"+ UserInfo.SCREEN_NAME+ "String_Node_Str"+ constraint+ "String_Node_Str"+ BasicColumns.ID+ "String_Node_Str"+ constraint+ "String_Node_Str";
  ;
  return managedQuery(UserInfo.CONTENT_URI,UserInfo.COLUMNS,where,null,null);
}
Program: 25936
Project: 25936
Buggy source:
private boolean writeToFile(String key,Bitmap bitmap){
  if (bitmap == null || StringHelper.isEmpty(key)) {
    return false;
  }
  String filename=StringHelper.md5(key) + "String_Node_Str";
  File file=new File(IOHelper.getImageCacheDir(mContext),filename);
  if (App.DEBUG) {
    Log.i(TAG,"String_Node_Str" + filename);
  }
  return ImageHelper.writeToFile(file,bitmap);
}

Fixed version (ground truth):
private boolean writeToFile(String key,Bitmap bitmap){
  if (bitmap == null || StringHelper.isEmpty(key)) {
    return false;
  }
  String filename=StringHelper.md5(key) + "String_Node_Str";
  File file=new File(IOHelper.getImageCacheDir(mContext),filename);
  if (App.DEBUG) {
    Log.d(TAG,"String_Node_Str" + filename);
  }
  return ImageHelper.writeToFile(file,bitmap);
}
Program: 25937
Project: 25937
Buggy source:
private void handleMention() throws ApiException {
  Cursor mc=initCursor(Status.TYPE_MENTION);
  List<Status> ss=App.me.api.mentions(0,0,Utils.getSinceId(mc),null,true);
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
      getContentResolver().notifyChange(DirectMessageInfo.CONTENT_URI,null,false);
      if (size == 1) {
        notifyStatusOne(NOTIFICATION_TYPE_MENTION,ss.get(0));
      }
 else {
        notifyStatusList(NOTIFICATION_TYPE_MENTION,size);
      }
    }
  }
  mc.close();
}

Fixed version (ground truth):
private void handleMention() throws ApiException {
  Cursor mc=initCursor(Status.TYPE_MENTION);
  List<Status> ss=App.me.api.mentions(0,0,Utils.getSinceId(mc),null,true);
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
      if (size == 1) {
        notifyStatusOne(NOTIFICATION_TYPE_MENTION,ss.get(0));
      }
 else {
        notifyStatusList(NOTIFICATION_TYPE_MENTION,size);
      }
    }
  }
  mc.close();
}
Program: 25938
Project: 25938
Buggy source:
private void handleHome() throws ApiException {
  Cursor mc=initCursor(Status.TYPE_HOME);
  List<Status> ss=App.me.api.homeTimeline(0,0,Utils.getSinceId(mc),null,true);
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
      getContentResolver().notifyChange(DirectMessageInfo.CONTENT_URI,null,false);
      if (size == 1) {
        notifyStatusOne(NOTIFICATION_TYPE_HOME,ss.get(0));
      }
 else {
        notifyStatusList(NOTIFICATION_TYPE_HOME,size);
      }
    }
  }
  mc.close();
}

Fixed version (ground truth):
private void handleHome() throws ApiException {
  Cursor mc=initCursor(Status.TYPE_HOME);
  List<Status> ss=App.me.api.homeTimeline(0,0,Utils.getSinceId(mc),null,true);
  if (ss != null) {
    int size=ss.size();
    if (size > 0) {
      getContentResolver().bulkInsert(StatusInfo.CONTENT_URI,Parser.toContentValuesArray(ss));
      getContentResolver().notifyChange(StatusInfo.CONTENT_URI,null,false);
      if (size == 1) {
        notifyStatusOne(NOTIFICATION_TYPE_HOME,ss.get(0));
      }
 else {
        notifyStatusList(NOTIFICATION_TYPE_HOME,size);
      }
    }
  }
  mc.close();
}
Program: 25939
Project: 25939
Buggy source:
@Override public void process(HttpResponse response,HttpContext context) throws HttpException, IOException {
  HttpEntity entity=response.getEntity();
  Header ceheader=entity.getContentEncoding();
  if (ceheader != null) {
    HeaderElement[] codecs=ceheader.getElements();
    for (int i=0; i < codecs.length; i++) {
      if (codecs[i].getName().equalsIgnoreCase("String_Node_Str")) {
        response.setEntity(new GzipDecompressingEntity(response.getEntity()));
        return;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void process(HttpResponse response,HttpContext context) throws HttpException, IOException {
  final HttpEntity entity=response.getEntity();
  final Header encoding=entity.getContentEncoding();
  if (encoding != null) {
    for (    HeaderElement element : encoding.getElements()) {
      if (element.getName().equalsIgnoreCase(ENCODING_GZIP)) {
        response.setEntity(new GzipDecompressingEntity(response.getEntity()));
        break;
      }
    }
  }
}
Program: 25940
Project: 25940
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (App.DEBUG)   log("String_Node_Str");
  mHandler=new Handler();
  setContentView(R.layout.home);
  setActionBar();
  setWriteBottom();
  setListViews();
  setViewPager();
  setCursors();
  setAdapters();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (App.DEBUG)   log("String_Node_Str");
  init();
  setContentView(R.layout.home);
  setActionBar();
  setWriteBottom();
  setListViews();
  setViewPager();
  setCursors();
  setAdapters();
}
Program: 25941
Project: 25941
Buggy source:
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  int page=getIntent().getIntExtra(Commons.EXTRA_PAGE,0);
  if (App.DEBUG) {
    log("String_Node_Str" + page);
  }
  mViewPager.setCurrentItem(page);
}

Fixed version (ground truth):
@Override protected void onNewIntent(Intent intent){
  super.onNewIntent(intent);
  setIntent(intent);
  int page=getIntent().getIntExtra(Commons.EXTRA_PAGE,0);
  if (App.DEBUG) {
    log("String_Node_Str" + page);
  }
  mViewPager.setCurrentItem(page);
  mPageIndicator.setCurrentItem(page);
  if (page == 0) {
    cursors[page].requery();
    views[page].setRefreshing();
  }
}
Program: 25942
Project: 25942
Buggy source:
private void setViewPager(){
  int initPage=getIntent().getIntExtra(Commons.EXTRA_PAGE,0);
  if (App.DEBUG) {
    log("String_Node_Str" + initPage);
  }
  mViewAdapter=new ViewsAdapter(views);
  mViewPager=(ViewPager)findViewById(R.id.viewpager);
  mViewPager.setOnPageChangeListener(this);
  mViewPager.setAdapter(mViewAdapter);
  mPageIndicator=(CirclePageIndicator)findViewById(R.id.viewindicator);
  mPageIndicator.setViewPager(mViewPager);
  mViewPager.setCurrentItem(initPage);
  mPageIndicator.setCurrentItem(initPage);
}

Fixed version (ground truth):
private void setViewPager(){
  if (App.DEBUG) {
    log("String_Node_Str" + mCurrentPage);
  }
  mViewAdapter=new ViewsAdapter(views);
  mViewPager=(ViewPager)findViewById(R.id.viewpager);
  mViewPager.setOnPageChangeListener(this);
  mViewPager.setAdapter(mViewAdapter);
  mPageIndicator=(CirclePageIndicator)findViewById(R.id.viewindicator);
  mPageIndicator.setViewPager(mViewPager);
  int page=getIntent().getIntExtra(Commons.EXTRA_PAGE,0);
  mViewPager.setCurrentItem(page);
  mPageIndicator.setCurrentItem(page);
}
Program: 25943
Project: 25943
Buggy source:
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.login_dologin:
    if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
      showToast("String_Node_Str");
    }
 else {
      g.setCustomVar(1,"String_Node_Str",username);
      g.trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",1);
      new LoginTask().execute();
    }
  break;
case R.id.login_signup_web:
goSignUpWeb();
break;
case R.id.login_signup_sms:
goSignUpSms();
default :
break;
}
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.login_dologin:
    if (TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) {
      showToast("String_Node_Str");
    }
 else {
      g.setCustomVar(1,"String_Node_Str",username);
      g.trackEvent("String_Node_Str","String_Node_Str","String_Node_Str",1);
      mProgressDialog.show();
      new LoginTask().execute();
    }
  break;
case R.id.login_signup_web:
goSignUpWeb();
break;
case R.id.login_signup_sms:
goSignUpSms();
default :
break;
}
}
Program: 25944
Project: 25944
Buggy source:
private void initLayout(){
  setContentView(R.layout.login);
  editUsername=(EditText)findViewById(R.id.login_username);
  editUsername.addTextChangedListener(new TextChangeListener(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
      username=s.toString();
    }
  }
);
  editPassword=(EditText)findViewById(R.id.login_password);
  editPassword.addTextChangedListener(new TextChangeListener(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
      password=s.toString();
    }
  }
);
  buttonLogin=(ImageView)findViewById(R.id.login_dologin);
  buttonLogin.setOnClickListener(this);
  textSignupWeb=(TextView)findViewById(R.id.login_signup_web);
  textSignupWeb.setOnClickListener(this);
  textSignupSms=(TextView)findViewById(R.id.login_signup_sms);
  textSignupSms.setOnClickListener(this);
}

Fixed version (ground truth):
private void initLayout(){
  setContentView(R.layout.login);
  editUsername=(EditText)findViewById(R.id.login_username);
  editUsername.addTextChangedListener(new TextChangeListener(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
      username=s.toString();
    }
  }
);
  editPassword=(EditText)findViewById(R.id.login_password);
  editPassword.addTextChangedListener(new TextChangeListener(){
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
      password=s.toString();
    }
  }
);
  buttonLogin=(ImageView)findViewById(R.id.login_dologin);
  buttonLogin.setOnClickListener(this);
  textSignupWeb=(TextView)findViewById(R.id.login_signup_web);
  textSignupWeb.setOnClickListener(this);
  textSignupSms=(TextView)findViewById(R.id.login_signup_sms);
  textSignupSms.setOnClickListener(this);
  mProgressDialog=new ProgressDialog(mContext);
  mProgressDialog.setMessage("String_Node_Str");
  mProgressDialog.setIndeterminate(true);
}
Program: 25945
Project: 25945
Buggy source:
@Override protected void onPreExecute(){
  this.dialog=new ProgressDialog(mContext);
  this.dialog.setMessage("String_Node_Str");
  this.dialog.setIndeterminate(true);
  this.dialog.show();
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
}
Program: 25946
Project: 25946
Buggy source:
@Override protected void onPostExecute(ResultInfo result){
  if (dialog != null) {
    dialog.dismiss();
  }
switch (result.code) {
case LOGIN_IO_ERROR:
    showToast(result.message);
  break;
case LOGIN_AUTH_FAILED:
showToast(result.message);
break;
case LOGIN_NEW_AUTH_SUCCESS:
case LOGIN_RE_AUTH_SUCCESS:
g.setCustomVar(2,"String_Node_Str",username);
g.setCustomVar(2,"String_Node_Str",String.valueOf(Build.VERSION.SDK_INT));
g.setCustomVar(2,"String_Node_Str",Build.MODEL);
g.setCustomVar(2,"String_Node_Str",DeviceHelper.uuid(mContext));
goHome();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override protected void onPostExecute(ResultInfo result){
  if (mProgressDialog != null && mProgressDialog.isShowing()) {
    mProgressDialog.dismiss();
  }
switch (result.code) {
case LOGIN_IO_ERROR:
    showToast(result.message);
  break;
case LOGIN_AUTH_FAILED:
showToast(result.message);
break;
case LOGIN_NEW_AUTH_SUCCESS:
case LOGIN_RE_AUTH_SUCCESS:
g.setCustomVar(2,"String_Node_Str",username);
g.setCustomVar(2,"String_Node_Str",String.valueOf(Build.VERSION.SDK_INT));
g.setCustomVar(2,"String_Node_Str",Build.MODEL);
g.setCustomVar(2,"String_Node_Str",DeviceHelper.uuid(mContext));
goHome();
break;
default :
break;
}
}
Program: 25947
Project: 25947
Buggy source:
@Override public int getItemViewType(int position){
  final Cursor c=(Cursor)getItem(position);
  if (c == null) {
    return ITEM_TYPE_NONE;
  }
  final Status s=Status.parse(c);
  if (s == null || s.isNull()) {
    if (App.DEBUG) {
      log("String_Node_Str" + position + "String_Node_Str");
    }
    return ITEM_TYPE_NONE;
  }
  if (s.text.contains("String_Node_Str" + App.me.userScreenName)) {
    return ITEM_TYPE_MENTION;
  }
 else {
    return ITEM_TYPE_NONE;
  }
}

Fixed version (ground truth):
@Override public int getItemViewType(int position){
  final Cursor c=(Cursor)getItem(position);
  if (c == null) {
    return ITEM_TYPE_NONE;
  }
  final Status s=Status.parse(c);
  if (s == null || s.isNull()) {
    return ITEM_TYPE_NONE;
  }
  if (StatusHelper.getSimpifiedText(s.text).contains("String_Node_Str" + App.me.userScreenName)) {
    return ITEM_TYPE_MENTION;
  }
 else {
    return ITEM_TYPE_NONE;
  }
}
Program: 25948
Project: 25948
Buggy source:
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  return new CursorLoader(getActivity(),getUri(),getProjection(),getSelection(),getSelectionArgs(),getSortOrder());
}

Fixed version (ground truth):
@Override public Loader<Cursor> onCreateLoader(int id,Bundle args){
  return getCursorLoader();
}
Program: 25949
Project: 25949
Buggy source:
public void initHelper(double[] theData,int theOffset,int theLength){
  this.data=theData;
  this.offset=theOffset;
  this.length=theLength;
}

Fixed version (ground truth):
public void initHelper(final int theOffset,final int theLength){
  this.offset=theOffset;
  this.length=theLength;
}
Program: 25950
Project: 25950
Buggy source:
public void finalizeStructure(){
  int offset=0;
  for (  FlatObject obj : this.flatObjects) {
    offset=obj.init(offset);
  }
  final double[] data=new double[offset];
  for (  FlatObject obj : this.flatObjects) {
    obj.setData(data);
  }
}

Fixed version (ground truth):
public void finalizeStructure(){
  int offset=0;
  for (  FlatObject obj : this.flatObjects) {
    offset=obj.init(offset);
  }
  this.data=new double[offset];
  for (  FlatObject obj : this.flatObjects) {
    obj.setData(data);
  }
}
Program: 25951
Project: 25951
Buggy source:
@Override public int init(final double[] theData,final int theOffset){
  int len=rows * columns;
  initHelper(theData,theOffset,len);
  return theOffset + len;
}

Fixed version (ground truth):
@Override public int init(final int theOffset){
  int len=rows * columns;
  initHelper(theOffset,len);
  return theOffset + len;
}
Program: 25952
Project: 25952
Buggy source:
@Override public int init(final double[] theData,final int theOffset){
  int len=this.rows * this.columns * this.depth;
  initHelper(theData,theOffset,len);
  return theOffset + len;
}

Fixed version (ground truth):
@Override public int init(final int theOffset){
  int len=this.rows * this.columns * this.depth;
  initHelper(theOffset,len);
  return theOffset + len;
}
Program: 25953
Project: 25953
Buggy source:
public FlatVolume(final int theRows,final int theColumns,final int theDepth){
  this.rows=theRows;
  this.columns=theColumns;
  this.depth=theDepth;
}

Fixed version (ground truth):
public FlatVolume(final int[] count){
  this(count[0],count[1],count[2]);
}
Program: 25954
Project: 25954
Buggy source:
public void process(){
  System.out.println("String_Node_Str");
  String dir=System.getProperty("String_Node_Str");
  MNISTReader trainingReader=loadMNIST(dir,true,MNIST_DEPTH);
  MNISTReader validationReader=loadMNIST(dir,false,MNIST_DEPTH);
  System.out.println("String_Node_Str" + trainingReader.getNumImages());
  System.out.println("String_Node_Str" + validationReader.getNumImages());
  int inputCount=trainingReader.getData().get(0).getInput().length;
  int outputCount=trainingReader.getData().get(0).getIdeal().length;
  BasicNetwork network=new BasicNetwork();
  network.addLayer(new BasicLayer(null,true,inputCount));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,50));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,25));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,5));
  network.addLayer(new BasicLayer(new ActivationSoftMax(),false,outputCount));
  network.finalizeStructure();
  network.reset();
  System.out.println("String_Node_Str");
  final BackPropagation train=new BackPropagation(network,trainingReader.getData(),1e-4,0.9);
  train.setL1(0);
  train.setL2(1e-11);
  this.performIterationsClassifyEarlyStop(train,network,trainingReader.getData(),5);
}

Fixed version (ground truth):
public void process(){
  System.out.println("String_Node_Str");
  String dir=System.getProperty("String_Node_Str");
  MNISTReader trainingReader=loadMNIST(dir,true,MNIST_DEPTH);
  MNISTReader validationReader=loadMNIST(dir,false,MNIST_DEPTH);
  System.out.println("String_Node_Str" + trainingReader.getNumImages());
  System.out.println("String_Node_Str" + validationReader.getNumImages());
  int inputCount=trainingReader.getData().get(0).getInput().length;
  int outputCount=trainingReader.getData().get(0).getIdeal().length;
  BasicNetwork network=new BasicNetwork();
  network.addLayer(new BasicLayer(null,true,inputCount));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,100));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,50));
  network.addLayer(new BasicLayer(new ActivationReLU(),true,25));
  network.addLayer(new BasicLayer(new ActivationSoftMax(),false,outputCount));
  network.finalizeStructure();
  network.reset();
  System.out.println("String_Node_Str");
  final BackPropagation train=new BackPropagation(network,trainingReader.getData(),1e-4,0.9);
  train.setL1(0);
  train.setL2(1e-11);
  this.performIterationsClassifyEarlyStop(train,network,validationReader.getData(),5);
}
Program: 25956
Project: 25956
Buggy source:
/** 
 * Get the weight between the two layers.
 * @param fromLayer The from layer.
 * @param fromNeuron The from neuron.
 * @param toNeuron The to neuron.
 * @return The weight value.
 */
public double getWeight(final int fromLayer,final int fromNeuron,final int toNeuron){
  validateNeuron(fromLayer,fromNeuron);
  validateNeuron(fromLayer + 1,toNeuron);
  final int fromLayerNumber=this.layerContextCount.length - fromLayer - 1;
  final int toLayerNumber=fromLayerNumber - 1;
  if (toLayerNumber < 0) {
    throw new AIFHError("String_Node_Str" + fromLayer);
  }
  final int weightBaseIndex=this.weightIndex[toLayerNumber];
  final int count=this.layerCounts[fromLayerNumber];
  final int weightIndex=weightBaseIndex + fromNeuron + (toNeuron * count);
  return this.weights[weightIndex];
}

Fixed version (ground truth):
/** 
 * Get the weight between the two layers.
 * @param fromLayer The from layer.
 * @param fromNeuron The from neuron.
 * @param toNeuron The to neuron.
 * @return The weight value.
 */
public double getWeight(final int fromLayer,final int fromNeuron,final int toNeuron){
  validateNeuron(fromLayer,fromNeuron);
  validateNeuron(fromLayer + 1,toNeuron);
  final int fromLayerNumber=this.layers.size() - fromLayer - 1;
  final int toLayerNumber=fromLayerNumber - 1;
  if (toLayerNumber < 0) {
    throw new AIFHError("String_Node_Str" + fromLayer);
  }
  final int weightBaseIndex=this.weightIndex[toLayerNumber];
  final int count=this.layerCounts[fromLayerNumber];
  final int weightIndex=weightBaseIndex + fromNeuron + (toNeuron * count);
  return this.weights[weightIndex];
}
Program: 25958
Project: 25958
Buggy source:
/** 
 * Process one training set element.
 * @param input The network input.
 * @param ideal The ideal values.
 */
public void process(ErrorCalculation errorCalc,double[] input,double[] ideal){
  this.network.compute(input,this.actual);
  errorCalc.updateError(this.actual,ideal,1.0);
  this.errorFunction.calculateError(this.network.getActivationFunctions()[0],this.layerSums,this.layerOutput,ideal,this.actual,this.layerDelta,0,1.0);
  if (this.owner.getL1() > AIFH.DEFAULT_PRECISION || this.owner.getL1() > AIFH.DEFAULT_PRECISION) {
    double[] lp=new double[2];
    calculateRegularizationPenalty(lp);
    for (int i=0; i < this.actual.length; i++) {
      double p=(lp[0] * this.owner.getL1()) + (lp[1] * this.owner.getL2());
      this.layerDelta[i]+=p;
    }
  }
  for (int i=0; i < this.layerCounts.length - 1; i++) {
    processLevel(i);
  }
}

Fixed version (ground truth):
/** 
 * Process one training set element.
 * @param input The network input.
 * @param ideal The ideal values.
 */
public void process(ErrorCalculation errorCalc,double[] input,double[] ideal){
  this.network.compute(input,this.actual);
  errorCalc.updateError(this.actual,ideal,1.0);
  int outputLayerIndex=this.network.getLayers().size() - 1;
  ActivationFunction outputActivation=this.network.getLayers().get(outputLayerIndex).getActivation();
  this.errorFunction.calculateError(outputActivation,this.layerSums,this.layerOutput,ideal,this.actual,this.layerDelta,0,1.0);
  if (this.owner.getL1() > AIFH.DEFAULT_PRECISION || this.owner.getL1() > AIFH.DEFAULT_PRECISION) {
    double[] lp=new double[2];
    calculateRegularizationPenalty(lp);
    for (int i=0; i < this.actual.length; i++) {
      double p=(lp[0] * this.owner.getL1()) + (lp[1] * this.owner.getL2());
      this.layerDelta[i]+=p;
    }
  }
  for (int i=this.layerCounts.length - 1; i > 0; i--) {
    Layer layer=this.network.getLayers().get(i);
    processLevel(layer);
  }
}
Program: 25959
Project: 25959
Buggy source:
/** 
 * Process one level.
 * @param currentLevel The level.
 */
private void processLevel(final int currentLevel){
  final int fromLayerIndex=this.layerIndex[currentLevel + 1];
  final int toLayerIndex=this.layerIndex[currentLevel];
  final int fromLayerSize=this.layerCounts[currentLevel + 1];
  final int toLayerSize=this.layerFeedCounts[currentLevel];
  final int index=this.weightIndex[currentLevel];
  final ActivationFunction activation=this.network.getActivationFunctions()[currentLevel];
  final double[] layerDelta=this.layerDelta;
  final double[] weights=this.weights;
  final double[] gradients=this.gradients;
  final double[] layerOutput=this.layerOutput;
  final double[] layerSums=this.layerSums;
  int yi=fromLayerIndex;
  for (int y=0; y < fromLayerSize; y++) {
    final double output=layerOutput[yi];
    double sum=0;
    int wi=index + y;
    final int loopEnd=toLayerIndex + toLayerSize;
    for (int xi=toLayerIndex; xi < loopEnd; xi++, wi+=fromLayerSize) {
      this.gradients[wi]+=-(output * layerDelta[xi]);
      sum+=weights[wi] * layerDelta[xi];
    }
    layerDelta[yi]=sum * (activation.derivativeFunction(layerSums[yi],layerOutput[yi]));
    yi++;
  }
}

Fixed version (ground truth):
/** 
 * Process one level.
 * @param layer The level.
 */
private void processLevel(final Layer layer){
  int currentLevel=layer.getLayerIndex();
  final int fromLayerIndex=this.layerIndex[currentLevel + 1];
  final int toLayerIndex=this.layerIndex[currentLevel];
  final int fromLayerSize=this.layerCounts[currentLevel + 1];
  final int toLayerSize=this.layerFeedCounts[currentLevel];
  final int index=this.weightIndex[currentLevel];
  final ActivationFunction activation=layer.getActivation();
  final double[] layerDelta=this.layerDelta;
  final double[] weights=this.weights;
  final double[] gradients=this.gradients;
  final double[] layerOutput=this.layerOutput;
  final double[] layerSums=this.layerSums;
  int yi=fromLayerIndex;
  for (int y=0; y < fromLayerSize; y++) {
    final double output=layerOutput[yi];
    double sum=0;
    int wi=index + y;
    final int loopEnd=toLayerIndex + toLayerSize;
    for (int xi=toLayerIndex; xi < loopEnd; xi++, wi+=fromLayerSize) {
      this.gradients[wi]+=-(output * layerDelta[xi]);
      sum+=weights[wi] * layerDelta[xi];
    }
    layerDelta[yi]=sum * (activation.derivativeFunction(layerSums[yi],layerOutput[yi]));
    yi++;
  }
}
Program: 25960
Project: 25960
Buggy source:
/** 
 * Update the multiverse on screen.
 */
public void update(){
  final Collection<AdvanceTask> tasks=new ArrayList<AdvanceTask>();
  for (  final UniversePane[] element : this.grid) {
    for (    final UniversePane anElement : element) {
      tasks.add(new AdvanceTask(anElement));
    }
  }
  try {
    this.threadPool.invokeAll(tasks);
    final Graphics g=getGraphics();
    final FontMetrics fm=this.offscreenGraphics.getFontMetrics();
    for (int row=0; row < this.rows; row++) {
      for (int col=0; col < this.cols; col++) {
        final int x=col * MultiverseViewer.getConfig().getPaneWidth();
        final int y=row * MultiverseViewer.getConfig().getPaneHeight();
        final UniversePane cell=this.grid[row][col];
        final Image img=cell.getImage();
        this.offscreenGraphics.drawImage(img,x,y,null);
        final UniverseRunner selected=this.grid[row][col].getUniverseRunner();
        if (this.copySource != null) {
          if (this.copySource == selected) {
            drawStatus(this.offscreenGraphics,row,col,fm,"String_Node_Str");
          }
        }
 else         if (this.crossoverParent1 != null || this.crossoverParent2 != null) {
          if (selected == this.crossoverParent1) {
            drawStatus(this.offscreenGraphics,row,col,fm,"String_Node_Str");
          }
 else           if (selected == this.crossoverParent2) {
            drawStatus(this.offscreenGraphics,row,col,fm,"String_Node_Str");
          }
        }
 else {
          final String s="String_Node_Str" + cell.getUniverseRunner().getDiff() + "String_Node_Str"+ cell.getUniverseRunner().getIterations();
          drawStatus(this.offscreenGraphics,row,col,fm,s);
        }
      }
    }
    g.drawImage(this.offscreenImage,0,0,this);
  }
 catch (  final InterruptedException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Update the multiverse on screen.
 */
public void update(){
  final Collection<AdvanceTask> tasks=new ArrayList<AdvanceTask>();
  for (  final UniversePane[] element : this.grid) {
    for (    final UniversePane anElement : element) {
      tasks.add(new AdvanceTask(anElement));
    }
  }
  try {
    this.threadPool.invokeAll(tasks);
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        updateGUI();
      }
    }
);
    Thread.sleep(100);
  }
 catch (  final InterruptedException ex) {
    ex.printStackTrace();
  }
}
Program: 25961
Project: 25961
Buggy source:
/** 
 * The constructor.
 */
public MultiverseViewer(){
  MultiverseViewer.loadConfig();
  setSize(1024,768);
  setTitle("String_Node_Str");
  final int rows=MultiverseViewer.getConfig().getUniversePaneRows();
  final int cols=MultiverseViewer.getConfig().getUniversePaneColumns();
  final Container c=getContentPane();
  c.setLayout(new BorderLayout());
  final JPanel buttonPanel=new JPanel();
  c.add(buttonPanel,BorderLayout.NORTH);
  buttonPanel.add(this.configButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.goButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.startButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.stopButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.resetButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.autoKill=new JCheckBox("String_Node_Str"));
  buttonPanel.add(this.deselectButton=new JButton("String_Node_Str"));
  c.add(this.outputPanel=new DisplayPanel(this,rows,cols),BorderLayout.CENTER);
  this.goButton.addActionListener(this);
  this.startButton.addActionListener(this);
  this.stopButton.addActionListener(this);
  this.resetButton.addActionListener(this);
  this.configButton.addActionListener(this);
  this.autoKill.addActionListener(this);
  this.configButton.addActionListener(this);
  this.deselectButton.addActionListener(this);
  this.outputPanel.setAutoKill(true);
  this.autoKill.setSelected(true);
  this.deselectButton.setEnabled(false);
  addWindowListener(this);
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public MultiverseViewer(){
  MultiverseViewer.loadConfig();
  setSize(1024,768);
  setTitle("String_Node_Str");
  final int rows=MultiverseViewer.getConfig().getUniversePaneRows();
  final int cols=MultiverseViewer.getConfig().getUniversePaneColumns();
  final Container c=getContentPane();
  c.setLayout(new BorderLayout());
  final JPanel buttonPanel=new JPanel();
  c.add(buttonPanel,BorderLayout.NORTH);
  buttonPanel.add(this.configButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.goButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.startButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.stopButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.resetButton=new JButton("String_Node_Str"));
  buttonPanel.add(this.autoKill=new JCheckBox("String_Node_Str"));
  buttonPanel.add(this.deselectButton=new JButton("String_Node_Str"));
  c.add(this.outputPanel=new DisplayPanel(this,rows,cols),BorderLayout.CENTER);
  this.goButton.addActionListener(this);
  this.startButton.addActionListener(this);
  this.stopButton.addActionListener(this);
  this.resetButton.addActionListener(this);
  this.configButton.addActionListener(this);
  this.autoKill.addActionListener(this);
  this.deselectButton.addActionListener(this);
  this.outputPanel.setAutoKill(true);
  this.autoKill.setSelected(true);
  this.deselectButton.setEnabled(false);
  addWindowListener(this);
}
Program: 25962
Project: 25962
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public double calculate(final double[] position1,final int pos1,final double[] position2,final int pos2,final int length){
  double sum=0;
  for (int i=0; i < length; i++) {
    final double d=Math.abs(position1[i] - position2[i]);
    sum+=d;
  }
  return sum;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public double calculate(final double[] position1,final int pos1,final double[] position2,final int pos2,final int length){
  double sum=0;
  for (int i=0; i < length; i++) {
    final double d=Math.abs(position1[pos1 + i] - position2[pos1 + i]);
    sum+=d;
  }
  return sum;
}