Program: 26175
Project: 26175
Buggy source:
protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_showpage);
  tv=(TextView)findViewById(R.id.tv_page);
  sv=(ScrollView)findViewById(R.id.scrollView1);
  settings=getSharedPreferences(FOXSETTING,0);
  editor=settings.edit();
  sp_fontsize=settings.getFloat("String_Node_Str",sp_fontsize);
  tv.setTextSize(sp_fontsize);
  Intent itt=getIntent();
  foxfrom=itt.getIntExtra("String_Node_Str",0);
  pagename=itt.getStringExtra("String_Node_Str");
  pageurl=itt.getStringExtra("String_Node_Str");
  SE_TYPE=itt.getIntExtra("String_Node_Str",1);
  setTitle(pagename + "String_Node_Str" + pageurl);
  final Handler handler=new Handler(){
    public void handleMessage(    Message msg){
      String sText=(String)msg.obj;
      if (msg.what == IS_REFRESH) {
        tv.setText("String_Node_Str" + sText.replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ pagename);
        setTitle(pagename + "String_Node_Str" + pageurl);
        if (sText.length() < 9) {
          tv.setText("String_Node_Str" + pageurl + "String_Node_Str"+ pagename+ "String_Node_Str"+ sText);
        }
      }
    }
  }
;
  final Runnable down_page=new Runnable(){
    @Override public void run(){
      String text="String_Node_Str";
switch (SE_TYPE) {
case SE_EASOU:
        text=FoxBookLib.downhtml(pageurl,"String_Node_Str");
      text=site_easou.json2Text(text);
    break;
case SE_ZSSQ:
  text=FoxBookLib.downhtml(pageurl,"String_Node_Str");
text=site_zssq.json2Text(text);
break;
case SE_KUAIDU:
text=site_qreader.qreader_GetContent(pageurl);
break;
default :
text=FoxBookLib.updatepage(-1,pageurl,oDB);
}
Message msg=Message.obtain();
msg.what=IS_REFRESH;
msg.obj=text;
handler.sendMessage(msg);
}
}
;
if (FROM_DB == foxfrom) {
pageid=itt.getIntExtra("String_Node_Str",0);
Map<String,String> infox=oDB.getOneRow("String_Node_Str" + pageid + "String_Node_Str");
pagetext=infox.get("String_Node_Str");
if (null == pagetext) {
pagetext="String_Node_Str";
}
 else {
bookid=Integer.valueOf(infox.get("String_Node_Str"));
}
tv.setText("String_Node_Str" + pagetext.replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ pagename);
}
if (FROM_NET == foxfrom) {
setTitle("String_Node_Str");
new Thread(down_page).start();
}
tv.setOnClickListener(new OnClickListener(){
@Override public void onClick(View arg0){
int vy=getWindowManager().getDefaultDisplay().getHeight();
if (cY <= vy / 3) {
sv.smoothScrollBy(0,30 - sv.getMeasuredHeight());
}
 else {
sv.smoothScrollBy(0,sv.getMeasuredHeight() - 30);
}
}
}
);
tv.setOnTouchListener(new OnTouchListener(){
@Override public boolean onTouch(View arg0,MotionEvent arg1){
cY=arg1.getRawY();
return false;
}
}
);
}

Fixed version (ground truth):
protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_showpage);
  tv=(TextView)findViewById(R.id.tv_page);
  sv=(ScrollView)findViewById(R.id.scrollView1);
  settings=getSharedPreferences(FOXSETTING,0);
  editor=settings.edit();
  sp_fontsize=settings.getFloat("String_Node_Str",sp_fontsize);
  tv.setTextSize(sp_fontsize);
  Intent itt=getIntent();
  foxfrom=itt.getIntExtra("String_Node_Str",0);
  pagename=itt.getStringExtra("String_Node_Str");
  pageurl=itt.getStringExtra("String_Node_Str");
  SE_TYPE=itt.getIntExtra("String_Node_Str",1);
  setTitle(pagename + "String_Node_Str" + pageurl);
  final Handler handler=new Handler(){
    public void handleMessage(    Message msg){
      String sText=(String)msg.obj;
      if (msg.what == IS_REFRESH) {
        tv.setText("String_Node_Str" + sText.replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ pagename);
        setTitle(pagename + "String_Node_Str" + pageurl);
        if (sText.length() < 9) {
          tv.setText("String_Node_Str" + pageurl + "String_Node_Str"+ pagename+ "String_Node_Str"+ sText);
        }
      }
    }
  }
;
  final Runnable down_page=new Runnable(){
    @Override public void run(){
      String text="String_Node_Str";
switch (SE_TYPE) {
case SE_EASOU:
        text=FoxBookLib.downhtml(pageurl,"String_Node_Str");
      text=site_easou.json2Text(text);
    break;
case SE_ZSSQ:
  text=FoxBookLib.downhtml(pageurl,"String_Node_Str");
text=site_zssq.json2Text(text);
break;
case SE_KUAIDU:
text=site_qreader.qreader_GetContent(pageurl);
break;
default :
text=FoxBookLib.updatepage(-1,pageurl,oDB);
}
Message msg=Message.obtain();
msg.what=IS_REFRESH;
msg.obj=text;
handler.sendMessage(msg);
}
}
;
if (FROM_DB == foxfrom) {
pageid=itt.getIntExtra("String_Node_Str",0);
Map<String,String> infox=oDB.getOneRow("String_Node_Str" + pageid + "String_Node_Str");
pagetext=infox.get("String_Node_Str");
pagename=infox.get("String_Node_Str");
if (null == pagetext) {
pagetext="String_Node_Str";
}
 else {
bookid=Integer.valueOf(infox.get("String_Node_Str"));
}
tv.setText("String_Node_Str" + pagetext.replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ pagename);
}
if (FROM_NET == foxfrom) {
setTitle("String_Node_Str");
new Thread(down_page).start();
}
tv.setOnClickListener(new OnClickListener(){
@Override public void onClick(View arg0){
int vy=getWindowManager().getDefaultDisplay().getHeight();
if (cY <= vy / 3) {
sv.smoothScrollBy(0,30 - sv.getMeasuredHeight());
}
 else {
sv.smoothScrollBy(0,sv.getMeasuredHeight() - 30);
}
}
}
);
tv.setOnTouchListener(new OnTouchListener(){
@Override public boolean onTouch(View arg0,MotionEvent arg1){
cY=arg1.getRawY();
return false;
}
}
);
}