Commit Graph

96 Commits

Author SHA1 Message Date
Julian Dolby b2503628a4 1) a bit more source mappimg information
2) fixes to how Contexts are combined
2018-10-13 08:42:08 -04:00
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Sifis Lagouvardos 6fd67b886e Added multidex apk file in dalvik.test/data and a new test for multidex apk files. 2018-09-21 19:08:06 -07:00
Sifis Lagouvardos 819e7e1a7f Added test for the new DexFileModule constructor that supports specific .dex files. 2018-09-21 19:08:06 -07:00
Julian Dolby c8cdaf8616 further refactoring to enable more reuse
eliminate all non-jva 8 compilation
2018-02-05 15:18:37 -08:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit 544a71ae72 Remove type arguments that Java 1.7+ can infer for us 2017-12-04 14:04:39 -08:00
Ben Liblit 456b0e45c3 Remove additional unnecessary casts of lambda expressions 2017-11-27 15:00:13 -06:00
Ben Liblit 6261880264 Remove unnecessary casts of lambda expressions 2017-11-27 11:31:15 -06:00
Ben Liblit 74e0640771 Replace simple lambdas with method references wherever possible 2017-11-27 11:31:15 -06:00
Ben Liblit 790d37781b Convert many single-method anonymous classes to lambdas
Eclipse's automated code clean-up tool did most of the heavy lifting
here: it specifically has a clean-up option for converting functional
interfaces to lambdas.  I merely had to revert the automated changes
for a single enumeration class for which it produced invalid results,
and for a few test inputs that apparently aren't set up to be compiled
with Java 8.
2017-11-27 11:31:15 -06:00
Julian Dolby 8d65788aef convert to Java 8 Function and Predicate 2017-11-11 20:29:04 -05:00
Julian Dolby ecdb599674 support for deodexing methods read from Dalvik, using support in dexlib2 2017-08-08 06:34:48 -04:00
Julian Dolby eaba8d59b7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:09:34 -04:00
Julian Dolby 9dda017450 Merge branch 'master' of https://github.com/wala/WALA 2017-07-28 13:42:45 -04:00
Ben Liblit 191904d607 Remove "throws XYZ" declarations where XYZ cannot be thrown
Unnecessary "throws" declarations tend to cascade.  If foo() calls
bar() and bar() falsely declares that it might throw IOException, that
often leads a programmer to declare that foo() might throw IOException
as well.  Fixing the bar() throws declaration then reveals that we can
fix the foo() throws declaration too.  By the time we reach a fixed
point with cleaning these up, we have removed roughly 320 unnecessary
throws declarations.

In a few cases, this cleanup even lets us remove entire "try
... catch" statements where the only thing being caught was an
exception that we now statically know cannot be thrown.  Nice!

In Eclipse project configurations, upgrade any future such shenanigans
from warnings to errors.  Now that we've fixed this, we don't want it
coming back again.

There is a potential drawback to this change.  Conceivably some public
WALA API entry point might have declared that it could throw some
exception merely to reserve the *option* of throwing that exception in
third-party code that subclasses and overrides the API entry point in
question.  I have no idea whether this is a significant concern in
practice, though.
2017-07-28 10:20:28 -07:00
Julian Dolby 0bd59c95b6 merge 2017-05-07 19:51:30 -04:00
Ben Liblit 9159ea7636 Remove unnecessary `klass` argument and propagate back to callers (#174) 2017-05-03 16:25:00 -07:00
Julian Dolby 56db4bbe78 Merge branch 'master' of https://github.com/wala/WALA 2017-03-15 22:06:43 -04:00
Julian Dolby 6cdeedd5e9 changes for analysis cache view 2017-03-15 22:06:19 -04:00
Ben Liblit fde65340d2 Fix 132 Eclipse warnings about using raw generic types 2017-03-15 11:08:20 -05:00
Julian Dolby bb0f38338e Merge branch 'warning-fixes-resource-management' of https://github.com/liblit/WALA 2017-03-13 10:44:38 -04:00
Ben Liblit b1678882b3 Plug numerous potential resource leaks
This fixes 33 out of 37 Eclipse "Potential resource leak: '...' may
not be closed" warnings.  It also fixes 3 out of 37 Eclipse "Resource
'...' should be managed by try-with-resource" warnings, although that
was not the main focus of this effort.

The remaining 4 warnings about potential resource leaks all involve a
leaked JarFile instance that is passed to a JarFileModule constructor
call.  JarFileModile never attempts to close its underlying JarFile;
this code is written as though JarFile cleanup were the caller's
responsibility.  However, the JarFile often cannot be closed by the
code that creates the JarFileModule either, since the JarFile needs to
remain open while the JarFileModule is in use, and some of these
JarFileModules stay around beyond the lifetime of the code that
created them.  Truly fixing this would essentially require making
JarFileModule implement Closeable, which in turn would probably
require that Module implement Closeable, which in turn would require
changes to lots of code that deals with Module instances to arrange
for them to be properly closed.  That's more invasive than I'm
prepared to take on right now.
2017-03-12 21:38:43 -05:00
Ben Liblit 994a70500f Remove redundant generic type parameters where possible
Instead, rely on Java's ability to infer type parameters in many
contexts.  This removes 665 Eclipse warnings.

Note: a few of these changes are to files under "test" subdirectories.
Presumably those are files that serve as test inputs rather than being
part of WALA code proper.  As far as I can tell, these changes do not
break any WALA tests.  But if any of those tests were specifically
intended to exercise WALA on code with non-inferred generic type
parameters, then I really should be leaving those alone.
2017-03-11 21:20:51 -06:00
Julian Dolby d24519e974 cross-cutting changes to make more of WALA runnable with TeaVM. The biggest change is refactoring to AnalysisCache and friends; since TeaVM does not support SoftReference, I needed to add a layer of interfaces so that I can use a more simpleminded caching implementation for TeaVM. There are other changes to Module and friends to break connections with File and URL, which also cause TeaVM grief. I also organized imports in many places to remove unused types that caused trouble. 2017-02-02 20:33:27 -05:00
Julian Dolby c9b1006305 changes for allowing seq. and conc. CHAs 2017-01-12 16:34:54 -05:00
Julian Dolby 76286a330c make Android entrypoint locator work for source code 2016-06-10 21:21:08 -04:00
Julian Dolby 970acf10db driver to dump APK IR 2016-02-11 13:49:09 -05:00
Julian Dolby 3ad0c2009a restructure tests 2015-09-16 13:27:31 -04:00
Julian Dolby a1159db2f4 switch to (one hopes) a more reliable javacup input file 2015-07-24 23:25:08 -04:00
Julian Dolby eb24a616f1 clean up 2015-07-24 22:45:25 -04:00
Julian Dolby b721a3ceb0 updates to dynamic call graphs to better match static ones 2015-07-10 09:44:01 +02:00
Julian Dolby a6a060ed25 changes for handling of 'callbacks' in dynamic CGs 2015-06-28 17:06:21 -04:00
Julian Dolby 63ec46f67d 1) changes for mobile
a) serializable added for use by Android services
  b) test classes refactored to allow Android variants to use JUnit 3
2) shrike instrumentation now uses java.lang.instrument
  a) refactoring
  b) online variants of call graph tracing
2015-05-25 19:00:51 -04:00
Julian Dolby 7b604da0b4 changes for mobile tests 2015-04-08 08:26:34 -04:00
Julian Dolby b7cf88e214 mobile tests changes 2015-04-07 19:34:27 -04:00
Julian Dolby c863d20448 hacks for A=ndroid lib tests 2015-04-06 19:19:19 -04:00
Julian Dolby 776b08aecd rename tests for maven 2015-04-06 18:04:02 -04:00
Julian Dolby 6947b3e7d9 hacks for android stuff 2015-04-06 13:28:51 -04:00
Julian Dolby cc5f683333 hacks for android stuff 2015-04-06 13:00:14 -04:00
Julian Dolby 7d2e5c0731 back to 4.4 2015-04-06 11:31:08 -04:00
Julian Dolby c8087c8935 juno stuff 2015-04-06 10:27:16 -04:00
Julian Dolby 65edd0071a juno stuff 2015-04-06 10:22:09 -04:00
Julian Dolby c2b62f2ddc newer junit 2015-04-06 10:00:44 -04:00
Julian Dolby 65b62d3f28 junit annoyances 2015-04-06 09:43:52 -04:00
Julian Dolby 22ad339fd9 dalvik test infrastructure 2015-04-05 21:22:55 -04:00
Julian Dolby 43c37d6d0e fixes to regression tests:
now, for me, code works using e44 with maven
  dalvik tests refactored for mobile version with android dev tools
  IDE tests Eclipse metadata fixed to make e44 work for me
  new android entrypoint to fix failure in new droidbench tests
2015-03-24 21:51:35 -04:00
Julian Dolby 1ea7746533 class loader stuff 2015-03-04 21:43:06 -05:00
Julian Dolby ac533bc44d class loader stuff 2015-03-04 20:02:49 -05:00
Julian Dolby dcc2f654f4 class loader stuff 2015-03-04 19:54:35 -05:00