Commit Graph

20 Commits

Author SHA1 Message Date
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
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 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 56236dec53 further work on analysis for JavaScript in Eclipse 2013-10-16 17:37:53 -04:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
dolby-oss f4a1544a2d fix overly-restrictive assertions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4521 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-02-20 16:04:48 +00:00
dolby-oss 4c6d062dbb blunt force trauma to CAst frond end:
1) Structural changes in the AstTranslator to allow retranslation and generation of custom IR.  This is mostly moving state from the translator itself into the context.
2) Some refactoring to share some AST generation code across the Java and JavaScript front ends.
3) Switching to the latest Rhino, release 1.7R3; this is a pervasive change to the JavaScript Rhino translator, since it involves switching to the new AST interface in Rhino.
4) Common code to, as an option, translate Do-style loops by replicating the loop body.  This allows the use of CAstNode.LOOP forms for such loops.
5) Some bug fixes to the mechanisms of the CAstRewriter to handle weird control flow cases.
6) An example of retranslation to specialize JavaScript methods based on how many arguments they receive at call sites.


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4425 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-27 20:15:33 +00:00
msridhar1 c40917c3da remove unused imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4421 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-06 23:31:16 +00:00
msridhar1 b517c6ca85 Started testing on MooTools.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4299 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-01-06 21:17:15 +00:00
msridhar1 40a294a5e4 optimization: cache result of getMappedNodes()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4173 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-05-05 04:15:06 +00:00
dolby-oss 59bdaf6d27 more checking
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3937 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-09-14 20:29:29 +00:00
dolby-oss 2e8da872c0 support for replication-based translation of Do loops in Java, so that the standard LOOP node type can be used.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3596 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-05-15 16:06:09 +00:00
dolby-oss 3e198f8244 merge of development on internal branch. Support for cross-building JNI code for Windows, and refactoring of abstract loader support.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3242 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-02-26 16:54:30 +00:00
dolby-oss 9979d0899c more fixes to lexical scoping for JavaScript
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3196 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-01-30 16:33:22 +00:00
sjfink 3e33169ecc add some generics
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2093 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-12-04 20:44:04 +00:00
dolby-oss c039c173e0 add accessor to test whether a given node is already mapped by a control flow recorder
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1411 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-11 12:05:36 +00:00
sjfink e34aa83beb delete CallGraph.getInterpreter() and CFGProvider
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1345 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-05 03:04:50 +00:00
dolby-oss 5144df56be more assertion checking of control flow map during IR generation; bug fix to CAst rewriting to handle control flow edges out of the code being rewritten; bug fix to AstTranslator for control flow in finally blocks so that it throws either the prior exception or any new one
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1312 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-25 20:08:56 +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
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