Program: 5449
Project: 5449
Buggy source:
/** 
 * @see android.os.AsyncTask#doInBackground(Params[])
 */
@Override protected Boolean doInBackground(Void... params){
  try {
    Log.d("String_Node_Str");
    if (!mWidgetConfiguration.isDisplayable()) {
      Log.i("String_Node_Str");
      cancel(true);
    }
    mFlickrConnect=new FlickrConnect(mContext);
    if (!mFlickrConnect.isLoggedIn()) {
      Log.e("String_Node_Str");
      return false;
    }
    mRootViews.removeAllViews(R.id.root);
    mRootViews.removeAllViews(R.id.root);
    mRootViews.addView(R.id.root,new RemoteViews(mContext.getPackageName(),R.layout.loading));
    pushUpdate();
    String userId=mFlickrConnect.getFlickrParameters().getNsid();
    if (userId != null) {
      Log.e("String_Node_Str");
      return false;
    }
    FlickrApiResult flickrApiResult=null;
switch (mWidgetConfiguration.getContent()) {
case userComments:
      Log.d("String_Node_Str");
    flickrApiResult=mFlickrConnect.getActivityUserComments(userId,String.valueOf(mWidgetConfiguration.getMaxItems()),"String_Node_Str");
  break;
case userPhotos:
Log.d("String_Node_Str");
flickrApiResult=mFlickrConnect.getActivityUserPhotos(userId,Constants.TIME_FRAME,String.valueOf(mWidgetConfiguration.getMaxItems()),"String_Node_Str");
break;
}
if (flickrApiResult == null) {
Log.e("String_Node_Str");
return false;
}
Log.i("String_Node_Str" + flickrApiResult.getItems().getItems().size() + "String_Node_Str");
if (flickrApiResult.getItems().getItems().isEmpty()) {
mRootViews.addView(R.id.root,new RemoteViews(mContext.getPackageName(),R.layout.nothing));
pushUpdate();
return true;
}
for (Item item : flickrApiResult.getItems().getItems()) {
RemoteViews itemRemoteViews=null;
Log.d("String_Node_Str" + item.getType());
switch (item.getType()) {
case photo:
itemRemoteViews=new RemoteViews(mContext.getPackageName(),R.layout.item_photo);
Photo photo=mFlickrConnect.getPhotoInfo(item.getId()).getPhoto();
if (photo == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
try {
Bitmap bitmap=photo.getBitmap(Photo.Size.SMALLSQUARE);
if (bitmap == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
itemRemoteViews.setImageViewBitmap(R.id.photoBitmap,bitmap);
if (item.getTitle().getContent() == null) {
Log.e("String_Node_Str");
}
 else {
itemRemoteViews.setTextViewText(R.id.photoText,item.getTitle().getContent());
}
}
 catch (Exception e) {
Log.e(e.getMessage(),e);
itemRemoteViews.setTextViewText(R.id.photoText,e.getMessage() == null ? "String_Node_Str" : e.getMessage());
}
for (Event event : item.getActivity().getEvents()) {
RemoteViews eventRemoteViews=new RemoteViews(mContext.getPackageName(),R.layout.event_photo);
Log.d("String_Node_Str" + event.getType());
switch (event.getType()) {
case added_to_gallery:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.expo);
Spanned txt=Html.fromHtml(getString(R.string.added_to_gallery,event.getUsername()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
case comment:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.comment);
txt=Html.fromHtml(getString(R.string.comment,event.getUsername(),event.getContent()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
case fave:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.fave);
txt=Html.fromHtml(getString(R.string.fave,event.getUsername()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
default :
Log.e("String_Node_Str" + event.getType());
eventRemoteViews.setTextViewText(R.id.event_photo_text,"String_Node_Str" + event.getType());
}
itemRemoteViews.addView(R.id.events,eventRemoteViews);
}
break;
default :
Log.e("String_Node_Str" + item.getType());
}
if (itemRemoteViews != null) {
mRootViews.addView(R.id.root,itemRemoteViews);
}
}
Intent widgetIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(Constants.FLICKR_ACTIVITY_URL));
PendingIntent pendingIntent=PendingIntent.getActivity(mContext,0,widgetIntent,0);
mRootViews.setOnClickPendingIntent(R.id.root,pendingIntent);
pushUpdate();
Log.d("String_Node_Str");
return true;
}
 catch (Exception e) {
Log.e("String_Node_Str");
Log.e(e.getMessage(),e);
return false;
}
}

Fixed version (ground truth):
/** 
 * @see android.os.AsyncTask#doInBackground(Params[])
 */
@Override protected Boolean doInBackground(Void... params){
  try {
    Log.d("String_Node_Str");
    if (!mWidgetConfiguration.isDisplayable()) {
      Log.i("String_Node_Str");
      cancel(true);
    }
    mFlickrConnect=new FlickrConnect(mContext);
    if (!mFlickrConnect.isLoggedIn()) {
      Log.e("String_Node_Str");
      return false;
    }
    mRootViews.removeAllViews(R.id.root);
    mRootViews.addView(R.id.root,new RemoteViews(mContext.getPackageName(),R.layout.loading));
    pushUpdate();
    mRootViews.removeAllViews(R.id.root);
    String userId=mFlickrConnect.getFlickrParameters().getNsid();
    if (userId == null) {
      Log.e("String_Node_Str");
      return false;
    }
    FlickrApiResult flickrApiResult=null;
switch (mWidgetConfiguration.getContent()) {
case userComments:
      Log.d("String_Node_Str");
    flickrApiResult=mFlickrConnect.getActivityUserComments(userId,String.valueOf(mWidgetConfiguration.getMaxItems()),"String_Node_Str");
  break;
case userPhotos:
Log.d("String_Node_Str");
flickrApiResult=mFlickrConnect.getActivityUserPhotos(userId,Constants.TIME_FRAME,String.valueOf(mWidgetConfiguration.getMaxItems()),"String_Node_Str");
break;
}
if (flickrApiResult == null) {
Log.e("String_Node_Str");
return false;
}
Log.i("String_Node_Str" + flickrApiResult.getItems().getItems().size() + "String_Node_Str");
if (flickrApiResult.getItems().getItems().isEmpty()) {
mRootViews.addView(R.id.root,new RemoteViews(mContext.getPackageName(),R.layout.nothing));
pushUpdate();
return true;
}
for (Item item : flickrApiResult.getItems().getItems()) {
RemoteViews itemRemoteViews=null;
Log.d("String_Node_Str" + item.getType());
switch (item.getType()) {
case photo:
itemRemoteViews=new RemoteViews(mContext.getPackageName(),R.layout.item_photo);
Photo photo=mFlickrConnect.getPhotoInfo(item.getId()).getPhoto();
if (photo == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
try {
Bitmap bitmap=photo.getBitmap(Photo.Size.SMALLSQUARE);
if (bitmap == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
itemRemoteViews.setImageViewBitmap(R.id.photoBitmap,bitmap);
if (item.getTitle().getContent() == null) {
Log.e("String_Node_Str");
}
 else {
itemRemoteViews.setTextViewText(R.id.photoText,item.getTitle().getContent());
}
}
 catch (Exception e) {
Log.e(e.getMessage(),e);
itemRemoteViews.setTextViewText(R.id.photoText,e.getMessage() == null ? "String_Node_Str" : e.getMessage());
}
for (Event event : item.getActivity().getEvents()) {
RemoteViews eventRemoteViews=new RemoteViews(mContext.getPackageName(),R.layout.event_photo);
Log.d("String_Node_Str" + event.getType());
switch (event.getType()) {
case added_to_gallery:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.expo);
Spanned txt=Html.fromHtml(getString(R.string.added_to_gallery,event.getUsername()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
case comment:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.comment);
txt=Html.fromHtml(getString(R.string.comment,event.getUsername(),event.getContent()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
case fave:
eventRemoteViews.setImageViewResource(R.id.event_photo_icon,R.drawable.fave);
txt=Html.fromHtml(getString(R.string.fave,event.getUsername()),getHtmlImageGetter(),null);
if (txt == null) {
Log.e("String_Node_Str" + item.getId());
continue;
}
eventRemoteViews.setTextViewText(R.id.event_photo_text,txt);
break;
default :
Log.e("String_Node_Str" + event.getType());
eventRemoteViews.setTextViewText(R.id.event_photo_text,"String_Node_Str" + event.getType());
}
itemRemoteViews.addView(R.id.events,eventRemoteViews);
}
break;
default :
Log.e("String_Node_Str" + item.getType());
}
if (itemRemoteViews != null) {
mRootViews.addView(R.id.root,itemRemoteViews);
}
}
Intent widgetIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(Constants.FLICKR_ACTIVITY_URL));
PendingIntent pendingIntent=PendingIntent.getActivity(mContext,0,widgetIntent,0);
mRootViews.setOnClickPendingIntent(R.id.root,pendingIntent);
pushUpdate();
Log.d("String_Node_Str");
return true;
}
 catch (Exception e) {
Log.e("String_Node_Str");
Log.e(e.getMessage(),e);
return false;
}
}