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

Xinxin Jin xinxinjin89 at gmail.com
Sat Feb 7 17:07:40 EST 2015


Thanks for the reply ! Yes, "final int DEFAULT_TIMEOUT " works, but go back
to my problem, is there any way to get the value without "final" keyword ?
Thank you !

On Sat, Feb 7, 2015 at 12:30 PM, Dacong Yan <tonywinslow1986 at gmail.com>
wrote:

> 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
> >
>



-- 
Xinxin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150207/7806fb78/attachment.html 


More information about the Soot-list mailing list