nus-yam/ex-repair huggingface dataset:
Program: 17484
Project: 17484
Buggy source:
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,long timestamp,int ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=UUIDs.unixTimestamp(uuid);
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def.getName(),null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    long shardId=i.getShardingStrategy().getShardKey(uuid);
    ret.add(makeInsertStatementWide(makeTableName(def.getName(),i.getName()),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
    if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
      ret.add(makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def.getName(),i.getName()),shardId,i.getIndexValues(data),timestamp));
    }
  }
  return new BoundedCQLStatementIterator(ret);
}

Fixed version (ground truth):
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,long timestamp,int ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=UUIDs.unixTimestamp(uuid);
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def,null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    long shardId=i.getShardingStrategy().getShardKey(uuid);
    ret.add(makeInsertStatementWide(makeTableName(def,i),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
    if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
      ret.add(makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def,i),shardId,i.getIndexValues(data),timestamp));
    }
  }
  return new BoundedCQLStatementIterator(ret);
}
Program: 17485
Project: 17485
Buggy source:
protected static String makeInsertStatementWideIndex(String tableName,String targetTableName,Long shardId,List<String> indexValues,long timestamp){
  String indexValuesString=Joiner.on("String_Node_Str").join(indexValues);
  return String.format(TEMPLATE_INSERT_WIDE_INDEX,tableName,targetTableName,indexValuesString,shardId,shardId + indexValuesString,timestamp);
}

Fixed version (ground truth):
protected static String makeInsertStatementWideIndex(String tableName,String targetTableName,Long shardId,List<String> indexValues,long timestamp){
  String indexValuesString=Joiner.on("String_Node_Str").join(indexValues);
  return String.format(TEMPLATE_INSERT_WIDE_INDEX,tableName,targetTableName,indexValuesString,shardId,shardId + "String_Node_Str" + indexValuesString,timestamp);
}
Program: 17486
Project: 17486
Buggy source:
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,long timestamp,int ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=UUIDs.unixTimestamp(uuid);
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def.getName(),null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    if (i.passesAllFilters(data)) {
      long shardId=i.getShardingStrategy().getShardKey(uuid);
      ret.add(makeInsertStatementWide(makeTableName(def.getName(),i.getName()),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
      if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
        makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def.getName(),i.getName()),shardId,i.getIndexValues(data),timestamp);
      }
    }
  }
  return new BoundedCQLStatementIterator(ret);
}

Fixed version (ground truth):
protected static CQLStatementIterator makeCQLforInsert(@NotNull CDefinition def,@NotNull Map<String,String> data,@Nullable UUID uuid,long timestamp,int ttl) throws CQLGenerationException {
  List<String> ret=Lists.newArrayList();
  if (uuid == null) {
    uuid=UUIDs.timeBased();
  }
  if (timestamp == 0) {
    timestamp=UUIDs.unixTimestamp(uuid);
  }
  if (!validateData(def,data)) {
    throw new CQLGenerationException("String_Node_Str");
  }
  Map<String,ArrayList<String>> fieldsAndValues=makeFieldAndValueList(def,data);
  ret.add(makeInsertStatementStatic(makeTableName(def.getName(),null),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,timestamp,ttl));
  for (  CIndex i : def.getIndexes().values()) {
    if (i.passesAllFilters(data)) {
      long shardId=i.getShardingStrategy().getShardKey(uuid);
      ret.add(makeInsertStatementWide(makeTableName(def.getName(),i.getName()),makeCommaList(fieldsAndValues.get("String_Node_Str")),makeCommaList(fieldsAndValues.get("String_Node_Str")),uuid,shardId,timestamp,ttl));
      if (!(i.getShardingStrategy() instanceof ShardingStrategyNone)) {
        ret.add(makeInsertStatementWideIndex(CObjectShardList.SHARD_INDEX_TABLE_NAME,makeTableName(def.getName(),i.getName()),shardId,i.getIndexValues(data),timestamp));
      }
    }
  }
  return new BoundedCQLStatementIterator(ret);
}
Program: 17487
Project: 17487
Buggy source:
public Range<Long> getShardKeyRange(long timestampStart,long timestampEnd,boolean inclusive) throws ShardStrategyException {
  long start=getShardKey(timestampStart);
  long end=getShardKey(timestampEnd);
  if (start == 0) {
    if (end == 0) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      return inclusive ? Range.atMost(end) : Range.lessThan(end);
    }
  }
 else {
    if (end == 0) {
      return inclusive ? Range.atLeast(start) : Range.greaterThan(start);
    }
 else {
      return inclusive ? Range.closed(start,end) : Range.open(start,end);
    }
  }
}

Fixed version (ground truth):
public Range<Long> getShardKeyRange(long timestampStart,long timestampEnd) throws ShardStrategyException {
  if (timestampStart == 0) {
    if (timestampEnd == 0) {
      throw new ShardStrategyException("String_Node_Str");
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.atMost(end);
    }
  }
 else {
    long start=getShardKey(timestampStart);
    if (timestampEnd == 0) {
      return Range.atLeast(start);
    }
 else {
      long end=getShardKey(timestampEnd);
      return Range.closed(start,end);
    }
  }
}
Program: 17488
Project: 17488
Buggy source:
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
}

Fixed version (ground truth):
public void testMakeCQLforGet() throws CQLGenerationException, CObjectParseException, IOException {
  Subject s=new Subject();
  s.testMakeCQLforGet();
}
Program: 17489
Project: 17489
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.uv_article_layout);
  final Article article=getIntent().getParcelableExtra("String_Node_Str");
  setTitle(article.getTitle());
  WebView webView=(WebView)findViewById(R.id.uv_webview);
  Utils.displayArticle(webView,article,this);
  findViewById(R.id.uv_container).setBackgroundColor(Utils.isDarkTheme(this) ? Color.BLACK : Color.WHITE);
  webView.setWebViewClient(new WebViewClient(){
    @Override public void onPageFinished(    WebView view,    String url){
      super.onPageFinished(view,url);
      findViewById(R.id.uv_helpful_section).setVisibility(View.VISIBLE);
    }
  }
);
  findViewById(R.id.uv_helpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Babayaga.track(Babayaga.Event.VOTE_ARTICLE,article.getId());
      Toast.makeText(ArticleActivity.this,R.string.uv_thanks,Toast.LENGTH_SHORT).show();
    }
  }
);
  findViewById(R.id.uv_unhelpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      UnhelpfulDialogFragment dialog=new UnhelpfulDialogFragment();
      dialog.show(getSupportFragmentManager(),"String_Node_Str");
    }
  }
);
  Babayaga.track(Babayaga.Event.VIEW_ARTICLE,article.getId());
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.uv_article_layout);
  final Article article=getIntent().getParcelableExtra("String_Node_Str");
  setTitle(article.getTitle());
  webView=(WebView)findViewById(R.id.uv_webview);
  final View helpfulSection=findViewById(R.id.uv_helpful_section);
  Utils.displayArticle(webView,article,this);
  findViewById(R.id.uv_container).setBackgroundColor(Utils.isDarkTheme(this) ? Color.BLACK : Color.WHITE);
  webView.setWebViewClient(new WebViewClient(){
    @Override public void onPageFinished(    WebView view,    String url){
      super.onPageFinished(view,url);
      helpfulSection.setVisibility(View.VISIBLE);
    }
  }
);
  findViewById(R.id.uv_helpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Babayaga.track(Babayaga.Event.VOTE_ARTICLE,article.getId());
      Toast.makeText(ArticleActivity.this,R.string.uv_thanks,Toast.LENGTH_SHORT).show();
    }
  }
);
  findViewById(R.id.uv_unhelpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      UnhelpfulDialogFragment dialog=new UnhelpfulDialogFragment();
      dialog.show(getSupportFragmentManager(),"String_Node_Str");
    }
  }
);
  Babayaga.track(Babayaga.Event.VIEW_ARTICLE,article.getId());
}
Program: 17490
Project: 17490
Buggy source:
@Override public void onPageFinished(WebView view,String url){
  super.onPageFinished(view,url);
  findViewById(R.id.uv_helpful_section).setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
@Override public void onPageFinished(WebView view,String url){
  super.onPageFinished(view,url);
  helpfulSection.setVisibility(View.VISIBLE);
}
Program: 17491
Project: 17491
Buggy source:
@Override public void finish(){
  WebView webview=(WebView)findViewById(R.id.uv_webview);
  webview.loadData("String_Node_Str","String_Node_Str","String_Node_Str");
  super.finish();
}

Fixed version (ground truth):
@Override public void finish(){
  webView.loadData("String_Node_Str","String_Node_Str","String_Node_Str");
  super.finish();
}
Program: 17492
Project: 17492
Buggy source:
protected Bitmap doInBackground(Void... voids){
  Bitmap bitmap=null;
  InputStream in=null;
  try {
    in=new java.net.URL(url).openStream();
    bitmap=BitmapFactory.decodeStream(in);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    in.close();
  }
  return bitmap;
}

Fixed version (ground truth):
protected Bitmap doInBackground(Void... voids){
  Bitmap bitmap=null;
  InputStream in=null;
  try {
    in=new java.net.URL(url).openStream();
    bitmap=BitmapFactory.decodeStream(in);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    try {
      in.close();
    }
 catch (    Exception ignored) {
    }
  }
  return bitmap;
}
Program: 17494
Project: 17494
Buggy source:
protected Bitmap doInBackground(Void... voids){
  Bitmap bitmap=null;
  InputStream in=null;
  try {
    in=new java.net.URL(url).openStream();
    bitmap=BitmapFactory.decodeStream(in);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    in.close();
  }
  return bitmap;
}

Fixed version (ground truth):
protected Bitmap doInBackground(Void... voids){
  Bitmap bitmap=null;
  InputStream in=null;
  try {
    in=new java.net.URL(url).openStream();
    bitmap=BitmapFactory.decodeStream(in);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    try {
      in.close();
    }
 catch (    Exception ignored) {
    }
  }
  return bitmap;
}
Program: 17495
Project: 17495
Buggy source:
private void signIn(){
  User currentUser=Session.getInstance().getUser();
  if (currentUser != null && (email == null || email.equals(currentUser.getEmail()))) {
    callback.run();
  }
 else {
    email=email == null ? Session.getInstance().getEmail() : email;
    name=name == null ? Session.getInstance().getName() : name;
    if (email != null) {
      User.discover(email,new Callback<User>(){
        @Override public void onModel(        User model){
          promptToSignIn();
        }
        @Override public void onError(        RestResult error){
          createUser();
        }
      }
);
    }
 else {
      promptToSignIn();
    }
  }
}

Fixed version (ground truth):
private void signIn(){
  User currentUser=Session.getInstance().getUser();
  if (currentUser != null && (email == null || email.equals(currentUser.getEmail()))) {
    callback.run();
  }
 else   if (Session.getInstance().getAccessToken() != null) {
    callback.run();
  }
 else {
    email=email == null ? Session.getInstance().getEmail() : email;
    name=name == null ? Session.getInstance().getName() : name;
    if (email != null) {
      User.discover(email,new Callback<User>(){
        @Override public void onModel(        User model){
          promptToSignIn();
        }
        @Override public void onError(        RestResult error){
          createUser();
        }
      }
);
    }
 else {
      promptToSignIn();
    }
  }
}
Program: 17497
Project: 17497
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.uv_article_layout);
  final Article article=Session.getInstance().getArticle();
  setTitle(article.getTitle());
  WebView webView=(WebView)findViewById(R.id.uv_webview);
  boolean darkTheme=Utils.displayArticle(webView,article,this);
  findViewById(R.id.uv_container).setBackgroundColor(darkTheme ? Color.BLACK : Color.WHITE);
  webView.setWebViewClient(new WebViewClient(){
    @Override public void onPageFinished(    WebView view,    String url){
      super.onPageFinished(view,url);
      findViewById(R.id.uv_helpful_section).setVisibility(View.VISIBLE);
    }
  }
);
  findViewById(R.id.uv_helpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Babayaga.track(Babayaga.Event.VOTE_ARTICLE,article.getId());
      Toast.makeText(ArticleActivity.this,R.string.uv_thanks,Toast.LENGTH_SHORT).show();
    }
  }
);
  findViewById(R.id.uv_unhelpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      UnhelpfulDialogFragment dialog=new UnhelpfulDialogFragment();
      dialog.show(getSupportFragmentManager(),"String_Node_Str");
    }
  }
);
  Babayaga.track(Babayaga.Event.VIEW_ARTICLE,article.getId());
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.uv_article_layout);
  final Article article=Session.getInstance().getArticle();
  setTitle(article.getTitle());
  WebView webView=(WebView)findViewById(R.id.uv_webview);
  Utils.displayArticle(webView,article,this);
  findViewById(R.id.uv_container).setBackgroundColor(Utils.isDarkTheme(this) ? Color.BLACK : Color.WHITE);
  webView.setWebViewClient(new WebViewClient(){
    @Override public void onPageFinished(    WebView view,    String url){
      super.onPageFinished(view,url);
      findViewById(R.id.uv_helpful_section).setVisibility(View.VISIBLE);
    }
  }
);
  findViewById(R.id.uv_helpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Babayaga.track(Babayaga.Event.VOTE_ARTICLE,article.getId());
      Toast.makeText(ArticleActivity.this,R.string.uv_thanks,Toast.LENGTH_SHORT).show();
    }
  }
);
  findViewById(R.id.uv_unhelpful_button).setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      UnhelpfulDialogFragment dialog=new UnhelpfulDialogFragment();
      dialog.show(getSupportFragmentManager(),"String_Node_Str");
    }
  }
);
  Babayaga.track(Babayaga.Event.VIEW_ARTICLE,article.getId());
}
Program: 17500
Project: 17500
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle(R.string.uv_helpful_article_message_question);
  builder.setNegativeButton(R.string.uv_no,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      dialog.cancel();
      getActivity().finish();
    }
  }
);
  builder.setPositiveButton(R.string.uv_yes,null);
  return builder.create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  if (!Utils.isDarkTheme(getActivity())) {
    builder.setInverseBackgroundForced(true);
  }
  builder.setTitle(R.string.uv_helpful_article_message_question);
  builder.setNegativeButton(R.string.uv_no,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      dialog.cancel();
      getActivity().finish();
    }
  }
);
  builder.setPositiveButton(R.string.uv_yes,null);
  return builder.create();
}
Program: 17501
Project: 17501
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle(R.string.uv_password_dialog_title);
  View view=getActivity().getLayoutInflater().inflate(R.layout.uv_password_dialog,null);
  final EditText password=(EditText)view.findViewById(R.id.uv_password);
  builder.setView(view);
  builder.setNegativeButton(R.string.uv_cancel,null);
  builder.setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    final DialogInterface dialog,    int which){
      AccessToken.authorize(Session.getInstance().getEmail(),password.getText().toString(),new DefaultCallback<AccessToken>(getActivity()){
        @Override public void onModel(        AccessToken model){
          Session.getInstance().setAccessToken(model);
          callback.run();
        }
      }
);
    }
  }
);
  AlertDialog dialog=builder.create();
  dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
  return dialog;
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle(R.string.uv_password_dialog_title);
  if (!Utils.isDarkTheme(getActivity())) {
    builder.setInverseBackgroundForced(true);
  }
  View view=getActivity().getLayoutInflater().inflate(R.layout.uv_password_dialog,null);
  final EditText password=(EditText)view.findViewById(R.id.uv_password);
  builder.setView(view);
  builder.setNegativeButton(R.string.uv_cancel,null);
  builder.setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    final DialogInterface dialog,    int which){
      AccessToken.authorize(Session.getInstance().getEmail(),password.getText().toString(),new DefaultCallback<AccessToken>(getActivity()){
        @Override public void onModel(        AccessToken model){
          Session.getInstance().setAccessToken(model);
          callback.run();
        }
      }
);
    }
  }
);
  AlertDialog dialog=builder.create();
  dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
  return dialog;
}
Program: 17505
Project: 17505
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setTitle(R.string.uv_unhelpful_article_message_question);
  builder.setNegativeButton(R.string.uv_no,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      dialog.cancel();
    }
  }
);
  builder.setPositiveButton(R.string.uv_yes,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      getActivity().startActivity(new Intent(getActivity(),ContactActivity.class));
      dialog.cancel();
    }
  }
);
  return builder.create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  if (!Utils.isDarkTheme(getActivity())) {
    builder.setInverseBackgroundForced(true);
  }
  builder.setTitle(R.string.uv_unhelpful_article_message_question);
  builder.setNegativeButton(R.string.uv_no,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      dialog.cancel();
    }
  }
);
  builder.setPositiveButton(R.string.uv_yes,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      getActivity().startActivity(new Intent(getActivity(),ContactActivity.class));
      dialog.cancel();
    }
  }
);
  return builder.create();
}
Program: 17506
Project: 17506
Buggy source:
@SuppressLint("String_Node_Str") public static boolean displayArticle(WebView webView,Article article,Context context){
  TypedValue tv=new TypedValue();
  float[] hsv=new float[3];
  context.getTheme().resolveAttribute(android.R.attr.textColorPrimary,tv,true);
  Color.colorToHSV(context.getResources().getColor(tv.resourceId),hsv);
  boolean darkTheme=hsv[2] > 0.5f;
  String styles="String_Node_Str";
  if (darkTheme) {
    webView.setBackgroundColor(Color.BLACK);
    styles+="String_Node_Str";
  }
  String html=String.format("String_Node_Str",styles,article.getTitle(),article.getHtml());
  webView.setWebChromeClient(new WebChromeClient());
  webView.getSettings().setJavaScriptEnabled(true);
  webView.getSettings().setPluginState(PluginState.ON);
  webView.loadUrl(String.format("String_Node_Str",Uri.encode(html)));
  return darkTheme;
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") public static void displayArticle(WebView webView,Article article,Context context){
  String styles="String_Node_Str";
  if (isDarkTheme(context)) {
    webView.setBackgroundColor(Color.BLACK);
    styles+="String_Node_Str";
  }
  String html=String.format("String_Node_Str",styles,article.getTitle(),article.getHtml());
  webView.setWebChromeClient(new WebChromeClient());
  webView.getSettings().setJavaScriptEnabled(true);
  webView.getSettings().setPluginState(PluginState.ON);
  webView.loadUrl(String.format("String_Node_Str",Uri.encode(html)));
}
Program: 17507
Project: 17507
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getListView().setDivider(null);
  adapter=createAdapter();
  setListAdapter(adapter);
  getListView().setOnHierarchyChangeListener(adapter);
  getListView().setOnItemClickListener(adapter);
  getListView().setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
  new InitManager(this,new Runnable(){
    @Override public void run(){
      onInitialize();
    }
  }
).init();
  getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getListView().setDivider(null);
  adapter=createAdapter();
  setListAdapter(adapter);
  getListView().setOnHierarchyChangeListener(adapter);
  getListView().setOnItemClickListener(adapter);
  getListView().setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
  new InitManager(this,new Runnable(){
    @Override public void run(){
      onInitialize();
    }
  }
).init();
  getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN | WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
Program: 17509
Project: 17509
Buggy source:
private void loadForum(){
  if (Session.getInstance().getForum() != null) {
    forum=Session.getInstance().getForum();
    setTitle(forum.getName());
    getModelAdapter().loadMore();
    return;
  }
  Forum.loadForum(Session.getInstance().getConfig().getForumId(),new DefaultCallback<Forum>(this){
    @Override public void onModel(    Forum model){
      Session.getInstance().setForum(model);
      forum=model;
      setTitle(forum.getName());
      getModelAdapter().loadMore();
    }
  }
);
}

Fixed version (ground truth):
private void loadForum(){
  if (Session.getInstance().getForum() != null) {
    forum=Session.getInstance().getForum();
    Babayaga.track(Babayaga.Event.VIEW_FORUM,forum.getId());
    setTitle(forum.getName());
    getModelAdapter().loadMore();
    return;
  }
  Forum.loadForum(Session.getInstance().getConfig().getForumId(),new DefaultCallback<Forum>(this){
    @Override public void onModel(    Forum model){
      Session.getInstance().setForum(model);
      forum=model;
      setTitle(forum.getName());
      getModelAdapter().loadMore();
    }
  }
);
}
Program: 17511
Project: 17511
Buggy source:
public static void createSuggestion(Forum forum,Category category,String title,String text,int numberOfVotes,final Callback<Suggestion> callback){
  Map<String,String> params=new HashMap<String,String>();
  params.put("String_Node_Str",String.valueOf(numberOfVotes));
  params.put("String_Node_Str",title);
  params.put("String_Node_Str",text);
  params.put("String_Node_Str",String.valueOf(category.getId()));
  doPost(apiPath("String_Node_Str",forum.getId()),params,new RestTaskCallback(callback){
    @Override public void onComplete(    JSONObject object) throws JSONException {
      callback.onModel(deserializeObject(object,"String_Node_Str",Suggestion.class));
    }
  }
);
}

Fixed version (ground truth):
public static void createSuggestion(Forum forum,Category category,String title,String text,int numberOfVotes,final Callback<Suggestion> callback){
  Map<String,String> params=new HashMap<String,String>();
  params.put("String_Node_Str",String.valueOf(numberOfVotes));
  params.put("String_Node_Str",title);
  params.put("String_Node_Str",text);
  if (category != null)   params.put("String_Node_Str",String.valueOf(category.getId()));
  doPost(apiPath("String_Node_Str",forum.getId()),params,new RestTaskCallback(callback){
    @Override public void onComplete(    JSONObject object) throws JSONException {
      callback.onModel(deserializeObject(object,"String_Node_Str",Suggestion.class));
    }
  }
);
}
Program: 17512
Project: 17512
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getListView().setDivider(null);
  getListView().setPadding(10,0,10,0);
  setListAdapter(new ContactAdapter(this));
  getListView().setOnHierarchyChangeListener((ContactAdapter)getListAdapter());
  getListView().setOnItemClickListener((ContactAdapter)getListAdapter());
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  getActionBar().setDisplayHomeAsUpEnabled(true);
  getListView().setDivider(null);
  getListView().setPadding(10,0,10,0);
  setListAdapter(new ContactAdapter(this));
  getListView().setOnHierarchyChangeListener((ContactAdapter)getListAdapter());
  getListView().setOnItemClickListener((ContactAdapter)getListAdapter());
  getListView().setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
}
Program: 17514
Project: 17514
Buggy source:
public int getSizeOfFile(File path){
  try {
    String output;
    output=RashrApp.SHELL.execCommand("String_Node_Str" + path);
    return Integer.valueOf(output.split("String_Node_Str")[0]);
  }
 catch (  Exception e) {
    RashrApp.ERRORS.add(e.toString());
    e.printStackTrace();
  }
  return -1;
}

Fixed version (ground truth):
public int getSizeOfFile(File path){
  try {
    String output;
    output=RashrApp.SHELL.execCommand("String_Node_Str" + path + "String_Node_Str");
    return Integer.valueOf(output.split("String_Node_Str")[0]);
  }
 catch (  Exception e) {
    RashrApp.ERRORS.add(e.toString());
    e.printStackTrace();
  }
  return -1;
}
Program: 17515
Project: 17515
Buggy source:
public String lokiPatch() throws FailedExecuteCommand {
  File aboot=new File("String_Node_Str");
  File extracted_aboot=new File(mContext.getFilesDir(),"String_Node_Str");
  File patched_CustomIMG=new File(mContext.getFilesDir(),mCustomIMG.getName() + "String_Node_Str");
  File loki_patch=new File(mContext.getFilesDir(),"String_Node_Str");
  File loki_flash=new File(mContext.getFilesDir(),"String_Node_Str");
  RashrApp.SHELL.execCommand("String_Node_Str" + aboot + "String_Node_Str"+ extracted_aboot,true);
  RashrApp.SHELL.execCommand(loki_patch + "String_Node_Str" + mCustomIMG+ "String_Node_Str"+ patched_CustomIMG+ "String_Node_Str",true);
  return loki_flash + "String_Node_Str" + patched_CustomIMG+ "String_Node_Str";
}

Fixed version (ground truth):
public String lokiPatch() throws FailedExecuteCommand {
  File aboot=new File("String_Node_Str");
  File extracted_aboot=new File(mContext.getFilesDir(),"String_Node_Str");
  File patched_CustomIMG=new File(mContext.getFilesDir(),mCustomIMG.getName() + "String_Node_Str");
  File loki_patch=new File(mContext.getFilesDir(),"String_Node_Str");
  File loki_flash=new File(mContext.getFilesDir(),"String_Node_Str");
  RashrApp.SHELL.execCommand("String_Node_Str" + aboot + "String_Node_Str"+ extracted_aboot+ "String_Node_Str",true);
  RashrApp.SHELL.execCommand(loki_patch + "String_Node_Str" + mCustomIMG+ "String_Node_Str"+ patched_CustomIMG+ "String_Node_Str",true);
  return loki_flash + "String_Node_Str" + patched_CustomIMG+ "String_Node_Str";
}
Program: 17516
Project: 17516
Buggy source:
/** 
 * Extract files from APK, the files are stored under RashrApp/src/res/raw
 * @throws IOException Files can't be extracted
 */
private void extractFiles() throws IOException {
  Common.pushFileFromRAW(mContext,Const.RecoveryCollectionFile,R.raw.recovery_sums,mVersionChanged);
  Common.pushFileFromRAW(mContext,Const.KernelCollectionFile,R.raw.kernel_sums,mVersionChanged);
  Const.Busybox=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.Busybox,R.raw.busybox,mVersionChanged);
  try {
    RashrApp.SHELL.execCommand("String_Node_Str" + Const.Busybox);
  }
 catch (  FailedExecuteCommand failedExecuteCommand) {
    failedExecuteCommand.printStackTrace();
  }
  File PartLayoutsZip=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,PartLayoutsZip,R.raw.partlayouts,mVersionChanged);
  File flash_image=new File(getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,flash_image,R.raw.flash_image,mVersionChanged);
  File dump_image=new File(getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,dump_image,R.raw.dump_image,mVersionChanged);
  Const.LokiPatch=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.LokiPatch,R.raw.loki_patch,mVersionChanged);
  Const.LokiFlash=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.LokiFlash,R.raw.loki_flash,mVersionChanged);
}

Fixed version (ground truth):
/** 
 * Extract files from APK, the files are stored under RashrApp/src/res/raw
 * @throws IOException Files can't be extracted
 */
private void extractFiles() throws IOException {
  Common.pushFileFromRAW(mContext,Const.RecoveryCollectionFile,R.raw.recovery_sums,mVersionChanged);
  Common.pushFileFromRAW(mContext,Const.KernelCollectionFile,R.raw.kernel_sums,mVersionChanged);
  Const.Busybox=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.Busybox,R.raw.busybox_arm,mVersionChanged);
  try {
    RashrApp.SHELL.execCommand("String_Node_Str" + Const.Busybox);
  }
 catch (  FailedExecuteCommand failedExecuteCommand) {
    failedExecuteCommand.printStackTrace();
  }
  File PartLayoutsZip=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,PartLayoutsZip,R.raw.partlayouts,mVersionChanged);
  File flash_image=new File(getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,flash_image,R.raw.flash_image,mVersionChanged);
  File dump_image=new File(getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,dump_image,R.raw.dump_image,mVersionChanged);
  Const.LokiPatch=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.LokiPatch,R.raw.loki_patch,mVersionChanged);
  Const.LokiFlash=new File(mContext.getFilesDir(),"String_Node_Str");
  Common.pushFileFromRAW(mContext,Const.LokiFlash,R.raw.loki_flash,mVersionChanged);
}
Program: 17518
Project: 17518
Buggy source:
@Override public void onSuccess(File file){
  try {
    if (BuildConfig.VERSION_CODE < Integer.valueOf(Common.fileContent(file).replace("String_Node_Str","String_Node_Str"))) {
      new AlertDialog.Builder(mContext).setTitle(R.string.update_available).setMessage(R.string.download_update).setPositiveButton(R.string.open_playstore,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str" + getPackageName())));
        }
      }
).setCancelable(false).show();
    }
 else {
      if (Common.getBooleanPref(mContext,Const.PREF_NAME,Const.PREF_KEY_HIDE_UPDATE_HINTS)) {
        Toast.makeText(mContext,R.string.app_uptodate,Toast.LENGTH_SHORT).show();
      }
    }
  }
 catch (  IOException ignore) {
  }
}

Fixed version (ground truth):
@Override public void onSuccess(File file){
  try {
    final int ServerVersion=Integer.valueOf(Common.fileContent(file).replace("String_Node_Str","String_Node_Str"));
    if (BuildConfig.VERSION_CODE < ServerVersion) {
      new AlertDialog.Builder(mContext).setTitle(R.string.update_available).setMessage(R.string.download_update).setPositiveButton(R.string.open_playstore,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str" + getPackageName())));
        }
      }
).setCancelable(false).show();
    }
 else {
      if (Common.getBooleanPref(mContext,Const.PREF_NAME,Const.PREF_KEY_HIDE_UPDATE_HINTS)) {
        Toast.makeText(mContext,R.string.app_uptodate,Toast.LENGTH_SHORT).show();
      }
    }
  }
 catch (  IOException|NumberFormatException ignore) {
  }
}
Program: 17519
Project: 17519
Buggy source:
private void placeImgBack() throws IOException, FailedExecuteCommand {
  RashrApp.SHELL.execCommand(Const.Busybox + "String_Node_Str" + tmpFile+ "String_Node_Str");
  Common.copyFile(tmpFile,mCustomIMG);
}

Fixed version (ground truth):
private void placeImgBack() throws IOException, FailedExecuteCommand {
  RashrApp.SHELL.execCommand(Const.Busybox + "String_Node_Str" + tmpFile+ "String_Node_Str");
  RashrApp.SHELL.execCommand(Const.Busybox + "String_Node_Str" + tmpFile+ "String_Node_Str"+ mCustomIMG+ "String_Node_Str");
}
Program: 17520
Project: 17520
Buggy source:
protected void onPostExecute(Boolean success){
  pDialog.dismiss();
  RashrApp.TOOLBOX.remount("String_Node_Str","String_Node_Str");
  if (success) {
    if (tmpFile.delete()) {
      if (isJobFlash() || isJobRestore()) {
        if (!Common.getBooleanPref(mContext,Const.PREF_NAME,Const.PREF_KEY_HIDE_REBOOT)) {
          showRebootDialog();
        }
      }
    }
    if (mOnTaskDoneListener != null) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mOnTaskDoneListener.onSuccess();
        }
      }
);
    }
  }
 else {
    if (mOnTaskDoneListener != null) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mOnTaskDoneListener.onFail(mException);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
protected void onPostExecute(Boolean success){
  pDialog.dismiss();
  tmpFile.delete();
  RashrApp.TOOLBOX.remount("String_Node_Str","String_Node_Str");
  if (success) {
    if (isJobFlash() || isJobRestore()) {
      if (!Common.getBooleanPref(mContext,Const.PREF_NAME,Const.PREF_KEY_HIDE_REBOOT)) {
        showRebootDialog();
      }
    }
    if (mOnTaskDoneListener != null) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mOnTaskDoneListener.onSuccess();
        }
      }
);
    }
  }
 else {
    if (mOnTaskDoneListener != null) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          mOnTaskDoneListener.onFail(mException);
        }
      }
);
    }
  }
}
Program: 17521
Project: 17521
Buggy source:
@Override public void onClick(View v){
  String EXT;
  File Path;
  final int JOB;
  if (RecoveryBackup) {
    EXT=mDevice.getRecoveryExt();
    Path=Const.PathToRecoveryBackups;
    JOB=FlashUtil.JOB_BACKUP_RECOVERY;
  }
 else {
    EXT=mDevice.getKernelExt();
    Path=Const.PathToKernelBackups;
    JOB=FlashUtil.JOB_BACKUP_KERNEL;
  }
  CharSequence Name="String_Node_Str";
  if (optName.isChecked()) {
    Name=optName.getText() + EXT;
  }
 else {
    if (etFileName.getText() != null && !etFileName.getText().toString().equals("String_Node_Str")) {
      Name=etFileName.getText().toString();
    }
    if (Name.equals("String_Node_Str")) {
      Name=String.valueOf(etFileName.getHint());
    }
    if (!Name.toString().endsWith(EXT)) {
      Name=Name + EXT;
    }
  }
  final File fBACKUP=new File(Path,Name.toString());
  if (fBACKUP.exists()) {
    Toast.makeText(mActivity,R.string.backupalready,Toast.LENGTH_SHORT).show();
  }
 else {
    final FlashUtil BackupCreator=new FlashUtil(mActivity,fBACKUP,JOB);
    BackupCreator.setOnTaskDoneListener(new FlashUtil.OnTaskDoneListener(){
      @Override public void onSuccess(){
        ArrayAdapter<String> adapter;
        if (RecoveryBackup) {
          adapter=mAdapter.getRecoveryBackupFragment().getAdapter();
        }
 else {
          adapter=mAdapter.getKernelBackupFragment().getAdapter();
        }
        loadBackups(mActivity.getDevice(),adapter,RecoveryBackup);
      }
      @Override public void onFail(      Exception e){
      }
    }
);
    BackupCreator.execute();
  }
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  String EXT;
  File Path;
  final int JOB;
  if (RecoveryBackup) {
    EXT=mDevice.getRecoveryExt();
    Path=Const.PathToRecoveryBackups;
    JOB=FlashUtil.JOB_BACKUP_RECOVERY;
  }
 else {
    EXT=mDevice.getKernelExt();
    Path=Const.PathToKernelBackups;
    JOB=FlashUtil.JOB_BACKUP_KERNEL;
  }
  CharSequence Name="String_Node_Str";
  if (optName.isChecked()) {
    Name=optName.getText() + EXT;
  }
 else {
    if (etFileName.getText() != null && !etFileName.getText().toString().equals("String_Node_Str")) {
      Name=etFileName.getText().toString();
    }
    if (Name.equals("String_Node_Str")) {
      Name=String.valueOf(etFileName.getHint());
    }
    if (!Name.toString().endsWith(EXT)) {
      Name=Name + EXT;
    }
  }
  final File fBACKUP=new File(Path,Name.toString());
  if (fBACKUP.exists()) {
    Toast.makeText(mActivity,R.string.backupalready,Toast.LENGTH_SHORT).show();
  }
 else {
    final FlashUtil BackupCreator=new FlashUtil(mActivity,fBACKUP,JOB);
    BackupCreator.setOnTaskDoneListener(new FlashUtil.OnTaskDoneListener(){
      @Override public void onSuccess(){
        mAdapter.reload();
      }
      @Override public void onFail(      Exception e){
      }
    }
);
    BackupCreator.execute();
  }
  dialog.dismiss();
}
Program: 17522
Project: 17522
Buggy source:
public ListFragment getKernelBackupFragment(){
  if (mKernelBackupFragment != null) {
    return mKernelBackupFragment;
  }
  mKernelBackupFragment=ListFragment.newInstance(mActivity,false);
  return mKernelBackupFragment;
}

Fixed version (ground truth):
public ListFragment getKernelBackupFragment(){
  if (mKernelBackupFragment != null) {
    return mKernelBackupFragment;
  }
  mKernelBackupFragment=ListFragment.newInstance(mActivity);
  loadBackups();
  return mKernelBackupFragment;
}
Program: 17523
Project: 17523
Buggy source:
public static void loadBackups(Device device,ArrayAdapter<String> adapter,boolean isRecovery){
  if ((isRecovery && !(device.isRecoveryDD() || device.isRecoveryMTD())) || !isRecovery && !(device.isKernelDD() || device.isKernelMTD())) {
    adapter.add("String_Node_Str");
  }
 else {
    File path=isRecovery ? Const.PathToRecoveryBackups : Const.PathToKernelBackups;
    if (path.listFiles() != null) {
      File FileList[]=path.listFiles();
      adapter.clear();
      for (      File backup : FileList) {
        if (!backup.isDirectory())         adapter.add(backup.getName());
      }
    }
  }
}

Fixed version (ground truth):
private void loadBackups(){
  if (mRecoveryBackupFragment != null) {
    mRecoveryBackupFragment.getAdapter().clear();
    if (!(mDevice.isRecoveryDD() || mDevice.isRecoveryMTD())) {
      mRecoveryBackupFragment.getAdapter().add("String_Node_Str");
    }
 else {
      File path=Const.PathToRecoveryBackups;
      if (path.listFiles() != null) {
        File FileList[]=path.listFiles();
        for (        File backup : FileList) {
          if (!backup.isDirectory()) {
            mRecoveryBackupFragment.getAdapter().add(backup.getName());
          }
        }
      }
    }
  }
  if (mKernelBackupFragment != null) {
    mKernelBackupFragment.getAdapter().clear();
    if (!(mDevice.isKernelDD() || mDevice.isKernelMTD())) {
      mKernelBackupFragment.getAdapter().add("String_Node_Str");
    }
 else {
      File path=Const.PathToKernelBackups;
      if (path.listFiles() != null) {
        File FileList[]=path.listFiles();
        for (        File backup : FileList) {
          if (!backup.isDirectory()) {
            mKernelBackupFragment.getAdapter().add(backup.getName());
          }
        }
      }
    }
  }
}
Program: 17525
Project: 17525
Buggy source:
@Override public int getIndicatorColor(int position){
  TypedValue typedValue=new TypedValue();
  Resources.Theme theme=mContext.getTheme();
  theme.resolveAttribute(R.attr.colorPrimaryDark,typedValue,true);
  return typedValue.data;
}

Fixed version (ground truth):
@Override public int getIndicatorColor(int position){
  TypedValue typedValue=new TypedValue();
  Resources.Theme theme=mContext.getTheme();
  theme.resolveAttribute(R.attr.colorAccent,typedValue,true);
  return typedValue.data;
}
Program: 17526
Project: 17526
Buggy source:
public static ListFragment newInstance(RashrActivity activity,boolean isRecovery){
  ListFragment fragment=new ListFragment();
  fragment.mActivity=activity;
  fragment.mListView=new ListView(activity);
  fragment.mAdapter=new ArrayAdapter<>(activity,R.layout.custom_list_item);
  fragment.mListView.setAdapter(fragment.getAdapter());
  fragment.isRecovery=isRecovery;
  return fragment;
}

Fixed version (ground truth):
public static ListFragment newInstance(RashrActivity activity){
  ListFragment fragment=new ListFragment();
  fragment.mListView=new ListView(activity);
  fragment.mAdapter=new ArrayAdapter<>(activity,R.layout.custom_list_item);
  fragment.mListView.setAdapter(fragment.getAdapter());
  return fragment;
}
Program: 17527
Project: 17527
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if (!(mDevice.isKernelDD() || mDevice.isKernelMTD())) {
    Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
  }
 else {
    showPopup(mActivity,view,false,mAdapter.getRecoveryBackupFragment().getAdapter(),mAdapter);
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  if (!(mDevice.isKernelDD() || mDevice.isKernelMTD())) {
    Toast.makeText(mContext,"String_Node_Str",Toast.LENGTH_SHORT).show();
  }
 else {
    showPopup(view);
  }
}
Program: 17529
Project: 17529
Buggy source:
public ListFragment getRecoveryBackupFragment(){
  if (mRecoveryBackupFragment != null) {
    return mRecoveryBackupFragment;
  }
  mRecoveryBackupFragment=ListFragment.newInstance(mActivity,true);
  return mRecoveryBackupFragment;
}

Fixed version (ground truth):
public ListFragment getRecoveryBackupFragment(){
  if (mRecoveryBackupFragment != null) {
    return mRecoveryBackupFragment;
  }
  mRecoveryBackupFragment=ListFragment.newInstance(mActivity);
  loadBackups();
  return mRecoveryBackupFragment;
}
Program: 17530
Project: 17530
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  loadBackups(mActivity.getDevice(),mAdapter,isRecovery);
  return mListView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return mListView;
}
Program: 17532
Project: 17532
Buggy source:
@Override public void onSuccess(){
  ArrayAdapter<String> adapter;
  if (RecoveryBackup) {
    adapter=mAdapter.getRecoveryBackupFragment().getAdapter();
  }
 else {
    adapter=mAdapter.getKernelBackupFragment().getAdapter();
  }
  loadBackups(mActivity.getDevice(),adapter,RecoveryBackup);
}

Fixed version (ground truth):
@Override public void onSuccess(){
  mAdapter.reload();
}
Program: 17533
Project: 17533
Buggy source:
private void selectItem(int position){
  if (mDrawerListView != null) {
    mDrawerListView.setItemChecked(position,true);
  }
  if (mDrawerLayout != null) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
  }
  if (mCallbacks != null) {
    mCallbacks.onNavigationDrawerItemSelected(position);
  }
}

Fixed version (ground truth):
private void selectItem(int position){
  if (mDrawerLayout != null) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
  }
  mCallbacks.onNavigationDrawerItemSelected(position);
}