Program: 60808
Project: 60808
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mVolumePage=Config.getVolumePage();
  Messenger.getInstance().register(Config.MESSENGER_ID_VOLUME_PAGE,this);
  mFullScreenHelper=new FullScreenHelper(this);
  mFullScreenHelper.setOnFullScreenBrokenListener(this);
  mFullScreenHelper.setFullScreen(true);
  mMaskView=(ColorView)findViewById(R.id.mask);
  mClock=findViewById(R.id.clock);
  mBattery=findViewById(R.id.battery);
  mConfigSliding=(SlidingLayout)findViewById(R.id.config_sliding);
  mCurrentPage=(TextView)mConfigSliding.findViewById(R.id.current_page);
  mPageSum=(TextView)mConfigSliding.findViewById(R.id.page_sum);
  mPageSeeker=(SeekBar)mConfigSliding.findViewById(R.id.page_seeker);
  mRefresh=(TextView)mConfigSliding.findViewById(R.id.refresh);
  mSend=(TextView)mConfigSliding.findViewById(R.id.send);
  mMoreSettings=(TextView)mConfigSliding.findViewById(R.id.more_settings);
  mReadingDirection=(Spinner)mConfigSliding.findViewById(R.id.reading_direction);
  mPageScaling=(Spinner)mConfigSliding.findViewById(R.id.page_scaling);
  mStartPosition=(Spinner)mConfigSliding.findViewById(R.id.start_position);
  mKeepScreenOn=(CheckBox)mConfigSliding.findViewById(R.id.keep_screen_on);
  mShowClock=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_clock);
  mShowBattery=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_battery);
  mCustomLightness=(CheckBox)mConfigSliding.findViewById(R.id.custom_lightness);
  mCustomLightnessValue=(SeekBar)mConfigSliding.findViewById(R.id.custom_lightness_value);
  mCustomCodec=(CheckBox)mConfigSliding.findViewById(R.id.custom_codec);
  mDecodeFormat=(Spinner)mConfigSliding.findViewById(R.id.decode_format);
  mConfigSliding.hide();
  mSendDialog=createSendDialog();
  Intent intent=getIntent();
  mGi=intent.getParcelableExtra(KEY_GALLERY_INFO);
  if (mGi == null) {
    new MaterialAlertDialog.Builder(this).setTitle(R.string.error).setMessage(R.string.ga_data_error).setPositiveButton(R.string.close).setButtonListener(new MaterialAlertDialog.OnClickListener(){
      @Override public boolean onClick(      MaterialAlertDialog dialog,      int which){
        finish();
        return true;
      }
    }
).show();
  }
 else {
    Data.getInstance().addHistory(mGi,Data.READ);
    int startIndex=intent.getIntExtra(KEY_START_INDEX,0);
    if (startIndex == -1)     startIndex=ExDownloader.readCurReadIndex(mGi.gid,mGi.title);
    mImageSet=new ImageSet(mGi.gid,mGi.token,mGi.title,startIndex);
    mGalleryView=new GalleryView(getApplicationContext(),mImageSet,startIndex);
    GLRootView glrv=(GLRootView)findViewById(R.id.gl_root_view);
    glrv.setContentPane(mGalleryView);
    mConfigSliding.setOnChildHideListener(this);
    mGalleryView.setGalleryViewListener(this);
    mPageSeeker.setOnSeekBarChangeListener(this);
    mRefresh.setOnClickListener(this);
    mSend.setOnClickListener(this);
    mMoreSettings.setOnClickListener(this);
    mReadingDirection.setOnItemSelectedListener(this);
    mPageScaling.setOnItemSelectedListener(this);
    mStartPosition.setOnItemSelectedListener(this);
    mDecodeFormat.setOnItemSelectedListener(this);
    mKeepScreenOn.setOnCheckedChangeListener(this);
    mShowClock.setOnCheckedChangeListener(this);
    mShowBattery.setOnCheckedChangeListener(this);
    mCustomLightness.setOnCheckedChangeListener(this);
    mCustomLightnessValue.setOnSeekBarChangeListener(this);
    mCustomCodec.setOnCheckedChangeListener(this);
    mKeepScreenOn=(CheckBox)mConfigSliding.findViewById(R.id.keep_screen_on);
    mShowClock=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_clock);
    mShowBattery=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_battery);
    mCustomCodec=(CheckBox)mConfigSliding.findViewById(R.id.custom_codec);
    mPageSeeker.setMax(mGalleryView.getSize() - 1);
    mPageSeeker.setProgress(startIndex);
    mCurrentPage.setText(Integer.toString(startIndex + 1));
    mPageSum.setText(Integer.toString(mGalleryView.getSize()));
    onRightToLeftChanged(mGalleryView.isRightToLeft());
    String keyGalleryFirst="String_Node_Str";
    if (Config.getBoolean(keyGalleryFirst,true)) {
      Config.setBoolean(keyGalleryFirst,false);
      new MaterialAlertDialog.Builder(this).setDrakTheme(true).setTitle(R.string.tip).setMessage(R.string.gallery_tip).setNegativeButton(android.R.string.cancel).setButtonListener(new MaterialAlertDialog.OnClickListener(){
        @Override public boolean onClick(        MaterialAlertDialog dialog,        int which){
          mFullScreenHelper.setFullScreen(true);
          return true;
        }
      }
).show();
    }
    updateState();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.gl_root_group);
  mVolumePage=Config.getVolumePage();
  Messenger.getInstance().register(Config.MESSENGER_ID_VOLUME_PAGE,this);
  mFullScreenHelper=new FullScreenHelper(this);
  mFullScreenHelper.setOnFullScreenBrokenListener(this);
  mFullScreenHelper.setFullScreen(true);
  mMaskView=(ColorView)findViewById(R.id.mask);
  mClock=findViewById(R.id.clock);
  mBattery=findViewById(R.id.battery);
  mConfigSliding=(SlidingLayout)findViewById(R.id.config_sliding);
  mCurrentPage=(TextView)mConfigSliding.findViewById(R.id.current_page);
  mPageSum=(TextView)mConfigSliding.findViewById(R.id.page_sum);
  mPageSeeker=(SeekBar)mConfigSliding.findViewById(R.id.page_seeker);
  mRefresh=(TextView)mConfigSliding.findViewById(R.id.refresh);
  mSend=(TextView)mConfigSliding.findViewById(R.id.send);
  mMoreSettings=(TextView)mConfigSliding.findViewById(R.id.more_settings);
  mReadingDirection=(Spinner)mConfigSliding.findViewById(R.id.reading_direction);
  mPageScaling=(Spinner)mConfigSliding.findViewById(R.id.page_scaling);
  mStartPosition=(Spinner)mConfigSliding.findViewById(R.id.start_position);
  mKeepScreenOn=(CheckBox)mConfigSliding.findViewById(R.id.keep_screen_on);
  mShowClock=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_clock);
  mShowBattery=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_battery);
  mCustomLightness=(CheckBox)mConfigSliding.findViewById(R.id.custom_lightness);
  mCustomLightnessValue=(SeekBar)mConfigSliding.findViewById(R.id.custom_lightness_value);
  mCustomCodec=(CheckBox)mConfigSliding.findViewById(R.id.custom_codec);
  mDecodeFormat=(Spinner)mConfigSliding.findViewById(R.id.decode_format);
  mConfigSliding.hide();
  mSendDialog=createSendDialog();
  Intent intent=getIntent();
  mGi=intent.getParcelableExtra(KEY_GALLERY_INFO);
  if (mGi == null) {
    new MaterialAlertDialog.Builder(this).setTitle(R.string.error).setMessage(R.string.ga_data_error).setPositiveButton(R.string.close).setButtonListener(new MaterialAlertDialog.OnClickListener(){
      @Override public boolean onClick(      MaterialAlertDialog dialog,      int which){
        finish();
        return true;
      }
    }
).show();
  }
 else {
    Data.getInstance().addHistory(mGi,Data.READ);
    int startIndex=intent.getIntExtra(KEY_START_INDEX,0);
    if (startIndex == -1)     startIndex=ExDownloader.readCurReadIndex(mGi.gid,mGi.title);
    mImageSet=new ImageSet(mGi.gid,mGi.token,mGi.title,startIndex);
    mGalleryView=new GalleryView(getApplicationContext(),mImageSet,startIndex);
    GLRootView glrv=(GLRootView)findViewById(R.id.gl_root_view);
    glrv.setContentPane(mGalleryView);
    mConfigSliding.setOnChildHideListener(this);
    mGalleryView.setGalleryViewListener(this);
    mPageSeeker.setOnSeekBarChangeListener(this);
    mRefresh.setOnClickListener(this);
    mSend.setOnClickListener(this);
    mMoreSettings.setOnClickListener(this);
    mReadingDirection.setOnItemSelectedListener(this);
    mPageScaling.setOnItemSelectedListener(this);
    mStartPosition.setOnItemSelectedListener(this);
    mDecodeFormat.setOnItemSelectedListener(this);
    mKeepScreenOn.setOnCheckedChangeListener(this);
    mShowClock.setOnCheckedChangeListener(this);
    mShowBattery.setOnCheckedChangeListener(this);
    mCustomLightness.setOnCheckedChangeListener(this);
    mCustomLightnessValue.setOnSeekBarChangeListener(this);
    mCustomCodec.setOnCheckedChangeListener(this);
    mKeepScreenOn=(CheckBox)mConfigSliding.findViewById(R.id.keep_screen_on);
    mShowClock=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_clock);
    mShowBattery=(CheckBox)mConfigSliding.findViewById(R.id.gallery_show_battery);
    mCustomCodec=(CheckBox)mConfigSliding.findViewById(R.id.custom_codec);
    mPageSeeker.setMax(mGalleryView.getSize() - 1);
    mPageSeeker.setProgress(startIndex);
    mCurrentPage.setText(Integer.toString(startIndex + 1));
    mPageSum.setText(Integer.toString(mGalleryView.getSize()));
    onRightToLeftChanged(mGalleryView.isRightToLeft());
    String keyGalleryFirst="String_Node_Str";
    if (Config.getBoolean(keyGalleryFirst,true)) {
      Config.setBoolean(keyGalleryFirst,false);
      new MaterialAlertDialog.Builder(this).setDrakTheme(true).setTitle(R.string.tip).setMessage(R.string.gallery_tip).setNegativeButton(android.R.string.cancel).setButtonListener(new MaterialAlertDialog.OnClickListener(){
        @Override public boolean onClick(        MaterialAlertDialog dialog,        int which){
          mFullScreenHelper.setFullScreen(true);
          return true;
        }
      }
).show();
    }
    updateState();
  }
}