Program: 8826
Project: 8826
Buggy source:
private void reset(){
  L("String_Node_Str");
  final Drawable sky=new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,SKIES[mTimeOfDay]);
  sky.setDither(true);
  setBackground(sky);
  mFlipped=frand() > 0.5f;
  setScaleX(mFlipped ? -1 : 1);
  setScore(0);
  int i=getChildCount();
  while (i-- > 0) {
    final View v=getChildAt(i);
    if (v instanceof GameView) {
      removeViewAt(i);
    }
  }
  mObstaclesInPlay.clear();
  mWidth=getWidth();
  mHeight=getHeight();
  boolean showingSun=(mTimeOfDay == DAY || mTimeOfDay == SUNSET) && frand() > 0.25;
  if (showingSun) {
    final Star sun=new Star(getContext());
    sun.setBackgroundResource(R.drawable.sun);
    final int w=getResources().getDimensionPixelSize(R.dimen.sun_size);
    sun.setTranslationX(frand(w,mWidth - w));
    if (mTimeOfDay == DAY) {
      sun.setTranslationY(frand(w,(mHeight * 0.66f)));
      if (Build.VERSION.SDK_INT >= 21)       sun.getBackground().setTint(0);
    }
 else {
      sun.setTranslationY(frand(mHeight * 0.66f,mHeight - w));
      if (Build.VERSION.SDK_INT >= 21) {
        sun.getBackground().setTintMode(PorterDuff.Mode.SRC_ATOP);
        sun.getBackground().setTint(0xC0FF8000);
      }
    }
    addView(sun,new LayoutParams(w,w));
  }
  if (!showingSun) {
    final boolean dark=mTimeOfDay == NIGHT || mTimeOfDay == TWILIGHT;
    final float ff=frand();
    if ((dark && ff < 0.75f) || ff < 0.5f) {
      final Star moon=new Star(getContext());
      moon.setBackgroundResource(R.drawable.moon);
      moon.getBackground().setAlpha(dark ? 255 : 128);
      moon.setScaleX(frand() > 0.5 ? -1 : 1);
      moon.setRotation(moon.getScaleX() * frand(5,30));
      final int w=getResources().getDimensionPixelSize(R.dimen.sun_size);
      moon.setTranslationX(frand(w,mWidth - w));
      moon.setTranslationY(frand(w,mHeight - w));
      addView(moon,new LayoutParams(w,w));
    }
  }
  final int mh=mHeight / 6;
  final boolean cloudless=frand() < 0.25;
  final int N=20;
  for (i=0; i < N; i++) {
    final float r1=frand();
    final Scenery s;
    if (HAVE_STARS && r1 < 0.3 && mTimeOfDay != DAY) {
      s=new Star(getContext());
    }
 else     if (r1 < 0.6 && !cloudless) {
      s=new Cloud(getContext());
    }
 else {
      s=new Building(getContext());
      s.z=(float)i / N;
      if (Build.VERSION.SDK_INT >= 21)       s.setTranslationZ(PARAMS.SCENERY_Z * (1 + s.z));
      s.v=0.85f * s.z;
      hsv[0]=175;
      hsv[1]=0.25f;
      hsv[2]=1 * s.z;
      s.setBackgroundColor(Color.HSVToColor(hsv));
      s.h=irand(PARAMS.BUILDING_HEIGHT_MIN,mh);
    }
    final LayoutParams lp=new LayoutParams(s.w,s.h);
    if (s instanceof Building) {
      lp.gravity=Gravity.BOTTOM;
    }
 else {
      lp.gravity=Gravity.TOP;
      final float r=frand();
      if (s instanceof Star) {
        lp.topMargin=(int)(r * r * mHeight);
      }
 else {
        lp.topMargin=(int)(1 - r * r * mHeight / 2) + mHeight / 2;
      }
    }
    addView(s,lp);
    s.setTranslationX(frand(-lp.width,mWidth + lp.width));
  }
  mDroid=new Player(getContext());
  mDroid.setX(mWidth / 2);
  mDroid.setY(mHeight / 2);
  addView(mDroid,new LayoutParams(PARAMS.PLAYER_SIZE,PARAMS.PLAYER_SIZE));
  mAnim=new TimeAnimator();
  mAnim.setTimeListener(new TimeAnimator.TimeListener(){
    @Override public void onTimeUpdate(    TimeAnimator timeAnimator,    long t,    long dt){
      step(t,dt);
    }
  }
);
}

Fixed version (ground truth):
public void reset(){
  L("String_Node_Str");
  final Drawable sky=new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP,SKIES[mTimeOfDay]);
  sky.setDither(true);
  setBackground(sky);
  mFlipped=frand() > 0.5f;
  setScaleX(mFlipped ? -1 : 1);
  setScore(0);
  int i=getChildCount();
  while (i-- > 0) {
    final View v=getChildAt(i);
    if (v instanceof GameView) {
      removeViewAt(i);
    }
  }
  mObstaclesInPlay.clear();
  mWidth=getWidth();
  mHeight=getHeight();
  boolean showingSun=(mTimeOfDay == DAY || mTimeOfDay == SUNSET) && frand() > 0.25;
  if (showingSun) {
    final Star sun=new Star(getContext());
    sun.setBackgroundResource(R.drawable.sun);
    final int w=getResources().getDimensionPixelSize(R.dimen.sun_size);
    sun.setTranslationX(frand(w,mWidth - w));
    if (mTimeOfDay == DAY) {
      sun.setTranslationY(frand(w,(mHeight * 0.66f)));
      if (Build.VERSION.SDK_INT >= 21)       sun.getBackground().setTint(0);
    }
 else {
      sun.setTranslationY(frand(mHeight * 0.66f,mHeight - w));
      if (Build.VERSION.SDK_INT >= 21) {
        sun.getBackground().setTintMode(PorterDuff.Mode.SRC_ATOP);
        sun.getBackground().setTint(0xC0FF8000);
      }
    }
    addView(sun,new LayoutParams(w,w));
  }
  if (!showingSun) {
    final boolean dark=mTimeOfDay == NIGHT || mTimeOfDay == TWILIGHT;
    final float ff=frand();
    if ((dark && ff < 0.75f) || ff < 0.5f) {
      final Star moon=new Star(getContext());
      moon.setBackgroundResource(R.drawable.moon);
      moon.getBackground().setAlpha(dark ? 255 : 128);
      moon.setScaleX(frand() > 0.5 ? -1 : 1);
      moon.setRotation(moon.getScaleX() * frand(5,30));
      final int w=getResources().getDimensionPixelSize(R.dimen.sun_size);
      moon.setTranslationX(frand(w,mWidth - w));
      moon.setTranslationY(frand(w,mHeight - w));
      addView(moon,new LayoutParams(w,w));
    }
  }
  final int mh=mHeight / 6;
  final boolean cloudless=frand() < 0.25;
  final int N=20;
  for (i=0; i < N; i++) {
    final float r1=frand();
    final Scenery s;
    if (HAVE_STARS && r1 < 0.3 && mTimeOfDay != DAY) {
      s=new Star(getContext());
    }
 else     if (r1 < 0.6 && !cloudless) {
      s=new Cloud(getContext());
    }
 else {
      s=new Building(getContext());
      s.z=(float)i / N;
      if (Build.VERSION.SDK_INT >= 21)       s.setTranslationZ(PARAMS.SCENERY_Z * (1 + s.z));
      s.v=0.85f * s.z;
      hsv[0]=175;
      hsv[1]=0.25f;
      hsv[2]=1 * s.z;
      s.setBackgroundColor(Color.HSVToColor(hsv));
      s.h=irand(PARAMS.BUILDING_HEIGHT_MIN,mh);
    }
    final LayoutParams lp=new LayoutParams(s.w,s.h);
    if (s instanceof Building) {
      lp.gravity=Gravity.BOTTOM;
    }
 else {
      lp.gravity=Gravity.TOP;
      final float r=frand();
      if (s instanceof Star) {
        lp.topMargin=(int)(r * r * mHeight);
      }
 else {
        lp.topMargin=(int)(1 - r * r * mHeight / 2) + mHeight / 2;
      }
    }
    addView(s,lp);
    s.setTranslationX(frand(-lp.width,mWidth + lp.width));
  }
  mDroid=new Player(getContext());
  mDroid.setX(mWidth / 2);
  mDroid.setY(mHeight / 2);
  addView(mDroid,new LayoutParams(PARAMS.PLAYER_SIZE,PARAMS.PLAYER_SIZE));
  mAnim=new TimeAnimator();
  mAnim.setTimeListener(new TimeAnimator.TimeListener(){
    @Override public void onTimeUpdate(    TimeAnimator timeAnimator,    long t,    long dt){
      step(t,dt);
    }
  }
);
}