[Soot-list] How to propagate constant defined in class fields to class methods ?

Dacong Yan tonywinslow1986 at gmail.com
Sat Feb 7 15:30:31 EST 2015


Although named in all capitals, DEFAULT_TIMEOUT is not a constant.
Maybe you can change it to
  private final int DEFAULT_TIMEOUT = 30000;
and see what happens.

On Sat, Feb 7, 2015 at 10:49 AM, Xinxin Jin <xinxinjin89 at gmail.com> wrote:
> Hello,
>
> I have a question about how constants propagate from class fields to class
> methods. I have a simple testing code:
>
> public class MyActivity extends ActionBarActivity {
>     private int DEFAULT_TIMEOUT = 30000;
>
>     @Override
>   protected void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> new FetchItemsTask().execute();
>   }
>   private class FetchItemsTask extends AsyncTask<Void,Void,String>{
> @Override
> protected String doInBackground(Void... arg0) {
>             int timeoutConnection = DEFAULT_TIMEOUT;
>   HttpParams httpParameters = new BasicHttpParams();
>   HttpConnectionParams.setConnectionTimeout(httpParameters,
> timeoutConnection);
>         }
> }
>
> Basically I want to get the value of timeoutConnection called by
> setConnectionTimeout. I used both ConstantPropagatorAndFolder() defined in
> soot and InterproceduralConstantValuePropagator() defined in Soot-infoflow,
> and expect DEFAULT_TIMEOUT should propagate to the parameter of
> setConnnectionTimeout. However, I cannot get the integer constant from
> setConnectionTimeout.
>
> I guess if neither  ConstantPropagatorAndFolder() nor
> InterproceduralConstantValuePropagator() propagate the class fields to class
> methods ?  Then what is the correct way to do this ?
> Please help me out !
>
> Thank you for your help in advance !
>
>
> --
> Xinxin
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>


More information about the Soot-list mailing list