Commit Graph

130 Commits

Author SHA1 Message Date
Julian Dolby cd944a8f12 refactoring of CAst front end machinery to allow more reuse 2018-01-25 14:42:27 -05:00
Ben Liblit f60c164ec1 Escape "<" and ">" in Javadoc when not used as HTML tag syntax 2017-12-19 16:53:52 -06: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 9c83e87cc1 Merge branch 'master' into modernization-java-8-lambdas-and-method-references 2017-11-29 10:51:33 -06:00
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 8ef6ad5069 Add proper type parameters to nearly all uses of Iterator
Java sources used as test data have been excluded.
2017-11-28 14:09:30 -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
Ben Liblit cb6d3b282a Fix Eclipse warnings about redundant null checks and assignments
Most of these are harmless, and are best fixed simply by removing the
redundant check or assignment.  The one in FlowType.compareBlocks,
however, revealed a real problem.  This code checks for nullness of
`a` *after* having called a method on `a`.  Assuming that `a` can
indeed be `null` here, the check must come first to avoid a
`NullPointerException`.

In several places, I saw code of this form:

   if (thing == null)
     assert thing != null : ... ;

I honestly don't understand the purpose of that `if` statement.  Why
not just have the `assert` statement there directly?  I removed the
seemingly irrelevant `if` statements in these cases, but if this is
some intentional pattern, please explain it to me.

In a few places where nullness is statically known but non-obvious,
add assert statements to point out what's going on to help future
developers.

Upgrade future such warnings to errors to keep us moving in a cleaner
direction.
2017-08-15 09:11:29 -07: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 594525a83f Fix Eclipse warnings about methods that can be declared static
The fix is to add "static" where appropriate, of course.  I've also
simplified calls to such methods to reflect the fact that they no
longer need a specific object to call the method on.

In projects that contain test inputs, I've left the non-static
declarations unchanged, and instead downgraded the warning to be
ignored.  In all other projects, this warning has been upgraded to an
error.
2017-07-14 22:38:38 -07: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 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
Juergen Graf eb9e74f442 add/remove @SuppressWarnings to keep in sync with wala main branch 2014-07-30 16:17:37 +02:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Michael Heilmann ea40719069 Merge branch 'master' of https://github.com/wala/WALA into development 2014-06-26 17:52:47 +02:00
Michael Heilmann 0bb5e6998e Remove redundant casts and imports, improve doc comments 2014-06-26 17:51:26 +02:00
Andrew Johnson c3202533f7 Fixing bug in ClassHierarchy.getLeastCommonSuperclass
If C1 extends C2 extends C3 getLeastCommonSuperClass(C1,C2) would give C3 instead of C2
2014-05-21 23:28:11 -04:00
Tobias Blaschke dcf5cd4a1c On progress monitoring
Small changes on progrss monitoring that enable having an actual
progress-meter instead of just having heart-beat information.
2014-04-11 17:50:17 +02:00
Juergen Graf ce833aefe2 fix bug: count only really unresolved classes in ClassHierarchy 2014-02-17 15:01:18 +01:00
Juergen Graf cdaaddf88b Merge branch 'wala' into master 2013-07-02 14:23:24 +02:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Manu Sridharan 3b1889121b add missing copyright headers 2013-05-22 15:39:19 -07:00
Julian Dolby 321e925660 work on CHA 2013-04-03 12:12:43 -04:00
Juergen Graf 61d7a33928 remove warnings in com.ibm.wala.core 2013-03-12 00:50:17 +01:00
Juergen Graf b82d5dba90 Merge branch 'wala' into master 2012-11-06 04:23:10 +01:00
Manu Sridharan 56f3d847a5 more conversion to Unix line endings 2012-09-04 15:59:50 -07: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
Manu Sridharan bb2c45803c Merge branch 'github_master' into internal_merge 2012-08-21 16:57:27 -07:00
Manu Sridharan cf04da7613 handle a couple of corner cases. some (very) basic support for pointer / reference types 2012-08-21 16:56:50 -07:00
Manu Sridharan 800203a71f improved documentation 2012-08-21 16:55:30 -07:00
Juergen Graf 1090e59717 Merge branch 'wala' into master 2012-04-04 11:27:23 +02:00
msridhar1 a28f0df3b7 change resolveField() to pass type when resolving a field
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4553 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2012-04-03 22:41:21 +00:00
Juergen Graf 7477b1730b Merge branch 'wala' into master 2012-03-19 13:33:48 +01:00
msridhar1 59e46916ce Generalize certain IR data structures to be less Java-specific. Generalize annotations code to allow for reading annotation parameters. Various other fixes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4290 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-12-28 17:03:27 +00:00
Juergen Graf c240d41b4f Merge branch 'wala' into master 2011-08-16 22:16:32 +02:00
dolby-oss 7a6af352b9 moved IR-independent visualization of graphs to util project
added DFS path find that finds all paths in sequence rather than just one
moved the WalaException out of warnings subpackage

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4257 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-08-16 16:51:11 +00:00
Juergen Graf 5c43668553 Merge branch 'wala' into master 2011-04-11 16:40:48 +02: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
Juergen Graf 1a67e8817c remember unresolved classes 2011-03-30 13:03:16 +02:00
sjfink 6bd8363503 refactor to isolate core utilities from dependence on Eclipse IProgressMonitor
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4034 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-01-17 22:06:58 +00:00
msridhar1 28ef96d4c3 fix comment
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3858 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2010-08-09 22:36:53 +00:00
sjfink 74b6c74492 use a ConcurrentHashMap as suggested by M. Bruch on mailing list
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3779 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-12-21 13:38:57 +00:00
sjfink 6b2e37ddfd delete deprecated code
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3761 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-11-13 18:06:35 +00:00
sjfink b5bc95f052 tweak some comments
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3714 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-02 18:20:10 +00:00
sjfink ba91ea7f77 revamp lookupClass() to avoid dependence on classloaders
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3712 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-02 17:49:25 +00:00
sjfink 1ab5b375ad deprecate
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3711 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-02 17:49:07 +00:00
sjfink 3eca1bca8e refactoring of internals
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3710 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-07-02 15:07:45 +00:00