Commit Graph

19 Commits

Author SHA1 Message Date
Ben Liblit e316471d88 Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops.  I didn't systematically look for all opportunities
to do this, though.  I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.

Better use of generics also allowed many casts to become statically
redundant.  I have removed all such redundant casts.

Only three raw-types warnings remain after this batch of fixes.  All
three involve raw uses of CallGraphBuilder.  I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point.  I may
give these last few problem areas another go in the future.  For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.

This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-12 10:39:06 -07:00
Ben Liblit 72c754e874 Declare private methods static wherever possible
If a method is private, there's no risk that a subclass elsewhere
might be overriding it and depending on dynamic dispatch to choose the
right implementation.  So all of these private methods can safely be
declared static without risk of regression in either WALA code or
unseen third-party code.
2017-06-07 08:29:23 -07: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 602800524b Hacks to make WALA run on TeaVM, and hence be able to run in Web browsers. TeaVM has some warts, but overall it is a very nice mechanism to run Java code on the browser. I have examples of analysis actually running in Firefox, which enables supportive tools. So, for those changes that are not ideal, such as dropping the ConcurrentHashMap in ClassHierarchy, we should find a way to support both them and TeaVM, based on demand. 2017-01-12 12:25:37 -05:00
Julian Dolby 56236dec53 further work on analysis for JavaScript in Eclipse 2013-10-16 17:37:53 -04:00
dolby-oss fde1be89b5 add more extensive exception message
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3979 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-11 14:39:22 +00:00
yinnon_haviv 6157acd567 Fix stack overflow on long methods bug.
See test case for more details.
- Convert the problematic recursion (SEARCH of SSA conversion) into an "iterative" code (by introducing a stack data structure.


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3961 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-10-02 20:53:31 +00:00
sjfink 9939142eae switch from Assertions._assert to Java assertions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3555 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-30 13:16:52 +00:00
sjfink ba37e01522 generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2965 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-07-27 21:32:04 +00:00
dolby-oss 6ba0be8559 bug fix to use the getInstructions() method more consistently
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2963 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-07-25 18:19:55 +00:00
sjfink 76c8a7f194 more cleanup of util packages
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2461 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-24 22:53:51 +00:00
sjfink cd78f3aa71 generics for control flow graph and filters
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1711 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-09-02 14:45:07 +00:00
dolby-oss 4b0508356a fixes for default values of null; more customization hooks for SSA conversion
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1483 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-16 15:09:59 +00:00
sjfink d10f912ee4 make IBasicBlock an Iterable<IInstruction>. Rename iterateAllInstructions() to iterator()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@877 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-03-22 10:50:31 +00:00
sjfink 5f3e4543d1 Graph API change: Graph is now an Iterable of Nodes!
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@865 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-03-21 21:07:01 +00:00
sjfink 05e1f973a6 squash remaining Eclipse warnings
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@700 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-02-09 15:33:45 +00:00
sjfink a92bff31bb some generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@692 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-02-08 20:45:07 +00:00
sjfink f4fef68587 miscellaneous minor cleanups. eclipse build stuff. import statements.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@680 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-02-08 19:08:31 +00:00
dolby-oss 3d9390a397 Initial contribution of core script analysis code
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@616 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-02-02 17:17:13 +00:00