Commit Graph

123 Commits

Author SHA1 Message Date
Julian Dolby e4f62978cb comment out non-working test; it seems to look at a URL that no longer
works
2018-09-11 13:39:06 -04:00
Ben Liblit 0512241027 Use the proper JUnit mechanism for conditionally skipping tests
These are slow tests that we were already effectively turning into
no-ops when running on Travis CI.  By skipping them using the proper
JUnit mechanism, these tests will show up as ignored or skipped in
test outcome reports.  That's better than having them show up as
passing, when we really don't know whether they would have passed or
failed.
2018-03-05 11:22:49 -08:00
Julian Dolby c8cdaf8616 further refactoring to enable more reuse
eliminate all non-jva 8 compilation
2018-02-05 15:18:37 -08:00
Julian Dolby cd944a8f12 refactoring of CAst front end machinery to allow more reuse 2018-01-25 14:42:27 -05:00
Ben Liblit 74e0640771 Replace simple lambdas with method references wherever possible 2017-11-27 11:31:15 -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
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 1d144db6d5 Merge branch 'master' of https://github.com/wala/WALA 2017-08-02 12:27:22 -04: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
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 163e10f5e4 Merge branch 'warning-fixes-plug-in-development-misc' of https://github.com/liblit/WALA 2017-06-22 09:27:47 +02: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 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
Julian Dolby fc7c7ec5d1 merge 2017-05-26 19:01:59 -04: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
Julian Dolby 0bd59c95b6 merge 2017-05-07 19:51:30 -04:00
Julian Dolby eca53cd0c2 Merge branch 'master' of https://github.com/wala/WALA 2017-03-19 08:18:25 -04:00
Ben Liblit 53f99a359b Update expected exception when test assertions fail
We used to use junit.framework.Assert for test assertions, and that
class reports failures by throwing
junit.framework.AssertionFailedError.  However, junit.framework.Assert
is obsoleted by org.junit.Assert, and we've already replaced the
former with the latter.  org.junit.Assert reports failures by throwing
java.lang.AssertionError, so that's what we need to expect in our
testing infrastructure.
2017-03-17 21:52:47 -05:00
Ben Liblit 7cbbeb1d81 Fix 92 deprecation warnings
All of these fixes involve replacing junit.framework.Assert with
org.junit.Assert for JUnit 4.x and later.
2017-03-17 21:18:26 -05:00
Julian Dolby 6cdeedd5e9 changes for analysis cache view 2017-03-15 22:06:19 -04:00
Julian Dolby f595eb357e add some abstraction to IR, using IRView 2017-03-11 13:22:45 -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
Julian Dolby c9b1006305 changes for allowing seq. and conc. CHAs 2017-01-12 16:34:54 -05:00
Julian Dolby 3156f03145 more CPA work 2016-09-19 13:51:18 -04:00
Julian Dolby c7971cb969 ajaxslt 0.8.1 2016-09-16 20:23:51 -04:00
Julian Dolby 0475e2e712 need to find new version failing to download 2016-09-16 08:59:14 -04:00
Julian Dolby ab22d9abb0 enable specialization of source extractor for Web pages 2015-11-30 21:28:40 -05:00
Julian Dolby 031ff4e121 use usual test naming convention 2015-11-11 20:55:16 -05:00
Julian Dolby ab16d9bc04 fixes for weird cases with control flow in finally blocks.
code fixes and test that used to crash.
2015-11-11 12:03:08 -05:00
Julian Dolby 5da3cd7df7 hybrid example 2015-04-05 23:02:20 -04:00
Julian Dolby 43c37d6d0e fixes to regression tests:
now, for me, code works using e44 with maven
  dalvik tests refactored for mobile version with android dev tools
  IDE tests Eclipse metadata fixed to make e44 work for me
  new android entrypoint to fix failure in new droidbench tests
2015-03-24 21:51:35 -04:00
Julian Dolby 5cc870dd77 fixes to Dalvik support, and work on running Dalvik tests on Travis 2015-02-26 09:34:03 -05:00
Julian Dolby 1bb7610011 work toward pointer analysis based on the flowgraph from field-based
call graph builder
2014-10-19 22:44:03 -04:00
Julian Dolby c9ad359d65 new test to remind me that prototype no longer works with correlation tracking:
com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShapeRhino.java
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/pages/prototype.html

work (not yet finished) on fixes to property accesses for JavaScript:
com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ipa/callgraph/AstJavaSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/JSSSAPropagationCallGraphBuilder.java

currently unused tests to remind me to fix bugs:
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/tests/loops.js
com.ibm.wala.cast.js.test.data/examples-src/tests/primitive_strings.js

fixes to exception handler code generation in JavaScript:
com.ibm.wala.cast.js.rhino/source/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java
com.ibm.wala.cast.js.test.data/examples-src/tests/try.js
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java

fixes to make the system build on both juno and luna
com.ibm.wala.cast.js.test.data/pom.xml
pom.xml
targets/e42/e42.target
targets/e44/e44.target
targets/pom.xml
com.ibm.wala.core.tests/META-INF/MANIFEST.MF
com.ibm.wala.dalvik.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt/source/com/ibm/wala/cast/java/translator/jdt/FakeExceptionTypeBinding.java
com.ibm.wala.ide.jdt/source/com/ibm/wala/ide/util/JavaEclipseProjectPath.java
com.ibm.wala.ide.jsdt.tests/META-INF/MANIFEST.MF
com.ibm.wala.ide.jsdt.tests/src/com/ibm/wala/ide/jsdt/tests/AbstractJSProjectScopeTest.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/EclipseProjectPath.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java

beginnings of "pointer analysis" on top of field-based analysis
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/FlowGraph.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/PropVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/RetVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VarVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VertexFactory.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ExceptionReturnValueKey.java

fixes for crashes in correlartion tracking
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/extraction/ClosureExtractor.java

fixes for Dalvik IR generation
com.ibm.wala.core/src/com/ibm/wala/cfg/BytecodeCFG.java
com.ibm.wala.core/src/com/ibm/wala/cfg/ShrikeCFG.java
com.ibm.wala.core/src/com/ibm/wala/ssa/SSACFG.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/test/callGraph/JVMLDalvikComparison.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/classLoader/DexCFG.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/dex/instructions/UnaryOperation.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/DexSSABuilder.java

fixes to stack map generation when instrumenting for Java 7
com.ibm.wala.shrike/src/com/ibm/wala/shrike/cg/DynamicCallGraph.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/ConstantInstruction.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Analyzer.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/ClassHierarchy.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Verifier.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/shrikeCT/ClassInstrumenter.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapConstants.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableReader.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableWriter.java
2014-10-15 16:01:38 +09:00
Julian Dolby 6c47da8091 Merge branch 'master' of https://github.com/wala/WALA
Conflicts:
	com.ibm.wala.core.tests/src/com/ibm/wala/core/tests/shrike/DynamicCallGraphTestBase.java
	com.ibm.wala.ide.jdt.test/launchers/JDTJava15IRTests.launch
2014-10-06 15:43:42 -04:00
Julian Dolby 36709b9d1a java 7 support, with much pain for stack maps :) 2014-10-06 15:34:16 -04:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Julian Dolby 3910608d60 JavaScript slicer support 2014-07-11 11:55:02 -04:00
Manu Sridharan f33b4d029d another Travis fix 2014-06-26 17:52:58 -07:00
Manu Sridharan b28ce864ae disable some long-running tests on Travis 2014-06-26 17:27:53 -07:00
Julian Dolby bdea38f6bc remove some printing 2014-06-26 11:11:00 -04:00
Julian Dolby fc07a27806 for now, comment out test that seems to die with a timeout on Travis CI 2014-05-28 16:42:00 -04:00
Julian Dolby 6765d84acb more tests for field-based call graphs 2014-05-28 13:32:24 -04:00
Julian Dolby af63719749 more testing for field-based callgraphs 2014-05-28 13:31:56 -04:00
Juergen Graf 4772f36d47 add standard type parameter to most pointer analysis references. When it breaks we move back to ? extends InstanceKey. 2014-05-20 22:00:06 +02:00
Julian Dolby 99512c5cd0 uuse PrinterWriter; make DOM model optional 2014-04-11 10:00:05 -04:00
Julian Dolby 3b7b59406f add types left out of commit 2014-02-09 19:12:13 -05:00
Julian Dolby 36e0716639 more tests 2014-02-08 21:36:56 -05:00