Commit Graph

77 Commits

Author SHA1 Message Date
Ben Liblit 6546d5d6a4 Resolve the last two Eclipse warnings about using raw types
Fixes bug #244.
2018-04-13 12:53:33 -05:00
Julian Dolby 41d254d547 more type parameters for analysis engine 2018-04-10 16:00:44 -04:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08: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
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 fde65340d2 Fix 132 Eclipse warnings about using raw generic types 2017-03-15 11:08:20 -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 0f0c3d6bd9 add more functionality to analysis engine: create SDGs and
parameterize to do both regular and field-based analysis in JavaScript
2016-08-18 22:43:12 -04:00
Julian Dolby 73747cbb86 fixes for work with ECJ 2016-07-05 19:37:36 -04:00
Andreas Sewe e2e5bcf435 SecurityExceptions when analyzing JARs with broken/expired signatures
See <https://github.com/wala/WALA/issues/100>
2016-06-08 11:08:10 +02:00
Julian Dolby 0265a1c2dc Eclipse Java Compiler as a standalone source code front end 2015-10-14 13:32:34 -04:00
Julian Dolby 5cc870dd77 fixes to Dalvik support, and work on running Dalvik tests on Travis 2015-02-26 09:34:03 -05:00
Juergen Graf 4772f36d47 add standard type parameter to most pointer analysis references. When it breaks we move back to ? extends InstanceKey. 2014-05-20 22:00:06 +02:00
Julian Dolby 62729613d7 less printing 2013-12-03 15:20:53 -05:00
Julian Dolby 1cc58c6e2f less printing 2013-12-03 13:09:35 -05:00
Julian Dolby 3015d1c5f9 added container access to ModuleEntry 2013-06-25 11:53:58 -04:00
Manu Sridharan dee324b609 add comment 2013-05-28 15:32:24 -07:00
Manu Sridharan 89803bc90c use updated API for getting library jars 2013-05-28 15:31:30 -07:00
Julian Dolby 87b856928c fixes for handling parse errors in JS and HTML 2013-03-01 10:07:20 -05:00
Julian Dolby afccdd2189 Annotation support 2013-02-02 21:27:45 -05:00
Manu Sridharan 256cd06460 Convert all Java source files to use Unix line endings; no semantic change 2012-09-04 15:56:05 -07:00
dolby 319eacc529 merge changes and changes for atomic sets work 2012-08-29 16:35:34 -04:00
Manu Sridharan 9a0e105e51 fix so that new lexical scheme can be enabled with Java frontends 2012-07-12 10:27:24 -07:00
dolby-oss a9ec87f360 Changes motivated by analysis issues in JavaScript. The main change is that calls of the form f.x() in JavaScript are now analyzed like 'method calls' so that the 'this' pointer in the receiver functions can be filtered based upon the types that actually have the method being invoked. This requires much more dynamic filtering than in a language like Java, since properties like 'x' are simply properties that happen to hold functions, and so can be assigned in a first-class manner. Thus, the filtering needs to handle variance in both the types and the values of their properties; this is implemented as multiple levels of abstract object directed side effect equations in the dataflow system.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4535 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-03-01 02:45:51 +00:00
msridhar1 857e456806 organize imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4081 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-04-03 04:08:05 +00:00
dolby-oss 8069fe81d8 fix issues with junit 3 vs. 4 by adding hacking method to get a name like the one junit 3 gives
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3790 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-01-06 13:57:06 +00:00
msridhar1 8025302fd0 update to JUnit 4
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3743 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-27 22:48:04 +00:00
dolby-oss cab3c60f7e fixes for JDT-based tests
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3730 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-16 18:08:29 +00:00
sjfink a0efbee8ff Major refactoring to introduce com.ibm.wala.ide. Many related changes and patches from Marcelo Paternostro.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3693 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-06-22 15:06:12 +00:00
sjfink 6f96d41dc2 remove unnecessary InvalidClassFileException declarations
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3618 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-05-29 14:23:29 +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
egeay 193fc85cdd - Updated test cases to 1.7 syntax
- Added one-level directory structure to separate the constructs tested.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3545 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-29 18:17:20 +00:00
egeay f5613864de git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3544 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 2009-04-29 18:13:14 +00:00
sjfink 957cb2b8ca deprecate Trace
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3432 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-09 20:31:14 +00:00
dolby-oss b2bae33bab generalize parsing of Descriptors to also handle languages other than Java
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3366 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-26 15:11:45 +00:00
sjfink b1cdc4fecf call new factories
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3305 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-13 17:06:09 +00:00
sjfink ed13ddbb17 bug fix 2666538: make ClassLoaderReference immutable, and related API fixes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3302 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-13 14:20:35 +00:00
dolby-oss ed52225d4f adapt to core changes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3230 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-02-19 15:59:33 +00:00
dolby-oss 624fb4c5ae refactor polyglot-based java code in its own projects
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3168 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-01-09 14:12:19 +00:00
sjfink b1f300156e patch from yinnon to make analysis scopes obey list order
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3144 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-12-17 19:52:27 +00:00
dolby-oss 7ce05498fd refactor java source test code to ease making plugin tests
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3134 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-12-16 14:29:11 +00:00
dolby-oss 866c6dc608 make dumpIR accessible to subclasses
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3082 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-11-06 17:58:11 +00:00
sjfink a26f7e2035 organize imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2853 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-27 19:43:53 +00:00
dolby-oss ed8a7159e6 remove dependence from cast.java.test to eclipse.tests
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2850 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-27 13:29:35 +00:00
dolby-oss 85747870f1 refactoring to prepare for JDT front end
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2844 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-23 16:24:17 +00:00
dolby-oss 3719bfd410 refactoring to prepare for JDT front end
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2842 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-23 15:58:02 +00:00
msridhar1 54f15e7c50 fix for mac
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2563 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-12 15:17:36 +00:00
sjfink d3b19b68cb just refactoring ... introduce 2 new packages in wala.util.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2444 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-24 22:04:26 +00:00
sjfink fa5af94335 clean up and refactor some APIs surrounding file I/O and exclusions files. Needed in order to allow clients to use some APIs with application-specific exclusions.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2251 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-02 22:28:04 +00:00
sjfink 0b441f5b13 organize imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2146 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-12-10 05:36:40 +00:00