Program: 46438
Project: 46438
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dbcache=DataCache.getInstance(getApplicationContext());
  im=InputManager.getInstance(this);
  locations=dbcache.getLocationNames();
  gps=new GPSLocator(this);
  ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.locationlist_item,locations);
  auto_origin=(AutoCompleteTextView)findViewById(R.id.autocomplete_origin);
  auto_origin.setAdapter(adapter);
  auto_dest=(AutoCompleteTextView)findViewById(R.id.autocomplete_destination);
  auto_dest.setAdapter(adapter);
  final Button src_btn=(Button)findViewById(R.id.locate_src_button);
  src_btn.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      progressDialog=new ProgressDialog(NPFStartActivity.this);
      progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progressDialog.setMessage("String_Node_Str");
      progressDialog.setCancelable(false);
      progressDialog.show();
      gps.startUpdate();
      progressDialog.show();
      new Thread(){
        public void run(){
          while (true) {
            gpsLocation=gps.getBestKnowLocation();
            if (gpsLocation != null) {
              handler.obtainMessage(0).sendToTarget();
              break;
            }
          }
        }
      }
.start();
    }
  }
);
  routeList=(ListView)findViewById(R.id.route_list);
  btnToMap=new Button(NPFStartActivity.this);
  btnToMap.setText("String_Node_Str");
  routeList.addFooterView(btnToMap);
  final Button submit=(Button)findViewById(R.id.get_location);
  submit.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      MapNode s_node, d_node;
      s_node=dbcache.getNodeByLocationName(auto_origin.getText().toString());
      d_node=dbcache.getNodeByLocationName(auto_dest.getText().toString());
      if (s_node != null && d_node != null) {
        im.setDestinationLocation(d_node.name);
        im.setSourceLocation(s_node.name);
        pf=new Pathfinder(s_node,d_node);
        ArrayList<MapNode> pathNodes=pf.getPath();
        ArrayList<String> nodes=new ArrayList<String>();
        String[] str_nodes=new String[pathNodes.size() + 1];
        nodes.add("String_Node_Str");
        for (int i=pathNodes.size() - 1; i >= 0; i--) {
          MapNode n=pathNodes.get(i);
          nodes.add(n.name);
        }
        nodes.toArray(str_nodes);
        routeList.setAdapter(new ArrayAdapter<String>(NPFStartActivity.this,R.layout.routelist_item,str_nodes));
        InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(v.getWindowToken(),0);
        btnToMap.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View arg0){
            Intent intent=new Intent(NPFStartActivity.this,NPFMapActivity.class);
            startActivity(intent);
          }
        }
);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  dbcache=DataCache.getInstance(getApplicationContext());
  im=InputManager.getInstance(this);
  locations=dbcache.getLocationNames();
  locations=ComUtil.decodeAll(locations);
  gps=new GPSLocator(this);
  ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.locationlist_item,locations);
  auto_origin=(AutoCompleteTextView)findViewById(R.id.autocomplete_origin);
  auto_origin.setAdapter(adapter);
  auto_dest=(AutoCompleteTextView)findViewById(R.id.autocomplete_destination);
  auto_dest.setAdapter(adapter);
  final Button src_btn=(Button)findViewById(R.id.locate_src_button);
  src_btn.setOnClickListener(new View.OnClickListener(){
    public void onClick(    View v){
      progressDialog=new ProgressDialog(NPFStartActivity.this);
      progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progressDialog.setMessage("String_Node_Str");
      progressDialog.setCancelable(false);
      progressDialog.show();
      gps.startUpdate();
      progressDialog.show();
      new Thread(){
        public void run(){
          while (true) {
            gpsLocation=gps.getBestKnowLocation();
            if (gpsLocation != null) {
              handler.obtainMessage(0).sendToTarget();
              break;
            }
          }
        }
      }
.start();
    }
  }
);
  routeList=(ListView)findViewById(R.id.route_list);
  btnToMap=new Button(NPFStartActivity.this);
  btnToMap.setText("String_Node_Str");
  routeList.addFooterView(btnToMap);
  final Button submit=(Button)findViewById(R.id.get_location);
  submit.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      MapNode s_node, d_node;
      s_node=dbcache.getNodeByLocationName(ComUtil.encode(auto_origin.getText().toString()));
      d_node=dbcache.getNodeByLocationName(ComUtil.encode(auto_dest.getText().toString()));
      if (s_node != null && d_node != null) {
        im.setDestinationLocation(d_node.name);
        im.setSourceLocation(s_node.name);
        pf=new Pathfinder(s_node,d_node);
        ArrayList<MapNode> pathNodes=pf.getPath();
        ArrayList<String> nodes=new ArrayList<String>();
        String[] str_nodes=new String[pathNodes.size() + 1];
        nodes.add("String_Node_Str");
        for (int i=pathNodes.size() - 1; i >= 0; i--) {
          MapNode n=pathNodes.get(i);
          nodes.add(n.name);
        }
        nodes.toArray(str_nodes);
        routeList.setAdapter(new ArrayAdapter<String>(NPFStartActivity.this,R.layout.routelist_item,str_nodes));
        InputMethodManager imm=(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(v.getWindowToken(),0);
        btnToMap.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View arg0){
            Intent intent=new Intent(NPFStartActivity.this,NPFMapActivity.class);
            startActivity(intent);
          }
        }
);
      }
    }
  }
);
}