Commit Graph

2385 Commits

Author SHA1 Message Date
Julian Dolby 004a81deba Merge branch 'master' of https://github.com/wala/WALA 2017-07-13 13:02:29 -04:00
Ben Liblit 9d6e362eaa Fix additional uses of raw types related to IVariable
These were not producing warnings in the Eclipse Oxygen GUI, and also
produced no warnings from Tycho when running Maven tests on my local
machine.  However, they did result in errors under Travis-CI.  I'm not
sure why this inconsistency exists, but hopefully we have now fixed
these raw-type uses in a way that makes everything happy.
2017-07-12 10:39:06 -07:00
Julian Dolby 289efc3bb8 Merge branch 'master' of https://github.com/wala/WALA 2017-07-12 08:08:34 -04:00
Ben Liblit 0bbe9970c6 Enable Eclipse Oxygen's new "unlikely argument types" diagnostics
There are two such diagnostics: one for collection methods and one for
equals().  See
<https://www.eclipse.org/eclipse/news/4.7/jdt.php#unlikely-argument-types>
for more information about these two new diagnostics.

For each of these diagnostics, I've set the severity level to
"warning" in projects that have some instances of the suspicious code,
or to "error" in projects that have no instances of the suspicious
code.
2017-07-08 13:22:00 -07:00
Ben Liblit 29f53d11fe Add a hashCode() method to a class that already has equals()
Generally, overriding one means you should be overriding the other
too.

Also, configure Eclipse to treat any similar cases as errors, rather
than merely warnings.
2017-06-30 10:24:36 -07:00
Julian Dolby 7ea9bca169 Merge branch 'master' of https://github.com/wala/WALA 2017-06-26 15:05:29 -04:00
Ben Liblit fb9042d3a6 Activate more Eclipse diagnostics, and treat many warnings as errors
The additional diagnostics are ones that were previously being
ignored, but which we seem to have been ignoring by default rather
than as a conscious choice.

For diagnostics of which we currently have *zero* instances, treat
these as errors rather than merely warnings.  The intent is to
permanently lock out future regressions of things we've completely
fixed.  In the future, whenever we fix the last instance of a given
warning in a given Eclipse project, we should also promote that
diagnostic to an error to keep things clean into the future.
2017-06-26 11:16:09 -07:00
Julian Dolby 6c217a7ee4 Merge branch 'master' of https://github.com/wala/WALA 2017-06-24 18:13:22 -04:00
Julian Dolby d774fdeb36 allow access from Scala wrappers 2017-06-24 18:51:27 +02:00
Manu Sridharan 7d29573a26 Remove code to scan call sites for max param count
We cannot find any case where this code fixes a problem,
and it doesn't seem to be a good fix anyway.
2017-06-22 14:39:13 +02:00
Ben Liblit 16f673490d Fix all remaining Eclipse "Unnecessary Code" warnings
There were only three left, all fairly straightforward to fix.
2017-06-22 14:08:44 +02:00
Julian Dolby 163e10f5e4 Merge branch 'warning-fixes-plug-in-development-misc' of https://github.com/liblit/WALA 2017-06-22 09:27:47 +02:00
Julian Dolby 8114f833ec clean up SDG 2017-06-22 09:27:34 +02:00
Ben Liblit a940935056 Export all packages
This fixes eleven Eclipse "This plug-in does not export all of its
packages" warnings in the "Plug-in Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit bfe5cabf42 Match case of property names to that expected in manifest
This fixes two Eclipse "Key '...' is not found in localization
properties file: plugin.properties" warnings in the "Plug-in
Development" category.
2017-06-07 17:42:11 +02:00
Julian Dolby fc7c7ec5d1 merge 2017-05-26 19:01:59 -04:00
Manu Sridharan 554a6e7ee9 Add options to ignore inter-procedural control dependence
In certain cases, one may want to ignore inter-procedural control
dependence.  Consider the following example:

    flag = getFlagVal();
    if (flag) {
      doStuff();
    }

If we are ignoring interprocedural control dependence, a forward slice
from the first statement will *not* include statements inside doStuff()
and its transitive callees.

This option is useful in scenarios where the effects of statements
inside control-dependent callees can be accounted for via some cheaper
effect analysis.  E.g., if you only care about heap effects of control-
dependent callees, you can compute that using mod-ref analysis,
rather than sucking all the control-dependent callee statements into the
slice.

Also added some more detailed comments, a new unit test, and removed
some trailing whitespace.
2017-05-26 15:29:08 -07:00
Ben Liblit dee2412ab5 Remove several unused locals and clean up surrounding code
In all of these cases, the code used to initialize the unused local
seems nontrivial to me.  I think this can all be removed without
erasing any needed side effects, but the code might still become
useful to someone in the future.  So I'm not really removing the code
entirely, but merely commenting it out.
2017-05-26 14:25:03 -07:00
Julian Dolby d4607979ed Merge branch 'master' of https://github.com/wala/WALA 2017-05-26 15:13:28 -04:00
Manu Sridharan 11ff511d61 Add API for passing an IProgressMonitor into the slicer 2017-05-24 14:38:30 -07:00
Ben Liblit 0ffd2bcee4 Add @Override annotations to all methods that do override (#180)
This fixes 49 Eclipse code style warnings.  I'm not sure why these
were overlooked in my previous sweep of missing-@Override warnings.
Ah well; got 'em this time around.
2017-05-15 07:15:00 -07:00
Julian Dolby f54346b36c Merge branch 'master' of https://github.com/wala/WALA 2017-05-08 10:48:05 -04:00
Ben Liblit 4cef26162c Add @Override annotations wherever possible (#178)
* Fix warnings about unset javacProjectSettings build entries

Specifically, these are all warnings of the form "The
'javacProjectSettings' build entry should be set when there are project
specific compiler settings".

* Add @Override annotations to all methods that do override

This fixes 287 Eclipse code style warnings.

* Cannot add @Override annotations here, so suppress warnings instead

We should be able to add these @Override annotations in the future,
one Eclipse Mars and earlier are no longer supported.  For now,
though, they have to go away in order to be compatible with older
Eclipse releases.
2017-05-08 07:39:49 -07:00
Julian Dolby ba743ef19c Merge branch 'master' of https://github.com/wala/WALA 2017-05-08 08:45:02 -04:00
Julian Dolby 0bd59c95b6 merge 2017-05-07 19:51:30 -04:00
Ben Liblit e753aba3cc Fix warnings about unset javacProjectSettings build entries (#176)
Specifically, these are all warnings of the form "The
'javacProjectSettings' build entry should be set when there are project
specific compiler settings".
2017-05-04 11:44:32 -07:00
Ben Liblit fbf9abfa3a Fix Eclipse type-safety warnings in overrides of `ModRef` visitor-making methods (#175)
* Add missing type parameters to overrides of ModRef.makeModVisitor

* Add missing type parameters to overrides of ModRef.makeRefVisitor

This also required slightly generalizing the generic type signature of
the ModRef.makeRefVisitor return type.  Instead of returning
"RefVisitor<T, ExtendedHeapModel>", we now return "RefVisitor<T, ?
extends ExtendedHeapModel>".  We need that extra flexibility because
at least one override of this method returns a RefVisitor whose second
generic type parameter is a subclass of ExtendedHeapModel.
2017-05-03 19:37:58 -07:00
Ben Liblit 9159ea7636 Remove unnecessary `klass` argument and propagate back to callers (#174) 2017-05-03 16:25:00 -07:00
Raffi Khatchadourian 97a6496c1f AnalysisCache -> IAnalysisCache, additional ignore, increased visibility, generic fixes (#172)
* Use IAnalysisCacheView instead of AnalysisCache. (#1)

It seems that some additional types need to be changed due to
d24519e974. This may not be inclusive,
however.

* Increase visibility of several methods and constructors.

Used for creating custom contexts and context selectors.

* Ignore the results directory.

* Some generic type fixes in ModRef.java.
2017-05-03 09:20:03 -07:00
Julian Dolby fe636f4b97 Merge branch 'master' of https://github.com/wala/WALA 2017-04-24 16:28:34 -04:00
Manu Sridharan 589db13fa7 add application-only call graph 2017-04-20 11:26:23 -07:00
Manu Sridharan 8c65754b0e implement some methods in CHACallGraph 2017-04-20 11:26:23 -07:00
Manu Sridharan c9022b0743 update version to 1.4.3-SNAPSHOT 2017-04-19 09:19:09 -07:00
Manu Sridharan 44e433085e tag 1.4.2 release 2017-04-19 09:17:13 -07:00
Manu Sridharan 0c424e12b3 Fix #164 2017-04-16 18:23:56 -07:00
Julian Dolby af83d11a4e Merge branch 'master' of https://github.com/wala/WALA 2017-04-14 10:13:04 -04:00
Manu Sridharan d7878b2bbd Merge pull request #163 from liblit/warning-fixes-plug-in-development
Disable Eclipse warnings about missing version constraints
2017-04-06 16:19:59 -07:00
Julian Dolby 11585f3d34 Merge branch 'master' of https://github.com/wala/WALA 2017-03-30 21:58:56 -04:00
Ben Liblit d35e8d0fa2 Disable Eclipse warnings about missing version constraints
Specifically, we're turning off Eclipse warnings about missing version
constraints on required bundles ("Require-Bundle"), exported
packages ("Export-Package"), and imported packages ("Import-Package").
We're not turning these off absolutely everywhere, though: only in
packages where one or more such warnings were actually being reported.
So if a given package was already providing all version constraints
for, say, package imports, then we've kept that warning on in that
package.

Honestly I don't entirely understand the practical implications of
these warnings.  However, there were 355 of them across many WALA
subprojects.  I take this as evidence that the WALA developers do not
consider these version constraints to be important.  Therefore, we may
as well stop warning about something we have no intention of fixing.

That being said, if we *do* want to fix some or all of these, I
welcome any advice on what those fixes should look like.  I am rather
ignorant about all things OSGi.
2017-03-28 20:37:41 -05:00
Ben Liblit b9c2890db6 Fix Eclipse warnings about unnecessary warning suppressions 2017-03-28 18:20:38 -05:00
Ben Liblit 2f7b52b01c Fix Eclipse warnings about unused imports 2017-03-28 18:20:33 -05:00
Julian Dolby 91ed8f6752 Merge branch 'master' of https://github.com/wala/WALA 2017-03-28 16:34:38 -04:00
Julian Dolby 59337d0d05 Merge branch 'master' of https://github.com/wala/WALA 2017-03-28 16:34:29 -04:00
Ben Liblit 65be11f222 Merge branch 'master' into warning-fixes-unnecessary-code-controversial 2017-03-25 22:12:03 -05:00
Ben Liblit 42c7866dfd Prune constructor and method signatures after removing unused fields
Removing an unused field sometimes means removing constructor code
that used to initialize that field.  Removing that initialization code
sometimes leaves whole constructor arguments unused.  Removing those
unused arguments can leave us with unused code to compute those
arguments in constructors' callers, and so on.  This commit tries to
clean all of this up, working backward from the unused fields that an
earlier commit already removed.  Hopefully I have avoided removing
upstream code that had other important side effects, but it wouldn't
hurt for a WALA expert to review this change carefully.
2017-03-25 17:40:22 -05:00
Ben Liblit b4e5d078dd Retain some unused methods
Manu requests that we keep these around even though they are currently
unused.  So we'll retain them, but also annotate them to suppress the
warning.
2017-03-25 17:11:34 -05:00
Manu Sridharan ab7e638c29 version 1.4.2-SNAPSHOT 2017-03-25 13:54:21 -07:00
Manu Sridharan 2d0518963d Tag release 1.4.1 2017-03-25 13:24:39 -07:00
Manu Sridharan b82e808b32 Merge pull request #156 from liblit/warning-fixes-unnecessary-code-uncontroversial
Fix 265 Eclipse warnings about unnecessary code
2017-03-23 17:48:10 -07:00
Ben Liblit 1bb3d827c4 Turn off Eclipse warnings about unused caught-exception parameters
Manu requested that we use this approach instead of adding
`@SuppressWarnings("unused")` at each affected catch block.  That
seems reasonable to me, given the large number of such warnings and
the lack of likely harm from ignoring such caught exceptions.
2017-03-23 16:39:58 -05:00
Ben Liblit 16492c7b78 Revert "Suppress 157 Eclipse warnings about unused exception parameters"
This reverts commit fe9f7a793a.
2017-03-23 16:32:00 -05:00
Manu Sridharan 9dafd5050f Merge pull request #155 from liblit/warning-fixes-javadoc-true-fixes
Fix 161 Eclipse Javadoc warnings
2017-03-23 13:30:51 -07:00
Manu Sridharan 167244ed5e Merge pull request #154 from liblit/warning-fixes-javadoc-bankruptcy
Disable Eclipse checks for routinely-violated Javadoc rules
2017-03-23 11:04:59 -07:00
Ben Liblit e52d872e3e Fix 19 Eclipse warnings about unnecessary casts 2017-03-23 12:28:14 -05:00
Ben Liblit b8264b884d Remove "@param" tags for which there is no corresponding parameter 2017-03-22 20:40:52 -05:00
Ben Liblit 780804e159 Fix "@param" tags whose name doesn't match the parameter name 2017-03-22 20:40:52 -05:00
Ben Liblit 7a198b0968 "@throws" with no other information is neither valid nor useful 2017-03-22 20:40:52 -05:00
Ben Liblit 17ee9c3f98 Fix assorted Javadoc typos, such as omitted "}" 2017-03-22 20:40:52 -05:00
Ben Liblit 323224504a Suppress several unfixable warnings about unresolved type references
Fixing these Javadoc comments would require adding packages to various
other packages' build paths.  In some of the cases suppressed,
changing build paths in that manner would create circular build
dependencies.  In other cases, it would simply add a Javadoc-motivated
dependency that does not exist for the real code, which seems
undesirable.  For a few cases, the reference seems to be to types in
code we don't even have here, such as code from "android" or
"org.mozilla" packages.
2017-03-22 20:40:52 -05:00
Ben Liblit 3b88836488 Fix broken type, field, and method references in Javadoc comments 2017-03-22 20:40:51 -05:00
Ben Liblit 0aad8739d9 Don't warn about Javadoc comments with non-visible references
These arise, for example, when Javadoc documentation on a public class
includes a @link to a private field.  I can see how this would be
problematic for closed-source Java code where private items are
invisible to outsiders.  However, given that WALA is open source,
nothing is truly non-visible.  If the WALA documentation authors
considered non-visible references useful when explaining things,
that's fine with me.

We don't turn this warning off in all projects.  Rather, we turn it
off only in projects that were producing at least one such warning.
In other words, if a project was already completely "clean" with
respect to this warning, then we leave this warning enabled for that
project.
2017-03-22 20:39:36 -05:00
Ben Liblit ea39ad647e Don't warn about Javadoc tags with missing descriptions
These changes turn off Eclipse warnings for Javadoc tags without
descriptions.  In some subprojects, we turn these off entirely.  In
others, leave on missing-descrption checks for "@return" tags only.

We don't turn this warning off in all projects.  Rather, we turn it
off only in projects that were producing at least one such warning.
In other words, if a project was already completely "clean" with
respect to this warning, then we leave this warning enabled for that
project.

Turning off these warnings is a partial declaration of Javadoc
bankruptcy.  In an ideal world, we would enable and fix all of these
warnings.  However, there are 576 of them.  Apparently the WALA team's
implicit coding style says that omitting descriptions is OK.  If
there's no intent to systematically add descriptions, then we may as
well turn off these warnings so that we can see other warnings that we
may want to fix.
2017-03-22 20:39:36 -05:00
Manu Sridharan f56ee9cd72 Merge pull request #153 from liblit/generalize-generic-types
Generalize a generic type parameter even more
2017-03-22 18:17:47 -07:00
Ben Liblit 9921fe37e6 Generalize a generic type parameter even more
As it turns out, I should have been using "? extends InstanceKey" rather
than "? super InstanceKey".  But really, we can just use "?" here since
HeapGraph itself constrains its own type parameter appropriately.
2017-03-22 16:15:41 -05:00
Manu Sridharan f7a3b98764 Merge pull request #152 from liblit/generalize-generic-types
Generalize a generic type
2017-03-22 13:32:23 -07:00
Julian Dolby dff76e1a82 Merge branch 'master' of https://github.com/wala/WALA 2017-03-22 15:43:03 -04:00
Ben Liblit 2a33cb3649 Generalize an over-constrained generic parameter
This fixes WALA bug #151, which was first introduced in commit fde6534.
2017-03-22 14:16:54 -05:00
Manu Sridharan 9b692e714f switch version to 1.4.1-SNAPSHOT 2017-03-21 09:38:36 -07:00
Manu Sridharan bfe378e7f2 1.4.0 release 2017-03-21 08:59:08 -07:00
Ben Liblit 934f8f524f Fix 11 Eclipse warnings about fields whose values are never used 2017-03-20 00:44:40 -05:00
Ben Liblit aaf66705e1 Fix 65 Eclipse warnings about unused exception parameters
In the cases addressed here, the caught exception was being "handled"
by throwing some new exception.  Instead of discarding the old
exception, pass it to the new exception's constructor to indicate the
original cause of the newly-created exception.  This practice, called
"exception chaining", can often be useful in debugging.
2017-03-20 00:44:39 -05:00
Ben Liblit 059810c1ca Fix 9 Eclipse warnings about unused methods
Note: some of these methods are decidedly nontrivial.  Perhaps they
should not actually be removed?  If any should be kept around, please
identify them to me.  I'll revise this change to retain those methods
and simply annotate them as needed to suppress Eclipse's warning.
2017-03-20 00:44:36 -05:00
Ben Liblit fe9f7a793a Suppress 157 Eclipse warnings about unused exception parameters
In the cases addressed here, the caught exception is truly not needed
by the handling code.
2017-03-20 00:44:06 -05:00
Ben Liblit 6766f1e261 Fix 42 Eclipse warnings about unused imports 2017-03-20 00:43:48 -05:00
Ben Liblit 64f7751a00 Merge branch 'warning-fixes-potential-programming-problems' 2017-03-19 23:35:12 -05:00
Julian Dolby eca53cd0c2 Merge branch 'master' of https://github.com/wala/WALA 2017-03-19 08:18:25 -04:00
Manu Sridharan a3f4c10c20 Merge pull request #150 from liblit/warning-fixes-potential-programming-problems
Resolve all Eclipse “Potential Programming Problem” warnings
2017-03-18 15:00:53 -07:00
Ben Liblit 421dcd4991 Change two "if" checks that can never be true into asserts
Eclipse warns that the "if" statements' true blocks are dead, and
indeed the conditions being tested here can never be true.  It's a
little subtle why that's so, though.  Changing them to "assert"
statements removes two warnings about deprecated code, while still
helping human readers understand what invariants must hold here.
2017-03-17 22:03:22 -05:00
Ben Liblit 296657a394 Suppress 88 Eclipse warnings about dead code
All of these involve conditionals that check some static, final debug
flag or debug level.  The code will indeed be dead if WALA is built
with those debug facilities turned off.  But we still want the code
present in case someone needs to turn some aspect of debugging on for
a while.
2017-03-17 21:49:34 -05:00
Ben Liblit dfa8f15dac Suppress two deprecation warnings about an internal CGNode API
The supposedly deprecated function (CGNode.addTarget) really seems to
be intended for internal use, not deprecated per se.  We are an
internal user here, so presumably it's OK for us to be using this API
entry point.
2017-03-17 21:18:36 -05: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
Manu Sridharan 811ce5257c Merge pull request #145 from ponder-lab/IAnalysisCacheView
Additional refactorings for IAnalysisCacheView.
2017-03-15 13:18:12 -07:00
Ben Liblit ab5aa90114 Suppress an Eclipse warning about unsafe varargs
Nothing we can do about this statically, due to Java limitations about
non-reifiable types.
2017-03-15 11:24:45 -05:00
Ben Liblit c382934933 Fix an Eclipse warning about an unchecked cast 2017-03-15 11:24:40 -05:00
Ben Liblit fde65340d2 Fix 132 Eclipse warnings about using raw generic types 2017-03-15 11:08:20 -05:00
Raffi Khatchadourian d95b6e33f0 Merge remote-tracking branch 'origin/master' into IAnalysisCacheView 2017-03-14 17:24:19 -04:00
Julian Dolby 7e3066b6cd bug 144 2017-03-14 10:05:18 -04:00
Raffi Khatchadourian 8fd41c148f Use IAnalysisCacheView instead of AnalysisCache.
It seems that some additional types need to be changed due to
d24519e974. This may not be inclusive,
however.
2017-03-13 16:27:05 -04:00
Julian Dolby a1dd19b8d0 Merge branch 'pull-request__android-bugfixes' of https://github.com/joana-team/WALA 2017-03-11 16:56:09 -05:00
Julian Dolby 605e7373ce Merge branch 'pull-request__exception-pruning-for-safe-array-creation' of https://github.com/joana-team/WALA 2017-03-11 16:38:03 -05:00
Julian Dolby db65c16863 Merge branch 'pull-request__typeannotations' of https://github.com/joana-team/WALA 2017-03-11 16:19:50 -05:00
Julian Dolby 2a4d24dc6f Merge branch 'pull-request__nullpointer-bugfixes' of https://github.com/joana-team/WALA 2017-03-11 14:48:13 -05:00
Julian Dolby f595eb357e add some abstraction to IR, using IRView 2017-03-11 13:22:45 -05:00
Julian Dolby a1f8894ba1 Merge branch 'master' of https://github.com/wala/WALA 2017-03-10 13:49:09 -05:00
Julian Dolby 0545060886 merge 2017-03-10 13:49:07 -05:00
Julian Dolby 016c3940e8 Merge branch 'pull-request__misc-bugfixes' of https://github.com/joana-team/WALA 2017-03-09 08:59:40 -05:00
Julian Dolby 0784a9da6a Merge pull request #124 from joana-team/slightly-more-informative-output
display which classes each handler catches when outputting IR
2017-03-09 08:51:06 -05:00
Julian Dolby 7b393a7da2 fix for missing Java 8 feature 2017-02-24 22:29:14 -05:00
Julian Dolby 96be295500 grr. commit -a does not find new files. 2017-02-02 20:46:34 -05:00
Julian Dolby b65517b958 forgot some files 2017-02-02 20:44:27 -05: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
Martin Mohr 64823846c0 get rid of HashCodeComparator and all its usages
This addresses both https://github.com/wala/WALA/issues/133 and
https://github.com/wala/WALA/issues/88
2017-01-26 14:16:48 +01:00
Julian Dolby 2396d0fad3 Revert "Revert "fixes to getting source positions from JVML""
This reverts commit 619df0a83d.
2017-01-19 19:12:22 -05:00
Julian Dolby 619df0a83d Revert "fixes to getting source positions from JVML"
This reverts commit 9e35099326.
2017-01-19 18:49:02 -05:00
Julian Dolby 9e35099326 fixes to getting source positions from JVML
CAst rewriter abstraction
2017-01-19 17:52:42 -05:00
Julian Dolby 74cc8454e3 make more of WALA run on TeaVM 2017-01-17 13:14:56 -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
Julian Dolby 37989efb6a adapt to teavm changes 2017-01-03 21:06:21 -05:00
Manu Sridharan f42ad7aea6 Fix #127
Check that we only loop over the parameters actually being passed at
the call site in the SDG construction.
2017-01-02 15:36:38 -08:00
Martin Mohr b9fb5e0481 display which classes each handler catches when outputting IR 2016-12-09 16:49:56 +01:00
Martin Mohr 4228bac5ff If we see a call to an unknown method, conservatively add edges to all catch handlers
This is an attempt to fix issue #123
2016-12-09 16:46:01 +01:00
Martin Hecker d5dee55918 correctly prune safe array creation for multi-dimensional array creation 2016-12-07 19:27:59 +01:00
Martin Mohr f7299b003b fix compilation problems caused by merge 2016-12-07 17:56:59 +01:00
Martin Hecker 64c4034dca fix: properly propagate NullPointerState along phi nodes in the NullPointerExceptionAnalysis 2016-12-07 17:56:59 +01:00
Martin Hecker edf4f8ed6f Attempt to fix intraprocedural Nullpointer analysis by respecting phi nodes, and correctly initializing entry variables.
Since  SSAPhiInstructions are never visited by NullPointerTransferFunctionProvider.TransferFunctionSSAVisitor,
we now respect phi instructions present at a given block by providing additional NodeTransferFunctions, improving precision.

Formerly, meets would lead to incorrect results due to incorrect initialization of initial data flow facts.

These are now properly initialized, interpreting
  "State.BOTH" to mean: both "null" and "non-null" are possible values for the given variable, and
  "State.UNKNOWN" to be the absurd assertion.

The initial fact at the entry block assumes variables to be BOTH, other blocks are initialy assumed unreachable and hence their variables to be UNKNOWN.
2016-12-07 17:56:48 +01:00
Martin Mohr 5624ad78fa really turn off short circuit optimization
The setting should comply with the comment. Plus,
turning it on seems to lead to some unsoundness because
exception points-to sets become empty but should not be
2016-12-07 16:11:19 +01:00
Martin Hecker 867a8ecf2b When creating TypeAnnotations with LocalVarTarget, somewhat deal with class files that lack a LocalVariableTable 2016-12-05 18:52:38 +01:00
Martin Hecker de0f9c2a1f WALA: Provide acces to JSR 308 Annotations via new Class TypeAnnotation.
Access is provided via corresponding methods in FieldImpl, ShrikeCTMethod and ShrikeClass.
Since we do not currently have implementation of these methods for front-ends other than Shrike, these new methods are not yet made available in the corresponding interfaces.
2016-12-05 18:52:38 +01:00
Martin Hecker 8e773fcf88 in order to look up instruction-indices from a bytecode-indices, do a binary search on the existing pcMap array (as suggested by Julian Dolby).
also see https://sourceforge.net/p/wala/mailman/message/35518796/ and answers.
2016-12-05 18:52:37 +01:00
Martin Mohr dff20ac49c make JarStreamModule inherit the assumptions of JarInputStream's constructor 2016-12-05 18:50:21 +01:00
Martin Mohr c00d9ec7af avoid NPE while constructing debug message 2016-12-05 18:23:55 +01:00
Martin Mohr 3283de6c44 promote visibility of some handy but harmless methods 2016-12-05 18:23:55 +01:00
Martin Mohr d830780242 slight fix of type parameter handling in PDG 2016-12-05 18:22:38 +01:00
Martin Mohr 4a7efc8c78 array creation is also safe if length comes from another array's length 2016-12-05 18:21:05 +01:00
Martin Mohr 13a7b5459e prune exceptions for array creations of constant, non-negative size 2016-12-05 18:21:05 +01:00
Martin Mohr f989290ca6 provide list of exceptions for array creation sites with non-negative size 2016-12-05 18:21:05 +01:00
Ben Liblit 18b79bf0f9 Merge branch 'master' into warning-fixes-xml-validation 2016-11-29 10:08:00 -06:00
Ben Liblit 48e158f87e Add stub DOCTYPE declarations for various hand-authored XML files
Some of these might have proper DTDs or XML Schema definitions
floating around somewhere that we could use.  Presumably many do not.
Rather than hand-craft such definitions myself, I'm just giving each a
minimal stub DOCTYPE declaration.  That's enough to satisfy Eclipse's
XML validator, which otherwise complains that these files lack grammar
constraints.
2016-11-28 14:55:34 -06:00
Ben Liblit 3b1547f0a7 Exclude Maven-generated (?) files from XML validation
I think the "target/p2artifacts.xml" and "target/p2content.xml" files
are generated by Maven.  They are well-formed XML but Eclipse's XML
validator legitimately warns that they lack grammar constraints.
Since we're not maintaining the tool that creates these files, we are
not in a position to do anything about that.  Therefore, we may as
well exclude these from validation entirely.  That way we can
more-clearly recognize warnings that we *can* do something about.
2016-11-28 14:55:25 -06:00
Ben Liblit 80e8ea3c4e Add stub DOCTYPE declarations for Ant build scripts
Ant "build.xml" files don't have a standard DTD or XML Schema; the
contents are simply too flexible for that.  But we can at least
give each a stub DOCTYPE declaration.  That's enough to satisfy
Eclipse's XML validator, which otherwise complains that these files
lack grammar constraints.
2016-11-28 12:50:56 -06:00
Ben Liblit ed0ddd780f Correct HTML embedded in Javadoc comments
Most of the invalid HTML arose from bare "<" and ">" characters.
These should be escaped as "&lt;" and "&gt;" when not intended to
introduce HTML tags.  When you have many such characters close
together, "{@literal ...}" is a nice, readable alternative that
automatically escapes its contents.  If the text in question is
intended to be a code fragment, then "{@code ...}"  is appropriate:
this is essentially equivalent to "<code>{@literal ...}</code>".

There were a few other HTML violations too, but none common enough to
be worth detailing here.
2016-11-28 11:14:41 -06:00
Ben Liblit e35b205bc2 Fix numerous unescaped "<" and ">" in Javadoc @author tags
The contents of @author go straight into HTML, just like most other
Javadoc material.  So if you want to have a "<foo@bar.com>" e-mail
address as part of the author information, the angle brackets must be
escaped.  Here I've opted to do that using "{@code <foo@bar.com>}",
which has some additional styling effects that seem appropriate for
e-mail addresses.  We could also have used "&lt;foo@bar.com&gt;" for
escaping without code styling.
2016-11-27 21:24:03 -06:00
Ben Liblit 2a5503b9aa Exclude Maven-generated HTML pages from validation
Eclipse validation warns about invalid HTML content in all
Maven-generated "target/site/dependency-convergence.html" files.  The
warnings are legitimate: these HTML files are indeed invalid.
However, we don't maintain the tool that generates these files, so we
are not in a position to fix them.  Better, therefore, to suppress
these warnings so that we can notice and fix other problems over which
we do have control.
2016-11-27 21:24:03 -06:00
Julian Dolby 166af27427 clean up types 2016-11-22 10:35:56 +08:00
Julian Dolby 8855f80c97 allow notion od edge labels to be overridden in the CDG 2016-09-26 19:42:19 -04:00
Julian Dolby f3b5d41af9 refactor CFG to separate instructions from CFGs; this is to allow code like CDGs to be reused without an IR. 2016-09-26 13:37:51 -04:00
Manu Sridharan 1a7c527dbe Remove unused conditionals 2016-09-20 14:04:03 -07:00
Manu Sridharan e4101510a2 Add IExplodedBasicBlock.getOriginalNumber()
This method is useful when reasoning about SSAPiStatements, as their
successor block number refers to original basic blocks, not exploded
blocks.
2016-09-20 13:50:43 -07:00
Manu Sridharan 2c9eec0cff Update callback APIs to expose path edge structure 2016-09-20 13:50:42 -07:00
Manu Sridharan 57198a22f3 Remove trailing whitespace; no functional change 2016-09-20 13:50:42 -07:00
Manu Sridharan b761e3871b Add new callbacks for tracking exploded supergraph
A subclass of TabulationSolver can now override the methods
newNormalExplodedEdge(), newCallExplodedEdge(), and
newReturnExplodedEdge() to take some action whenever (logically)
some edge in the exploded supergraph is "discovered" during
tabulation.
2016-09-20 13:50:42 -07:00
Julian Dolby 3156f03145 more CPA work 2016-09-19 13:51:18 -04:00
Julian Dolby 8b2ab22335 support for full CPA, when desired. 2016-09-15 21:32:35 -04:00
Julian Dolby 5eb1c7bc1d HybriDroid support 2016-09-15 21:14:34 -04:00
Julian Dolby 30bc2858c4 fix for slicer issue in javascript 2016-08-23 20:59:08 -04: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
Manu Sridharan d0fdd2cdf0 Remove incorrect methods from ICFGSupergraph
These methods were constructing an IR based on some default
AnalysisOptions, which may not match the options used when constructing
the underlying CallGraph.  This mismatch can lead to bad bugs.
Instead of these methods, analyses should get IR directory from the
CGNodes via CGNode.getIR().

Ideally we would fix the methods and not change the interface, but
that would require knowing the right AnalysisOptions, which itself
would necessitate an interface change.
2016-08-11 11:24:50 -07:00
Manu Sridharan 315d836d18 Fix building jars with JDK 7 2016-07-22 14:46:35 -07:00
Manu Sridharan 373a4d8aa4 Update Maven Central files to allow building under Java 8 2016-07-22 12:32:51 -07:00
Manu Sridharan 5e51615222 Fix some generic type warnings 2016-07-21 16:57:38 -07:00
Manu Sridharan 63eb5ade55 Also add lib/ directory contents to Maven jar 2016-07-20 12:25:47 -07:00
Julian Dolby 73747cbb86 fixes for work with ECJ 2016-07-05 19:37:36 -04:00
Julian Dolby 22ce3d1144 Merge https://github.com/steohan/WALA 2016-06-29 13:03:50 -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 065a3ff767 pruned call graph takes edges as well as nodes 2016-06-06 14:17:12 -04:00
Manu Sridharan 330692ad0e Include files from dat directory in jar 2016-05-25 11:51:50 +02:00
Manu Sridharan cd560b3b2b switch version to 1.3.10-SNAPSHOT 2016-05-10 22:53:28 +09:00
Manu Sridharan 158a5deeb0 Version 1.3.9 2016-05-10 21:59:26 +09:00
Julian Dolby e87b2e5d84 fixes for slicing of field-based CGs 2016-02-14 17:18:21 -05:00
Julian Dolby 57a8c7d019 Merge branch 'master' of https://github.com/wala/WALA 2016-02-11 12:09:50 -05:00
Julian Dolby eb7748a745 fixes for slicing of graphs built with the field-based builder 2016-02-11 11:51:39 -05:00
steohan 715b1e86fe Merge pull request #1 from wala/master
Pull from Wala
2016-01-13 02:23:04 +01:00
Stephan Gocht 2869af24df Bugfixes, code and documentation improvements. 2016-01-13 02:07:11 +01:00
Stephan Gocht b75d93cb1c Changed pi policy to only create pi nodes for integer variables. 2016-01-08 14:10:55 +01:00
Stephan Gocht 448c8c5f86 Missing Files for last commit. 2015-12-20 19:35:00 +01:00
Stephan Gocht c3b7f9ffb3 Documentation and Refactoring. 2015-12-20 19:34:40 +01:00
Stephan Gocht 467707701f Added InstructionByIindexMap, to make sureinstructions are identified by
iindex in hash and equals only.
2015-12-20 13:35:51 +01:00
Manu Sridharan e95663e24a Be more robust to broken java_runtime_dir
If java_runtime_dir in wala.properties is invalid, fall back to the
boot class path instead of just failing.
2015-12-16 10:56:09 -08:00
Julian Dolby 46a483f320 language changes 2015-12-15 19:33:59 -05:00
Julian Dolby dc552316b9 language changes 2015-12-15 19:31:04 -05:00
Manu Sridharan 2f47ffa02b Clarify a comment 2015-12-11 15:50:25 -08:00
Julian Dolby 1936ccd94f changes for language work 2015-12-10 06:59:05 -05:00
Stephan Gocht fd0d06df5d Added correct handling for this pointer in member methods. 2015-11-30 23:03:28 +01:00
Stephan Gocht bed18b792c Extended exceptionan anlysis with exception filter. 2015-11-30 23:02:40 +01:00
Stephan Gocht 77b1ed71c7 Generalized Type. 2015-11-26 11:03:26 +01:00
Stephan Gocht 79883b3def Completed implementation of basic functionality. 2015-11-25 17:05:51 +01:00
Stephan Gocht c5c4799b35 Added minimalistic implementation of an exceptio analyisis. (Not fully
functional yet.)
2015-11-20 21:19:41 +01:00
Stephan Gocht 3acd97ebfb Fixed assertion fault, in case of multidimensional arrays. 2015-11-15 21:05:39 +01:00
Julian Dolby 2b2543cfbb fixed bugs with switch bytecodes in Dalvik.
ignore exceptions in callgraph construction when they are ignored in
bytecode from Dalvik.
2015-11-13 19:25:23 -05:00
Stephan Gocht dfaa44d111 Added quicksort example, and made larger change as it wasn't as expected
first. This change should improve the results of the analysis.
2015-11-06 18:52:11 +01:00
Stephan Gocht 381cf2d2f1 Fixed a bug, which allowed only usage of phi notes with exactly 2 uses.
(There may be more than 2 uses in a phi note.)
2015-10-26 00:50:01 +01:00
Stephan Gocht 7d7e236fd6 Added test for exception pruning (including example for usage). 2015-10-23 14:56:33 +02:00
Stephan Gocht 65fcc2d5da Fixed a bug causing crash. 2015-10-23 14:55:39 +02:00
Stephan Gocht ec4f5e506a Removed unnecessary generic. 2015-10-23 14:54:49 +02:00
Stephan Gocht 7238f6d1ed Fixed a bug, which was introduced in the previous commit. (Resulted in
infinite recursion.)
2015-10-23 09:48:20 +02:00
Stephan Gocht f8cae1b509 Added Tests and Testdata for array bounds analysis. 2015-10-19 23:20:36 +02:00
Stephan Gocht e85816a986 Fixed getPis method. 2015-10-19 23:15:40 +02:00
Stephan Gocht 4e073e9afe Added new PiPolicy to add pis for all variables used in a conditional
branch.
2015-10-19 23:15:21 +02:00
Stephan Gocht 58dd111203 Added classes for exception pruning and adapter for null pointer and
array out of bounds analysis.
2015-10-12 19:52:29 +02:00
Stephan Gocht 9024f19bf6 Added an array out of bounds analysis. 2015-10-12 19:51:14 +02:00
Stephan Gocht f78ef5bcbb Added new class for simpler access to intraprocedural null pointer
analysis.
2015-10-12 19:39:06 +02:00
Stephan Gocht b32f798ae1 Modified files from earlyer change [1], so no format changes are done.
[1] 52ea4af62c
2015-10-11 19:25:05 +02:00
Manu Sridharan e46bb81081 Update version to 1.3.9-SNAPSHOT 2015-10-09 12:55:49 -07:00
Manu Sridharan ed5093d6db Properly update version to 1.3.8
Other changes were accidentally committed last time.
2015-10-09 11:06:03 -07:00
Manu Sridharan 077cabc4eb Revert "update version to 1.3.8"
This reverts commit 4aac703ee5.
2015-10-09 11:03:46 -07:00
Manu Sridharan 4aac703ee5 update version to 1.3.8 2015-10-09 10:45:57 -07:00
Julian Dolby 45af0414b7 more attempts to placate annoying ibm jvm 2015-09-18 21:48:13 -04:00
Julian Dolby 13de4a3bd1 add support for generic signatures 2015-09-16 13:23:21 -04:00