[Soot-list] Create a method with no arguments?

Patrick Lam plam at sable.mcgill.ca
Wed Jul 22 17:27:50 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kelvin Tian wrote:
>  Hi,
> 
>     Just a silly question.  I wanna create a method with no arguments,
> like this   void Foo().  The tutorial example to create main() method is
> like below, and the second argument is a list, like below.
> ===
> method = new SootMethod("main",
> Arrays.asList(new Type[] {ArrayType.v(RefType.v("java.lang.String"), 1)}),
>  VoidType.v(), Modifier.PUBLIC | Modifier.STATIC);
> ===
> 
> If I want to create a method with no arguments, what am I supposed to
> put as the second argument of SootMethod constructor?   I tried null,
> VoidType.v() and so on, it just doesn't work.  Thanks for any suggestions!

Have you tried just an empty list? new SootMethod("main", new
LinkedList()); for instance, or Collections.emptyList().

pat
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpnhFYACgkQNTVxnNGEyOh5mQCeJU5/oS2re0S7FenFqKKL5M9R
SEIAn1o7WHEyQ25khuxA39IqtuguoC/N
=yhQ5
-----END PGP SIGNATURE-----


More information about the Soot-list mailing list