Commit Graph

5051 Commits

Author SHA1 Message Date
Ben Liblit 9c81cae9be Externalize bundle names and vendors
This fixes 33 Eclipse "The value for attribute '...' is not
externalized.  The value must begin with %" warnings in the "Plug-in
Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 3b9cd9838a JUnit @Test methods must not be static 2017-06-07 08:29:23 -07:00
Ben Liblit 8cc4daf6a0 Access static fields directly via the classes that declare them
Previously some of these were accessing such fields through a subclass
of the declaring class.  That creates an unnecessary extra inter-class
dependency lower in the type hierarchy than necessary.

Also, suppress this warning in an automated test input where the
indirect static accesses are explicitly intentional.
2017-06-07 08:29:23 -07:00
Ben Liblit 38c11f0fa6 Don't warn about intentional indirect access to static methods
This test code is intentionally crafted to use instances to access
static methods.  Eclipse's recommendation to access those methods
directly is, therefore, counterproductive.
2017-06-07 08:29:23 -07:00
Ben Liblit 237b49a425 Declare two public methods of a final class static
These methods access only static members.  They are methods of a final
class, which means no subclass can ever override these methods and use
dynamic dispatch to choose the implementation at run time.  So
declaring these methods static is (statically) safe.
2017-06-07 08:29:23 -07:00
Ben Liblit aa39fc63d5 Declare a protected final method static
The method itself accesses only static members.  The fact that it is
final means no subclass can ever override this method and use dynamic
dispatch to choose the implementation at run time.  So declaring this
method static is (statically) safe.
2017-06-07 08:29:23 -07:00
Ben Liblit 72c754e874 Declare private methods static wherever possible
If a method is private, there's no risk that a subclass elsewhere
might be overriding it and depending on dynamic dispatch to choose the
right implementation.  So all of these private methods can safely be
declared static without risk of regression in either WALA code or
unseen third-party code.
2017-06-07 08:29:23 -07:00
Ben Liblit e1d2fa9850 Suppress Eclipse warnings about potentially-static methods
The "potentially" qualifier is here because these methods are visible
outside the WALA source tree.  These methods may seem OK to be static
based on the code we have here, but we have no way of knowing whether
third-party code expected to be able to subclass and override.  I'm
going to play it safe and assume that we want to allow that.

Note that we are still allowing Eclipse warnings about methods that
can *definitely* be declared static; a different configuration option
controls these.  For private methods, final methods, and methods in
final classes, if the code seems static-safe based on what we have
here, then that's good enough: we don't need to worry about
third-party overrides.
2017-06-07 08:29:23 -07:00
Caius Brindescu 404a17c9cc When converting JDT AST to IR, a do-while loop in a case statement will throw NPE (#186)
* Fixed bug for source analysis

Do while in case statement would throw an NPE. Now it doesn't

* Added test case

The test will fail with an NPE if the fix is not applied.
2017-06-07 08:27:23 -07: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 24fb1f6d10 Suppress unused-local-variable warnings in test inputs
Test code can do many things we'd consider bad style in real
application code, including defining local variables that are never
subsequently used.
2017-05-26 14:25:03 -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
Ben Liblit 08b6d8dd68 Discard results of BufferedInputStream.read() calls
Previously we were saving these return values into local variables
that were never checked or used in any way.  So effectively we were
already discarding these results anyway, but in a manner that produced
Eclipse warnings about unused local variables.
2017-05-26 14:25:03 -07:00
Ben Liblit 966bc5b3e3 Remove AnalysisCache.getIR() calls whose results are unused
I'm grouping these together in a single commit in case these calls are
actually wanted for side effects.
2017-05-26 14:25:03 -07:00
Ben Liblit 2e503a17a2 Remove ClassHierarchy.resolveMethod() calls whose results are unused
I'm grouping these together in a single commit in case these calls are
actually wanted for side effects.
2017-05-26 14:25:03 -07:00
Ben Liblit 214e0caa86 Suppress Eclipse warnings about unused allocations
In each of these cases, the constructor directly or indirectly has
side effects that we want to keep, even if the object itself is not
retained and used by eht code that invokes `new`.
2017-05-26 14:25:03 -07:00
Ben Liblit 97bf43c0b9 Fix Eclipse warnings about unused method parameters 2017-05-26 14:25:03 -07:00
Manu Sridharan 9585aaf0a2 make overriding method public 2017-05-24 14:43:00 -07:00
Manu Sridharan 11ff511d61 Add API for passing an IProgressMonitor into the slicer 2017-05-24 14:38:30 -07:00
Manu Sridharan 05eb665526 make DotUtil.dotOutput method public 2017-05-24 14:30:32 -07:00
Ben Liblit 1bebbeb8e9 Simplify management of virtual frame buffer X server (#181)
Using the `xvfb-run` script gives us automatic lifetime management for
the virtual X server: it will start before the `mvn` test script and
will terminate when that test script exits.  The `xvfb-run` script
also sets `$DISPLAY` properly in the `mvn` test script, so we no
longer need to manage that setting ourselves.
2017-05-15 09:02:52 -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
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
Ben Liblit ae7b365493 Suppress a few Eclipse code style warnings that are not WALA style (#177)
* 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".

* Turn off Eclipse warnings about undocumented empty blocks

The presence of 65 such warnings in two packages suggests that the de
facto WALA coding style does not mandate documenting empty blocks.
Better to avoid printing warnings that will be routinely ignored, so
that other important warnings are more likely to be noticed.

* Turn off Eclipse warnings about synthetic accessor methods

Synthetic accessor methods allow access to otherwise inaccessible
members of enclosing types.  The presence of 246 such warnings in
three packages suggests that the de facto WALA coding style does not
consider synthetic accessor methods to be problematic.  Better to
avoid printing warnings that will be routinely ignored, so that other
important warnings are more likely to be noticed.
2017-05-07 22:57:24 -07: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
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 32bb5e617b Revert "remove almost-obsolete 1.4 source and target levels for building JLex"
This reverts commit 34601814e1.
2017-04-18 21:42:50 -07:00
Manu Sridharan c303d4547a Add <resource> tag so dat/ directory is included in jar 2017-04-18 21:22:28 -07:00
Manu Sridharan 34601814e1 remove almost-obsolete 1.4 source and target levels for building JLex 2017-04-18 20:42:38 -07:00
Manu Sridharan 88bd0c01cd more aggressive exclusions 2017-04-16 21:30:44 -07:00
Manu Sridharan 6bf0108964 actually add an assertion 2017-04-16 20:45:14 -07:00
Manu Sridharan ed4b0e45ee add test case for mailing list issue 2017-04-16 20:40:41 -07:00
Manu Sridharan 0c424e12b3 Fix #164 2017-04-16 18:23:56 -07:00
Manu Sridharan 5ecbba95ff disable appveyor for now 2017-04-13 22:06:35 -07:00
Manu Sridharan 0c333ab1ce try disabling test on Appveyor 2017-04-13 21:16:22 -07:00
Manu Sridharan 8ed483bee3 add null guard 2017-04-13 20:57:35 -07:00
Manu Sridharan bcb7dc2595 fix up manifest 2017-04-13 20:32:23 -07:00
Manu Sridharan bec0387850 Attempt to fix weird Windows bug with TemporaryFile
Also remove the walaUtil.jar output, which no one uses
2017-04-13 20:19:31 -07:00
Manu Sridharan 52c7a4b649 remove explicit MacOS dependency 2017-04-13 18:51:33 -07:00
Manu Sridharan 4691e3a0bf try out appveyor 2017-04-13 18:44:06 -07: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
Manu Sridharan c1b33fcab0 Merge pull request #162 from liblit/warning-fixes-type-safety-and-raw-types
Fix or disable Eclipse warnings about type safety and raw types
2017-04-06 16:19:11 -07:00
Manu Sridharan 7c5241c50b Merge pull request #161 from liblit/warning-fixes-unnecessary-code
Fix, suppress, or disable assorted Eclipse warnings about unnecessary code
2017-04-06 16:18:22 -07:00
Manu Sridharan dc0709084f Merge pull request #160 from liblit/warning-fixes-restricted-api
Suppress 14 Eclipse warnings about discouraged access to restricted APIs
2017-04-06 16:17:19 -07:00