Commit Graph

2385 Commits

Author SHA1 Message Date
Ben Liblit 559c577093 Treat diagnostics about unchecked type operations as errors 2017-08-28 11:55:56 -07:00
Raffi Khatchadourian a49bcf5aa1 Add missing void type. 2017-08-27 11:07:22 -07:00
Ben Liblit 2d641251fb Enforce Eclipse resource leak diagnostics more strongly
In Eclipse projects that currently have no definite or potential
resource leaks, treat any such diagnostics as errors in the future.

In `com.ibm.wala.core`, enable warnings about definite or potential
resource leaks.  Previously these diagnostics were turned off entirely
in this project.  So we actually end up with more warnings now than we
had before, but they are all warnings we should eventually look into.
2017-08-27 11:03:14 -07:00
Ben Liblit eaf1c0af85 Plug a `JarFile` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 3825c03b16 Plug a `JarInputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 4cb4273ff9 Plug a `JarInputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 6ebbb834b9 Plug an `InputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 9c79c7ef9b Plug an `InputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 4378fbbc12 Plug an `InputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 5751c949e8 Plug an `InputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit 8541d67a14 Plug a `BufferedInputStream` resource leak 2017-08-27 11:03:14 -07:00
Julian Dolby b6af5267f1 java 8 changes
minor fixes, such as making CheckForFrontEndErrors more accessible
minor hacks to make stuff compile with TeaVM
2017-08-25 10:58:00 -04:00
Julian Dolby 2d829a339e Merge branch 'master' of https://github.com/wala/WALA 2017-08-22 18:05:59 -04:00
Raffi Khatchadourian 68f30f949d Minor performance improvements to methods in TypeInference class (#230)
* Only get the variable once.

* Only get symbol table if it is needed.
2017-08-21 09:59:15 -07:00
Julian Dolby 6a17898b71 Merge branch 'master' of https://github.com/wala/WALA 2017-08-17 20:06:38 -04:00
Raffi Khatchadourian 72053efd26 Return Java 8 default methods from getAllMethods()
Fixes #219 
Fixes #220
2017-08-17 14:45:49 -07:00
Julian Dolby e599d58cd7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-16 14:50:12 -04:00
Julian Dolby 3371e23de0 java 8 stuff 2017-08-16 14:50:01 -04:00
Ben Liblit b70d69d62f Treat many Eclipse plugin-related problems as errors
These are all problems that Eclipse can detect, but that it detects no
instances of right now.  Treating these as warnings instead of errors
should help prevent us from slipping backward in the future.
2017-08-16 11:36:46 -07:00
Julian Dolby 4a33c527d2 Merge branch 'master' of https://github.com/wala/WALA 2017-08-15 18:01:41 -04:00
Ben Liblit d73b11fd8f Escalate switch-related diagnostics from warnings to errors
We have fixed all of these that Eclipse reports.  Treating them as
errors in the future should help us keep moving in the direction of
cleaner code.
2017-08-15 14:55:34 -07:00
Ben Liblit da5f925cab Be explicit when the proper default for a switch is to do nothing
Of course, doing nothing isn't always the right behavior.  Sometimes a
previously-unhandled value is truly unexpected and one should fail by
throwing an exception.  It may not always be clear whether an
exception or doing nothing is the right choice.  For some `switch`
statements affected by this commit, I initially guessed that throwing
an exception was the right default behavior, but was proven wrong when
doing so caused WALA regression test failures.  That's strong evidence
that the unmatched values were not really unexpected, but merely
should have been handled by doing nothing as before.
2017-08-15 14:55:34 -07:00
Ben Liblit ab791f8c41 Throw a loud exception if switch encounters unexpected enum value
Previously each of these `switch` statements would implicitly do
nothing if an unanticipated `enum` value came along.  My impression is
that each of these `switch` statements is supposed to be exhaustive,
such that an unexpected (unhandled) value should never appear.  If one
does, we should recognize it and complain loudly.

Of course, sometimes the right behavior for previously-unhandled
values is to do nothing.  It may not always be clear whether an
exception or doing nothing is the right choice.  For this commit,
WALA's regression tests still pass even with the possibility of
throwing an exception for unexpected values.  If we assume that the
test suite is thorough, that tells me that throwing an exception is
the right policy for each `switch` statement that I'm changing here.
2017-08-15 14:55:34 -07:00
Julian Dolby a92b881c22 Merge branch 'master' of https://github.com/wala/WALA 2017-08-15 12:39:27 -04:00
Julian Dolby 6431cbeb60 java 8 2017-08-15 12:39:19 -04:00
Ben Liblit 11b636f764 Suppress some unchecked-cast warnings we cannot avoid
Type erasure makes me sad.
2017-08-15 09:16:59 -07:00
Ben Liblit ba84b5a403 Fix warning about unchecked cast to generic by being less specific
Casting to `Foo<Bar>` results in an unchecked-cast warning due to Java
generics type erasure.  However, sometimes we don't really need a
`Foo<Bar>`, but could simply use any `Foo<?>`.  Casting to the latter
creates no warning.
2017-08-15 09:16:59 -07:00
Ben Liblit bb6be21e2d Fix remaining "unlikely argument type" warnings from Eclipse Oxygen
Each of these required careful consideration of what the original
developer *intended* as distinguished from what the developer's code
actually *does*.  I believe I got each one right, and WALA's
regression tests agree.  A second opinion by a core WALA developer
would be welcome, though.
2017-08-15 09:16:14 -07: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
Julian Dolby ecdb599674 support for deodexing methods read from Dalvik, using support in dexlib2 2017-08-08 06:34:48 -04:00
Julian Dolby 15f54f0248 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 10:30:32 -04:00
Manu Sridharan e8bdf2f8f9 version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
Julian Dolby 69929b4985 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 08:06:02 -04:00
Manu Sridharan d901b13425 version 1.4.3 2017-08-05 20:52:32 -07:00
Julian Dolby b9b498bd17 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:10:28 -04:00
Julian Dolby eaba8d59b7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:09:34 -04:00
Manu Sridharan 73063628de cache call targets in CHACallGraph (#213)
This is a simple optimization that helps performance a lot.
2017-08-05 14:07:27 -07:00
Ben Liblit d6ce679a72 Add static private serialVersionUID fields to Serializable classes
We already have plenty of examples of Serializable classes with this
field, and the vast majority of those fields have generated IDs rather
than "1L".  From this I infer that using proper serialVersionUID
fields is considered appropriate WALA coding style.
2017-08-05 13:30:35 -07:00
Ben Liblit 678e3e64a6 Fix all Eclipse warnings about unused local variables
Also report unused variables as errors in the future, not just
warnings.  We've fixed all of these as of right now, so let's keep it
clean in the future too.
2017-08-05 13:29:50 -07:00
Ben Liblit 321b28f149 Remove some unnecessary warning suppressions
One such annotation was unnecessary because the thing it was
suppressing no longer happens.  Any future unnecessary warning
suppressions of this kind will now be treated as errors.

The other annotations were unnecessary because the corresponding
warnings have been disabled entirely in the Eclipse projects'
configurations.  There seems to be no way to tell Eclipse to treat
these as anything other than "info" diagnostics in the future, so
that's how they will remain.
2017-08-05 13:29:50 -07:00
Julian Dolby 1d144db6d5 Merge branch 'master' of https://github.com/wala/WALA 2017-08-02 12:27:22 -04:00
Julian Dolby 2b55088213 merge 2017-08-01 10:19:52 -04:00
Ben Liblit f7dc0a06de Treat unused parameters as errors, not merely warnings
We've fixed or suppressed all such warnings, except in projects
containing test inputs.  Let's make sure no more appear in the future.
2017-07-31 15:29:00 -07:00
Ben Liblit 6087b73cee Fix or suppress all 242 Eclipse warnings about unused parameters
In general, my approach was to try to eliminate each unused parameter
using Eclipse's "Change Method Signature" refactoring.  That did not
always succeed: a parameter may be unused in some base class method,
but then be used in subclass's override of that method.  In cases
where refactoring to eliminate a parameter failed, I instead annotated
the parameter with '@SuppressWarnings("unused")' to silence the
warning.

Note: this group of changes creates a significant risk of
incompatibility for third-party WALA code.  Some removed parameters
change externally-visible APIs.  Furthermore, these changes do not
necessarily lead to Java compilation errors.  For example, suppose
third-party code subclasses a WALA class or interface, overrides a
method, but does not annotate that method as @Override.  Removing a
parameter means that the third-party method no longer overrides.  This
can quietly change code behavior without compile-time errors or
warnings.  This is exactly why one should use @Override wherever
possible, but we cannot guarantee that third-party WALA users have
done that.
2017-07-31 15:29:00 -07:00
Ben Liblit c65943add1 Enable Eclipse warnings about unused parameters in more projects 2017-07-31 15:29:00 -07:00
Julian Dolby 9dda017450 Merge branch 'master' of https://github.com/wala/WALA 2017-07-28 13:42:45 -04: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
Julian Dolby 12e736b36f Merge branch 'master' of https://github.com/wala/WALA 2017-07-15 14:01:51 -04:00
Ben Liblit a888a49fdd Fix all Eclipse warnings about unnecessary semicolons
I have *not* upgraded this problem to be treated as an error in the
future.  Unfortunately Eclipse uses a single configuration setting for
both unnecessary semicolons and also for empty control-flow statements
like `while (p) ;`.  I'm not convinced that it's worth rewriting all
instances of the latter into `while (p) { }`.  So this is just going
to stay as a warning for now.
2017-07-14 22:39:01 -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 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