nus-yam/ex-repair huggingface dataset:
Program: 143765
Project: 143765
Buggy source:
protected static String instrumentBodyText(CharSequence bodyText,int halign,int valign){
  StringBuffer instrumentedBodyText=new StringBuffer();
  instrumentedBodyText.append("String_Node_Str");
  if (halign != ISupportTextSetup.RIGHT && valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (halign != ISupportTextSetup.LEFT && valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (halign == ISupportTextSetup.LEFT)   instrumentedBodyText.append("String_Node_Str");
 else   if (halign == ISupportTextSetup.RIGHT)   instrumentedBodyText.append("String_Node_Str");
 else   instrumentedBodyText.append("String_Node_Str");
  if (valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (valign == ISupportTextSetup.TOP)   instrumentedBodyText.append("String_Node_Str");
 else   if (valign == ISupportTextSetup.BOTTOM)   instrumentedBodyText.append("String_Node_Str");
  instrumentedBodyText.append("String_Node_Str");
  if (bodyText != null)   instrumentedBodyText.append(bodyText);
  instrumentedBodyText.append("String_Node_Str");
  return instrumentedBodyText.toString();
}

Fixed version (ground truth):
protected static String instrumentBodyText(CharSequence bodyText,int halign,int valign,boolean fullWidth,boolean fullHeight){
  StringBuffer instrumentedBodyText=new StringBuffer();
  instrumentedBodyText.append("String_Node_Str");
  if (halign != ISupportTextSetup.RIGHT && valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (halign != ISupportTextSetup.LEFT && valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (halign == ISupportTextSetup.LEFT)   instrumentedBodyText.append("String_Node_Str");
 else   if (halign == ISupportTextSetup.RIGHT)   instrumentedBodyText.append("String_Node_Str");
 else   instrumentedBodyText.append("String_Node_Str");
  if (valign != ISupportTextSetup.CENTER)   instrumentedBodyText.append("String_Node_Str");
  if (valign == ISupportTextSetup.TOP)   instrumentedBodyText.append("String_Node_Str");
 else   if (valign == ISupportTextSetup.BOTTOM)   instrumentedBodyText.append("String_Node_Str");
  if (fullWidth)   instrumentedBodyText.append("String_Node_Str");
  if (fullHeight)   instrumentedBodyText.append("String_Node_Str");
  instrumentedBodyText.append("String_Node_Str");
  if (bodyText != null)   instrumentedBodyText.append(bodyText);
  instrumentedBodyText.append("String_Node_Str");
  return instrumentedBodyText.toString();
}
Program: 143766
Project: 143766
Buggy source:
protected void instrumentAndReplaceBody(MarkupStream markupStream,ComponentTag openTag,CharSequence bodyText){
  replaceComponentTagBody(markupStream,openTag,WebBaseButton.instrumentBodyText(bodyText,halign,valign));
}

Fixed version (ground truth):
protected void instrumentAndReplaceBody(MarkupStream markupStream,ComponentTag openTag,CharSequence bodyText){
  replaceComponentTagBody(markupStream,openTag,WebBaseButton.instrumentBodyText(bodyText,halign,valign,false,false));
}
Program: 143767
Project: 143767
Buggy source:
protected void instrumentAndReplaceBody(MarkupStream markupStream,ComponentTag openTag,CharSequence bodyText){
  replaceComponentTagBody(markupStream,openTag,WebBaseButton.instrumentBodyText(bodyText,halign,valign));
}

Fixed version (ground truth):
protected void instrumentAndReplaceBody(MarkupStream markupStream,ComponentTag openTag,CharSequence bodyText){
  replaceComponentTagBody(markupStream,openTag,WebBaseButton.instrumentBodyText(bodyText,halign,valign,fillAllSpace(),fillAllSpace()));
}
Program: 143768
Project: 143768
Buggy source:
protected void addOrCondition(String dataProviderId,QueryTable qTable,String likeValue,String[] displayValues,OrCondition overallOr){
  IQuerySelectValue querySelect=DBValueList.getQuerySelectValue(table,qTable,dataProviderId);
  if (table.getColumnType(dataProviderId) != IColumnTypes.TEXT) {
    querySelect=new QueryFunction(QueryFunction.CAST,new IQuerySelectValue[]{querySelect,new QueryColumnValue("String_Node_Str",null,true)},null);
  }
 else {
    querySelect=new QueryFunction(QueryFunction.UPPER,querySelect,dataProviderId);
  }
  if (displayValues != null) {
    for (    String displayValue : displayValues) {
      overallOr.addCondition(new CompareCondition(ISQLCondition.LIKE_OPERATOR,querySelect,displayValue));
    }
  }
  overallOr.addCondition(new CompareCondition(ISQLCondition.LIKE_OPERATOR,querySelect,likeValue));
}

Fixed version (ground truth):
protected void addOrCondition(String dataProviderId,QueryTable qTable,String likeValue,String[] displayValues,OrCondition overallOr){
  IQuerySelectValue querySelect=DBValueList.getQuerySelectValue(table,qTable,dataProviderId);
  if (displayValues != null) {
    for (    String displayValue : displayValues) {
      overallOr.addCondition(SQLGenerator.createLikeCompareCondition(querySelect,table.getColumnType(dataProviderId),displayValue));
    }
  }
  overallOr.addCondition(SQLGenerator.createLikeCompareCondition(querySelect,table.getColumnType(dataProviderId),likeValue));
}
Program: 143771
Project: 143771
Buggy source:
@Override protected AppendingStringBuffer postProcessSettings(AppendingStringBuffer settings){
  settings=super.postProcessSettings(settings);
  settings.append("String_Node_Str").append("String_Node_Str");
  settings.append(isModal());
  settings.append("String_Node_Str");
  settings.append("String_Node_Str").append("String_Node_Str");
  settings.append(getJSId());
  settings.append("String_Node_Str");
  return settings;
}

Fixed version (ground truth):
@Override protected AppendingStringBuffer postProcessSettings(AppendingStringBuffer settings){
  settings=super.postProcessSettings(settings);
  settings.append("String_Node_Str").append("String_Node_Str");
  settings.append(getBoundEventsDelay());
  settings.append("String_Node_Str");
  settings.append("String_Node_Str").append("String_Node_Str");
  settings.append(isModal());
  settings.append("String_Node_Str");
  settings.append("String_Node_Str").append("String_Node_Str");
  settings.append(getJSId());
  settings.append("String_Node_Str");
  MoveBehavior mb=getBehaviors(MoveBehavior.class).get(0);
  settings.append("String_Node_Str");
  settings.append(mb.getCallbackScript());
  settings.append("String_Node_Str");
  ResizeBehavior rb=getBehaviors(ResizeBehavior.class).get(0);
  settings.append("String_Node_Str");
  settings.append(rb.getCallbackScript());
  settings.append("String_Node_Str");
  return settings;
}
Program: 143772
Project: 143772
Buggy source:
protected void initialize(){
  jsId=getNextJSId();
  add(JavascriptPackageResource.getHeaderContribution(JAVA_SCRIPT));
}

Fixed version (ground truth):
protected void initialize(){
  add(new MoveBehavior());
  add(new ResizeBehavior());
  jsId=getNextJSId();
  add(JavascriptPackageResource.getHeaderContribution(JAVA_SCRIPT));
}
Program: 143774
Project: 143774
Buggy source:
public void close(){
  if (RequestCycle.get() != null) {
    Session.get().getPage(getPageMapName(),getPath(),LATEST_VERSION);
  }
  client.setWindowBounds(getPageMapName(),null);
  setShowPageInDialogDelayed(false);
  pageContributor.showNoDialog();
  if (callingContainer != null) {
    if (isShowingInWindow()) {
      appendJavaScriptChanges("String_Node_Str");
    }
    callingContainer.closeChildWindow(getPageMapName());
  }
  showingInWindow=false;
  showingInDialog=false;
}

Fixed version (ground truth):
public void close(){
  if (RequestCycle.get() != null) {
    Session.get().getPage(getPageMapName(),getPath(),LATEST_VERSION);
  }
  setWindowSize(null);
  setShowPageInDialogDelayed(false);
  pageContributor.showNoDialog();
  if (callingContainer != null) {
    if (isShowingInWindow()) {
      appendJavaScriptChanges("String_Node_Str");
    }
    callingContainer.closeChildWindow(getPageMapName());
  }
  showingInWindow=false;
  showingInDialog=false;
}
Program: 143775
Project: 143775
Buggy source:
public static ISessionBean createSessionBean(ServletRequest req,String solutionname,String username,String password,Object[] solutionOpenMethodArgs) throws Exception {
  return HeadlessClientFactoryInternal.createSessionBean(req,solutionname,username,password,solutionOpenMethodArgs,null);
}

Fixed version (ground truth):
public static ISessionBean createSessionBean(ServletRequest req,String solutionname,String username,String password,Object[] solutionOpenMethodArgs) throws Exception {
  return HeadlessClientFactoryInternal.createSessionBean(req,solutionname,username,password,solutionOpenMethodArgs);
}
Program: 143776
Project: 143776
Buggy source:
public static IHeadlessClient createHeadlessClient(String solutionname,String username,String password,Object[] solutionOpenMethodArgs) throws Exception {
  return HeadlessClientFactoryInternal.createHeadlessClient(solutionname,username,password,solutionOpenMethodArgs,null);
}

Fixed version (ground truth):
public static IHeadlessClient createHeadlessClient(String solutionname,String username,String password,Object[] solutionOpenMethodArgs) throws Exception {
  return HeadlessClientFactoryInternal.createHeadlessClient(solutionname,username,password,solutionOpenMethodArgs);
}
Program: 143777
Project: 143777
Buggy source:
public static ISessionClient createSessionBean(final ServletRequest req,final String solutionname,final String username,final String password,final Object[] solutionOpenMethodArgs,final InfoChannel channel) throws Exception {
  final ISessionClient[] sc={null};
  final Exception[] exception={null};
  Runnable createSessionBeanRunner=new Runnable(){
    public void run(){
      try {
        IApplicationServerSingleton as=ApplicationServerSingleton.get();
        if (as.isDeveloperStartup()) {
          sc[0]=as.getDebugClientHandler().createDebugHeadlessClient(req,username,password,null,solutionOpenMethodArgs);
        }
 else {
          sc[0]=new SessionClient(req,username,password,null,solutionOpenMethodArgs,solutionname);
        }
        sc[0].setOutputChannel(channel);
        sc[0].loadSolution(solutionname);
      }
 catch (      Exception e) {
        exception[0]=e;
      }
    }
  }
;
  if (Context.getCurrentContext() == null) {
    createSessionBeanRunner.run();
  }
 else {
    Thread createSessionBeanThread=new Thread(createSessionBeanRunner,"String_Node_Str");
    createSessionBeanThread.start();
    createSessionBeanThread.join();
  }
  if (exception[0] != null) {
    throw exception[0];
  }
  return sc[0];
}

Fixed version (ground truth):
public static ISessionClient createSessionBean(final ServletRequest req,final String solutionname,final String username,final String password,final Object[] solutionOpenMethodArgs) throws Exception {
  final ISessionClient[] sc={null};
  final Exception[] exception={null};
  Runnable createSessionBeanRunner=new Runnable(){
    public void run(){
      try {
        IApplicationServerSingleton as=ApplicationServerSingleton.get();
        if (as.isDeveloperStartup()) {
          sc[0]=as.getDebugClientHandler().createDebugHeadlessClient(req,username,password,null,solutionOpenMethodArgs);
        }
 else {
          sc[0]=new SessionClient(req,username,password,null,solutionOpenMethodArgs,solutionname);
        }
        sc[0].loadSolution(solutionname);
      }
 catch (      Exception e) {
        exception[0]=e;
      }
    }
  }
;
  if (Context.getCurrentContext() == null) {
    createSessionBeanRunner.run();
  }
 else {
    Thread createSessionBeanThread=new Thread(createSessionBeanRunner,"String_Node_Str");
    createSessionBeanThread.start();
    createSessionBeanThread.join();
  }
  if (exception[0] != null) {
    throw exception[0];
  }
  return sc[0];
}
Program: 143778
Project: 143778
Buggy source:
public static IHeadlessClient createHeadlessClient(String solutionname,String username,String password,Object[] solutionOpenMethodArgs,InfoChannel channel) throws Exception {
  return createSessionBean(null,solutionname,username,password,solutionOpenMethodArgs,channel);
}

Fixed version (ground truth):
public static IHeadlessClient createHeadlessClient(String solutionname,String username,String password,Object[] solutionOpenMethodArgs) throws Exception {
  return createSessionBean(null,solutionname,username,password,solutionOpenMethodArgs);
}
Program: 143779
Project: 143779
Buggy source:
public void run(){
  try {
    IApplicationServerSingleton as=ApplicationServerSingleton.get();
    if (as.isDeveloperStartup()) {
      sc[0]=as.getDebugClientHandler().createDebugHeadlessClient(req,username,password,null,solutionOpenMethodArgs);
    }
 else {
      sc[0]=new SessionClient(req,username,password,null,solutionOpenMethodArgs,solutionname);
    }
    sc[0].setOutputChannel(channel);
    sc[0].loadSolution(solutionname);
  }
 catch (  Exception e) {
    exception[0]=e;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    IApplicationServerSingleton as=ApplicationServerSingleton.get();
    if (as.isDeveloperStartup()) {
      sc[0]=as.getDebugClientHandler().createDebugHeadlessClient(req,username,password,null,solutionOpenMethodArgs);
    }
 else {
      sc[0]=new SessionClient(req,username,password,null,solutionOpenMethodArgs,solutionname);
    }
    sc[0].loadSolution(solutionname);
  }
 catch (  Exception e) {
    exception[0]=e;
  }
}
Program: 143780
Project: 143780
Buggy source:
Thread startBatchClientProcess(final IBatchClient bc,InfoChannel channel);

Fixed version (ground truth):
Thread startBatchClientProcess(final IBatchClient bc);
Program: 143782
Project: 143782
Buggy source:
public void actionPerformed(ActionEvent event){
  if (!isAdjusting) {
    if (setupable != null) {
      actionDesignPerformed(event);
    }
 else {
      actionRuntimePerformed(event);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the foreground color.  The main difference from StyledEditorKit.ForegroundAction is the filtering of attributes  before the setCharacterAttributes.
 * @param e the action event
 */
public void actionPerformed(ActionEvent e){
  JEditorPane editor=getEditor(e);
  if (editor != null) {
    Color fg=this.fg;
    if ((e != null) && (e.getSource() == editor)) {
      String s=e.getActionCommand();
      try {
        fg=Color.decode(s);
      }
 catch (      NumberFormatException nfe) {
      }
    }
    if (fg != null) {
      MutableAttributeSet oldInputAttributes=getStyledEditorKit(editor).getInputAttributes();
      for (Enumeration eold=oldInputAttributes.getAttributeNames(); eold.hasMoreElements(); ) {
        Object key=eold.nextElement();
        if (key instanceof HTML.Tag && key.toString().equalsIgnoreCase("String_Node_Str")) {
          oldInputAttributes.removeAttribute(key);
        }
        if (key instanceof CSS.Attribute && key.toString().equalsIgnoreCase("String_Node_Str")) {
          oldInputAttributes.removeAttribute(key);
        }
      }
      MutableAttributeSet attr=new SimpleAttributeSet();
      StyleConstants.setForeground(attr,fg);
      attr.addAttributes(oldInputAttributes);
      setCharacterAttributes(editor,attr,true);
    }
 else {
      UIManager.getLookAndFeel().provideErrorFeedback(editor);
    }
  }
}
Program: 143786
Project: 143786
Buggy source:
/** 
 * @see com.servoy.j2db.dataprocessing.IFoundSetInternal#getState(int)
 */
public IRecordInternal getRecord(int row){
  return new PrintState(this,rowManager.createNotYetExistInDBRowObject(data.getRow(row),false));
}

Fixed version (ground truth):
/** 
 * @see com.servoy.j2db.dataprocessing.IFoundSetInternal#getState(int)
 */
public IRecordInternal getRecord(int row){
  return new PrintState(this,new Row(rowManager,data.getRow(row),sheet.getAllUnstoredCalculationNamesWithNoValue(),false){
    @Override protected void handleCalculationDependencies(    Column column,    String dataProviderID){
    }
  }
);
}
Program: 143787
Project: 143787
Buggy source:
public SubSummaryFoundSet(IFoundSetManagerInternal fsm,IFoundSetInternal set,SortColumn[] summaryFields,List<AggregateVariable> aggregates,IDataSet data,Table table) throws ServoyException {
  this.fsm=fsm;
  relatedInfoLookup=set;
  this.data=data;
  rowManager=((FoundSetManager)fsm).getRowManager(fsm.getDataSource(table));
  sheet=((FoundSetManager)fsm).getSQLGenerator().getNewTableSQLSheet(fsm.getDataSource(table));
  HashMap<String,Integer> columnIndexes=new HashMap<String,Integer>();
  for (int i=0; i < summaryFields.length; i++) {
    SortColumn s=summaryFields[i];
    columnIndexes.put(s.getName(),new Integer(i));
  }
  for (int i=0; i < aggregates.size(); i++) {
    AggregateVariable ag=aggregates.get(i);
    columnIndexes.put(ag.getName(),new Integer(i + summaryFields.length));
  }
  sheet.setDataProviderIDsColumnMap(columnIndexes);
}

Fixed version (ground truth):
public SubSummaryFoundSet(IFoundSetManagerInternal fsm,IFoundSetInternal set,SortColumn[] groupByFields,List<AggregateVariable> aggregates,IDataSet data,Table table) throws ServoyException {
  this.fsm=fsm;
  relatedInfoLookup=set;
  this.data=data;
  rowManager=((FoundSetManager)fsm).getRowManager(fsm.getDataSource(table));
  sheet=((FoundSetManager)fsm).getSQLGenerator().getNewTableSQLSheet(fsm.getDataSource(table));
  HashMap<String,Integer> columnIndexes=new HashMap<String,Integer>();
  for (int i=0; i < groupByFields.length; i++) {
    SortColumn s=groupByFields[i];
    columnIndexes.put(s.getName(),new Integer(i));
  }
  for (int i=0; i < aggregates.size(); i++) {
    AggregateVariable ag=aggregates.get(i);
    columnIndexes.put(ag.getName(),new Integer(i + groupByFields.length));
  }
  sheet.setDataProviderIDsColumnMap(columnIndexes);
}
Program: 143788
Project: 143788
Buggy source:
@Override public Object getValue(String dataProviderID){
  ((SubSummaryFoundSet)parent).setDelegate(delegate);
  Object retval=dataproviderValueCache.get(dataProviderID);
  if (retval == null && !dataproviderValueCache.containsKey(dataProviderID)) {
    int columnIndex=parent.getSQLSheet().getColumnIndex(dataProviderID);
    if (columnIndex != -1) {
      retval=getRawData().getValue(columnIndex,true);
    }
 else {
      retval=super.getValue(dataProviderID);
    }
    if (retval == null)     retval=parent.getDataProviderValue(dataProviderID);
    dataproviderValueCache.put(dataProviderID,retval);
  }
  return retval;
}

Fixed version (ground truth):
@Override public Object getValue(String dataProviderID){
  ((SubSummaryFoundSet)parent).setDelegate(delegate);
  Object retval=dataproviderValueCache.get(dataProviderID);
  if (retval == null && !dataproviderValueCache.containsKey(dataProviderID)) {
    int columnIndex=parent.getSQLSheet().getColumnIndex(dataProviderID);
    if (columnIndex != -1) {
      retval=getRawData().getValue(columnIndex,true);
    }
 else {
      retval=super.getValue(dataProviderID);
    }
    if (retval == null)     retval=delegate.getRecord(0).getValue(dataProviderID);
    dataproviderValueCache.put(dataProviderID,retval);
  }
  return retval;
}
Program: 143789
Project: 143789
Buggy source:
@Override public Object setValue(String dataProviderID,Object value){
  return null;
}

Fixed version (ground truth):
@Override public Object setValue(String dataProviderID,Object value,boolean checkIsEditing){
  return null;
}
Program: 143792
Project: 143792
Buggy source:
public Scriptable getParentScope(){
  return parentScope;
}

Fixed version (ground truth):
public Scriptable getParentScope(){
  if (parentScope == null) {
    return parent.getFoundSetManager().getApplication().getScriptEngine().getSolutionScope().getParentScope();
  }
  return parentScope;
}
Program: 143793
Project: 143793
Buggy source:
public void userAddSms(long new_id,String body,String s,int i,Time now,int i1){
  add_sms(new_id,body,s,i,now,i1);
  conversationAdapter.notifyDataSetChanged();
  conversation_nb_sms+=1;
  liste.smoothScrollToPosition(liste.getBottom());
}

Fixed version (ground truth):
public void userAddSms(long new_id,String body,String s,int i,Time now,int i1){
  add_sms("String_Node_Str",new_id,body,s,i,now,i1);
  conversation_nb_sms+=1;
  liste.smoothScrollToPosition(liste.getBottom());
}
Program: 143794
Project: 143794
Buggy source:
@Override public void customReceivedSMS(){
  if (PhoneNumberUtils.compare(phoneContact,phone)) {
    Time t=new Time();
    t.set(date);
    add_sms(-1L,body,"String_Node_Str",0,t,0);
    conversationAdapter.notifyDataSetChanged();
    conversation_nb_sms+=1;
    liste.smoothScrollToPosition(liste.getBottom());
    LheidoUtils.Send.newMessageRead(context,list_conversationId,phoneContact);
  }
}

Fixed version (ground truth):
@Override public void customReceivedSMS(){
  if (PhoneNumberUtils.compare(phoneContact,phone)) {
    Time t=new Time();
    t.set(date);
    add_sms(phone,-1L,body,"String_Node_Str",0,t,0);
    conversation_nb_sms+=1;
    liste.smoothScrollToPosition(liste.getBottom());
    LheidoUtils.Send.newMessageRead(context,list_conversationId,phoneContact);
  }
}
Program: 143795
Project: 143795
Buggy source:
public void add_sms(long _id,String body,String sender,int deli,Time t,int position){
  add_sms_(new Message(_id,body,sender,deli,t),position);
}

Fixed version (ground truth):
public void add_sms(String phone,long _id,String body,String sender,int deli,Time t,int position){
  Message sms=new Message(_id,body,sender,deli,t);
  sms.setSender(phone);
  add_sms_(sms,position);
}
Program: 143796
Project: 143796
Buggy source:
public void init_broadcast(){
  mBroadCast=new SmsReceiver(){
    @Override public void customReceivedSMS(){
      if (PhoneNumberUtils.compare(phoneContact,phone)) {
        Time t=new Time();
        t.set(date);
        add_sms(-1L,body,"String_Node_Str",0,t,0);
        conversationAdapter.notifyDataSetChanged();
        conversation_nb_sms+=1;
        liste.smoothScrollToPosition(liste.getBottom());
        LheidoUtils.Send.newMessageRead(context,list_conversationId,phoneContact);
      }
    }
    @Override public void customReceivedMMS(){
      if (PhoneNumberUtils.compare(phoneContact,phone)) {
      }
    }
    @Override public void customNewMessageRead(    int position,    String phone){
    }
    @Override public void customDelivered(    long _id){
      int k=0;
      boolean find=false;
      while (!find && k < Message_list.size()) {
        if (_id == Message_list.get(k).getId()) {
          find=true;
          Message_list.get(k).setRead(true);
          conversationAdapter.notifyDataSetChanged();
        }
        k++;
      }
    }
  }
;
  IntentFilter filter=new IntentFilter();
  filter.addAction(LheidoUtils.ACTION_RECEIVE_SMS);
  filter.addAction(LheidoUtils.ACTION_SENT_SMS);
  filter.addAction(LheidoUtils.ACTION_DELIVERED_SMS);
  filter.setPriority(2000);
  context.registerReceiver(mBroadCast,filter);
}

Fixed version (ground truth):
public void init_broadcast(){
  mBroadCast=new SmsReceiver(){
    @Override public void customReceivedSMS(){
      if (PhoneNumberUtils.compare(phoneContact,phone)) {
        Time t=new Time();
        t.set(date);
        add_sms(phone,-1L,body,"String_Node_Str",0,t,0);
        conversation_nb_sms+=1;
        liste.smoothScrollToPosition(liste.getBottom());
        LheidoUtils.Send.newMessageRead(context,list_conversationId,phoneContact);
      }
    }
    @Override public void customReceivedMMS(){
      if (PhoneNumberUtils.compare(phoneContact,phone)) {
      }
    }
    @Override public void customNewMessageRead(    int position,    String phone){
    }
    @Override public void customDelivered(    long _id){
      int k=0;
      boolean find=false;
      while (!find && k < Message_list.size()) {
        if (_id == Message_list.get(k).getId()) {
          find=true;
          Message_list.get(k).setRead(true);
          conversationAdapter.notifyDataSetChanged();
        }
        k++;
      }
    }
  }
;
  IntentFilter filter=new IntentFilter();
  filter.addAction(LheidoUtils.ACTION_RECEIVE_SMS);
  filter.addAction(LheidoUtils.ACTION_SENT_SMS);
  filter.addAction(LheidoUtils.ACTION_DELIVERED_SMS);
  filter.setPriority(2000);
  context.registerReceiver(mBroadCast,filter);
}
Program: 143800
Project: 143800
Buggy source:
@Override protected void customReceiveSms(String new_name,String phone,String body,long date){
  userPref=PreferenceManager.getDefaultSharedPreferences(mContext);
  activ_notif=userPref.getBoolean(LheidoUtils.receiver_notification_key,true);
  Toast.makeText(mContext,"String_Node_Str" + new_name,Toast.LENGTH_LONG).show();
  if (activ_notif) {
    if (!notificationsId.containsKey(phone))     notificationsId.put(phone,notificationsId.size());
    Intent notificationIntent=new Intent(mContext,MainLheidoSMS.class);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pIntent=PendingIntent.getActivity(mContext,0,notificationIntent,0);
    Intent openAction=new Intent(mContext,MainLheidoSMS.class);
    openAction.putExtra("String_Node_Str",new_name);
    openAction.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent openPending=PendingIntent.getActivity(mContext,0,openAction,PendingIntent.FLAG_CANCEL_CURRENT);
    showNotification(body,new_name,phone,pIntent,openPending);
  }
  playNotificationSound();
  moveConversationOnTop(phone,true);
  LheidoUtils.Send.receiveNewMessage(mContext);
  Time d=new Time();
  d.set(date);
  LheidoUtils.Send.notifyReceiveSms(mContext,new Message(-1,body,phone,1,d));
}

Fixed version (ground truth):
@Override protected void customReceiveSms(String new_name,String phone,String body,long date){
  userPref=PreferenceManager.getDefaultSharedPreferences(mContext);
  activ_notif=userPref.getBoolean(LheidoUtils.receiver_notification_key,true);
  Toast.makeText(mContext,"String_Node_Str" + new_name,Toast.LENGTH_LONG).show();
  if (activ_notif) {
    if (!notificationsId.containsKey(phone))     notificationsId.put(phone,notificationsId.size());
    Intent notificationIntent=new Intent(mContext,MainLheidoSMS.class);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent pIntent=PendingIntent.getActivity(mContext,0,notificationIntent,0);
    Intent openAction=new Intent(mContext,MainLheidoSMS.class);
    openAction.putExtra("String_Node_Str",new_name);
    openAction.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    PendingIntent openPending=PendingIntent.getActivity(mContext,0,openAction,PendingIntent.FLAG_CANCEL_CURRENT);
    showNotification(body,new_name,phone,pIntent,openPending);
  }
  playNotificationSound();
  moveConversationOnTop(phone,true);
  LheidoUtils.Send.receiveNewMessage(mContext);
  Time d=new Time();
  d.set(date);
  LheidoUtils.Send.notifyReceiveSms(mContext,new Message(-1,body,phone,1,d));
}
Program: 143801
Project: 143801
Buggy source:
private void selectItem(int position){
  mCurrentSelectedPosition=position;
  if (mDrawerListView != null) {
  }
  if (mDrawerLayout != null) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
  }
  if (mCallbacks != null) {
    cancelNotification(position);
    mCallbacks.onNavigationDrawerItemSelected(position,lheidoConversationListe.get(position));
  }
}

Fixed version (ground truth):
private void selectItem(int position){
  mCurrentSelectedPosition=position;
  if (mDrawerListView != null) {
  }
  if (mDrawerLayout != null && !onPauseDrawerOpened) {
    mDrawerLayout.closeDrawer(mFragmentContainerView);
  }
  if (mCallbacks != null) {
    cancelNotification(position);
    LheidoContact contact=lheidoConversationListe.get(position);
    mCallbacks.onNavigationDrawerItemSelected(position,contact);
    if (!onPauseDrawerOpened)     getActionBar().setTitle(contact.getName());
  }
}
Program: 143802
Project: 143802
Buggy source:
@Override public void onResume(){
  super.onResume();
  updateFragment();
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
}
Program: 143803
Project: 143803
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.conversation,container,false);
  init(rootView);
  init_sms_body(rootView);
  init_send_button(rootView);
  getActivity().setTitle(name);
  init_broadcast();
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.conversation,container,false);
  init(rootView);
  gen_conversation();
  init_sms_body(rootView);
  init_send_button(rootView);
  init_broadcast();
  return rootView;
}
Program: 143805
Project: 143805
Buggy source:
public LheidoContact(String name,String phone,long nb_sms,String conversation_id){
  this.name_=name;
  this.phone_=phone;
  this.nb_sms_=nb_sms;
  this.conversation_id_=conversation_id;
}

Fixed version (ground truth):
/** 
 * @param name            : contact name.
 * @param phone           : contact phone number
 * @param nb_sms          : sms count
 * @param conversation_id : conversation id to fetch database
 */
public LheidoContact(String name,String phone,long nb_sms,String conversation_id){
  this.name_=name;
  this.phone_=phone;
  this.nb_sms_=nb_sms;
  this.conversation_id_=conversation_id;
}
Program: 143807
Project: 143807
Buggy source:
@Override public void customNewMessageRead(int position,String phone){
  cancelNotif(phone);
  Global.conversationsList.get(position).markNewMessage(false);
  LheidoUtils.Send.notifyDataChanged(context);
}

Fixed version (ground truth):
@Override public void customNewMessageRead(int position,String phone){
  cancelNotif(phone);
  int i=0;
  int size=Global.conversationsList.size();
  while (i < size && !PhoneNumberUtils.compare(Global.conversationsList.get(i).getPhone(),phone)) {
    i++;
  }
  if (i < size && PhoneNumberUtils.compare(Global.conversationsList.get(i).getPhone(),phone)) {
    Global.conversationsList.get(i).markNewMessage(false);
  }
  LheidoUtils.Send.notifyDataChanged(context);
}
Program: 143808
Project: 143808
Buggy source:
public void link(FragmentActivity pActivity){
  act=new WeakReference<FragmentActivity>(pActivity);
}

Fixed version (ground truth):
public void link(MainLheidoSMS pActivity){
  act=new WeakReference<MainLheidoSMS>(pActivity);
}
Program: 143809
Project: 143809
Buggy source:
@Override protected Boolean doInBackground(Void... params){
  if (act.get() != null) {
    Cursor allMms=context.getContentResolver().query(Uri.parse(mms_uri),projection,selection,selectionArgs.toArray(new String[selectionArgs.size()]),"String_Node_Str");
    if (allMms != null) {
      int count=0;
      while (count < userPref.max_sms && allMms.moveToNext()) {
        long mmsId=allMms.getLong(allMms.getColumnIndexOrThrow("String_Node_Str"));
        int read=allMms.getInt(allMms.getColumnIndexOrThrow("String_Node_Str"));
        String senderAdd=getAddressNumber(mmsId);
        if (senderAdd == null)         senderAdd=getUserPhone(context);
        Message mms=getMMSData(mmsId,senderAdd);
        long date=allMms.getLong(allMms.getColumnIndex("String_Node_Str"));
        Time t=new Time();
        t.set(date);
        mms.setDate(t);
        publishProgress(mms);
        count+=1;
      }
      allMms.close();
      if (count == 0 && last_sms == -1) {
        Time now=new Time();
        now.setToNow();
        Message sms=new Message(-1L,"String_Node_Str","String_Node_Str",0,now);
        publishProgress(sms);
      }
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override protected Boolean doInBackground(Void... voids){
  String[] projection={ContactsContract.Contacts._ID,ContactsContract.Contacts.DISPLAY_NAME,ContactsContract.Contacts.HAS_PHONE_NUMBER};
  if (act.get() != null) {
    Cursor c=context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,projection,null,null,null);
    if (c != null) {
      while (c.moveToNext()) {
        String phone=null;
        String id=c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
        String name=c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
        int hasPhone=c.getInt(c.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));
        if (hasPhone > 0) {
          String[] pr={ContactsContract.CommonDataKinds.Phone.NUMBER};
          Cursor cur=context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,pr,ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "String_Node_Str" + id,null,null);
          if (cur != null) {
            while (cur.moveToNext()) {
              phone=cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
            }
            cur.close();
            LheidoContact contact=new LheidoContact();
            contact.setId(Long.parseLong(id));
            contact.setName(name);
            contact.setPhone(phone);
            contact.setPic();
            publishProgress(contact);
          }
        }
      }
      c.close();
      return true;
    }
  }
  return false;
}
Program: 143810
Project: 143810
Buggy source:
public static long store_sms(Context context,Message sms,long thread_id){
  try {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",sms.getSender());
    values.put("String_Node_Str",sms.getBody());
    values.put("String_Node_Str",false);
    values.put("String_Node_Str",isRight(context,sms.getSender()) ? 2 : 1);
    values.put("String_Node_Str",32);
    if (thread_id != -1)     values.put("String_Node_Str",thread_id);
    values.put("String_Node_Str",sms.getDateNormalize());
    Uri uri_id=context.getContentResolver().insert(Uri.parse("String_Node_Str"),values);
    if (uri_id != null)     return Long.parseLong(uri_id.toString().substring(14));
  }
 catch (  Exception ex) {
    Toast.makeText(context,"String_Node_Str" + ex.toString(),Toast.LENGTH_LONG).show();
  }
  return -1;
}

Fixed version (ground truth):
public static long store_sms(Context context,String phoneContact,Message sms,long thread_id){
  try {
    ContentValues values=new ContentValues();
    values.put("String_Node_Str",sms.getSender());
    values.put("String_Node_Str",sms.getBody());
    values.put("String_Node_Str",false);
    values.put("String_Node_Str",(!PhoneNumberUtils.compare(phoneContact,sms.getSender())) ? 2 : 1);
    values.put("String_Node_Str",32);
    if (thread_id != -1)     values.put("String_Node_Str",thread_id);
    values.put("String_Node_Str",sms.getDateNormalize());
    Uri uri_id=context.getContentResolver().insert(Uri.parse("String_Node_Str"),values);
    if (uri_id != null)     return Long.parseLong(uri_id.toString().substring(14));
  }
 catch (  Exception ex) {
    Toast.makeText(context,"String_Node_Str" + ex.toString(),Toast.LENGTH_LONG).show();
  }
  return -1;
}
Program: 143811
Project: 143811
Buggy source:
@Override protected void onPreExecute(){
  if (act.get() != null) {
    context=act.get().getApplicationContext();
    userPref=new UserPref();
    userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(context));
  }
}

Fixed version (ground truth):
@Override protected void onPreExecute(){
  if (act.get() != null) {
    context=act.get().getApplicationContext();
  }
}
Program: 143812
Project: 143812
Buggy source:
@Override abstract protected void onProgressUpdate(Message... prog);

Fixed version (ground truth):
@Override abstract protected void onProgressUpdate(LheidoContact... prog);
Program: 143813
Project: 143813
Buggy source:
public void init_sms_body(){
  sms_body=(EditText)findViewById(R.id.send_body);
  final Context context=this;
  sms_body.setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (!hasFocus) {
        InputMethodManager inputManager=(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.hideSoftInputFromWindow(v.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
      }
    }
  }
);
  if (mem_body != null)   sms_body.setText(mem_body);
  sms_body.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
  if (!userPref.first_upper)   sms_body.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
  sms_body.setSingleLine(false);
  sms_body.setFocusable(false);
}

Fixed version (ground truth):
public void init_sms_body(){
  sms_body=(EditText)findViewById(R.id.send_body);
  final Context context=this;
  sms_body.setOnFocusChangeListener(new View.OnFocusChangeListener(){
    @Override public void onFocusChange(    View v,    boolean hasFocus){
      if (!hasFocus) {
        InputMethodManager inputManager=(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
        inputManager.hideSoftInputFromWindow(v.getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
      }
    }
  }
);
  if (mem_body != null)   sms_body.setText(mem_body);
  sms_body.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
  if (!userPref.first_upper)   sms_body.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
  sms_body.setSingleLine(false);
}
Program: 143814
Project: 143814
Buggy source:
public ConversationAdapter(Context context,int ressource,ArrayList<Message> conversation){
  mContext=context;
  mListSms=conversation;
  userPref=new LheidoUtils.UserPref();
  userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(mContext));
}

Fixed version (ground truth):
public ConversationAdapter(Context context,String contactPhone,ArrayList<Message> conversation){
  mContext=context;
  mListSms=conversation;
  mPhoneContact=contactPhone;
  userPref=new LheidoUtils.UserPref();
  userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(mContext));
}
Program: 143817
Project: 143817
Buggy source:
public MMSAdapter(Context context,ArrayList<Message> conversation){
  mContext=context;
  mListSms=conversation;
  userPref=new LheidoUtils.UserPref();
  userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(mContext));
}

Fixed version (ground truth):
public MMSAdapter(Context context,String contactPhone,ArrayList<Message> conversation){
  mContext=context;
  mListSms=conversation;
  mPhoneContact=contactPhone;
  userPref=new LheidoUtils.UserPref();
  userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(mContext));
}
Program: 143818
Project: 143818
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.conversation_mms,container,false);
  if (rootView != null) {
    context=getActivity();
    userPref=new LheidoUtils.UserPref();
    userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(context));
    name=getArguments().getString(ARG_CONTACT_NAME);
    phoneContact=getArguments().getString(ARG_CONTACT_PHONE);
    conversationId=getArguments().getInt(ARG_CONVERSATION_ID);
    list_conversationId=getArguments().getInt(ARG_CONVERSATION_NUMBER);
    liste=(JazzyListView)rootView.findViewById(R.id.list_conversation_mms);
    liste.setTransitionEffect(userPref.conversation_effect);
    liste.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
    liste.setOnItemClickListener(new MMSItemClickListener());
    zoom=(ImageButton)rootView.findViewById(R.id.expanded_image);
    zoom.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        zoom.setVisibility(View.INVISIBLE);
      }
    }
);
    conversation_nb_sms=getArguments().getLong(ARG_CONVERSATION_COUNT);
    conversationMmsAdapter=new MMSAdapter(context,Message_list);
    liste.setAdapter(conversationMmsAdapter);
    swipeLayout=(SwipeRefreshLayout)rootView.findViewById(R.id.swipe_container);
    swipeLayout.setOnRefreshListener(this);
    init_broadcast();
  }
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View rootView=inflater.inflate(R.layout.conversation_mms,container,false);
  if (rootView != null) {
    context=getActivity();
    userPref=new LheidoUtils.UserPref();
    userPref.setUserPref(PreferenceManager.getDefaultSharedPreferences(context));
    name=getArguments().getString(ARG_CONTACT_NAME);
    phoneContact=getArguments().getString(ARG_CONTACT_PHONE);
    conversationId=getArguments().getInt(ARG_CONVERSATION_ID);
    list_conversationId=getArguments().getInt(ARG_CONVERSATION_NUMBER);
    liste=(JazzyListView)rootView.findViewById(R.id.list_conversation_mms);
    liste.setTransitionEffect(userPref.conversation_effect);
    liste.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
    liste.setOnItemClickListener(new MMSItemClickListener());
    zoom=(ImageButton)rootView.findViewById(R.id.expanded_image);
    zoom.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        zoom.setVisibility(View.INVISIBLE);
      }
    }
);
    conversation_nb_sms=getArguments().getLong(ARG_CONVERSATION_COUNT);
    conversationMmsAdapter=new MMSAdapter(context,phoneContact,Message_list);
    liste.setAdapter(conversationMmsAdapter);
    swipeLayout=(SwipeRefreshLayout)rootView.findViewById(R.id.swipe_container);
    swipeLayout.setOnRefreshListener(this);
    init_broadcast();
  }
  return rootView;
}
Program: 143821
Project: 143821
Buggy source:
@Override public void customReceivedSMS(){
  Toast.makeText(context,"String_Node_Str" + new_name,Toast.LENGTH_LONG).show();
  if (activ_notif) {
    Intent notificationIntent=new Intent(context,MainLheidoSMS.class);
    PendingIntent pIntent=PendingIntent.getActivity(context,0,notificationIntent,0);
    showNotification(body,new_name,phone,pIntent);
  }
  playNotificationSound();
  if (vibrate)   v.vibrate(1000);
  moveConversationOnTop(phone,true);
  LheidoUtils.Send.receiveNewMessage(context);
}

Fixed version (ground truth):
@Override public void customReceivedSMS(){
  Toast.makeText(context,"String_Node_Str" + new_name,Toast.LENGTH_LONG).show();
  if (activ_notif) {
    Intent notificationIntent=new Intent(context,MainLheidoSMS.class);
    PendingIntent pIntent=PendingIntent.getActivity(context,0,notificationIntent,0);
    showNotification(body,new_name,phone,pIntent);
  }
  playNotificationSound();
  moveConversationOnTop(phone,true);
  LheidoUtils.Send.receiveNewMessage(context);
}
Program: 143822
Project: 143822
Buggy source:
@Override public void customDelivered(long id){
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
  if (userPref.getBoolean("String_Node_Str",true)) {
    long[] pattern={0,100,100,100,100,100,100,100};
    v.vibrate(pattern,-1);
  }
}

Fixed version (ground truth):
@Override public void customDelivered(long id){
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
  if (userPref.getBoolean("String_Node_Str",true)) {
    try {
      long[] pattern={0,100,100,100,100,100,100,100};
      v.vibrate(pattern,-1);
    }
 catch (    Exception e) {
      Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show();
    }
  }
}
Program: 143823
Project: 143823
Buggy source:
@Override protected void onDestroy(){
  super.onDestroy();
}

Fixed version (ground truth):
@Override protected void onDestroy(){
  LheidoUtils.Send.cancelVibrator(this);
  super.onDestroy();
}
Program: 143824
Project: 143824
Buggy source:
public void playNotificationSound(){
  AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
switch (am.getRingerMode()) {
case AudioManager.RINGER_MODE_SILENT:
    break;
case AudioManager.RINGER_MODE_VIBRATE:
  break;
case AudioManager.RINGER_MODE_NORMAL:
SharedPreferences userPref=PreferenceManager.getDefaultSharedPreferences(context);
if (userPref.getBoolean(LheidoUtils.receiver_ringtone_key,true)) {
try {
  Uri notification=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  Ringtone r=RingtoneManager.getRingtone(context,notification);
  r.play();
}
 catch (Exception e) {
  e.printStackTrace();
}
}
break;
}
}

Fixed version (ground truth):
public void playNotificationSound(){
  AudioManager am=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
  SharedPreferences userPref=PreferenceManager.getDefaultSharedPreferences(context);
switch (am.getRingerMode()) {
case AudioManager.RINGER_MODE_SILENT:
    break;
case AudioManager.RINGER_MODE_VIBRATE:
  try {
    if (vibrate)     v.vibrate(1000);
  }
 catch (  Exception e) {
    Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show();
  }
break;
case AudioManager.RINGER_MODE_NORMAL:
if (userPref.getBoolean(LheidoUtils.receiver_ringtone_key,true)) {
try {
  Uri notification=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  Ringtone r=RingtoneManager.getRingtone(context,notification);
  r.play();
}
 catch (Exception e) {
  Toast.makeText(context,e.getMessage(),Toast.LENGTH_LONG).show();
}
}
break;
}
}
Program: 143826
Project: 143826
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main_activity);
  Toolbar actionBar=(Toolbar)findViewById(R.id.action_bar);
  setSupportActionBar(actionBar);
  syncLogFragment=(SyncLogFragment)getSupportFragmentManager().findFragmentById(R.id.sync_log);
  drawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  drawerToggle=new ActionBarDrawerToggle(this,drawerLayout,actionBar,0,0){
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      getSupportActionBar().setTitle(R.string.app_name);
      invalidateOptionsMenu();
    }
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      getSupportActionBar().setTitle(title);
      invalidateOptionsMenu();
    }
    @Override public void onDrawerSlide(    View drawerView,    float slideOffset){
      super.onDrawerSlide(drawerView,slideOffset);
      syncLogFragment.setScaleFactor(1 - slideOffset);
    }
  }
;
  drawerLayout.setDrawerListener(drawerToggle);
  drawerListAdapter=new FeedListAdapter();
  drawerListView=(ListView)drawerLayout.findViewById(R.id.drawer);
  drawerListView.setAdapter(drawerListAdapter);
  drawerListView.setOnItemClickListener(this);
  getLoaderManager().initLoader(LOADER_FEEDS,null,this);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setHomeButtonEnabled(true);
  title=getTitle();
  selectDrawerItem(0,-1);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main_activity);
  Toolbar actionBar=(Toolbar)findViewById(R.id.action_bar);
  setSupportActionBar(actionBar);
  syncLogFragment=(SyncLogFragment)getFragmentManager().findFragmentById(R.id.sync_log);
  drawerLayout=(DrawerLayout)findViewById(R.id.drawer_layout);
  drawerToggle=new ActionBarDrawerToggle(this,drawerLayout,actionBar,0,0){
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      getSupportActionBar().setTitle(R.string.app_name);
      invalidateOptionsMenu();
    }
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      getSupportActionBar().setTitle(title);
      invalidateOptionsMenu();
    }
    @Override public void onDrawerSlide(    View drawerView,    float slideOffset){
      super.onDrawerSlide(drawerView,slideOffset);
      syncLogFragment.setScaleFactor(1 - slideOffset);
    }
  }
;
  drawerLayout.setDrawerListener(drawerToggle);
  drawerListAdapter=new FeedListAdapter();
  drawerListView=(ListView)drawerLayout.findViewById(R.id.drawer);
  drawerListView.setAdapter(drawerListAdapter);
  drawerListView.setOnItemClickListener(this);
  getLoaderManager().initLoader(LOADER_FEEDS,null,this);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setHomeButtonEnabled(true);
  title=getTitle();
  if (savedInstanceState == null) {
    selectDrawerItem(0,-1);
  }
}