Compare commits

...

1447 Commits

Author SHA1 Message Date
Achim D. Brucker b3ac9e29ba Marked development version 2018-10-29 08:26:36 +00:00
Achim D. Brucker 96b9968b65 Preparing release of version 1.5.1.S.DASCA.1.0.0. 2018-10-29 08:04:08 +00:00
Achim D. Brucker 87bef0017e Updated publishing URL. 2018-10-27 15:43:15 +01:00
Achim D. Brucker 186a33333f Updated versioning schema. 2018-10-27 14:45:13 +01:00
Achim D. Brucker af0b88038a Marked development version. 2018-10-27 10:50:29 +01:00
Achim D. Brucker ffd165a7f2 Updated instructions how to update version strings. 2018-10-27 10:50:07 +01:00
Achim D. Brucker 8e11e605a4 Updated documentation. 2018-10-27 10:41:21 +01:00
Achim D. Brucker 29a2dcec9d Added configuration for publishing artifacts to artifacts.logicalhacking.com. 2018-10-27 10:31:44 +01:00
Achim D. Brucker d28d21d820 Added DASCA version postfix. 2018-10-23 21:00:48 +01:00
Achim D. Brucker c285cc72d2 Moved resource declaration into try-statement. 2018-10-21 20:20:13 +01:00
Achim D. Brucker d53814e154 Restored error level for org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable. 2018-10-21 18:29:40 +01:00
Achim D. Brucker 3d5dec0b0c Manual merge. 2018-10-21 16:31:25 +01:00
Julian Dolby 2d2d6070ff more talking 2018-10-20 12:16:43 -04:00
Julian Dolby 8381141e54 try out instead of err output 2018-10-19 22:31:10 -04:00
Julian Dolby a1649be85b talk to Travis 2018-10-18 23:23:24 -04:00
Julian Dolby 869ca81272 more memory, parallelism for tests 2018-10-18 22:55:13 -04:00
Julian Dolby 38c5de6160 fix for forName selector: use the CHA in getRelevantParameters to resolve
the declared target of the call site.  This is needed to make sure
forName targets loaded with the Application loader get resolved to point
to the real metod reference for forName.

this issue actually manifested itself in the Kawa Chess program, and so
I have added an assertion to make sure this resolution is done properly.
2018-10-18 22:25:21 -04:00
Julian Dolby 533d392bda support for method argument default values 2018-10-17 19:44:44 -04:00
Julian Dolby 948d69cbb8 fix for Soot: trim instruction array to avoid nulls 2018-10-16 21:43:26 -04:00
Julian Dolby d690d94cdd more use for object literals 2018-10-16 00:34:31 -04:00
Julian Dolby bf3c419e1c test for presence of nodes in Kawa chess test that need method handles
and string constants to play nicely together.
2018-10-15 02:12:42 -04:00
Julian Dolby 89492c28fa more heap space for tests 2018-10-13 09:27:38 -04:00
Julian Dolby b2503628a4 1) a bit more source mappimg information
2) fixes to how Contexts are combined
2018-10-13 08:42:08 -04:00
Julian Dolby 31cf42674a Merge branch 'master' of github.com:wala/WALA 2018-10-03 09:02:26 -04:00
Julian Dolby 7a7d341c94 merge 2018-10-03 09:02:07 -04:00
Erik Derr 018e9d20eb Fixes Exception in AndroidAnalysisScope (#361)
Fixes inconsistent behavior of the exclusions argument.
Depending on the androidLib argument, setting exclusions to null
is either fine or raises and exception.

This patch makes exclusions truely optional for any case
when null is passed.
2018-10-02 22:29:44 -07:00
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Erik Derr 751444a656 Fixes IllegalStateException (#358)
* Fixes IllegalStateException

Reverts refactored code with try-with-resource back to potentially
leaking implementation. The refactored code threw an exception since
JarFileModule does not implement the AutoClosable interface. Further,
removed the printStackTrace() call, as this is not an exceptional case
but intended control-flow in case DexFileModule creation fails.

* Downgrade JarFile leak diagnostic from warning to error

This is consistent with how we are treating potential JarFile leaks in
other WALA components.  WALA issue #236 already notes that these
should be cleaned up eventually, although doing so will not be easy.
2018-09-30 12:19:14 -07:00
Sifis Lagouvardos 6fd67b886e Added multidex apk file in dalvik.test/data and a new test for multidex apk files. 2018-09-21 19:08:06 -07:00
Sifis Lagouvardos 819e7e1a7f Added test for the new DexFileModule constructor that supports specific .dex files. 2018-09-21 19:08:06 -07:00
Sifis Lagouvardos 2ab002df3e Added new DexFileModule constructor to support specific dex files inside apks. 2018-09-21 19:08:06 -07:00
Julian Dolby 1867b57425 move utility so other tests can use it 2018-09-20 14:48:06 -04:00
Julian Dolby 1c6a6b0cbd
Merge pull request #352 from sifislag/master
Added a CAstNode and a CAstOperator to support some wanted python features.
2018-09-12 15:55:57 -04:00
Sifis Lagouvardos be0ef4e16b Added CAstOperator to support the not in operation in Python. 2018-09-12 18:25:21 +03:00
Sifis Lagouvardos 9ce10ab5b9 Added GLOBAL_DECL CAstNode for the python global statement. 2018-09-12 18:21:00 +03:00
Julian Dolby b32704b8a3 Merge branch 'master' of github.com:wala/WALA 2018-09-11 13:57:32 -04:00
Julian Dolby 7f47c7200a dexlib -> 2.2.5 2018-09-11 13:43:07 -04:00
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
Julian Dolby e85f01b2b3 fix for Dalvik instruction generation 2018-09-11 13:36:29 -04:00
Julian Dolby d13a38fbe1
Merge pull request #345 from SunghoLee/master
Fix the comparison method for ConstantKey
2018-08-27 21:47:46 -04:00
Sungho Lee 2640b97b5d Fix comparison method for ConstantKey 2018-08-28 09:47:09 +09:00
Julian Dolby 762389c315
Merge pull request #344 from bryantam/cast_constant-h-add-changes
add missing CAstNodeType to cast_constant.h that are defined in CAstNode
2018-08-26 22:35:58 -04:00
Bryan Tam 6f317bc9fa add missing CAstNodeType to cast_constant.h that are defined in CAstNode 2018-08-23 21:16:24 -04:00
Manu Sridharan 49628fdf44 Start new development version 2018-08-22 12:01:19 -07:00
Manu Sridharan 6b46ce4faa Version 1.5.0 2018-08-22 11:19:51 -07:00
Manu Sridharan 5d7b4d5988 Update change-version.py to handle build.gradle, and clean it up 2018-08-22 09:51:54 -07:00
Julian Dolby c40c7e34f0
Merge pull request #340 from liblit/assorted-gradle-test-fixes
Assorted Gradle test fixes
2018-08-11 16:53:41 -04:00
Ben Liblit 32795455fb Avoid redundant copying of some test resources
These specific test resources are already included in the "testArchives"
configuration of the "com.ibm.wala.core.tests" subproject, upon which
the "com.ibm.wala.dalvik.test" tests already depend.  So there's no need
to also copy these resources into the "com.ibm.wala.dalvik.test" test
resources area as well.
2018-08-11 12:40:44 -05:00
Ben Liblit d9f7abdad3 Augment cleanTest tasks rather than replacing them
Previously I hadn't realized that Gradle's "java" plugin would generate
default "cleanTest" tasks for us.  By defining my own "cleanTest" tasks
we were replacing the generated ones, but what we really wanted to do
was augment them with additional files to delete.
2018-08-11 12:36:22 -05:00
Julian Dolby d92c732dec fix more osx builds 2018-08-08 21:53:41 -05:00
Julian Dolby be7b0deb5f
Merge pull request #338 from liblit/kawa-gradle-improvements
Improvements for Kawa- and JNI-related Gradle build tasks
2018-08-04 18:52:05 -04:00
Ben Liblit e4bb8f2246 Remove redundant "afterEclipseBuildshipImport" dependencies
Every dependency task listed here is already a dependency of at least
one subproject's "processTestResources" task, and each
"processTestResources" task already depends on the corresponding
"afterEclipseBuildshipImport" task.  So listing these tasks here too
is unnecessary.
2018-08-04 05:15:08 -05:00
Ben Liblit febf20145e Rework Kawa download and build tasks to be more Gradle'y
All Kawa-related downloads now use our existing VerifiedDownload task
class.  This gives us Gradle-integrated progress reporting,
incremental build support, build caching, correct dependencies, etc.

Using Kawa to compile Scheme into bytecode now also has proper
dependency management, incremental build support, and build caching.
Same goes for bundling these compiled bytecode files into jar archives
for later use in regression tests.

Also, when downloading kawa-chess, grab a specific commit hash rather
than whatever is the most recent master commit.  If this project
changes in the future, we don't want our tests to break unexpectedly.
Perhaps we'd want to pick up any new kawa-chess commits; perhaps not.
Either way, that should be a conscious decision rather than something
that can happen behind our backs.
2018-08-04 04:37:41 -05:00
Ben Liblit 8324a9cb56 Ignore downloaded "kawa-chess" subdirectory
This is not our source code.  It's just a clone of someone else's Git
repository.  Maven or Gradle will recreate it when asked to do so.
2018-08-04 04:35:30 -05:00
Ben Liblit a7cef8e77a Declare a task's outputs, enabling incremental build and caching
This specific task runs an external command, and we consider the task
successful if that command exits without error.  We don't actually
examine the stdout or stderr of the command being run.

However, it is still useful to log the stdout and stderr to a file,
and to declare that file to be the output of the task.  Otherwise, the
task has no declared outputs at all.  A task with no outputs is
ineligible for caching and is always considered to be out-of-date.

squash! Declare a task's outputs, enabling incremental build and caching
2018-08-04 04:29:59 -05:00
Julian Dolby e0ad8fd9f7 try Xcode version recommended by Travis 2018-08-03 16:21:03 -04:00
Julian Dolby c5cdb9e32a clean up MethodHandle support 2018-08-03 15:52:24 -04:00
Julian Dolby 25bb519221 set version for macos 2018-08-03 08:21:41 -04:00
Julian Dolby d54859f923 revert chnage 2018-08-03 00:29:29 -04:00
Julian Dolby 530c6d5bd7 put kawa.jar in proper place 2018-08-03 00:08:46 -04:00
Julian Dolby 768a546f19 try to force kawa compiles 2018-08-03 00:02:12 -04:00
Julian Dolby 01af1c6ddc try more kawa compile hacks 2018-08-02 23:21:47 -04:00
Julian Dolby 62931350eb try hacks for kawa 2018-08-02 22:56:15 -04:00
Julian Dolby b9400f816e copy kawa jar 2018-08-02 21:58:05 -04:00
Julian Dolby 82061c83e0 exclusions for GUI 2018-08-02 21:41:08 -04:00
Julian Dolby 415fd39f0d ant work 2018-08-02 21:20:06 -04:00
Julian Dolby 834927239c gradle work 2018-08-02 21:17:52 -04:00
Julian Dolby a4eb79edbe another try to fix gradle on travis 2018-08-02 20:21:18 -04:00
Julian Dolby 9af2e30262 try fix to gradle build 2018-08-02 20:08:21 -04:00
Julian Dolby e6136a0045 Merge branch 'master' of github.com:wala/WALA 2018-08-02 19:38:14 -04:00
Julian Dolby 7e6cfe84f6 more support for method handles, particularly for ones created with
reflection.
2018-08-02 19:35:32 -04:00
Ben Liblit cc2ba19b7c Categorize Eclipse sources as main vs. test
This leverages new Eclipse 4.8 (Photon) features that distinguish main
code from test code:
<https://www.eclipse.org/photon/noteworthy/index.php#test-sources>.
An eventual fix to <https://github.com/gradle/gradle/issues/4802>
might mean that Buildship starts doing this automatically, but for now
we can do it ourselves.

If using an older Eclipse release, this change does nothing useful,
but neither does it cause any harm.
2018-07-30 09:17:05 -07:00
Julian Dolby 0ad11fefc3 work on Wala with Yannis' group 2018-07-22 16:19:32 -04:00
Ben Liblit 8edfd285d7 Turn off a Gradle warning about Gradle 5.0 incompatibility
The issue here is a planned change to how "publishing" blocks work.
Per
<https://docs.gradle.org/4.9/userguide/publishing_maven.html#publishing_maven:deferred_configuration>,
the right way to prepare for this change is to enable it and check for
unexpected changes in what gets published to a local repository.  I
have done this, and find no unexpected changes.

So we are actually ready for Gradle 5.0; the warning is a false
positive for us.  Leaving the future change enabled means we won't
keep seeing this warning.  It also means that any further changes to
our use of "publishing" will be tested under that future change, which
is a good way to avoid surprises later.
2018-07-22 02:42:54 +02:00
Leo Li d15f49bd90 Add install_name when build libcast on macos. (#332)
Gradle won't pass absolute path when build libcast. We need to set install_name manually otherwise `dyld` would not able to find libcast at runtime.

This is only needed on macos since `ld` will look up all runtime search path automatically.
2018-07-22 02:42:19 +02:00
Ben Liblit bc3ea1a777 Fix a spelling error in a comment 2018-07-20 08:44:23 +02:00
Ben Liblit 2b2483abd6 Avoid dereferencing null if no C/C++ compiler is present
Fixes #328, which requested better diagnostic messages in the case of
a missing C/C++ compiler toolchain.  Gradle actually has perfectly
good, informative messages in that case.  Unfortunately, we were
killing the build by dereferencing null before Gradle had a chance to
explain.  Now we bail out of some setup work early to avoid the null
dereference, thereby letting Gradle explain things properly.
2018-07-20 08:44:23 +02:00
Ben Liblit 10d3adf324 Retry download task if the destination file is missing
Under some circumstances, Gradle seems to decide that the destination
file being absent is the download task's expected outcome.  It caches
this state, and refuses to retry the download in the future since it
thinks the task is up-to-date.  We can correct this by telling Gradle
that the task should not be considered up-to-date if the file is
missing, as recommended by
<https://discuss.gradle.org/t/task-up-to-date-but-outputfile-not-created/17568/2>.
2018-07-20 08:44:23 +02:00
Ben Liblit 0510c914bb Update Gradle wrapper to release 4.9
Gradle 4.9 has no new features of particular interest to us.  It's
good to stay up-to-date, though.
2018-07-20 08:44:23 +02:00
Ben Liblit 72e9ba31f8 Use more complete Gradle package for better IDE support
In particular, using the "all" package (which includes source) allows
IntelliJ IDEA to provide autocompletion and other nice features that
are unavailable when using the "bin" package.
2018-07-20 08:44:23 +02:00
Ben Liblit c242f6126c Publish all generated Java bytecode jar archives
Previously we were only publishing source archives.  This fixes
wala/WALA#326 if I got everything right on the first try.  More likely
is that we will need a few rounds of revision before it's all doing
what it should.  For example, we may need to customize aspects of the
Gradle-generated "*.pom" files as described at
<https://docs.gradle.org/current/userguide/publishing_maven.html#sec:identity_values_in_the_generated_pom>
and
<https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom>.
2018-07-19 22:23:14 +02:00
Manu Sridharan 2b1d82d1bb Expand missing super test 2018-07-19 18:17:59 +02:00
Manu Sridharan a78af3f67e
Add API to add an InputStream for a jar to an AnalysisScope (#330)
This is useful, e.g., if you have the bytes of a jar file in memory and want to load it into an `AnalysisScope`.
2018-07-19 17:01:51 +02:00
Manu Sridharan aeb17dfca4
Allow for classes with missing superclasses in class hierarchy (#329)
Fixes #322 

We add an option `createPhantomSuperclasses` to `ClassHierarchy`.  When set, if a superclass is missing, we create a new `PhantomClass` in its place and allow the subclass to be added.

To use, you can create the `ClassHierarchy` with the new `ClassHierarchyFactory.makeWithPhantom` methods.
2018-07-19 16:10:35 +02:00
Julian Dolby 5edf49254c ore meta data 2018-07-19 14:02:04 +02:00
Julian Dolby fc261b6ee7 mata data 2018-07-19 13:51:06 +02:00
Julian Dolby 6e6b29339c latest dexlib 2018-07-19 12:45:17 +02:00
Julian Dolby 1bbca5a222 Merge branch 'master' of github.com:wala/WALA 2018-07-15 12:41:25 +02:00
Julian Dolby c5f812d784 fix script for python 3 2018-07-15 12:41:18 +02:00
Ben Liblit 1ac4ca9475 Tweaks and instructions for WALA as an IntelliJ IDEA project
We already had some IntelliJ IDEA project metadata files in ".idea".
I've revisited and updated those now that I have more experience with
Gradle + IntelliJ IDEA + Git.  I think this now represents a better
set of decisions regarding what does and does not belong in version
control.

This commit also extends "README-Gradle.md" with clear instructions on
how to bringup WALA as a top-level IntelliJ IDEA project.  The
instructions are of a similar flavor to the Eclipse instructions that
were already present, though the details vary.  Most notably, with
IntelliJ IDEA you should *open* WALA as an existing project,
not *import* it as a new Gradle project derived from "build.gradle".
This is exactly the reverse of what one should and shouldn't do for
WALA in Eclipse.
2018-07-12 14:52:13 -07:00
Julian Dolby ed59197ae3
Merge pull request #325 from liblit/miscellaneous-ide-updates
Miscellaneous IDE updates
2018-07-12 12:57:40 -04:00
Ben Liblit 858148e91b Reorganize how we deal with shared JavaScript test examples
When IntelliJ IDEA imports WALA's Gradle configuration, it creates
what is calls a "module" for each sourceSet of each Gradle subproject.
In so doing, it automatically picks up the source and resource
directories used by each of these sourceSets.  Unfortunately, IntelliJ
IDEA does not allow multiple modules to share a single root directory
as their source or resource directories, and that's exactly what was
going on with the "example-src" subdirectory under
"com.ibm.wala.cast.js.test.data".

This revised Gradle configuration still has is copying the necessary
"example-src" resources to the appropriate locations for use as test
resources.  But IntelliJ IDEA no longer treats "example-src" as a root
directory for resources in the automatically-generated modules.  So
now we get along nicer with IntelliJ IDEA while keeping everything
working with Gradle as well.
2018-07-11 16:13:05 -05:00
Ben Liblit 3d9e4d23d8 Add helper task for extra setup after opening in IntelliJ IDEA
This task serves a similar role to the "afterEclipseBuildshipImport"
task used with Eclipse.  It should only be necessary to build this
task once:  in a freshly checked-out tree, just after opening it for
the first time in IntelliJ IDEA.

Ideally this extra setup task would be triggered automatically using
the "Tasks Activation" feature of IntelliJ IDEA's Gradle support.
Unfortunately, "Tasks Activation" settings are recorded in
".idea/workspace.xml", which is used for non-revision-tracked personal
settings.
2018-07-11 15:13:39 -05:00
Ben Liblit 7c2189849f Add a stub JDT preferences file, originally created by Buildship 2018-07-11 15:11:44 -05:00
Julian Dolby dc47e1da98 add default methods to instruction visitors
relax dump api
2018-07-10 21:53:48 -04:00
Julian Dolby ef89dc5345 a little tolerance for sloppy models 2018-07-04 15:46:06 -04:00
Julian Dolby bc0309b5ba Merge branch 'master' of github.com:wala/WALA 2018-06-27 14:58:10 -04:00
Julian Dolby fe1247f2ce switch to rhino 1.7.10 2018-06-27 14:57:35 -04:00
Ben Liblit 6be7a1a8a2 Have Travis CI periodically try to build each subproject separately
If Gradle dependencies are set up correctly, then it should be
possible to build any subproject starting with a pristine tree.
These take too long to use for every commit, pull request, etc.  But
running an extensive test like this periodically (e.g., weekly) seems
reasonable.
2018-06-26 09:19:02 -07:00
Ben Liblit 36320a078c Upgrade Gradle wrapper to release 4.8.1
No significant changes in this release that affect us, but it's good
to stay up-to-date.
2018-06-26 08:31:59 -07:00
Julian Dolby 0752bf321c Merge branch 'master' of github.com:wala/WALA 2018-06-22 21:49:06 -04:00
Julian Dolby 37eea27f4a more support for out-of-order lexical declarations 2018-06-22 19:49:49 -04:00
Julian Dolby 4de0ed876d remove overly conservative assertion 2018-06-22 07:26:38 -04:00
Julian Dolby af639ec654
Merge pull request #319 from liblit/minor-tidying-up
Minor tidying up
2018-06-10 22:01:03 -04:00
Ben Liblit bc86a27e85 Remove a subproject ".gitignore" whose patterns no longer apply
Perhaps files once existed here that matched the given exclusion
patterns, but there are certainly no such files here now.
2018-06-09 18:46:11 -05:00
Ben Liblit 2fcd079fe2 Anchor many ignore patterns that only apply at the topmost level 2018-06-09 18:46:11 -05:00
Ben Liblit ddeb2bd8ab Ignore a Visual Studio Code settings file
The settings I am seeing in here so far seem like per-developer
preferences, not shared per-project configuration information.
2018-06-09 18:46:11 -05:00
Ben Liblit c4f127f371 Subproject "com.ibm.wala.cast.js.test.data" contains no Java code 2018-06-09 18:46:11 -05:00
Julian Dolby b1b09684bd
Merge pull request #317 from liblit/future-java-compatibility-fixes
Future Java compatibility fixes
2018-06-06 12:52:51 -04:00
Ben Liblit 5336a08af2 Avoid using deprecated boxing constructors
Boxing a primitive using the constructor ("new Integer(4)") always
creates a distinct new boxed instance.  That's rarely what you need,
and in fact all of those constructors have been deprecated in Java 9.
Using the static "valueOf" method instead ("Integer.valueOf(4)") can
give better performance by reusing existing instances.  You no longer
get a unique boxed object, but generally that's OK.
2018-06-05 14:44:59 -05:00
Julian Dolby 9aed4e058d more tracking of sourse positions for function parameters 2018-06-05 15:00:31 -04:00
Ben Liblit 32e105a3c0 Skip a specific test if offline; this test requires network access 2018-06-04 12:29:57 -05:00
Ben Liblit 5cf8b7efe3 Stop using deprecated "javah" to generate JNI headers
"javah" was deprecated in Java 9, and has been removed entirely in
Java 10.  The right way to generate headers now is by using the "-h"
flag to "javac".  When "javac" is run in this way, it still generates
bytecode too.  So ideally, we'd run "javac" just once to generate
bytecode and headers simultaneously.  Fortunately, the Gradle JNI
plugin at <https://github.com/wpilibsuite/gradle-jni> help us do this
cleanly.  Nice!
2018-06-04 12:29:57 -05:00
Ben Liblit 85651608e9 Don't use interpolated strings unless actually needed 2018-06-04 12:28:42 -05:00
Ben Liblit 6679262707 Refactor linker logic, and add "smoke_main" to automated tests
Previously we were compiling and linking "smoke_main", but not
actually running it as part of automated testing.  I simply overlooked
this in the process of recreating the Maven build logic in Gradle.
Now we run "smoke_main" when testing, which turns out to be a pretty
good test of our management of both Java search paths as well as
linker / shared library search paths.
2018-06-04 12:28:42 -05:00
Ben Liblit fbac524a02 Find JVM shared library better across versions and operating systems
We now use "-rpath" on both Linux and macOS.  This linker flag sets
the ELF RPATH on Linux, and the "@rpath" attribute on macOS, but
effectively it's doing the same thing, and that same thing is exactly
what we want.  I think.

On Linux, we also now look for the JVM shared library in three
different places.  The library has moved between Java 8 and 9, and
even on Java 9 it goes in a different place on Fedora 28 versus Ubuntu
16.04.
2018-06-04 12:28:42 -05:00
Ben Liblit 24151e7422 Don't specify Java version; defaults to whatever JVM is being used 2018-06-04 12:28:42 -05:00
Ben Liblit c7344e611a Remove TODO comment about producing native components for test only
According to
<https://docs.gradle.org/current/userguide/native_software.html>,
"When you assemble dependents of a component, the component and all of
its dependents are compiled and linked, including any test suite
binaries."  So it's intentional that the "assemble" task causes
creation of the smoke_main executable and xlator_test shared library.
Nothing TODO here; the current behavior is as designed.
2018-06-04 12:28:42 -05:00
Ben Liblit 2067d6c37a Open up some more vertical white space 2018-06-04 12:28:42 -05:00
Ben Liblit 989ef3ec43 Help Java 9 with some tricky generics type inference
The existing code worked fine under Java 8, but Java 9 fails to
resolve type constraints unless it has more explicit information about
at least one of the arguments to anyOf.  Weird.
2018-06-04 12:28:42 -05:00
Julian Dolby d2852beebf
Merge pull request #312 from liblit/gradle-load-plugins-modernization
Load Gradle plugins using “plugins” closure rather than “apply plugin”
2018-06-04 12:22:33 -04:00
Julian Dolby d1840f0531 make slicer handle multiple languages, using the Language to build mod and ref visitors 2018-06-01 13:56:08 -04:00
Julian Dolby 196f7cb153 fix for nasty bug in decoding dup2_x2 2018-05-31 19:32:02 -04:00
Julian Dolby 400b2055ce break basic blocks at eachelementget instructions 2018-05-30 12:26:19 -04:00
Ben Liblit e2ce6a84b0 Load plugins using "plugins" closure rather than "apply plugin"
Apparently the latter is considered a "legacy method":
<https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application>.
2018-05-23 16:47:58 -05:00
Julian Dolby 24d7757814
Merge pull request #309 from liblit/junit-4.12
Require JUnit 4.12 instead of 4.11
2018-05-21 21:46:05 -04:00
Julian Dolby 4a372eff2d
Merge pull request #308 from liblit/git-ignore-cleanups
Git ignore cleanups
2018-05-21 21:45:39 -04:00
Ben Liblit decd164fa6 Require JUnit 4.12 instead of 4.11
WALA itself does not use any JUnit 4.12 features.  However, I am
working on a WALA-based project that does require JUnit 4.12.  Mixing
jar versions is a path to madness.  So if the WALA maintainers don't
mind, it would make my life easier if WALA itself required JUnit 4.12.
Otherwise, I need to maintain that 4.11/4.12 difference indefinitely
as a divergence between official WALA and my WALA variant.

I suppose an alternative could be to let the JUnit version be
specified externally somehow. I have not explored this option in
depth, but could look into it if simply moving to JUnit 4.12 is
undesirable.
2018-05-21 17:27:54 -05:00
Ben Liblit b2e190ceed Remove a Java bytecode file that shouldn't be revision-tracked
We have the corresponding ".java" source file, so we can (and do)
rebuild this bytecode file whenever needed.
2018-05-21 16:15:53 -05:00
Ben Liblit 6fe9959a73 Ignore some more IntelliJ IDEA project metadata
I *think* that the per-module configuration metadata that goes here
should be per-developer, not tracked in git.
2018-05-21 16:14:48 -05:00
Ben Liblit 8146db20ff Remove git ignore patterns for several revision-tracked files
Someone may have thought that we were ignoring these files, but we
aren't.  From what I can tell, for these specific files, revision
tracking is intentional.
2018-05-21 16:14:48 -05:00
Julian Dolby 5236b95bd2 tighten type 2018-05-11 12:30:32 -04:00
Julian Dolby a3a6ce3f51 expose copy propagation records to allow better source position mapping even when copy propagation has occurred. 2018-05-09 18:10:20 -04:00
Julian Dolby 6b2db3e190 more-detailed source mapping information 2018-05-08 08:01:35 -04:00
Julian Dolby 8005b665b9 flexibility in how to model constants 2018-04-30 19:09:59 -04:00
Julian Dolby 2a7a98ed32 move code for sharing between javascript and python 2018-04-30 13:33:48 -04:00
Julian Dolby 27a8fff714 ast-based constant folding 2018-04-28 12:05:49 +02:00
Julian Dolby bc4939db97
Merge pull request #303 from liblit/tweaks-for-IntelliJ-IDEA
Tweaks for IntelliJ IDEA
2018-04-25 00:43:40 -04:00
Ben Liblit 45ea8969ed Add or ignore several metadata files created by IntelliJ IDEA
I decided which to keep and which to ignore by following advice given
at
<https://intellij-support.jetbrains.com/hc/en-us/articles/206544839>
and
<https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore>,
which in turn influenced <https://www.gitignore.io/api/jetbrains>.
2018-04-23 15:02:21 -05:00
Ben Liblit f7d07fe757 Ignore "out" subdirectories into which IntelliJ IDEA puts binaries 2018-04-23 14:53:49 -05:00
Ben Liblit e77535a41f Use the full Gradle wrapper distribution instead of just binaries
This follows an IntelliJ IDEA recommendation.  Having the full
distribution allows IntelliJ IDEA to provide contextual help,
autocompletion, etc. for Gradle build scripts.  The disadvantage, I
suppose, is that it imposes a larger download time on first use of
"gradlew".
2018-04-23 14:53:07 -05:00
Julian Dolby 49b0d66512
Merge pull request #300 from liblit/gradle-4.7
Upgrade Gradle wrapper to release 4.7
2018-04-19 08:06:45 -04:00
Ben Liblit 8e27f98f2d Upgrade Gradle wrapper to release 4.7
New features that I like from this release: (1) better output grouping
when building in parallel, and (2) automatic test ordering to try
previously-failing tests first.
2018-04-18 19:32:04 -05:00
Julian Dolby a6096e6d75
Merge pull request #299 from liblit/gradle-and-buildship
Build WALA using Gradle instead of Maven
2018-04-18 12:36:59 -04:00
Ben Liblit 209086f068 Bump version to 1.5.0-SNAPSHOT before merging with WALA master
This gives the WALA maintainers the option of doing future 1.4.5+
releases from of a pre-Gradle branch if these merged Gradle changes
turn out to be more disruptive than expected.
2018-04-18 11:29:29 -05:00
Ben Liblit 8529c10491 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
2018-04-18 11:29:29 -05:00
Julian Dolby 61972810d0 more work on file names 2018-04-18 11:29:29 -05:00
Julian Dolby 380d0027d7 fixes for nodejs performance 2018-04-18 11:29:29 -05:00
Ben Liblit 00478ea806 Tell Travis CI to be even more patient during initial p2AsMaven downloads 2018-04-18 11:29:29 -05:00
Ben Liblit f28b63a025 Tell Travis CI to be more patient during initial p2AsMaven downloads 2018-04-18 11:29:29 -05:00
Ben Liblit 7cbccb33fb Simplify how we refer to the outputs of certain tasks 2018-04-18 11:29:29 -05:00
Ben Liblit 0e629f68e7 Exclude a test that has started failing due to running out of memory
I don't know what changes are triggering this.  Presumably it's
something to do with the temporary-file code, but I don't see why that
would happen.  For now, let's just skip this test.
2018-04-18 11:29:29 -05:00
Ben Liblit b14804bfdc Don't put fixed-name, writable files into "java.io.tmpdir"
If multiple tests both write to "/tmp/cg.txt" (for example), then
these tests cannot safely run concurrently.  That never used to be a
problem with Maven, since our Maven tests were all strictly sequential
anyway.  But parallelized testing using Gradle requires that we do
better.  Fortunately, Java has perfectly reasonable APIs for
generating uniquely-named temporary files and directories.
2018-04-18 11:29:29 -05:00
Ben Liblit ba01621de5 Don't use build cache (a.k.a. task output caching) under Travis CI
The performance improvement offered by the build cache is modest when
run by Travis CI.  This is probably because Travis CI does not keep
the cache on any local machine.  Instead, Travis CI uploads the build
cache across a network at the end of each run, then restores the cache
across the network at the start of the next run.  So in many cases
we're simply trading network access to original downloads for network
access to the cache image.

Furthermore, it's probably a better test to perform Travis CI testing
jobs from something closer to a clean slate.  We really want to know
whether everything builds and passes tests correctly starting from
nothing.  We don't want to risk accidentally thinking something would
work simply because we have a cached copy of what it did when it
worked previously.
2018-04-18 11:29:29 -05:00
Ben Liblit 47539da731 Unpack Android SDK and install extra components as a single task
Previously we unpacked in one task, then installed two extra
components in two dependent tasks.  However, installing extra
components modifies some files in place, effectively making those
files both inputs and outputs.  That creates race conditions, and
probably interferes with task output caching.  Better, then, to treat
the unpack and extra installations all as a single task whose output
is the complete Android SDK tree with all required components
installed.
2018-04-18 11:29:29 -05:00
Ben Liblit 01fc8fcae5 If tests fail, print full stack traces to aid debugging 2018-04-18 11:29:29 -05:00
Ben Liblit bd42510c6b Enable both parallel builds and build output caching by default
This should give us a nice build-performance boost, both locally and
in Travis CI.  I've used parallel builds routinely for months now, and
they're working fine.  Build output caching is newer, but it also
seems to be working well and saves us tremendous time on downloads.
2018-04-18 11:29:29 -05:00
Ben Liblit 3a1b1d1d1e Allow parallel testing within each subproject
Without this setting, Gradle would run multiple "test" tasks from
multiple subprojects concurrently, but each "test" task would only run
a single test at a time.  Some of our subprojects' test tasks take a
long time to complete, which could easily leave us sequentially
testing on just one or two CPU cores while other cores sit idle.

With this change, Gradle will use as many task slots as are
available (e.g., when run with "--parallel") to run multiple
simultaneous JUnit test classes within any given subproject.  This
seems to be fine for us:  I am unaware of any shared global state that
would cause conflicts between two test classes within any given
subproject.
2018-04-18 11:29:29 -05:00
Ben Liblit 4840966807 Don't try to exhaustively anticipate all generated header names
When JNI headers for a given class, each nested class will end up with
its own additional header.  But I don't want to try to parse nested
class details out of the Java source files just so we can determine
exactly which headers will be created.  Instead, simply treat the
entire header destination directory as the output of this task.
2018-04-18 11:29:29 -05:00
Ben Liblit 36fe02d71c Improve build caching by reducing path sensitivity where appropriate 2018-04-18 11:29:29 -05:00
Ben Liblit 74523f5058 Enable caching of task outputs for custom build tasks 2018-04-18 11:29:29 -05:00
Ben Liblit 000b21f36e Rename a build task to more clearly reflect what it builds
This task has an input named "hello_hash.ml", and an output named
"hello_hash.jar".  So calling this task "generateHelloHash" is too
vague.  Now we call it "generateHelloHashJar" instead.
2018-04-18 11:29:29 -05:00
Ben Liblit c0ec959e4a Extend Gradle's "clean" task to remove some additional build targets 2018-04-18 11:29:29 -05:00
Ben Liblit 328b1ec52b Merge info from existing, hand-authored manifests when building jars 2018-04-18 11:29:29 -05:00
Ben Liblit 4dc1e41529 Tell Eclipse to ignore some questionable manifest contents
These manifest files are here for use by the Maven build, but Eclipse
is now using Gradle (via Buildship).  So the manifests as seen by
Eclipse do not entirely make sense.  I'm hesitant to change the
manifests directly, since presumably they were correct for Maven and
still are.

Perhaps some day we'll be using Gradle to generate manifests.  Until
that day comes, we're better off leaving the manifests as they are and
just suppressing Eclipse's warnings instead.
2018-04-18 11:29:29 -05:00
Ben Liblit 7dcff25dcf After Builldship import, put "dx.jar" where the manifest expects it 2018-04-18 11:29:29 -05:00
Ben Liblit 72e5eb2b8d Restore old manifests in hope of fixing Maven regressions 2018-04-18 11:29:29 -05:00
Ben Liblit 7b96281e77 Bail out if any Travis CI testing commands fail
Previously we could fail some "mvn" stage but keep running anyway,
thereby fooling us into thinking that everything was OK.
2018-04-18 11:29:29 -05:00
Ben Liblit 3961b3a20e Incremental improvements to Windows JDK library configuration
This still doesn't actually work, but it's closer than it was before.
There's still some problem with improper mixing of 32-bit ("x86") and
64-bit ("x64") libraries.
2018-04-18 11:29:29 -05:00
Ben Liblit 298d6654d6 Clean up questionable memory management during string construction
Avoid allocating memory using strdup() and then releasing it using
operator delete.  strdup()-allocated memory should be released using
free(), not delete.  But in these specific cases, there really was
never any good reason to duplicate the C-style strings in the first
place.  Instead, we can safely pass those NUL-terminated char pointers
directly in calls to JNI's NewStringUTF().  NewStringUTF() does not
take ownership of its argument, but rather clones that string data
internally before returning.  So using strdup() and delete was just
unnecessary memory churn.

In cases where we need to format, concatenate, or construct new
strings, don't use sprintf() into variable-sized, stack-allocated
arrays.  Variable-sized arrays are not portable, and in particular are
rejected by Microsoft's Visual Studio 2017 C++ compiler.  Instead, do
our string formatting and manipulations using std::ostringstream
and/or std::string.  We just need to be a bit careful about the
lifetimes and ownership responsibilities of allocated data.  In
brief, (1) ostringstream::str() returns a temporary string instance
that expires at the end of the enclosing statement, independent of the
lifetime of the ostringstream instance; while (2) string::c_str()
returns an pointer to internal data that remains valid as long as the
string on which it was called is valid and unmodified.
2018-04-18 11:29:29 -05:00
Ben Liblit 216981f7e3 Somebody decided to use three-space indentation in this file only
OK, whatever makes you happy.
2018-04-18 11:29:29 -05:00
Ben Liblit 86fe6e9334 Fill in likely (but untested) JVM library path on Windows 2018-04-18 11:29:29 -05:00
Ben Liblit 5f2d64f85a Factor out common code for installing Android SDK components 2018-04-18 11:29:28 -05:00
Ben Liblit 587d0a95dc Skip DroidBench tests on Windows, for now
The default location of DroidBench in "/tmp/DroidBench" does not work
well on Windows. So let's disable these tests until someone has time to
make that path more portable.
2018-04-18 11:29:28 -05:00
Ben Liblit c642ec4039 Fix Android SDK installation under Windows 2018-04-18 11:29:28 -05:00
Ben Liblit 9295bcdd0d Switch to a different DroidBench download URL
This URL skips over a redirect that the previous URL went through.
This URL also avoids an annoying "Invalid cookie header" warning that
the previous URL produced.
2018-04-18 11:29:28 -05:00
Ben Liblit afd4bb49bb Use download task instead of "git clone" to get DroidBench
This gives us better progress reporting during the download, better
caching, better file-level dependency tracking, etc.
2018-04-18 11:29:28 -05:00
Ben Liblit 1d2a8a3e7e Factor out recurring pattern in download tasks 2018-04-18 11:29:28 -05:00
Ben Liblit 848530f39a Experimental combined task for download and checksum verification
Not working yet:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.
2018-04-18 11:29:28 -05:00
Ben Liblit 03e43d100b Update gradle-download-plugin and use some of its new features
We now download and verify checksums as a single task, rather than as
two separate tasks.  This simplifies other task dependencies, since we
no longer have a checksum-verified "stamp" file separate from the
download itself.  Unfortunately the combined task now has a
significant amount of repeated boilerplate.  I'm hoping to refactor
that all out into a custom task class, but haven't yet figured out the
details:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.

We now also use ETags to be smarter about when a fresh download is or
is not actually needed.  I think there are still opportunities for
improved caching here, but this is a step in the right direction.
2018-04-18 11:29:28 -05:00
Ben Liblit 9baf192416 If Travis CI gives us multiple CPUs, we may as well use them
I believe Travis CI jobs get two CPUs by default.

Doing parallel builds regularly is also a good way to help us discover
any build race conditions we may have.  There's no guarantee that any
such races will be revealed, but even exposing them
nondeterministically is better than having no possibility of exposing
them at all.
2018-04-18 11:29:28 -05:00
Ben Liblit 3cb91d1e67 Fix a shellcheck warning when setting a variable to the empty string 2018-04-18 11:29:28 -05:00
Ben Liblit 361b689966 Update to Gradle 4.6
No significant new features of interest for us in this release, but I
like to keep current.
2018-04-18 11:29:28 -05:00
Ben Liblit ea239ba484 Add a new README with Gradle-specific instructions and tips 2018-04-18 11:29:28 -05:00
Ben Liblit 49e5aa4f52 Remove two Maven repositories that we no longer use for anything
We used to use these to find various Eclipse packages, but that was
always a dodgy affair since we never quite knew whether we had
matching versions of everything.  Now that we are using the
"com.diffplug.gradle.p2.asmaven" plug-in, though, we have much better
control over getting exactly the Eclipse material we need.  These two
Maven repositories no longer provide anything we use, and therefore
can be removed.
2018-04-18 11:29:28 -05:00
Ben Liblit c0e6cd37b0 We only expect ".gradle" directories in two specific places 2018-04-18 11:29:28 -05:00
Ben Liblit 17fc048599 Generalize post-import Eclipse run configuration for more fixups
Previously this launcher's job was to run "processTestResources" and
any other Gradle tasks needed to create files that Eclipse was
expecting to be available.  But we also want to use it to revert the
bad changes that Buildship applies to ".launch" configuration files.

This is a temporary hack to work around
<https://github.com/eclipse/buildship/issues/653>.
2018-04-18 11:29:28 -05:00
Ben Liblit c6a6ef8b97 Minor indentation fix 2018-04-18 11:29:28 -05:00
Ben Liblit bcbd298808 Extra help for finding "cast" native library on macOS
Unlike Linux, macOS has no "RPATH" facility for embedding additional
search paths within shared libraries.  Instead, we need to set
"DYLD_LIBRARY_PATH" appropriately in the environment.  This
environment variable is the macOS analogue of "LD_LIBRARY_PATH" on
Linux.

Note that adding the required path to the "java.library.path" system
property will *not* work.  This property only affects where the JVM
looks for shared objects that it is loading directly.  This property
does not influence the search for other, transitively-required shared
objects.

Fixes #3.
2018-04-18 11:29:28 -05:00
Ben Liblit 48ffce525c Fix remaining Javadoc warnings
This fixes the last of our Javadoc warnings without creating a
circular dependency between ":com.ibm.wala.cast:javadoc" and
":com.ibm.wala.cast.js:javadoc".  Fixes #4, wherein more details about
this tricky dependency challenge can be found.
2018-04-18 11:29:28 -05:00
Ben Liblit 2a75244914 Use ".singleFile" instead of "[0]" when we expect just one file
This documents our intent more clearly, and actively checks for
mistakes rather than silently ignoring unexpected extra files.
2018-04-18 11:29:28 -05:00
Ben Liblit 1d8869bb0a Start exploring publication features by adding source jar archives 2018-04-18 11:29:28 -05:00
Ben Liblit 7fd8f02382 Replicate test include/exclude patterns already used in Maven builds 2018-04-18 11:29:28 -05:00
Ben Liblit 9a2af5bbb8 Add "com.ibm.wala.core.testdata" to classpath for testing
This lets the "DynamicCallGraphTest" tests pass.  The tests in that
class expect to find some element of the classpath that includes the
substring "com.ibm.wala.core.testdata".  They then treat that as a
collection of bytecode files to instrument.
2018-04-18 11:29:28 -05:00
Ben Liblit 4c179e51bc Skip a test intentionally; Maven already does the same
Big thanks to Julian for showing me where this exclusion logic lives
in the Maven configuration.  There's a "**/*AndroidLibs*.java"
exclusion pattern in the top-level "pom.xml".
2018-04-18 11:29:28 -05:00
Ben Liblit fca0f7c117 Fix jar exclusion patterns to match what Ant uses
One previously-failing test class now passes.  Progress!
2018-04-18 11:29:28 -05:00
Ben Liblit c2b1930248 Add some Eclipse dependencies needed only when running tests
This allows two test classes to pass that previously were failing.
Yay!
2018-04-18 11:29:28 -05:00
Ben Liblit bb98b2f84d Add a resource directory containing a zip archive used for testing
The excluded test in this subproject still does not pass, though now
it's failing for a different reason than before.  Progress, I suppose!
2018-04-18 11:29:28 -05:00
Ben Liblit 20be2b59c4 Disable Gradle linter check for unused dependencies in Travis CI
It's telling me to remove "eclipse-deps:org.eclipse.core.runtime:+"
and "org.osgi:org.osgi.core:4.2.0" as unused dependencies in the
"com.ibm.wala.cast.java.ecj" subproject.  However, these two
dependencies (jar files) are actually needed; compilation fails
without them.
2018-04-18 11:29:28 -05:00
Ben Liblit d0bf53474b Also get Eclipse JSDT from a P2 repository, but not the same one 2018-04-18 11:29:28 -05:00
Ben Liblit c16f172932 Find Eclipse jars using local Maven mirror of Eclipse P2 repository
This should give us a set of mutually-consistent jars rather than
picking up random, outdated pieces from Maven Central or wherever else
I could find them.  We now also have a single, central place where we
set the Eclipse version that we're building against.  Much, *much*
cleaner.
2018-04-18 11:29:28 -05:00
Ben Liblit fc0b951ead Assume that Eclipse needs all standard test-resource processing 2018-04-18 11:29:28 -05:00
Ben Liblit a99db6b946 Trivial whitespace tweak 2018-04-18 11:29:28 -05:00
Ben Liblit 01e54886df Exclude one macOS test that I don't know how to fix right now 2018-04-18 11:29:28 -05:00
Ben Liblit 3d026d409e Download appropriate Android SDK for current OS 2018-04-18 11:29:28 -05:00
Ben Liblit baee9d32e1 Try to continue building/testing even after the first failure
If other, non-dependent tasks would also fail, I'd rather discover all
of them at once.
2018-04-18 11:29:28 -05:00
Ben Liblit d8948324f7 "rm" on macOS apparently doesn't understand long ("--foo") flags 2018-04-18 11:29:28 -05:00
Ben Liblit 393ef13622 macOS doesn't seem to have "xvfb-run", and may not need it anyway 2018-04-18 11:29:28 -05:00
Ben Liblit b5cfd56041 Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
We're not going to attempt macOS Travis CI testing for Maven builds,
because I don't know whether that's even expected to work on the
official WALA master branch.  Our main focus here is Gradle.

Note that Travis macOS images do not support JDK switching, so
explicitly selecting the JDK version now becomes part of the
Linux-only configuration.

Travis macOS images also do not support Android as a build "language".
So our Travis CI configuration for Gradle builds now declares that
this is a Java project rather than an Android one.  That's OK, though,
because our Gradle scripts already handle downloading the Android SDK;
we don't need Travis CI to do that for us.  When building using Maven,
though, we still call this an Android project because Maven builds do
still rely on Travis CI to provide the Android SDK.

squash! Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
2018-04-18 11:29:27 -05:00
Ben Liblit 4853d2b275 Download a specific DroidBench release that we know works for us
If future DroidBench changes include things we need, then we can
decide to move to those newer revisions.  But we shouldn't allow
DroidBench to change out from under us implicitly whenever someone
commits something new to the DroidBench repository.
2018-04-18 11:29:27 -05:00
Ben Liblit c223625f22 Add "TODO" reminders of furture refactoring opportunities 2018-04-18 11:29:27 -05:00
Ben Liblit af5a22d4bb Factor out some repeated accesses to a task's output files 2018-04-18 11:29:27 -05:00
Ben Liblit 1cf1d7c05a Derive Android platforms version from Android build-tools version
This should help us keep the two in sync if the latter changes one
day.
2018-04-18 11:29:27 -05:00
Ben Liblit dfe3659dcb Got DynamicDalvikComparisonJavaLibsTest working at some point 2018-04-18 11:29:27 -05:00
Ben Liblit bbc9ec7e97 Ignore a transient file that appears during testing 2018-04-18 11:29:27 -05:00
Ben Liblit eb00a84a40 Grab an additional archive needed by DalvikAnnotationsTest 2018-04-18 11:29:27 -05:00
Ben Liblit 22245f8cb4 Download a few additional supporting files needed by tests 2018-04-18 11:29:27 -05:00
Ben Liblit 79c8cf1411 Import a class that we will soon be using multiple times 2018-04-18 11:29:27 -05:00
Ben Liblit 2e04ac9838 Fix accidental copying of entire subproject as test resource 2018-04-18 11:29:27 -05:00
Ben Liblit 90a947dad1 Use an "android.jar" that matches the "dx.jar" we are already using
Nothing was obviously failing with the older "android.jar", but I feel
more comfortable knowing that these two are more closely matched.
2018-04-18 11:29:27 -05:00
Ben Liblit fde718b5d3 Suppress harmless broken-pipe warnings from "yes" 2018-04-18 11:29:27 -05:00
Ben Liblit 386cdc117b Set Android build-tools version in just one place 2018-04-18 11:29:27 -05:00
Ben Liblit bc0062e4b0 Use more recent "dx.jar" than is available through Maven Central
This lets us ditch pre-Java-8 in the Gradle build.  (The official WALA
master branch recently got rid of pre-Java-8 in its Maven build.)
That, in turn, lets two "com.ibm.wala.dalvik.test" tests pass that
previously were failing.  We still have two other failing tests in
that subproject, but this is definitely progress!

Our Gradle build scripts manage the entire process of downloading and
locally installing the appropriate Android SDK.  That includes
automatically accepting a license.  Maybe some lawyer will throw a fit
about that some day.  Until then, I'd rather have a build system that
does everything needed without imposing additional manual steps on
developers.
2018-04-18 11:29:27 -05:00
Ben Liblit a09be64332 Ignore some transient files that appear during testing 2018-04-18 11:29:27 -05:00
Ben Liblit 77e0fc2b9c Set name and version to help Gradle composite-build substitutions 2018-04-18 11:29:27 -05:00
Ben Liblit 5398570308 Update Eclipse JUnit test launchers for use with Buildship
Previously Buildship removed its classpath from all of these
launchers.  Now it's automatically putting that back in as soon as I
visit each launcher in Eclipse's "Run Configurations" dialog.  Not
sure what's going on here, but it certainly seems more sane to me to
assume that the Buildship-computed classpath *is* needed for all of
these.  I have an open question on the Gradle discussion forum to try
to understand what's going on here and how to fix it:
<https://discuss.gradle.org/t/launchers-lose-buildship-classpath-on-import-regain-it-later/25641>.
2018-04-18 11:29:27 -05:00
Ben Liblit 525c4aa5fe Update Eclipse "Java Application" launchers for use with Buildship 2018-04-18 11:29:27 -05:00
Ben Liblit c2edaf3119 Use Eclipse-computed paths rather than hard-coding absolute paths 2018-04-18 11:29:27 -05:00
Ben Liblit ca17b12187 Remove launchers whose main Java code is found nowhere in WALA 2018-04-18 11:29:27 -05:00
Ben Liblit f6db318c91 Note some excessive resource copying that we should eventually fix 2018-04-18 11:29:27 -05:00
Ben Liblit 39781604a2 Create a broad "Process Test Resources" Eclipse launch configuration
This should prepare test resources for all subprojects.  A WALA
developer should run this once before running any tests inside
Eclipse.  Initially I'd hoped to make this more narrowly focused, but
Eclipse just doesn't have the infrastructure to deal with fine-grained
dependencies.  On the other hand, running "./gradlew
eclipsePrepareTestResources" automatically for each build seems like
overkill, and could end up being rather slow.  So for now we require
that the developer run this once, by hand.
2018-04-18 11:29:27 -05:00
Ben Liblit 61d8ee1b02 Fix various warnings produced by "./gradlew javadoc"
Three stubborn warnings remain, but this is progress!
2018-04-18 11:29:27 -05:00
Ben Liblit eb4e97a665 Fix warnings about Javadoc links to "java.lang.reflect" package 2018-04-18 11:29:27 -05:00
Ben Liblit da90d1cf5a Trigger custom clean tasks whenever running "./gradlew clean"
A cleaned tree is now much closer to a pristine tree that has just
been checked out and never built.  The only extra created files that
are left behind are ".gradle", "buildSrc/.gradle", and
"buildSrc/build".
2018-04-18 11:29:27 -05:00
Ben Liblit 51cef18bc9 Unpack node.js in the same place that Maven unpacks it
This gets rid of some Eclipse warnings that stem from Buildship being
confused about what it should treat as a source directory if Maven and
Gradle are both being used in the same tree.
2018-04-18 11:29:27 -05:00
Ben Liblit b3dab4c2b0 Tweak Buildship-generated Eclipse ".project" file for extra jars 2018-04-18 11:29:27 -05:00
Ben Liblit 504849e6f5 Update Gradle wrapper to Gradle 4.5
No major new features for us here, but better native caching and other
performance improvements.
2018-04-18 11:29:27 -05:00
Ben Liblit 5f2bab0f3d Get a core test to work by putting "bcel-5.2.jar" where expected 2018-04-18 11:29:27 -05:00
Ben Liblit 031740338f Get a Dalvik test to work by putting "dx.jar" where expected 2018-04-18 11:29:27 -05:00
Ben Liblit 817166c128 Compute a library path from the native software model
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.  That being said, extracting this
information from the depths of the native software model seems *far*
more complex than it should be.  I had hoped for something nicer in
response to
<https://discuss.gradle.org/t/compute-wl-rpath-flag-suitable-for-native-shared-library/25278>,
but so far there's nothing.
2018-04-18 11:29:27 -05:00
Ben Liblit 50bed1cbe8 Compute a library path from the corresponding linker task
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.
2018-04-18 11:29:27 -05:00
Ben Liblit 22421c6882 rpath only matters for shared libraries 2018-04-18 11:29:27 -05:00
Ben Liblit 7c4c2c895c Add previously-undeclared dependency of tests on native library 2018-04-18 11:29:27 -05:00
Ben Liblit a98b913373 Avoid random leftover junk by using "Sync" instead of "Copy" 2018-04-18 11:29:27 -05:00
Ben Liblit c98ea16374 Simplify filtering of archive contents 2018-04-18 11:29:26 -05:00
Ben Liblit 8303eaba4c Override specific "cleanFooBar" tasks instead of generic "clean" 2018-04-18 11:29:26 -05:00
Ben Liblit 5b825997bf Be more concise by calling property setters instead of assigning 2018-04-18 11:29:26 -05:00
Ben Liblit ad1f024b77 Be more concise by omitting implicit "it." in closures 2018-04-18 11:29:26 -05:00
Ben Liblit 2aadd55227 Change archive file names while unpacking, rather than in two stages 2018-04-18 11:29:26 -05:00
Ben Liblit c812e72cb5 Use Groovy's implicit "it" closure argument 2018-04-18 11:29:26 -05:00
Ben Liblit 17b1d85f76 Remove leftover debugging output that I no longer need 2018-04-18 11:29:26 -05:00
Ben Liblit 2e54ec4b0c Download "android-4.1.1.4.jar" (as "android.jar") when needed
Previously Maven did this, but Gradle did not.  So Gradle testing
would only succeed if we'd already done a Maven build first.  Now
these tests pass in a fresh tree that's never seen a Maven build.
2018-04-18 11:29:26 -05:00
Ben Liblit d745f4509f Simplify how we refer to a task's only output 2018-04-18 11:29:26 -05:00
Ben Liblit 07dd646a40 Don't bother importing when we only need one symbol, one time 2018-04-18 11:29:26 -05:00
Ben Liblit f1b2080f99 Download NodeJS and include its "lib/*.js" files in jar archive 2018-04-18 11:29:26 -05:00
Ben Liblit 70fd9a3091 Remove "extraBundledJars" task, which nothing else actually uses
Some tests in other subprojects do depend on some these extra jar
files.  But they can declare those specific dependencies as needed.
Nothing seems to depend on the entire group of extra jars, so it's not
really useful to declare a task that is merely an alias for all of
them.
2018-04-18 11:29:26 -05:00
Ben Liblit 1346a8ac55 Set working directory in the same way Maven does
This seems to help ECJSyncDuplicatorTest find a "./src/Monitor2.java"
file that it needs.  The test still fails, though, for other reasons.
2018-04-18 11:29:26 -05:00
Ben Liblit da30f5dbb4 Enable a few more tests that started working, or perhaps always did 2018-04-18 11:29:26 -05:00
Ben Liblit 20cba8a8d8 Factor out recurring pattern of MD5 checksum + stamp file 2018-04-18 11:29:26 -05:00
Ben Liblit b7b01c8486 Replicate Maven's extra system property settings for some tests 2018-04-18 11:29:26 -05:00
Ben Liblit a1cf040897 Add missing test resources to make many more regression tests pass 2018-04-18 11:29:26 -05:00
Ben Liblit afeba0d984 Remove some test exclusions that are not actually needed now 2018-04-18 11:29:26 -05:00
Ben Liblit 51f748bddc Replicate Maven's heap size limits for tests 2018-04-18 11:29:26 -05:00
Ben Liblit 1bfdf978f2 Buildship removed classpath provider thing from more launch configs
This is more of the same sort of change first seen in a1bd95d.  Still
no idea why it happens; still hoping that Buildship knows what it's
doing.
2018-04-18 11:29:26 -05:00
Ben Liblit 5040019cec Turn on proper regression testing in Travis-CI
Many tests are excluded until
<https://github.com/liblit/WALA/issues/5> is fixed.  But we can at
least have Travis-CI watching over our shoulder to ensure that
no *new* regressions sneak into the tree.
2018-04-18 11:29:26 -05:00
Ben Liblit 5c30dd7581 Explicitly disable regression tests that are currently failing
<https://github.com/liblit/WALA/issues/5> notes that several
subprojects' tests are currently broken under Gradle.  I'd still like
to be able to run non-broken tests, though.  So here I'm disabling the
failing tests.  The intent is to treat these exclusions as a to-do
list.  We can remove exclusions as we get the corresponding tests
working.  No more exclusions means
<https://github.com/liblit/WALA/issues/5> is fixed.
2018-04-18 11:29:26 -05:00
Ben Liblit 91ca24584b Explicitly make "/tmp/DroidBench" be a file, not just a string
I'm hoping this might remove some seemingly-spurious reruns of this
task.  Still not sure why those are happening, though.
2018-04-18 11:29:26 -05:00
Ben Liblit e6677c5aed Do not run Gradle linter by default
It's rather slow, adding roughly five seconds to every "./gradlew"
invocation.  And the advice it gives might not even be reaching a
fixed point.  I like the idea of running the linter as part of CI
testing, but I now think it's overkill to impose on every developer
build.
2018-04-18 11:29:26 -05:00
Ben Liblit d720046110 Dependency tweaks suggested by Gradle linter
I'm starting to wonder whether the linter might be driving us in
cycles rather than reaching a fixed point.  We should keep our eyes on
this.
2018-04-18 11:29:26 -05:00
Ben Liblit 3ba04469ad Teach Gradle how to download "/tmp/DroidBench" when needed
One less thing for developers to have to remember to do manually!
2018-04-18 11:29:26 -05:00
Ben Liblit e9eb934b82 Give each verification task an output for better incremental building 2018-04-18 11:29:26 -05:00
Ben Liblit 98324cd148 Simplify how we refer to existing tasks 2018-04-18 11:29:26 -05:00
Ben Liblit ed275f12a9 Add missing resources for "com.ibm.wala.cast.js.test" tests
The ":com.ibm.wala.cast.js.test:build" task now passes.
2018-04-18 11:29:26 -05:00
Ben Liblit 01acd0e338 RPath settings apply only to Linux; some only to Linux on x86_64
I don't know whether Windows or MacOS needs anything similar.  If they
do, the details will differ, and should be handled by adding suitable
cases to these switch statements.
2018-04-18 11:29:26 -05:00
Ben Liblit 564a4eb9bd Correctly declare dependency on a task that has not been defined yet 2018-04-18 11:29:26 -05:00
Ben Liblit 054a106ae5 Dependency tweaks suggested by Gradle linter
This partially reverts 72bc456b7.  I'm starting to wonder whether the
linter might be driving us in cycles rather than reaching a fixed
point.  We should keep our eyes on this.
2018-04-18 11:29:26 -05:00
Ben Liblit 16ec6d7461 Simplify file management for a download task 2018-04-18 11:29:26 -05:00
Ben Liblit 0bb899b503 Download, extract, and/or construct various additional bundled jars
I don't really know what these are all used for.  However, Maven+Ant
builds them, so for now Gradle should too.
2018-04-18 11:29:26 -05:00
Ben Liblit 1e1de1bdb9 Prefer single-quoted (non-interpolated) strings where sufficient 2018-04-18 11:29:26 -05:00
Ben Liblit 35663c1264 Teach Gradle how to find and copy a Jar archive that we bundle
I'm not actually sure why this archive is needed, except that it is
mentioned in "META-INF/MANIFEST.MF" and "build.properties".  If we
eventually stop supporting Maven, then we may be able to discard the
"copyJarsIntoLib" task and the corresponding lines in
"META-INF/MANIFEST.MF" and "build.properties"
2018-04-18 11:29:25 -05:00
Ben Liblit dd1f51e8f0 Buildship removed classpath provider thing from all launch configs
This consistently happens when I import WALA as an existing Gradle
project into Eclipse with Buildship.  I don't really know what this
change means, or whether it's desirable.  For now, I'm going to trust
Buildship and see what happens.
2018-04-18 11:29:25 -05:00
Ben Liblit 1ebabf8b60 Complain more loudly about missing output directories 2018-04-18 11:29:25 -05:00
Ben Liblit 3380b78f38 This is no longer how we'll build the native library in Eclipse 2018-04-18 11:29:25 -05:00
Ben Liblit ba5849afb6 Simplify inclusion of "OSGI-INF" and the only file it contains 2018-04-18 11:29:25 -05:00
Ben Liblit 6bcca003a2 Tweak output dirs to match what Buildship puts into ".classpath" 2018-04-18 11:29:25 -05:00
Ben Liblit 9a3ecd6ab9 Disable some Eclipse warnings on Java test inputs
I think these were previously not being compiled at all.  Now, with
Buildship generating Eclipse ".project" settings automatically, these
are being processed.  In general we don't care much about questionable
code in test data, though.
2018-04-18 11:29:25 -05:00
Ben Liblit 89860b53bb Let Buildship create new settings files when importing
These settings files currently are generated with an initial timestamp
comment line, which is not something we'd want to track in version
control.  Fortunately, the contents of these files are entirely
mundane, so there should be no problem with having Buildship generate
them anew each time a developer imports WALA into Eclipse as an
existing Gradle project.
2018-04-18 11:29:25 -05:00
Ben Liblit 4b48f8ee4d Have Buildship add Eclipse plugin (PDE) nature to some subprojects
Specifically, we need this for subprojects that build included plugins
for any of the "*_feature" subprojects.
2018-04-18 11:29:25 -05:00
Ben Liblit 310ef1daa5 Exclude Eclipse ".project" and ".classpath" from version control
Apparently Buildship generates these when one uses Import -> Existing
Gradle Project:
<https://discuss.gradle.org/t/buildship-eclipse-plug-in-multiproject-builds/24030/5>.
We can use the Gradle "eclipse" plugin if customizations are
necessary, but my impression is that the intent is to treat ".project"
and ".classpath" as generated files, not sources to be tracked in
source control.
2018-04-18 11:29:25 -05:00
Ben Liblit 8d0f64f3c6 Update Gradle wrapper to latest version (4.4.1) 2018-04-18 11:29:25 -05:00
Sungho Lee 3984cd0001 Fill the dynamic library path for OSX 2018-04-18 11:29:25 -05:00
Sungho Lee c1f6b70eb0 Fill the dynamic library path for OSX 2018-04-18 11:29:25 -05:00
Ben Liblit 3ce242a22c Simplify loading of plugins shared by many subprojects 2018-04-18 11:29:25 -05:00
Ben Liblit 1432e18c37 Clean up some simple syntactic redundancy in dependency declarations 2018-04-18 11:29:25 -05:00
Sungho Lee 9084cb9ad3 Check Java version 2018-04-18 11:29:25 -05:00
Sungho Lee 6bc547a48b Remove unused dependencies 2018-04-18 11:29:25 -05:00
Ben Liblit 69a67fe7ec Better handling of OS- and architecture-specific JDK paths 2018-04-18 11:29:25 -05:00
Ben Liblit 0500d237f9 Add various test resource directories
Unfortunately these tests are still not finding their resources
properly at test run time.  I don't know why.  It seems to have
something to do with how the tests instantiate and use class loaders.
I'm probably going to need expert help with this.
2018-04-18 11:29:25 -05:00
Ben Liblit 7fc607cc1c Dependency tweaks suggested by Gradle linter 2018-04-18 11:29:25 -05:00
Ben Liblit 3d973e9d61 Find the "xlator_test" shared library at test run time
Dependencies are still not set properly here, so you need to have
built the shared library ("./gradlew xlator_testSharedLibrary") before
running the ":com.ibm.wala.cast.test:test" test task.  But at least
the tests do now find and load that shared library properly.
2018-04-18 11:29:25 -05:00
Ben Liblit 5d5fa18b5f Replace source directories rather than appending to them
I was confused about the differences among:

	srcDir 'foo'
	srcDirs ['foo']
	srcDirs = ['foo']

As it turns out, the first two append to the set of source
directories, while the last replaces this set entirely.  I generally
want replacement, since WALA's current directory layout never matches
Gradle's assumed defaults.
2018-04-18 11:29:25 -05:00
Ben Liblit 0704a66ab1 Cleaner way to form colon-deliminated search path from list of paths 2018-04-18 11:29:25 -05:00
Ben Liblit 0f69db6fe3 Cleaner approach to augmenting Javadoc classpath 2018-04-18 11:29:25 -05:00
Ben Liblit 01a4fe025e Start getting some unit tests to pass
The main requirement here is to arrange for the proper classpath
settings when tests are running so that they can find any associated
resources (i.e., other supporting files).
2018-04-18 11:29:25 -05:00
Ben Liblit 04d9397a1d Tweak classpath for some Javadoc build tasks
This comes up when the Javadoc comments refer to classes in other
subprojects that the corresponding Java code did not actually depend
upon.
2018-04-18 11:29:25 -05:00
Ben Liblit e52c8d981d Declare common library dependencies for source sets, not binaries
No sense repeating this for each binary when it's the same for all of
them.
2018-04-18 11:29:25 -05:00
Ben Liblit b9e712bfa9 Add a second native library and a native executable 2018-04-18 11:29:25 -05:00
Ben Liblit 43a482dfae Add Gradle logic for building a native library
This approach uses no external makefiles; it's pure Gradle.  Nice!
2018-04-18 11:29:25 -05:00
Ben Liblit 6007b11c3f Compile test code, but don't run it for now
The tests are currently broken due to some sort of problem using class
loaders to find supporting resources.  Until I figure this out, better
to have Travis-CI verify only the things we think work.
2018-04-18 11:29:25 -05:00
Ben Liblit 377d7586ef Consistently use simple sorted order for dependencies
This isn't even sorting by library or subproject name.  It's just a
dumb textual sort of the contents of each line.
2018-04-18 11:29:25 -05:00
Ben Liblit db2d34b60d Leave Gradle linter turned on by default, now that it's quieter 2018-04-18 11:29:25 -05:00
Ben Liblit afa982adf2 Properly distinguish main from test code, now that I know how 2018-04-18 11:29:25 -05:00
Ben Liblit a56a3616dc Selectively disable some Gradle linter rules
Specifically, we're not really in a position now to deal with
duplicated classes among our dependencies.  Maybe we can try harder to
examine those in the future, but for now they are a distraction from
other issues that we can attack more readily.
2018-04-18 11:29:25 -05:00
Ben Liblit 9cd5d2ba56 Split generic Java setup from OSGi substitution setup 2018-04-18 11:29:25 -05:00
Ben Liblit 1ca17e93be Automated Gradle-driven download of JLex test input 2018-04-18 11:29:25 -05:00
Ben Liblit 9664b1e5b3 Disable Javadoc linter for now
Some of the linter's checks produce failures (errors) when Gradle
builds the Javadoc documentation.  Fixing them isn't really a Gradle
issue, though, so I don't want to deal with them now.
2018-04-18 11:29:24 -05:00
Ben Liblit 18495ab44d Improve documentation for broad sections of top-level build script 2018-04-18 11:29:24 -05:00
Ben Liblit 9e905c7a04 More Gradle dependency clean-ups suggested by linter
Unfortunately the linter does not reach a fixpoint if you keep trying
to apply its suggestions.  If you include "compile
'org.eclipse.core:org.eclipse.core.runtime:3.10.0.v20140318-2214'" in
the dependencies for "com.ibm.wala.ide.jdt", then the linter tells you
that this dependency is unused and can be removed.  If you remove it,
then the linter tells you that it should be added.  Sigh.
2018-04-18 11:29:24 -05:00
Ben Liblit b3dbdd3357 Fix a tricky cross-subproject Javadoc dependency
By default, each subproject's Javadoc task depends on the same
subproject's Java compilation task, and uses the same classpath.
Thus, any classes that some Java code uses will also be visible when
building the same Java code's documentation.

In this case, we need to see one of the "com.ibm.wala.core" classes in
order to build the "com.ibm.wala.util" documentation.  However, we
cannot have Java compilation of "com.ibm.wala.util" depend on Java
compilation of "com.ibm.wala.core", because that would create a
dependency cycle.  So we need to add this as a special dependency just
for the "com.ibm.wala.util" documentation task, and add the
appropriate classpath as well.

I'm quite proud of myself for figuring out how to do this properly.
2018-04-18 11:29:24 -05:00
Ben Liblit ad60605fe8 In Travis-CI, test Maven and Gradle separately and concurrently
This should help identify cases where the Gradle build only works if
it runs before or after a Maven build.  It will also help us recognize
any Maven regressions accidentally introduced by our Gradle work.
2018-04-18 11:29:24 -05:00
Ben Liblit dec3b8f15b Add a Gradle linter to help me write clean build configurations
The linter does not run by default.  To activate it, use "./gradlew
autoLintGradle".
2018-04-18 11:29:24 -05:00
Ben Liblit 2ef04905c2 Additional explicit dependencies suggested by Gradle linter 2018-04-18 11:29:24 -05:00
Ben Liblit eac47334ca Automated Gradle-driven download of AJAXSLT test inputs
I'm not sure that I am doing this in the best way possible.  But it
seems to be working.  Refinements are welcome!
2018-04-18 11:29:24 -05:00
Ben Liblit 2716731357 Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit 209c1d25c6 Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit cd304237ea Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit 8e5415e3db Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit 25a52254f5 Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit f41baeb0f8 Add a direct dependency that previously we picked up transitively 2018-04-18 11:29:24 -05:00
Ben Liblit cebf14c8c5 Run a Gradle build after the Maven build
Eventually I'll want to swap that order, so that we know that Gradle
builds work even without any help from Maven build setup logic.  For
now, though, I just want to test whether the Gradle build works at
all.
2018-04-18 11:29:24 -05:00
Ben Liblit 530d74929f Many improvements to Gradle build support, including within Eclipse 2018-04-18 11:29:24 -05:00
Sungho Lee ffaa2e4626 change hamcrest library version of core.tests 2018-04-18 11:29:24 -05:00
Sungho Lee b4fa7f425b Support the gradlew build 2018-04-18 11:29:24 -05:00
Sungho Lee 50d0f7ee71 Change build.gradle files for proper format and delete all tests 2018-04-18 11:29:24 -05:00
Sungho Lee 4a31927b00 Gradle build scripts 2018-04-18 11:29:24 -05:00
Ben Liblit 99c2493e37 Revert "Build WALA using Gradle instead of Maven" (#298) 2018-04-18 12:15:56 -04:00
Julian Dolby 8f41069b23
Merge pull request #278 from liblit/gradle-and-buildship
Build WALA using Gradle instead of Maven
2018-04-18 08:22:25 -04:00
Ben Liblit 6639d8b93a Bump version to 1.5.0-SNAPSHOT before merging with WALA master
This gives the WALA maintainers the option of doing future 1.4.5+
releases from of a pre-Gradle branch if these merged Gradle changes
turn out to be more disruptive than expected.
2018-04-17 15:32:01 -05:00
Ben Liblit 742cad58e9 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
2018-04-17 15:02:36 -05:00
Julian Dolby 89ffb96acf more work on file names 2018-04-17 15:02:36 -05:00
Julian Dolby 1ba0082896 fixes for nodejs performance 2018-04-17 15:02:36 -05:00
Ben Liblit 563d7446d1 Tell Travis CI to be even more patient during initial p2AsMaven downloads 2018-04-17 15:02:36 -05:00
Ben Liblit 0290469ba7 Tell Travis CI to be more patient during initial p2AsMaven downloads 2018-04-17 15:02:36 -05:00
Ben Liblit 5df33f85d7 Simplify how we refer to the outputs of certain tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 929fdb99af Exclude a test that has started failing due to running out of memory
I don't know what changes are triggering this.  Presumably it's
something to do with the temporary-file code, but I don't see why that
would happen.  For now, let's just skip this test.
2018-04-17 15:02:36 -05:00
Ben Liblit 7886fa13dc Don't put fixed-name, writable files into "java.io.tmpdir"
If multiple tests both write to "/tmp/cg.txt" (for example), then
these tests cannot safely run concurrently.  That never used to be a
problem with Maven, since our Maven tests were all strictly sequential
anyway.  But parallelized testing using Gradle requires that we do
better.  Fortunately, Java has perfectly reasonable APIs for
generating uniquely-named temporary files and directories.
2018-04-17 15:02:36 -05:00
Ben Liblit 6599d3d294 Don't use build cache (a.k.a. task output caching) under Travis CI
The performance improvement offered by the build cache is modest when
run by Travis CI.  This is probably because Travis CI does not keep
the cache on any local machine.  Instead, Travis CI uploads the build
cache across a network at the end of each run, then restores the cache
across the network at the start of the next run.  So in many cases
we're simply trading network access to original downloads for network
access to the cache image.

Furthermore, it's probably a better test to perform Travis CI testing
jobs from something closer to a clean slate.  We really want to know
whether everything builds and passes tests correctly starting from
nothing.  We don't want to risk accidentally thinking something would
work simply because we have a cached copy of what it did when it
worked previously.
2018-04-17 15:02:36 -05:00
Ben Liblit 93c8d126b8 Unpack Android SDK and install extra components as a single task
Previously we unpacked in one task, then installed two extra
components in two dependent tasks.  However, installing extra
components modifies some files in place, effectively making those
files both inputs and outputs.  That creates race conditions, and
probably interferes with task output caching.  Better, then, to treat
the unpack and extra installations all as a single task whose output
is the complete Android SDK tree with all required components
installed.
2018-04-17 15:02:36 -05:00
Ben Liblit b13e5d72b1 If tests fail, print full stack traces to aid debugging 2018-04-17 15:02:36 -05:00
Ben Liblit 9cbfff23f5 Enable both parallel builds and build output caching by default
This should give us a nice build-performance boost, both locally and
in Travis CI.  I've used parallel builds routinely for months now, and
they're working fine.  Build output caching is newer, but it also
seems to be working well and saves us tremendous time on downloads.
2018-04-17 15:02:36 -05:00
Ben Liblit c034dce3c3 Allow parallel testing within each subproject
Without this setting, Gradle would run multiple "test" tasks from
multiple subprojects concurrently, but each "test" task would only run
a single test at a time.  Some of our subprojects' test tasks take a
long time to complete, which could easily leave us sequentially
testing on just one or two CPU cores while other cores sit idle.

With this change, Gradle will use as many task slots as are
available (e.g., when run with "--parallel") to run multiple
simultaneous JUnit test classes within any given subproject.  This
seems to be fine for us:  I am unaware of any shared global state that
would cause conflicts between two test classes within any given
subproject.
2018-04-17 15:02:36 -05:00
Ben Liblit 3f5460231e Don't try to exhaustively anticipate all generated header names
When JNI headers for a given class, each nested class will end up with
its own additional header.  But I don't want to try to parse nested
class details out of the Java source files just so we can determine
exactly which headers will be created.  Instead, simply treat the
entire header destination directory as the output of this task.
2018-04-17 15:02:36 -05:00
Ben Liblit 66a4d20e3a Improve build caching by reducing path sensitivity where appropriate 2018-04-17 15:02:36 -05:00
Ben Liblit 6869a4d5f4 Enable caching of task outputs for custom build tasks 2018-04-17 15:02:36 -05:00
Ben Liblit e42e36c4de Rename a build task to more clearly reflect what it builds
This task has an input named "hello_hash.ml", and an output named
"hello_hash.jar".  So calling this task "generateHelloHash" is too
vague.  Now we call it "generateHelloHashJar" instead.
2018-04-17 15:02:36 -05:00
Ben Liblit 4f94b4c341 Extend Gradle's "clean" task to remove some additional build targets 2018-04-17 15:02:36 -05:00
Ben Liblit b4fca9c38d Merge info from existing, hand-authored manifests when building jars 2018-04-17 15:02:36 -05:00
Ben Liblit 272e3adaf8 Tell Eclipse to ignore some questionable manifest contents
These manifest files are here for use by the Maven build, but Eclipse
is now using Gradle (via Buildship).  So the manifests as seen by
Eclipse do not entirely make sense.  I'm hesitant to change the
manifests directly, since presumably they were correct for Maven and
still are.

Perhaps some day we'll be using Gradle to generate manifests.  Until
that day comes, we're better off leaving the manifests as they are and
just suppressing Eclipse's warnings instead.
2018-04-17 15:02:36 -05:00
Ben Liblit 9d7df5de7e After Builldship import, put "dx.jar" where the manifest expects it 2018-04-17 15:02:36 -05:00
Ben Liblit 7a5f140127 Restore old manifests in hope of fixing Maven regressions 2018-04-17 15:02:36 -05:00
Ben Liblit 4a707d954a Bail out if any Travis CI testing commands fail
Previously we could fail some "mvn" stage but keep running anyway,
thereby fooling us into thinking that everything was OK.
2018-04-17 15:02:36 -05:00
Ben Liblit 08dc11ad7d Incremental improvements to Windows JDK library configuration
This still doesn't actually work, but it's closer than it was before.
There's still some problem with improper mixing of 32-bit ("x86") and
64-bit ("x64") libraries.
2018-04-17 15:02:36 -05:00
Ben Liblit e8b86fdf82 Clean up questionable memory management during string construction
Avoid allocating memory using strdup() and then releasing it using
operator delete.  strdup()-allocated memory should be released using
free(), not delete.  But in these specific cases, there really was
never any good reason to duplicate the C-style strings in the first
place.  Instead, we can safely pass those NUL-terminated char pointers
directly in calls to JNI's NewStringUTF().  NewStringUTF() does not
take ownership of its argument, but rather clones that string data
internally before returning.  So using strdup() and delete was just
unnecessary memory churn.

In cases where we need to format, concatenate, or construct new
strings, don't use sprintf() into variable-sized, stack-allocated
arrays.  Variable-sized arrays are not portable, and in particular are
rejected by Microsoft's Visual Studio 2017 C++ compiler.  Instead, do
our string formatting and manipulations using std::ostringstream
and/or std::string.  We just need to be a bit careful about the
lifetimes and ownership responsibilities of allocated data.  In
brief, (1) ostringstream::str() returns a temporary string instance
that expires at the end of the enclosing statement, independent of the
lifetime of the ostringstream instance; while (2) string::c_str()
returns an pointer to internal data that remains valid as long as the
string on which it was called is valid and unmodified.
2018-04-17 15:02:36 -05:00
Ben Liblit 4b04f8d812 Somebody decided to use three-space indentation in this file only
OK, whatever makes you happy.
2018-04-17 15:02:36 -05:00
Ben Liblit e9fa6f31b3 Fill in likely (but untested) JVM library path on Windows 2018-04-17 15:02:36 -05:00
Ben Liblit 0a21f20348 Factor out common code for installing Android SDK components 2018-04-17 15:02:36 -05:00
Ben Liblit ad111547de Skip DroidBench tests on Windows, for now
The default location of DroidBench in "/tmp/DroidBench" does not work
well on Windows. So let's disable these tests until someone has time to
make that path more portable.
2018-04-17 15:02:36 -05:00
Ben Liblit f568db5de6 Fix Android SDK installation under Windows 2018-04-17 15:02:36 -05:00
Ben Liblit 7f8de6d611 Switch to a different DroidBench download URL
This URL skips over a redirect that the previous URL went through.
This URL also avoids an annoying "Invalid cookie header" warning that
the previous URL produced.
2018-04-17 15:02:36 -05:00
Ben Liblit e4f9fedf38 Use download task instead of "git clone" to get DroidBench
This gives us better progress reporting during the download, better
caching, better file-level dependency tracking, etc.
2018-04-17 15:02:36 -05:00
Ben Liblit 813c79caa0 Factor out recurring pattern in download tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 4749fe47c0 Experimental combined task for download and checksum verification
Not working yet:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.
2018-04-17 15:02:36 -05:00
Ben Liblit ba455f4737 Update gradle-download-plugin and use some of its new features
We now download and verify checksums as a single task, rather than as
two separate tasks.  This simplifies other task dependencies, since we
no longer have a checksum-verified "stamp" file separate from the
download itself.  Unfortunately the combined task now has a
significant amount of repeated boilerplate.  I'm hoping to refactor
that all out into a custom task class, but haven't yet figured out the
details:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.

We now also use ETags to be smarter about when a fresh download is or
is not actually needed.  I think there are still opportunities for
improved caching here, but this is a step in the right direction.
2018-04-17 15:02:36 -05:00
Ben Liblit 17f42c3725 If Travis CI gives us multiple CPUs, we may as well use them
I believe Travis CI jobs get two CPUs by default.

Doing parallel builds regularly is also a good way to help us discover
any build race conditions we may have.  There's no guarantee that any
such races will be revealed, but even exposing them
nondeterministically is better than having no possibility of exposing
them at all.
2018-04-17 15:02:36 -05:00
Ben Liblit 96055cca75 Fix a shellcheck warning when setting a variable to the empty string 2018-04-17 15:02:36 -05:00
Ben Liblit 00a645100e Update to Gradle 4.6
No significant new features of interest for us in this release, but I
like to keep current.
2018-04-17 15:02:36 -05:00
Ben Liblit 596c9091bb Add a new README with Gradle-specific instructions and tips 2018-04-17 15:02:36 -05:00
Ben Liblit 29fad5b1e0 Remove two Maven repositories that we no longer use for anything
We used to use these to find various Eclipse packages, but that was
always a dodgy affair since we never quite knew whether we had
matching versions of everything.  Now that we are using the
"com.diffplug.gradle.p2.asmaven" plug-in, though, we have much better
control over getting exactly the Eclipse material we need.  These two
Maven repositories no longer provide anything we use, and therefore
can be removed.
2018-04-17 15:02:36 -05:00
Ben Liblit 43f7704d5d We only expect ".gradle" directories in two specific places 2018-04-17 15:02:36 -05:00
Ben Liblit 84f1977ab4 Generalize post-import Eclipse run configuration for more fixups
Previously this launcher's job was to run "processTestResources" and
any other Gradle tasks needed to create files that Eclipse was
expecting to be available.  But we also want to use it to revert the
bad changes that Buildship applies to ".launch" configuration files.

This is a temporary hack to work around
<https://github.com/eclipse/buildship/issues/653>.
2018-04-17 15:02:36 -05:00
Ben Liblit 5b1aed99a7 Minor indentation fix 2018-04-17 15:02:36 -05:00
Ben Liblit faf3b86e1b Extra help for finding "cast" native library on macOS
Unlike Linux, macOS has no "RPATH" facility for embedding additional
search paths within shared libraries.  Instead, we need to set
"DYLD_LIBRARY_PATH" appropriately in the environment.  This
environment variable is the macOS analogue of "LD_LIBRARY_PATH" on
Linux.

Note that adding the required path to the "java.library.path" system
property will *not* work.  This property only affects where the JVM
looks for shared objects that it is loading directly.  This property
does not influence the search for other, transitively-required shared
objects.

Fixes #3.
2018-04-17 15:02:36 -05:00
Ben Liblit cac0e87082 Fix remaining Javadoc warnings
This fixes the last of our Javadoc warnings without creating a
circular dependency between ":com.ibm.wala.cast:javadoc" and
":com.ibm.wala.cast.js:javadoc".  Fixes #4, wherein more details about
this tricky dependency challenge can be found.
2018-04-17 15:02:36 -05:00
Ben Liblit 709c38c049 Use ".singleFile" instead of "[0]" when we expect just one file
This documents our intent more clearly, and actively checks for
mistakes rather than silently ignoring unexpected extra files.
2018-04-17 15:02:36 -05:00
Ben Liblit e4f8d00cbe Start exploring publication features by adding source jar archives 2018-04-17 15:02:36 -05:00
Ben Liblit 2bf92e1214 Replicate test include/exclude patterns already used in Maven builds 2018-04-17 15:02:36 -05:00
Ben Liblit f287ee5c41 Add "com.ibm.wala.core.testdata" to classpath for testing
This lets the "DynamicCallGraphTest" tests pass.  The tests in that
class expect to find some element of the classpath that includes the
substring "com.ibm.wala.core.testdata".  They then treat that as a
collection of bytecode files to instrument.
2018-04-17 15:02:36 -05:00
Ben Liblit b8f1bb3aaf Skip a test intentionally; Maven already does the same
Big thanks to Julian for showing me where this exclusion logic lives
in the Maven configuration.  There's a "**/*AndroidLibs*.java"
exclusion pattern in the top-level "pom.xml".
2018-04-17 15:02:36 -05:00
Ben Liblit 2763589d1f Fix jar exclusion patterns to match what Ant uses
One previously-failing test class now passes.  Progress!
2018-04-17 15:02:36 -05:00
Ben Liblit d301a89f4f Add some Eclipse dependencies needed only when running tests
This allows two test classes to pass that previously were failing.
Yay!
2018-04-17 15:02:36 -05:00
Ben Liblit 06d464216b Add a resource directory containing a zip archive used for testing
The excluded test in this subproject still does not pass, though now
it's failing for a different reason than before.  Progress, I suppose!
2018-04-17 15:02:36 -05:00
Ben Liblit 7227deb8a9 Disable Gradle linter check for unused dependencies in Travis CI
It's telling me to remove "eclipse-deps:org.eclipse.core.runtime:+"
and "org.osgi:org.osgi.core:4.2.0" as unused dependencies in the
"com.ibm.wala.cast.java.ecj" subproject.  However, these two
dependencies (jar files) are actually needed; compilation fails
without them.
2018-04-17 15:02:36 -05:00
Ben Liblit 7e0ac84a03 Also get Eclipse JSDT from a P2 repository, but not the same one 2018-04-17 15:02:36 -05:00
Ben Liblit 5e0e251766 Find Eclipse jars using local Maven mirror of Eclipse P2 repository
This should give us a set of mutually-consistent jars rather than
picking up random, outdated pieces from Maven Central or wherever else
I could find them.  We now also have a single, central place where we
set the Eclipse version that we're building against.  Much, *much*
cleaner.
2018-04-17 15:02:36 -05:00
Ben Liblit 196dd2d971 Assume that Eclipse needs all standard test-resource processing 2018-04-17 15:02:36 -05:00
Ben Liblit d230fe836c Trivial whitespace tweak 2018-04-17 15:02:36 -05:00
Ben Liblit eb2d2dd850 Exclude one macOS test that I don't know how to fix right now 2018-04-17 15:02:36 -05:00
Ben Liblit e9ea4d7f1d Download appropriate Android SDK for current OS 2018-04-17 15:02:36 -05:00
Ben Liblit c02776fc4d Try to continue building/testing even after the first failure
If other, non-dependent tasks would also fail, I'd rather discover all
of them at once.
2018-04-17 15:02:36 -05:00
Ben Liblit fb33cbe03b "rm" on macOS apparently doesn't understand long ("--foo") flags 2018-04-17 15:02:36 -05:00
Ben Liblit cb72ebc177 macOS doesn't seem to have "xvfb-run", and may not need it anyway 2018-04-17 15:02:36 -05:00
Ben Liblit aff4067c39 Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
We're not going to attempt macOS Travis CI testing for Maven builds,
because I don't know whether that's even expected to work on the
official WALA master branch.  Our main focus here is Gradle.

Note that Travis macOS images do not support JDK switching, so
explicitly selecting the JDK version now becomes part of the
Linux-only configuration.

Travis macOS images also do not support Android as a build "language".
So our Travis CI configuration for Gradle builds now declares that
this is a Java project rather than an Android one.  That's OK, though,
because our Gradle scripts already handle downloading the Android SDK;
we don't need Travis CI to do that for us.  When building using Maven,
though, we still call this an Android project because Maven builds do
still rely on Travis CI to provide the Android SDK.

squash! Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
2018-04-17 15:02:36 -05:00
Ben Liblit 0e231b4363 Download a specific DroidBench release that we know works for us
If future DroidBench changes include things we need, then we can
decide to move to those newer revisions.  But we shouldn't allow
DroidBench to change out from under us implicitly whenever someone
commits something new to the DroidBench repository.
2018-04-17 15:02:36 -05:00
Ben Liblit 49eda8ffab Add "TODO" reminders of furture refactoring opportunities 2018-04-17 15:02:36 -05:00
Ben Liblit cdd4aac942 Factor out some repeated accesses to a task's output files 2018-04-17 15:02:35 -05:00
Ben Liblit 9b5cc743fe Derive Android platforms version from Android build-tools version
This should help us keep the two in sync if the latter changes one
day.
2018-04-17 15:02:35 -05:00
Ben Liblit 18a4edd84e Got DynamicDalvikComparisonJavaLibsTest working at some point 2018-04-17 15:02:35 -05:00
Ben Liblit ff8f6ec348 Ignore a transient file that appears during testing 2018-04-17 15:02:35 -05:00
Ben Liblit e3ebd87242 Grab an additional archive needed by DalvikAnnotationsTest 2018-04-17 15:02:35 -05:00
Ben Liblit 22acff5130 Download a few additional supporting files needed by tests 2018-04-17 15:02:35 -05:00
Ben Liblit d78d68176e Import a class that we will soon be using multiple times 2018-04-17 15:02:35 -05:00
Ben Liblit e529c9d96f Fix accidental copying of entire subproject as test resource 2018-04-17 15:02:35 -05:00
Ben Liblit e70ddf4dec Use an "android.jar" that matches the "dx.jar" we are already using
Nothing was obviously failing with the older "android.jar", but I feel
more comfortable knowing that these two are more closely matched.
2018-04-17 15:02:35 -05:00
Ben Liblit 1a82397fd7 Suppress harmless broken-pipe warnings from "yes" 2018-04-17 15:02:35 -05:00
Ben Liblit bcf685ba40 Set Android build-tools version in just one place 2018-04-17 15:02:35 -05:00
Ben Liblit b2fa87efe3 Use more recent "dx.jar" than is available through Maven Central
This lets us ditch pre-Java-8 in the Gradle build.  (The official WALA
master branch recently got rid of pre-Java-8 in its Maven build.)
That, in turn, lets two "com.ibm.wala.dalvik.test" tests pass that
previously were failing.  We still have two other failing tests in
that subproject, but this is definitely progress!

Our Gradle build scripts manage the entire process of downloading and
locally installing the appropriate Android SDK.  That includes
automatically accepting a license.  Maybe some lawyer will throw a fit
about that some day.  Until then, I'd rather have a build system that
does everything needed without imposing additional manual steps on
developers.
2018-04-17 15:02:35 -05:00
Ben Liblit 16c056f196 Ignore some transient files that appear during testing 2018-04-17 15:02:35 -05:00
Ben Liblit 9082a5205a Set name and version to help Gradle composite-build substitutions 2018-04-17 15:02:35 -05:00
Ben Liblit 2674806aa5 Update Eclipse JUnit test launchers for use with Buildship
Previously Buildship removed its classpath from all of these
launchers.  Now it's automatically putting that back in as soon as I
visit each launcher in Eclipse's "Run Configurations" dialog.  Not
sure what's going on here, but it certainly seems more sane to me to
assume that the Buildship-computed classpath *is* needed for all of
these.  I have an open question on the Gradle discussion forum to try
to understand what's going on here and how to fix it:
<https://discuss.gradle.org/t/launchers-lose-buildship-classpath-on-import-regain-it-later/25641>.
2018-04-17 15:02:35 -05:00
Ben Liblit 5de787bb2a Update Eclipse "Java Application" launchers for use with Buildship 2018-04-17 15:02:35 -05:00
Ben Liblit 83abb6a10a Use Eclipse-computed paths rather than hard-coding absolute paths 2018-04-17 15:02:35 -05:00
Ben Liblit b30da752e0 Remove launchers whose main Java code is found nowhere in WALA 2018-04-17 15:02:35 -05:00
Ben Liblit 557ea62426 Note some excessive resource copying that we should eventually fix 2018-04-17 15:02:35 -05:00
Ben Liblit 5b7e3f750e Create a broad "Process Test Resources" Eclipse launch configuration
This should prepare test resources for all subprojects.  A WALA
developer should run this once before running any tests inside
Eclipse.  Initially I'd hoped to make this more narrowly focused, but
Eclipse just doesn't have the infrastructure to deal with fine-grained
dependencies.  On the other hand, running "./gradlew
eclipsePrepareTestResources" automatically for each build seems like
overkill, and could end up being rather slow.  So for now we require
that the developer run this once, by hand.
2018-04-17 15:02:35 -05:00
Ben Liblit 62d7980ea3 Fix various warnings produced by "./gradlew javadoc"
Three stubborn warnings remain, but this is progress!
2018-04-17 15:02:35 -05:00
Ben Liblit 72a9ddd2d7 Fix warnings about Javadoc links to "java.lang.reflect" package 2018-04-17 15:02:35 -05:00
Ben Liblit 57e3dc15fa Trigger custom clean tasks whenever running "./gradlew clean"
A cleaned tree is now much closer to a pristine tree that has just
been checked out and never built.  The only extra created files that
are left behind are ".gradle", "buildSrc/.gradle", and
"buildSrc/build".
2018-04-17 15:02:35 -05:00
Ben Liblit 48fe74cba7 Unpack node.js in the same place that Maven unpacks it
This gets rid of some Eclipse warnings that stem from Buildship being
confused about what it should treat as a source directory if Maven and
Gradle are both being used in the same tree.
2018-04-17 15:02:35 -05:00
Ben Liblit 4809a365de Tweak Buildship-generated Eclipse ".project" file for extra jars 2018-04-17 15:02:35 -05:00
Ben Liblit ca5824a214 Update Gradle wrapper to Gradle 4.5
No major new features for us here, but better native caching and other
performance improvements.
2018-04-17 15:02:35 -05:00
Ben Liblit f7f8dd4351 Get a core test to work by putting "bcel-5.2.jar" where expected 2018-04-17 15:02:35 -05:00
Ben Liblit 2233d56d2a Get a Dalvik test to work by putting "dx.jar" where expected 2018-04-17 15:02:35 -05:00
Ben Liblit 9df594189d Compute a library path from the native software model
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.  That being said, extracting this
information from the depths of the native software model seems *far*
more complex than it should be.  I had hoped for something nicer in
response to
<https://discuss.gradle.org/t/compute-wl-rpath-flag-suitable-for-native-shared-library/25278>,
but so far there's nothing.
2018-04-17 15:02:35 -05:00
Ben Liblit a3f524f7a9 Compute a library path from the corresponding linker task
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.
2018-04-17 15:02:35 -05:00
Ben Liblit 2a6eee85a4 rpath only matters for shared libraries 2018-04-17 15:02:35 -05:00
Ben Liblit 3b8e32b322 Add previously-undeclared dependency of tests on native library 2018-04-17 15:02:35 -05:00
Ben Liblit b2ba188176 Avoid random leftover junk by using "Sync" instead of "Copy" 2018-04-17 15:02:35 -05:00
Ben Liblit 1b4e04be6a Simplify filtering of archive contents 2018-04-17 15:02:35 -05:00
Ben Liblit df8a61a8d7 Override specific "cleanFooBar" tasks instead of generic "clean" 2018-04-17 15:02:35 -05:00
Ben Liblit 84b0846517 Be more concise by calling property setters instead of assigning 2018-04-17 15:02:35 -05:00
Ben Liblit d3ddbd6343 Be more concise by omitting implicit "it." in closures 2018-04-17 15:02:35 -05:00
Ben Liblit f12f5faa83 Change archive file names while unpacking, rather than in two stages 2018-04-17 15:02:35 -05:00
Ben Liblit 016538b688 Use Groovy's implicit "it" closure argument 2018-04-17 15:02:35 -05:00
Ben Liblit 3b4ae0f210 Remove leftover debugging output that I no longer need 2018-04-17 15:02:35 -05:00
Ben Liblit cad94b7076 Download "android-4.1.1.4.jar" (as "android.jar") when needed
Previously Maven did this, but Gradle did not.  So Gradle testing
would only succeed if we'd already done a Maven build first.  Now
these tests pass in a fresh tree that's never seen a Maven build.
2018-04-17 15:02:35 -05:00
Ben Liblit 141e4a6b41 Simplify how we refer to a task's only output 2018-04-17 15:02:35 -05:00
Ben Liblit f628ee1e08 Don't bother importing when we only need one symbol, one time 2018-04-17 15:02:35 -05:00
Ben Liblit 8058acb18b Download NodeJS and include its "lib/*.js" files in jar archive 2018-04-17 15:02:35 -05:00
Ben Liblit aabace3241 Remove "extraBundledJars" task, which nothing else actually uses
Some tests in other subprojects do depend on some these extra jar
files.  But they can declare those specific dependencies as needed.
Nothing seems to depend on the entire group of extra jars, so it's not
really useful to declare a task that is merely an alias for all of
them.
2018-04-17 15:02:35 -05:00
Ben Liblit 3b172370d0 Set working directory in the same way Maven does
This seems to help ECJSyncDuplicatorTest find a "./src/Monitor2.java"
file that it needs.  The test still fails, though, for other reasons.
2018-04-17 15:02:35 -05:00
Ben Liblit b24f60e727 Enable a few more tests that started working, or perhaps always did 2018-04-17 15:02:35 -05:00
Ben Liblit 60870d7231 Factor out recurring pattern of MD5 checksum + stamp file 2018-04-17 15:02:35 -05:00
Ben Liblit 2c1bc5c52c Replicate Maven's extra system property settings for some tests 2018-04-17 15:02:35 -05:00
Ben Liblit 9c58a94056 Add missing test resources to make many more regression tests pass 2018-04-17 15:02:35 -05:00
Ben Liblit 9d9b10cd0a Remove some test exclusions that are not actually needed now 2018-04-17 15:02:35 -05:00
Ben Liblit b1f0cfce15 Replicate Maven's heap size limits for tests 2018-04-17 15:02:35 -05:00
Ben Liblit 737e948640 Buildship removed classpath provider thing from more launch configs
This is more of the same sort of change first seen in a1bd95d.  Still
no idea why it happens; still hoping that Buildship knows what it's
doing.
2018-04-17 15:02:35 -05:00
Ben Liblit bde936eec5 Turn on proper regression testing in Travis-CI
Many tests are excluded until
<https://github.com/liblit/WALA/issues/5> is fixed.  But we can at
least have Travis-CI watching over our shoulder to ensure that
no *new* regressions sneak into the tree.
2018-04-17 15:02:35 -05:00
Ben Liblit e2e340b490 Explicitly disable regression tests that are currently failing
<https://github.com/liblit/WALA/issues/5> notes that several
subprojects' tests are currently broken under Gradle.  I'd still like
to be able to run non-broken tests, though.  So here I'm disabling the
failing tests.  The intent is to treat these exclusions as a to-do
list.  We can remove exclusions as we get the corresponding tests
working.  No more exclusions means
<https://github.com/liblit/WALA/issues/5> is fixed.
2018-04-17 15:02:35 -05:00
Ben Liblit 6a4ed60e9a Explicitly make "/tmp/DroidBench" be a file, not just a string
I'm hoping this might remove some seemingly-spurious reruns of this
task.  Still not sure why those are happening, though.
2018-04-17 15:02:35 -05:00
Ben Liblit 56b3c1d37c Do not run Gradle linter by default
It's rather slow, adding roughly five seconds to every "./gradlew"
invocation.  And the advice it gives might not even be reaching a
fixed point.  I like the idea of running the linter as part of CI
testing, but I now think it's overkill to impose on every developer
build.
2018-04-17 15:02:35 -05:00
Ben Liblit 582fb2a97b Dependency tweaks suggested by Gradle linter
I'm starting to wonder whether the linter might be driving us in
cycles rather than reaching a fixed point.  We should keep our eyes on
this.
2018-04-17 15:02:35 -05:00
Ben Liblit a32a3e3191 Teach Gradle how to download "/tmp/DroidBench" when needed
One less thing for developers to have to remember to do manually!
2018-04-17 15:02:35 -05:00
Ben Liblit 75270b18ca Give each verification task an output for better incremental building 2018-04-17 15:02:35 -05:00
Ben Liblit 365d17bf32 Simplify how we refer to existing tasks 2018-04-17 15:02:35 -05:00
Ben Liblit e654e3dd16 Add missing resources for "com.ibm.wala.cast.js.test" tests
The ":com.ibm.wala.cast.js.test:build" task now passes.
2018-04-17 15:02:35 -05:00
Ben Liblit 6fec4bba94 RPath settings apply only to Linux; some only to Linux on x86_64
I don't know whether Windows or MacOS needs anything similar.  If they
do, the details will differ, and should be handled by adding suitable
cases to these switch statements.
2018-04-17 15:02:35 -05:00
Ben Liblit 23a301cfff Correctly declare dependency on a task that has not been defined yet 2018-04-17 15:02:35 -05:00
Ben Liblit 6baa918963 Dependency tweaks suggested by Gradle linter
This partially reverts 72bc456b7.  I'm starting to wonder whether the
linter might be driving us in cycles rather than reaching a fixed
point.  We should keep our eyes on this.
2018-04-17 15:02:35 -05:00
Ben Liblit e4cc086476 Simplify file management for a download task 2018-04-17 15:02:35 -05:00
Ben Liblit cf9281719a Download, extract, and/or construct various additional bundled jars
I don't really know what these are all used for.  However, Maven+Ant
builds them, so for now Gradle should too.
2018-04-17 15:02:35 -05:00
Ben Liblit e32b495354 Prefer single-quoted (non-interpolated) strings where sufficient 2018-04-17 15:02:35 -05:00
Ben Liblit be8f22145e Teach Gradle how to find and copy a Jar archive that we bundle
I'm not actually sure why this archive is needed, except that it is
mentioned in "META-INF/MANIFEST.MF" and "build.properties".  If we
eventually stop supporting Maven, then we may be able to discard the
"copyJarsIntoLib" task and the corresponding lines in
"META-INF/MANIFEST.MF" and "build.properties"
2018-04-17 15:02:35 -05:00
Ben Liblit fd4d68d278 Buildship removed classpath provider thing from all launch configs
This consistently happens when I import WALA as an existing Gradle
project into Eclipse with Buildship.  I don't really know what this
change means, or whether it's desirable.  For now, I'm going to trust
Buildship and see what happens.
2018-04-17 15:02:35 -05:00
Ben Liblit 0d557aec3b Complain more loudly about missing output directories 2018-04-17 15:02:35 -05:00
Ben Liblit 18e34918d5 This is no longer how we'll build the native library in Eclipse 2018-04-17 15:02:35 -05:00
Ben Liblit 8f52ab8d36 Simplify inclusion of "OSGI-INF" and the only file it contains 2018-04-17 15:02:35 -05:00
Ben Liblit d14d40ee3f Tweak output dirs to match what Buildship puts into ".classpath" 2018-04-17 15:02:35 -05:00
Ben Liblit 51c9e062f4 Disable some Eclipse warnings on Java test inputs
I think these were previously not being compiled at all.  Now, with
Buildship generating Eclipse ".project" settings automatically, these
are being processed.  In general we don't care much about questionable
code in test data, though.
2018-04-17 15:02:35 -05:00
Ben Liblit efd3a6ab18 Let Buildship create new settings files when importing
These settings files currently are generated with an initial timestamp
comment line, which is not something we'd want to track in version
control.  Fortunately, the contents of these files are entirely
mundane, so there should be no problem with having Buildship generate
them anew each time a developer imports WALA into Eclipse as an
existing Gradle project.
2018-04-17 15:02:35 -05:00
Ben Liblit da27efec97 Have Buildship add Eclipse plugin (PDE) nature to some subprojects
Specifically, we need this for subprojects that build included plugins
for any of the "*_feature" subprojects.
2018-04-17 15:02:35 -05:00
Ben Liblit be11083cd8 Exclude Eclipse ".project" and ".classpath" from version control
Apparently Buildship generates these when one uses Import -> Existing
Gradle Project:
<https://discuss.gradle.org/t/buildship-eclipse-plug-in-multiproject-builds/24030/5>.
We can use the Gradle "eclipse" plugin if customizations are
necessary, but my impression is that the intent is to treat ".project"
and ".classpath" as generated files, not sources to be tracked in
source control.
2018-04-17 15:02:35 -05:00
Ben Liblit 2753810958 Update Gradle wrapper to latest version (4.4.1) 2018-04-17 15:02:35 -05:00
Sungho Lee 41fe177e89 Fill the dynamic library path for OSX 2018-04-17 15:02:35 -05:00
Sungho Lee 2e03ded0f8 Fill the dynamic library path for OSX 2018-04-17 15:02:35 -05:00
Ben Liblit 2bc0768242 Simplify loading of plugins shared by many subprojects 2018-04-17 15:02:35 -05:00
Ben Liblit db348b4ddd Clean up some simple syntactic redundancy in dependency declarations 2018-04-17 15:02:35 -05:00
Sungho Lee a185ae500e Check Java version 2018-04-17 15:02:35 -05:00
Sungho Lee 6016bfa21f Remove unused dependencies 2018-04-17 15:02:35 -05:00
Ben Liblit 95d7bf775e Better handling of OS- and architecture-specific JDK paths 2018-04-17 15:02:35 -05:00
Ben Liblit 4b6c26eb07 Add various test resource directories
Unfortunately these tests are still not finding their resources
properly at test run time.  I don't know why.  It seems to have
something to do with how the tests instantiate and use class loaders.
I'm probably going to need expert help with this.
2018-04-17 15:02:35 -05:00
Ben Liblit e9a79212c8 Dependency tweaks suggested by Gradle linter 2018-04-17 15:02:35 -05:00
Ben Liblit e64fbc7050 Find the "xlator_test" shared library at test run time
Dependencies are still not set properly here, so you need to have
built the shared library ("./gradlew xlator_testSharedLibrary") before
running the ":com.ibm.wala.cast.test:test" test task.  But at least
the tests do now find and load that shared library properly.
2018-04-17 15:02:35 -05:00
Ben Liblit 651f40c170 Replace source directories rather than appending to them
I was confused about the differences among:

	srcDir 'foo'
	srcDirs ['foo']
	srcDirs = ['foo']

As it turns out, the first two append to the set of source
directories, while the last replaces this set entirely.  I generally
want replacement, since WALA's current directory layout never matches
Gradle's assumed defaults.
2018-04-17 15:02:35 -05:00
Ben Liblit f7c7419351 Cleaner way to form colon-deliminated search path from list of paths 2018-04-17 15:02:35 -05:00
Ben Liblit 5f513fd643 Cleaner approach to augmenting Javadoc classpath 2018-04-17 15:02:35 -05:00
Ben Liblit e23e6786da Start getting some unit tests to pass
The main requirement here is to arrange for the proper classpath
settings when tests are running so that they can find any associated
resources (i.e., other supporting files).
2018-04-17 15:02:35 -05:00
Ben Liblit a81d583cbf Tweak classpath for some Javadoc build tasks
This comes up when the Javadoc comments refer to classes in other
subprojects that the corresponding Java code did not actually depend
upon.
2018-04-17 15:02:35 -05:00
Ben Liblit 1a3a1570af Declare common library dependencies for source sets, not binaries
No sense repeating this for each binary when it's the same for all of
them.
2018-04-17 15:02:35 -05:00
Ben Liblit 35e04bc598 Add a second native library and a native executable 2018-04-17 15:02:35 -05:00
Ben Liblit df2e39b0fc Add Gradle logic for building a native library
This approach uses no external makefiles; it's pure Gradle.  Nice!
2018-04-17 15:02:35 -05:00
Ben Liblit 3f3de7a7fa Compile test code, but don't run it for now
The tests are currently broken due to some sort of problem using class
loaders to find supporting resources.  Until I figure this out, better
to have Travis-CI verify only the things we think work.
2018-04-17 15:02:35 -05:00
Ben Liblit aae1c2230a Consistently use simple sorted order for dependencies
This isn't even sorting by library or subproject name.  It's just a
dumb textual sort of the contents of each line.
2018-04-17 15:02:35 -05:00
Ben Liblit 336f0c04ad Leave Gradle linter turned on by default, now that it's quieter 2018-04-17 15:02:35 -05:00
Ben Liblit 695cd2863c Properly distinguish main from test code, now that I know how 2018-04-17 15:02:35 -05:00
Ben Liblit a276932a10 Selectively disable some Gradle linter rules
Specifically, we're not really in a position now to deal with
duplicated classes among our dependencies.  Maybe we can try harder to
examine those in the future, but for now they are a distraction from
other issues that we can attack more readily.
2018-04-17 15:02:35 -05:00
Ben Liblit 143698bbe5 Split generic Java setup from OSGi substitution setup 2018-04-17 15:02:35 -05:00
Ben Liblit 74e39ce101 Automated Gradle-driven download of JLex test input 2018-04-17 15:02:35 -05:00
Ben Liblit 777509adbc Disable Javadoc linter for now
Some of the linter's checks produce failures (errors) when Gradle
builds the Javadoc documentation.  Fixing them isn't really a Gradle
issue, though, so I don't want to deal with them now.
2018-04-17 15:02:35 -05:00
Ben Liblit 0c24fde2ef Improve documentation for broad sections of top-level build script 2018-04-17 15:02:35 -05:00
Ben Liblit 4bb91b4bba More Gradle dependency clean-ups suggested by linter
Unfortunately the linter does not reach a fixpoint if you keep trying
to apply its suggestions.  If you include "compile
'org.eclipse.core:org.eclipse.core.runtime:3.10.0.v20140318-2214'" in
the dependencies for "com.ibm.wala.ide.jdt", then the linter tells you
that this dependency is unused and can be removed.  If you remove it,
then the linter tells you that it should be added.  Sigh.
2018-04-17 15:02:35 -05:00
Ben Liblit 9ac69fb0ef Fix a tricky cross-subproject Javadoc dependency
By default, each subproject's Javadoc task depends on the same
subproject's Java compilation task, and uses the same classpath.
Thus, any classes that some Java code uses will also be visible when
building the same Java code's documentation.

In this case, we need to see one of the "com.ibm.wala.core" classes in
order to build the "com.ibm.wala.util" documentation.  However, we
cannot have Java compilation of "com.ibm.wala.util" depend on Java
compilation of "com.ibm.wala.core", because that would create a
dependency cycle.  So we need to add this as a special dependency just
for the "com.ibm.wala.util" documentation task, and add the
appropriate classpath as well.

I'm quite proud of myself for figuring out how to do this properly.
2018-04-17 15:02:35 -05:00
Ben Liblit 781a448a9a In Travis-CI, test Maven and Gradle separately and concurrently
This should help identify cases where the Gradle build only works if
it runs before or after a Maven build.  It will also help us recognize
any Maven regressions accidentally introduced by our Gradle work.
2018-04-17 15:02:35 -05:00
Ben Liblit dcc7677b34 Add a Gradle linter to help me write clean build configurations
The linter does not run by default.  To activate it, use "./gradlew
autoLintGradle".
2018-04-17 15:02:35 -05:00
Ben Liblit b94390f2fe Additional explicit dependencies suggested by Gradle linter 2018-04-17 15:02:35 -05:00
Ben Liblit 54a2878b0f Automated Gradle-driven download of AJAXSLT test inputs
I'm not sure that I am doing this in the best way possible.  But it
seems to be working.  Refinements are welcome!
2018-04-17 15:02:35 -05:00
Ben Liblit 651a0d4d82 Add Gradle build script for a subproject that previously had none 2018-04-17 15:02:35 -05:00
Ben Liblit 25e2201ec6 Add Gradle build script for a subproject that previously had none 2018-04-17 15:02:35 -05:00
Ben Liblit 7af7bbf881 Add Gradle build script for a subproject that previously had none 2018-04-17 15:02:35 -05:00
Ben Liblit 603378cd0b Add Gradle build script for a subproject that previously had none 2018-04-17 15:02:35 -05:00
Ben Liblit b6e4939097 Add Gradle build script for a subproject that previously had none 2018-04-17 15:02:35 -05:00
Ben Liblit 22b59de491 Add a direct dependency that previously we picked up transitively 2018-04-17 15:02:35 -05:00
Ben Liblit 045b9f646c Run a Gradle build after the Maven build
Eventually I'll want to swap that order, so that we know that Gradle
builds work even without any help from Maven build setup logic.  For
now, though, I just want to test whether the Gradle build works at
all.
2018-04-17 15:02:35 -05:00
Ben Liblit 401fbaf89a Many improvements to Gradle build support, including within Eclipse 2018-04-17 15:02:35 -05:00
Sungho Lee e7154b9ac7 change hamcrest library version of core.tests 2018-04-17 15:00:03 -05:00
Sungho Lee 69f0a93fb6 Support the gradlew build 2018-04-17 15:00:03 -05:00
Sungho Lee 6dceb3d8ef Change build.gradle files for proper format and delete all tests 2018-04-17 15:00:03 -05:00
Sungho Lee 04923544f0 Gradle build scripts 2018-04-17 15:00:03 -05:00
Julian Dolby 3b3a97e8af
Merge pull request #293 from liblit/remove-cvs-ignore
WALA uses Git, so CVS ignore patterns are moot
2018-04-14 21:49:40 -04:00
Ben Liblit 4bb4a3104a WALA uses Git, so CVS ignore patterns are moot 2018-04-14 19:08:14 -05:00
Julian Dolby 883b7282f4
Merge pull request #287 from pierlauro/master
Protected visibility for JavaSourceLoaderImpl's internal methods and classes
2018-04-13 17:02:24 -04:00
Julian Dolby 726b3c35ce
Merge pull request #292 from liblit/fix-raw-types-warnings
Resolve the last two Eclipse warnings about using raw types
2018-04-13 17:01:52 -04:00
Ben Liblit 6546d5d6a4 Resolve the last two Eclipse warnings about using raw types
Fixes bug #244.
2018-04-13 12:53:33 -05:00
Julian Dolby 0052213542 build ML projects 2018-04-13 09:11:57 -04:00
Julian Dolby 436d3165f7 rename getNumberOfParameters to getNumberOfPositionalParameters since the Python front end now supports keyword parameters
support variable names in IR for synthetic summaries
2018-04-12 19:09:25 -04:00
Julian Dolby 41d254d547 more type parameters for analysis engine 2018-04-10 16:00:44 -04:00
Achim D. Brucker f6c663c238 Merge remote-tracking branch 'upstream/master' 2018-04-05 23:19:36 +01:00
Pierlauro Sciarelli 886ba11c1e Protected visibility for JavaSourceLoaderImpl's internal methods and classes 2018-03-08 15:52:20 +01:00
Julian Dolby e2c1f72a3e
Create LICENSE 2018-03-08 09:08:53 -05: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 6cb72ad2b8 fixes to make PropagationGraph and friends easier to use in dataflow problems 2018-03-02 15:29:42 -05:00
Julian Dolby e1def2ffb5 more generalization for reuse 2018-02-17 22:08:09 +01:00
Julian Dolby be6bb3dc9a a little more work on summaries 2018-02-14 18:54:21 -05:00
Julian Dolby 6c1d0d9cb6 more work for reuse
make synthetic code better support non-Java languages
2018-02-14 09:00:07 -05:00
Ben Liblit 81a6e67b4b Remove "@param" Javadoc tags for parameters that no longer exist 2018-02-10 18:08:15 -08:00
Julian Dolby 7d76e20d2a try to find dx.jar 2018-02-05 15:43:49 -08:00
Julian Dolby aa414b3503 abandon hackish profiles 2018-02-05 15:26:08 -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 b7d9d037a6 more refactoring for reuse 2018-01-30 14:08:25 -05:00
Julian Dolby 0f3b6f5d7e disable debugging properly 2018-01-25 15:18:17 -05:00
Julian Dolby cd944a8f12 refactoring of CAst front end machinery to allow more reuse 2018-01-25 14:42:27 -05:00
Julian Dolby 8796653292 Merge branch 'master' of https://github.com/wala/WALA 2018-01-23 19:57:37 -05:00
Julian Dolby 9c29f59e21 merge 2018-01-23 19:57:34 -05:00
Julian Dolby 742b42efdf native config cleanup 2018-01-20 17:40:10 +00:00
Ben Liblit 372f0bd5d8 Fix several broken cross-references in Javadoc comments 2018-01-17 10:35:49 -08:00
Manu Sridharan 76faa4df2d
Fix bug with method lookup (#276)
The previous lookup logic would erroneously look in superclasses for a constructor with parameters.

Bug reported on [the mailing list](https://groups.google.com/forum/#!msg/wala-sourceforge-net/6m_VmDF-lZ0/erZIYQ68BwAJ;context-place=topic/wala-sourceforge-net/TjRzdDyljjY)
2017-12-23 16:38:26 -08:00
Julian Dolby a19507312a
Merge pull request #274 from ponder-lab/upstream_master2
Fix Atom.startsWith() failure case.
2017-12-20 22:45:18 +00:00
Julian Dolby d9cd362f8b
Merge pull request #275 from liblit/fix-javadoc-miscellaneous
Fix various Javadoc errors
2017-12-20 22:44:11 +00:00
Ben Liblit 0a770ce7ab "@todo" is not a valid Javadoc tag 2017-12-19 16:53:56 -06:00
Ben Liblit 73e6291a8a Fix bad split of "<a>" across multiple comment lines 2017-12-19 16:53:56 -06:00
Ben Liblit 4cf2dac911 Fix missing "#" when using "@link" to refer to same-class member 2017-12-19 16:53:56 -06:00
Ben Liblit 0d6d9f2b2e Remove useless "@return" tags with no descriptive text 2017-12-19 16:53:56 -06:00
Ben Liblit 85ca6424b1 "@link" does not allow generic type parameters in method signatures 2017-12-19 16:53:56 -06:00
Ben Liblit c50dd6302f "<\tt>" is not how you close an HTML "<tt>" tag 2017-12-19 16:53:56 -06:00
Ben Liblit 4ad5322ebf Add missing right curly brace at end of "{@link ...}" 2017-12-19 16:53:55 -06:00
Ben Liblit 9072560a22 HTML lists must not have free-floating text between list items 2017-12-19 16:53:55 -06:00
Ben Liblit a7f00ffce8 "@param" parameter name must match the name of some formal parameter 2017-12-19 16:53:55 -06:00
Ben Liblit ba71f45119 "@throws" should be followed by class name and space, not comma 2017-12-19 16:53:55 -06:00
Ben Liblit ca23fc5b91 "@brief" is not a valid Javadoc tag 2017-12-19 16:53:55 -06:00
Ben Liblit d8b041469f "@returns" is not a valid Javadoc tag, but "@return" is 2017-12-19 16:53:55 -06:00
Ben Liblit ce403cef2b "@throw" is not a valid Javadoc tag, but "@throws" is 2017-12-19 16:53:55 -06:00
Ben Liblit fa62aa03e6 "<verbatim>" is not a valid HTML tag; perhaps "<pre>" was intended? 2017-12-19 16:53:55 -06:00
Ben Liblit 6beaac98bd "<bf>" is not a valid HTML tag, but "<b>" is 2017-12-19 16:53:55 -06:00
Ben Liblit f60c164ec1 Escape "<" and ">" in Javadoc when not used as HTML tag syntax 2017-12-19 16:53:52 -06:00
Raffi Khatchadourian fc62c16d9b Fix https://github.com/wala/WALA/issues/273. 2017-12-19 16:58:48 -05:00
Julian Dolby d29e278291 more instrumentation fixes
remove junk from dominators
2017-12-08 11:19:41 +08:00
Julian Dolby 5a02cde690 more flexibility to not extract calls for invokedynamic. Potentially, this will break instrumented methods that have massive numbers of invokedynamics in them, but that seems unlikely to happen at least with Java use of invokedynamic so far. We can burn this bridge when we come to it. 2017-12-06 19:04:27 +08:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit bf6698edf5 Use more specific type than "Object" to avoid casting 2017-12-04 14:04:39 -08:00
Ben Liblit 66e2e76205 Prefer to cast Iterables instead of the things they can iterate over 2017-12-04 14:04:39 -08:00
Ben Liblit 544a71ae72 Remove type arguments that Java 1.7+ can infer for us 2017-12-04 14:04:39 -08:00
Ben Liblit b25e461bfe Convert a few more loops into modern for-each loops 2017-12-04 14:04:39 -08:00
Julian Dolby da4247f923 add HybriDroid to testing 2017-12-04 17:15:34 +08:00
Julian Dolby 0ea98643f3 revert lambdas thait cause trouble with WALA Mobile. It may be that the
issue is Swing, since I think that is not on Android.
2017-12-03 11:31:29 +08:00
Julian Dolby b68ff20c82
Merge pull request #269 from liblit/modernization-java-8-lambdas-and-method-references
Use Java 8 lambdas and method references wherever possible
2017-12-03 09:54:09 +08:00
Julian Dolby 4a53da36ea fix type-o 2017-12-01 20:22:37 +08:00
Julian Dolby 803243ea53 Merge branch 'master' of https://github.com/wala/WALA 2017-12-01 20:02:00 +08:00
Julian Dolby 7cd2a2acf8 Fixes for instrumentation of invoke dynamic 2017-12-01 20:01:16 +08:00
Julian Dolby d685fbb71f Add Jeff's group's incremental pointer analysis project to trigger 2017-12-01 13:05:25 +08:00
Ben Liblit 9c83e87cc1 Merge branch 'master' into modernization-java-8-lambdas-and-method-references 2017-11-29 10:51:33 -06:00
Julian Dolby 6be349096c
Merge pull request #271 from liblit/modernization-loops-and-iterators
Modernize loops and iterators
2017-11-29 04:30:28 -05:00
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
Ben Liblit 12ca05ddb7 Enforce not using raw types more forcefully where possible
These are all modules where no such warnings currently arise.  If any
arise in the future, then, let's treat them as errors so we keep
things clean.
2017-11-28 14:09:42 -06:00
Ben Liblit 8ef6ad5069 Add proper type parameters to nearly all uses of Iterator
Java sources used as test data have been excluded.
2017-11-28 14:09:30 -06:00
Ben Liblit 456b0e45c3 Remove additional unnecessary casts of lambda expressions 2017-11-27 15:00:13 -06:00
Ben Liblit 5bc0e11e90 Ignore invalid Javadoc here, in case we don't have Android's SDK 2017-11-27 11:31:15 -06:00
Ben Liblit 6261880264 Remove unnecessary casts of lambda expressions 2017-11-27 11:31:15 -06:00
Ben Liblit 16913ffc80 Remove an apparently-useless no-op walk over elements of a set 2017-11-27 11:31:15 -06:00
Ben Liblit 2e084bdec7 Use existing IteratorUtil.filter when that's exactly what we need 2017-11-27 11:31:15 -06:00
Ben Liblit b2e1081221 Clean up IteratorUtil.filter
Use method references where possible.  Remove no-longer-needed
annotations.
2017-11-27 11:31:15 -06:00
Ben Liblit 5fa3643652 Don't suppress javadoc warnings; these are disabled entirely anyway 2017-11-27 11:31:15 -06:00
Ben Liblit de2690dfac Remove two imports that are no longer used 2017-11-27 11:31:15 -06:00
Ben Liblit 4b81b69165 Disable annotation-based nullness analysis
Using constructor references apparently pulls in something involving
nullness annotations.  However, we don't actually build with a jar
file that defines those annotations, so this leads to Eclipse build
failures.  I don't know the right way to add such a jar file to our
current configuration mishmash of Ant, Maven, and Eclipse.  So the
easier thing to do is just disable annotation-based nullness analysis.
I doubt we were getting any benefit from such an analysis anyway,
given that WALA itself doesn't use those annotations at all.
2017-11-27 11:31:15 -06: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
Ben Liblit 28f0e09435 Make FilterIterator and Predicate statically type-correct
Previously FilterIterator was very permissive regarding the type
relationships between the original iterator, the filtered iterator,
and the predicate used to prune the former down to the latter.  Now we
enforce those relationships more strictly, including proper use of
covariant ("<? extends T>") and contravariant ("<? super T>")
polymorphic type parameters where appropriate.

This lets us get rid of seven suppressed warnings about generic types
and/or unchecked conversions.  It also moves us toward being able to
use modern Java features like lambdas and streams more easily.
2017-11-27 11:31:14 -06:00
Julian Dolby 5ac8bf881d
Merge pull request #265 from liblit/java-8-build-configuration
Update more parts of the build configuration to use Java 8
2017-11-26 20:53:28 -05:00
Ben Liblit 11828c57f4 Update more parts of the build configuration to use Java 8
Julian Dolby assures me that WALA is now supposed to be using Java 8
everywhere.  This covers nearly all remaining places that I can find
where an earlier Java version was still being used.  (The few
exceptions are places where switching to Java 8 causes test failures.
I'll address those separately, probably by reaching out to the WALA
maintainers for help.)
2017-11-26 18:46:00 -06:00
Ben Liblit 9ef6ff1a9c Remove "build.xml" files not used by corresponding "pom.xml" files 2017-11-26 18:11:56 -06:00
Ben Liblit ded9e880b1 Update Maven Central configurations to also use Java 8 (#264)
E-mail exchanged with Julian Dolby suggests that this is the right
thing to do, and that it should have been done back when we converted
other parts of the build configuration to Java 8.
2017-11-23 12:55:05 -08:00
Julian Dolby 49b5fe83b5 Merge branch 'master' of https://github.com/wala/WALA 2017-11-22 20:15:10 -05:00
Julian Dolby 45da66a95d cleanups and changes for TAMU work 2017-11-22 18:24:39 -05:00
Ben Liblit e89c5c6562 Disable deprecation warnings in modules where they are unavoidable (#263)
These two modules refer to "AST.JLS8".  If you have Java 9 installed,
then "AST.JLS8" is marked as deprecated, and we can a warning unless
we suppress or disable the deprecation warning wherever "AST.JLS8" is
used.  However, if you don't have Java 9 installed, then "AST.JLS8" is
not deprecated, and trying to suppress deprecation warnings where
"AST.JLS8" is used instead produces warnings about unnecessary warning
suppression.  Aagh!  Turning off the deprecation warnings entirely for
these two modules seems like the only sane compromise.
2017-11-21 18:00:43 -08:00
Julian Dolby 5faae993e9
Merge pull request #261 from liblit/warning-fixes-deprecated-AST-JLS8
Suppress deprecation warnings about requesting an old AST version
2017-11-19 17:41:59 -05:00
Julian Dolby 96559826c2
Merge pull request #262 from liblit/warning-fix-unnecessary-default-encoding
Remove a default encoding setting that Eclipse considers unnecessary
2017-11-19 17:41:20 -05:00
Ben Liblit 221a1a26ed Remove a default encoding setting that Eclipse considers unnecessary
Removing fixes one Eclipse error diagnostic: "Default encoding (UTF-8)
for library '.' should be removed as the workspace does not specify an
explicit encoding."

This reapplies the fox from ecd1ff72fe,
which was reverted (apparently unintentionally) as part of a larger
group of changes in 8d65788aef.
2017-11-19 15:46:40 -06:00
Ben Liblit d79707e137 Suppress deprecation warnings about requesting an old AST version
Near as I can tell, the requests for deprecated versions here are
intentional.  The non-deprecated version (AST.JLS9) is the latest and
greatest, but as far as I can tell we really do want the older version
here.

This is similar to 6caecce3e7, though in
that case JLS8 was the non-reprecated latest version and we were still
asking for JLS3.
2017-11-19 15:43:45 -06:00
Raffi Khatchadourian 1d239dac52 Remove explicit super call (#252) 2017-11-18 09:19:43 -05:00
Achim D. Brucker 108dea730b Merge remote-tracking branch 'upstream/master' 2017-11-14 05:31:19 +00:00
Manu Sridharan 808688b793 use lambda shorthand 2017-11-12 10:08:57 -08:00
Julian Dolby d124256835 remove java 7 support 2017-11-11 21:20:41 -05:00
Julian Dolby 8fc5a35c91 Merge branch 'master' of https://github.com/wala/WALA 2017-11-11 20:32:14 -05:00
Julian Dolby 8d65788aef convert to Java 8 Function and Predicate 2017-11-11 20:29:04 -05:00
Achim D. Brucker 503266fa74 Merge remote-tracking branch 'upstream/master' 2017-10-31 08:31:26 +00:00
Julian Dolby 12882baba4 Merge pull request #253 from karimhamdanali/master
Support for Averroes + Dynamic call graphs
2017-10-23 23:02:54 -04:00
Karim Ali 423db824b3 adding support for the dynamic call graph experiments
currentSite should be ThreadLocal because not having this screws up a lot of the instrumentation-based dynamic call graphs we generate for the shootout benchmarks.

I have also conditionally changed how the string of the currentSite is created based on the output format that Julian came up with for the dynamic call graph. This support is necessary, because the Java std libraries are not instrumented. Therefore, they would appear as if calls from them show up from nowhere in the log that WALA generates for the dynamic call graph. This fix make those calls originate from a fake library BLOB node in the call graph.
2017-10-23 17:54:01 -06:00
Karim Ali d22ee36b09 adding some support for averroes
- adding multi-flow AnalysisOption
- enable/disable special handling of zero-length arrays

Both are required to enable precise analysis of some Dacapo benchmarks when using the Averroes-generated summaries
2017-10-23 17:43:28 -06:00
Julian Dolby 26d354d1fc remove debug printing 2017-10-19 17:38:37 -04:00
Julian Dolby 11120329e1 fix messages about final; these vaiables do not need to be final in Java 8, really. 2017-10-19 15:02:19 -04:00
Julian Dolby 0f2d9b7635 fixes to dynamic CG to minimize bloating of methods 2017-10-19 13:12:21 -04:00
Julian Dolby 84ff23f852 expose implicit keys predicate 2017-10-19 13:09:27 -04:00
Julian Dolby b38286621a remove unneeded type parameter 2017-10-19 13:08:34 -04:00
Julian Dolby 207181aa89 linking issues on Linux. It seems that the name 'launch' for a function was causing some weird linking issues that only happened sometimes. Quite ikely, the issue is another library using the same name. 2017-10-18 01:49:25 +00:00
Julian Dolby 601c9fae7b clean up native init 2017-10-17 20:25:46 -04:00
Julian Dolby 02e2193875 clean up native init 2017-10-17 20:14:35 -04:00
Julian Dolby 6961748fb2 Merge branch 'master' of https://github.com/wala/WALA 2017-10-17 20:12:43 -04:00
Julian Dolby b504165e64 clean up native init 2017-10-17 20:12:42 -04:00
Julian Dolby e23a1fc9a4 Merge pull request #227 from liblit/warning-fixes-plug-in-development-renamings
Rename `...-feature` to `..._feature` in subdirs and features
2017-10-10 11:42:00 -04:00
Achim D. Brucker cf914e9bd1 Merge remote-tracking branch 'upstream/master' 2017-10-05 21:04:12 +01:00
Julian Dolby b3fbbe0edb Merge branch 'master' of https://github.com/wala/WALA 2017-10-02 14:21:34 -04:00
Julian Dolby b49f6c31d3 merge 2017-10-02 14:21:28 -04:00
Julian Dolby ce0411d8a4 disable check that breaks TeaVM 2017-09-28 20:15:24 +00:00
Julian Dolby 2c5d6ed15f hack for TeaVM 2017-09-28 19:34:54 +00:00
Julian Dolby 5dc7ed76f5 Merge branch 'master' of https://github.com/wala/WALA 2017-09-28 19:03:46 +00:00
Achim D. Brucker da27479c9c Merge remote-tracking branch 'upstream/master' 2017-09-24 09:52:14 +01:00
Manu Sridharan d5936b2f7e Enable ErrorProne on wala.util project (#248)
* remove import
2017-09-19 05:52:53 -07:00
Ben Liblit 1fcdfbe2a3 Add localization properties file with some bundle string definitions
This fixes two Eclipse Plug-in Development warnings of the form "Key
'...' is not found in localization properties file:
OSGI-INF/l10n/bundle.properties".
2017-09-17 14:25:40 -07:00
Ben Liblit d70e52e323 Set required build property for project-specific compiler settings
This fixes two Eclipse Plug-in Development warnings of the form "The
'javacProjectSettings' build entry should be set when there are
project specific compiler settings".
2017-09-17 14:25:40 -07:00
Ben Liblit 182073ff4f Silently allow plug-ins to not export all of their packages
This removes three Eclipse Plug-in Development warnings of the form
"This plug-in does not export all of its packages"

I assume that omitting some exports is OK, because apparently nothing
else fails to build against these.  If an omitted export were needed
elsewhere, something would fail to build.
2017-09-17 14:25:40 -07:00
Achim D. Brucker 8d781d1ec1 Merge remote-tracking branch 'upstream/master' 2017-09-17 20:19:38 +01:00
Julian Dolby 3ee1f2d368 Merge branch 'master' of https://github.com/wala/WALA 2017-09-16 18:25:35 +00:00
Julian Dolby 36ab38c659 expanded Monitor2 2017-09-16 14:24:47 -04:00
Julian Dolby 3c898224ff Revert changes to native code for now
This reverts commit a39da55d97.
2017-09-16 14:23:00 -04:00
Julian Dolby e399d7b9f3 Merge branch 'master' of https://github.com/wala/WALA 2017-09-16 18:19:07 +00:00
Julian Dolby 5a04c422e3 merge 2017-09-16 18:19:04 +00:00
Julian Dolby a39da55d97 need shrike
update monitor test
2017-09-16 14:06:28 -04:00
Julian Dolby 385b135bf2 Merge branch 'master' of https://github.com/wala/WALA 2017-09-12 07:13:45 +09:00
Julian Dolby 3083e6c06d new test 2017-09-12 07:13:35 +09:00
Achim D. Brucker 5d28f92798 Fixed compilation error with Java 8. 2017-09-11 14:35:58 +01:00
Achim D. Brucker 9716d50146 Merged with remote-tracking branch 'upstream/master'. 2017-09-10 23:20:40 +01:00
Ben Liblit 65672f98ba Suppress Eclipse warnings that arise in JLex, which we don't control 2017-08-30 17:03:35 -07:00
Ben Liblit 01ea35ccb7 Rename "...-feature" to "..._feature" in subdirs and features
This change affects both top-level subdirectory names as well as
Eclipse plug-in feature names.  Perhaps it would have been possible to
change only the latter, but I don't like the idea of the two being
different.

These name changes fix three Eclipse plug-in warnings of the form:

	Illegal value '...-feature' for attribute 'id'.
	Legal token characters are "a-z", "A-Z", "0-9", "_".  Tokens
	must be separated by "."

I'll be the first to admit that I know nearly nothing about Eclipse
plug-in development.  If changing these plug-in feature IDs has
broader implications that the automated regression tests won't detect,
then I probably overlooked them too.  I would greatly appreciate
skeptical review of this change by someone who knows Eclipse plug-in
development well.

Note that personal Eclipse workspaces may need some manual adjustment
after this change.  The three "...-feature" Eclipse projects should be
removed from the workspace, and the three corresponding "..._feature"
Eclipse projects should be added.  If you do your git pull using
Eclipse's team features, perhaps it is smart enough to do this for
you?  I don't know, but it wouldn't surprise me if fixing things
manually were still needed even in that case.
2017-08-30 16:32:33 -05:00
Ben Liblit 15a30c1436 Tell M2Eclipse to run a few Maven plugins with no special handling
Specifically, this will run the "javadoc" goal of the
"maven-javadoc-plugin" and the "plugin-source" goal of the
"tycho-source-plugin" whenever Eclipse does a full build.  It will not
run these on incremental builds, though.  Maven plugins in general are
usually not designed with incremental execution in mind, so rerunning
them on every incremental build turns out to be too sluggish in
practice.

Previously, M2Eclipse would occasionally notice these two plugins,
realize it didn't know what to do with them, and produce Eclipse error
diagnostics that were difficult to resolve.  With this change we are
telling Eclipse's Maven builder to just run the plugins in the natural
way even though M2Eclipse has no special handling built-in for them.

Fixes #198, much to my relief.
2017-08-30 13:39:25 -07:00
Ben Liblit 95507651d2 Trivial indentation fix
I would not bother to fix indentation by itself, but it makes sense to
fix this indentation now in advance of some larger changes coming to
this file soon.
2017-08-30 13:39:25 -07:00
Manu Sridharan 4aedf7124e Update README.md
Add Travis graphic
2017-08-30 13:38:59 -07:00
Ben Liblit 5b6e6aefa0 Remove some unnecessary warning suppression annotations 2017-08-28 11:55:56 -07:00
Ben Liblit 559c577093 Treat diagnostics about unchecked type operations as errors 2017-08-28 11:55:56 -07:00
Ben Liblit f8e3172653 Be explicit about the type parameter in generic static method calls
In modern Java, we would not need to do this.  Java 1.8 can infer the
generic type, which would allow us to write simply
"Collections.emptySet()" instead of
"Collections.<TypeReference>"emptySet()".  Unfortunately, Android is
behind the times, so this specific project targets Java 1.5.  That
older Java definition does not do the inference we would want here, so
we have to be explicit instead.
2017-08-28 11:55:56 -07:00
Ben Liblit 1603ec314f Use Collections.emptySet() instead of Collections.EMPTY_SET
The former returns Set<T> for any T, whereas the latter merely returns
a raw Set.  Using the former instead of the latter fixes four Eclipse
warnings about using raw generics.
2017-08-28 11:55:56 -07:00
Julian Dolby 5b23010116 Merge branch 'master' of https://github.com/wala/WALA 2017-08-28 08:11:31 -04:00
Manu Sridharan b54eadf461 disable Maven nature for NodeJS project 2017-08-27 20:50:38 -07:00
Ben Liblit ecd1ff72fe Remove a default encoding setting that Eclipse considers unnecessary
Julian added this in a recent commit, but has told me that he does not
think it is necessary, and that I am free to remove it if it is
causing trouble.  Removing this does indeed fix one Eclipse error
diagnostic: "Default encoding (UTF-8) for library '.' should be
removed as the workspace does not specify an explicit encoding."
2017-08-27 20:15:54 -07:00
Manu Sridharan 14ec60add8 remove unneeded .classpath entry 2017-08-27 15:32:24 -07:00
Julian Dolby 5f370bcfd8 remove jcommander 2017-08-27 17:22:59 -04: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 e63de76139 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 dae5bc58bd Plug an `InputStream` resource leak 2017-08-27 11:03:14 -07:00
Ben Liblit e1010439d1 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 ee8e4b4c83 type hack 2017-08-25 12:06:09 -04:00
Julian Dolby b5b67f3d7c issues with mvncentral.xml 2017-08-25 12:00:39 -04:00
Julian Dolby 44348b80d7 add neglected file 2017-08-25 11:13:40 -04:00
Julian Dolby bd8bf7cb99 fixes for paths on travis 2017-08-25 11:08:54 -04:00
Julian Dolby 701cd1ac7d fix for paths on travis 2017-08-25 11:04:43 -04: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
Ben Liblit 6f132281b3 Use the default output folder for `dat`
This fixes an Eclipse Plug-In Development warning that reads "Source
folder 'dat/' does not have the output folder in corresponding output
entry 'output..'."  It is not the default quick fix that Eclipse
suggests, and I am *definitely* not sure that this is the right way to
fix this problem.  (I have nearly zero knowledge of Eclipse plug-in
development.)

That being said, this change does make the warning go away, and `mvn
clean install` without `-DskipTests` still succeeds.
2017-08-16 11:36:46 -07:00
Ben Liblit 4da719edbc Exclude a directory containing only C code from the Java build path 2017-08-16 11:36:46 -07:00
Ben Liblit 48be35ddc2 Set `javacProjectSettings` where appropriate
In particular, per the corresponding Eclipse warning, "The
`javacProjectSettings` build entry should be set when there are
project specific compiler settings".
2017-08-16 11:36:46 -07:00
Ben Liblit 291c01b960 Silently ignore unresolved bundles
In particular, be quiet about being unable to resolve
"org.eclipse.jdt.launching.macosx", which was already marked as
`optional` anyway.  I assume that I'm missing this because I'm not
developing on MacOS, and that it would be present if I were.  Can
someone using MacOS confirm this?
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 ea95940d0f Be explicit when case fall-through is intentional 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
Ben Liblit cbcfb40435 Don't be silent in case of weird enum value
This `switch` statement currently covers all possible values of the
`enum` it is testing.  However, if a new value were introduced in the
future, the `switch` would have been silent about it instead of
printing a debug message as is done in all of the other cases.  Better
to print *some* kind of debug in the default case too.
2017-08-15 14:55:34 -07:00
Ben Liblit ce335f495d Avoid unintended control fall-through in case of weird enum value
This `switch` statement currently covers all possible values of the
`enum` it is testing.  However, if a new value were introduced in the
future, the `switch` would have allowed control-flow to fall through
by default instead of throwing an exception as is done in all of the
other cases.  Better to throw *some* kind of exception in the default
case too.
2017-08-15 14:55:34 -07:00
Ben Liblit 7dc71151d1 Add missing `break`s to print just 1 debug message instead of 1-3 2017-08-15 14:55:34 -07:00
Ben Liblit 61e9641094 Semantics-preserving control-flow tweaks to fix switch warnings
Eclipse was warning that these `switch` statements had no `default`
cases.  Each did have some default behavior, but implemented outside
the `switch`.  By moving the default behavior into a `default` case
within the `switch`, we eliminate a static warning with no change
whatsoever to the run-time behavior.
2017-08-15 14:55:34 -07:00
Ben Liblit 30966195c8 Prefer dynamic dispatch over switch statements on enum values
Eclipse was warning about the lack of a `default` case in the `switch`
statement.  None of the current `enum` values was actually missing
from the `switch`, but if the enum values list were extended in the
future, that would be an easy mistake to make.

Replacing the `switch` with dynamic dispatch to a method lets us
statically enforce the requirement that every enum value must
implement the behavior in some way.
2017-08-15 14:55:34 -07:00
Ben Liblit 37fe595fbd Factor out common logic for Dot output format names/suffixes
Instead of having two `switch` statements on the Dot format
enumeration, give each Dot enumeration value a way to identify its own
preferred file suffix and command-line format name.  This removes some
warnings about `switch` statements without default cases.  It also
creates strong static enforcement that any new Dot format *must* also
provide this information.
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 5bcc985069 Tidy up some code that performs unchecked casts to a generic type 2017-08-15 09:16:59 -07:00
Ben Liblit daea7095e2 Fix Eclipse warnings about unchecked casts to generics
This is the first time I can ever remember explicitly casting to
`Object`.  Such a cast might seem useless, and certainly it is
statically known to always succeed.  However, it is here for good
reason.  Without the cast, we end up making a `Pair<Object, ?>` but
what we really want is a `Pair<Object, Object>`.
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 8ebfd7615c add MemSAT 2017-08-12 20:02:18 -04:00
Julian Dolby 7e8e499f04 get actual art version 2017-08-09 17:33:41 -04:00
Julian Dolby ecdb599674 support for deodexing methods read from Dalvik, using support in dexlib2 2017-08-08 06:34:48 -04:00
Achim D. Brucker 29185f272c Merge with upstream. 2017-08-07 12:07:37 +01:00
Julian Dolby e7a152341c update dependencies 2017-08-06 20:03:37 -04:00
Julian Dolby 2e3836c487 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 23:33:45 +00:00
Julian Dolby 8282340ec3 merge 2017-08-06 23:33:40 +00:00
Julian Dolby 2fbe15fc91 fetch guava 22 2017-08-06 19:30:16 -04:00
Julian Dolby c5d5ce7fe2 missed files 2017-08-06 19:16:25 -04:00
Julian Dolby cc8831ebcf misc fixes, and optional new translation for for..in; ultimately, this new translation is better, but for now it breaks some correlation-tracking tests, so it is available only as an option. 2017-08-06 18:36:33 -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
Julian Dolby 34dd8c1f04 merge 2017-08-06 08:05:59 -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 13d807708f Suppress an Eclipse warning about lacking XML grammar info
The single "No grammar constraints (DTD or XML Schema) referenced in
the document" warning arises in a generated file.  I doubt that we can
change the generation process to include grammar information.  Even if
we could, I don't mind omitting validation here assuming that we can
trust the generator tool to be correct.  Validation is much more
important for human-authored XML; for tool-authored XML, we can live
without it.
2017-08-05 13:30:54 -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 f76b79b067 Don't complain about unqualified accesses to instance fields
I'm very picky about code style, but even I see no benefit in
requiring "this.field" instead of simply "field".
2017-08-05 13:30:04 -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 b1cd868e06 Remove an unused method relating to Android system entry points 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 ef94d85d2b quiet 2017-08-03 21:11:33 +00:00
Julian Dolby 202a53d090 reference javadoc 2017-08-03 20:43:22 +00:00
Julian Dolby 3db5ff4707 use e47 2017-08-02 22:20:09 +00:00
Achim D. Brucker 58bc42a75d Merge remote-tracking branch 'upstream/master' 2017-08-02 21:30:16 +01:00
Julian Dolby 2ba40c99fa Eclipse Oxygen 2017-08-02 19:59:54 +00:00
Julian Dolby 98f770035d merge 2017-08-02 12:28:46 -04:00
Julian Dolby 5b6397297f merge 2017-08-02 12:28:25 -04:00
Julian Dolby 1d144db6d5 Merge branch 'master' of https://github.com/wala/WALA 2017-08-02 12:27:22 -04:00
Julian Dolby 8a76b132cd try new way to make javadoc 2017-08-02 14:56:04 +00:00
Julian Dolby 4629f8b9cd see if maven 3.5.0 builds javascript on travis as it does on my laptop 2017-08-02 02:53:01 +00:00
Julian Dolby 3d2cdf76b7 kill debug logging 2017-08-02 02:13:55 +00:00
Julian Dolby 1971b09b6a mirror 2017-08-02 01:03:56 +00:00
Julian Dolby 340fb45b85 remove -q for diagnostics 2017-08-02 00:39:51 +00:00
Julian Dolby f094bb7bd0 more combinations 2017-08-02 00:25:27 +00:00
Julian Dolby 725c734b8b swap verify and install 2017-08-02 00:04:38 +00:00
Julian Dolby 93119c7ad4 try javadoc 2017-08-01 23:46:43 +00:00
Julian Dolby e41ff85bbb try javadoc 2017-08-01 23:43:26 +00:00
Julian Dolby df6618ee95 try javadoc 2017-08-01 23:09:35 +00:00
Achim D. Brucker 409ab78e36 Merge remote-tracking branch 'upstream/master' 2017-08-01 23:50:46 +01:00
Julian Dolby 10d88f3208 try javadoc 2017-08-01 22:41:21 +00:00
Julian Dolby 31a38e8a4c try javadoc 2017-08-01 22:33:39 +00:00
Julian Dolby 62ca182690 try javadoc 2017-08-01 22:19:37 +00:00
Julian Dolby ab183520da try javadoc 2017-08-01 22:16:32 +00:00
Julian Dolby 9569471d63 try javadoc 2017-08-01 22:15:29 +00:00
Julian Dolby 0e29403485 try javadoc 2017-08-01 22:12:31 +00:00
Julian Dolby 699bc5a308 try javadoc 2017-08-01 22:08:50 +00:00
Julian Dolby 50d0836701 try javadoc 2017-08-01 22:05:32 +00:00
Julian Dolby 9ea26ad22d try javadoc 2017-08-01 22:03:50 +00:00
Julian Dolby 4168547f35 try javadoc 2017-08-01 22:01:38 +00:00
Julian Dolby ec82f6b6e2 try javadoc 2017-08-01 21:57:57 +00:00
Julian Dolby 3dfc70d919 try javadoc 2017-08-01 21:56:21 +00:00
Julian Dolby a3113df645 try javadoc 2017-08-01 21:52:58 +00:00
Julian Dolby bc31c11003 try javadoc 2017-08-01 21:49:44 +00:00
Julian Dolby 63a82aee61 try javascript 2017-08-01 21:45:48 +00:00
Julian Dolby 944f620537 try javascript 2017-08-01 21:44:07 +00: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
Achim D. Brucker ea1c98964c Merge remote-tracking branch 'upstream/master' 2017-07-31 21:22:47 +01:00
Julian Dolby 504102684d Merge branch 'master' of https://github.com/wala/WALA 2017-07-30 18:08:09 -04:00
Julian Dolby f5aaa67598 merge 2017-07-30 18:08:06 -04:00
Julian Dolby b5805b5459 move nio from static ctor to make android 7 happy 2017-07-29 01:52:55 +00:00
Julian Dolby 76435cfa92 prune dependencies 2017-07-29 01:17:52 +00:00
Julian Dolby 9dda017450 Merge branch 'master' of https://github.com/wala/WALA 2017-07-28 13:42:45 -04:00
Julian Dolby ea51030c45 merge 2017-07-28 13:42:29 -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
Ben Liblit c1572ec3a5 Remove unnecessary warning-suppression annotations
These annotations used to suppress real Eclipse warnings.  However,
we've now turned those warnings off for the entire project.
2017-07-26 20:08:34 -07:00
Ben Liblit 455a4a2bd6 Disable or suppress various Eclipse warnings in test data
These are all things one might consider fixing in real application
data.  Java code used as test inputs, though, serves a different
purpose.  Weird code is generally acceptable or even intentional.
2017-07-26 20:08:34 -07:00
Julian Dolby 00ad57fede trigger WALA-Mobile too 2017-07-24 17:28:24 +00:00
Julian Dolby 27e906135f Merge branch 'master' of https://github.com/wala/WALA 2017-07-24 10:08:10 -04:00
Julian Dolby 13db92ee8c add source files to dalvik test jar 2017-07-24 10:06:52 -04:00
Julian Dolby 18ea72d1d7 try to trigger WALA Client 2017-07-24 10:05:46 -04:00
Julian Dolby 1e95dbcdd4 try to trigger WALA Client 2017-07-24 14:03:06 +00:00
Achim D. Brucker 48631092c3 Tuned warning level down. 2017-07-24 08:28:22 +01:00
Achim D. Brucker e754c037b1 Removed unused variable. 2017-07-24 08:27:35 +01:00
Achim D. Brucker 7cc2b5c8f5 Merge remote-tracking branch 'upstream/master' 2017-07-24 08:14:25 +01:00
Julian Dolby fb6f5df424 add missing files 2017-07-23 18:24:23 +00:00
Ben Liblit ec0d7354ef Disable Eclipse warnings about empty statements
Previously we had 5 such warnings.  That's not very many, but it
suggests that the WALA developers consider this to be an acceptable
coding style.  If that's so, then it's better to hide these warnings
rather than keep them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Ben Liblit 10dff7fb1c Disable Eclipse warnings about assignments to parameters
Previously we had 227 such warnings.  That large number suggests that
the WALA developers consider this to be an acceptable coding style.
If that's so, then it's better to hide these warnings rather than keep
them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Ben Liblit d5e6da89ae Suppress a benign warning about an unused parameter 2017-07-18 20:43:36 -07:00
Ben Liblit d3c4200bc3 Disable Eclipse warnings about name shadowing
Previously we had 242 such warnings.  That large number suggests that
the WALA developers consider this to be an acceptable coding style.
If that's so, then it's better to hide these warnings rather than keep
them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Julian Dolby ecf05f6bd8 Merge pull request #203 from liblit/fix-native-build-Makefile-configuration-churn
Fix native build `Makefile.configuration` churn
2017-07-15 21:10:00 -04: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
Ben Liblit 2f44bbf518 Help Emacs recognize that these are (fragments of) makefiles 2017-07-14 21:46:46 -07:00
Ben Liblit fae3ff6789 Set Emacs indentation configuration to mimic existing code
This isn't fix per se, but adding this configuration info helps me
edit this file in Emacs without introducing unnecessary indentation
changes.
2017-07-14 21:46:29 -07:00
Ben Liblit a1ef133501 Fail early if any subcommand fails or if an udefined var is used
I like my shell scripts to be paranoid.
2017-07-14 21:45:51 -07:00
Ben Liblit 433cd78f65 Move logic from "cbuild.sh" into portable "Makefile.configuration"
In "com.ibm.wala.cast.test", the "cbuild.sh" script is gone entirely.
Instead, "pom.xml" directs Maven to run "make" directly.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

In "com.ibm.wala.cast", a small "cbuild.sh" remains, to do some
special processing involving Visual Studio variables under Windows.
When not building under Windows, "cbuild.sh" now simply runs "make".
It may well be possible to hoist the special Windows stuff up into
this subproject's "pom.xml", or to change that "pom.xml" to run
"cbuild.sh" only when on Windows, and to run "make" directly
otherwise.  I don't know "pom.xml" stuff very well, though.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

The changes I've made in both "Makefile.configuration" files use GNU
make extensions.  I assume that's safe because "Makefile.definitions"
already relies on GNU make.
2017-07-14 21:44:33 -07:00
Julian Dolby 0aadaa7aa0 small extensions to native code 2017-07-13 21:20:48 +00:00
Julian Dolby 004a81deba Merge branch 'master' of https://github.com/wala/WALA 2017-07-13 13:02:29 -04:00
Ben Liblit 0e6b00e29f Revert accidental, harmless, but unnecessary make config changes 2017-07-12 10:39:06 -07: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
Ben Liblit 1d27ca974b Upgrade raw-types-usage warnings to errors where possible
In general, these diagnostics are now errors in projects for which all
such warnings have been fixed.  There are three unfixed warnings in
two projects, so this diagnostic remains a warning (not an error) in
those projects.

There are also many places where rwa-types-usage warnings have been
locally suppressed using @SuppressWarnings annotations.  I haven't
systematically revisited those to see if any can be fixed properly.
So for those projects this diagnostic must also remain a warning (not
an error), since @SuppressWarnings does not work on things Eclipse is
configured to treat as errors.
2017-07-12 10:39:06 -07:00
Ben Liblit e316471d88 Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops.  I didn't systematically look for all opportunities
to do this, though.  I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.

Better use of generics also allowed many casts to become statically
redundant.  I have removed all such redundant casts.

Only three raw-types warnings remain after this batch of fixes.  All
three involve raw uses of CallGraphBuilder.  I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point.  I may
give these last few problem areas another go in the future.  For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.

This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-12 10:39:06 -07:00
Ben Liblit cdce02573e Suppress warning about redundant type arguments in pre-1.7 code
Apparently this code is built using Java 1.6 under Tycho.  This leads
to complaints about the Java 1.7+ "<>" generic type inference feature,
if I try to use it.  Weirdly, the Eclipse GUI does not complain about
this, so apparently the Eclipse GUI is using Java 1.7 or later.  I do
not understand why Tycho and the Eclipse GUI are mismatched in this
way.
2017-07-12 10:39:06 -07:00
Ben Liblit f948b01e15 Suppress warnings about using raw types that we cannot fix
Some of the code in this project is machine-generated, so we cannot do
anything about raw-type warnings that arise.
2017-07-12 10:39:06 -07:00
Ben Liblit 65e6e5fbcf Suppress warnings about using raw types in test input
We shouldn't use raw types in real application code, but we often want
test inputs to do things that are simpler, or even not-quite-kosher.
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
Julian Dolby a910795e05 merge 2017-07-09 05:58:20 -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 42c1c0a37e Ignore Eclipse warnings about missing hashCode() methods in tests
In regular application code, these warnings should be taken seriously
and fixed.  But for test code, it's better to keep things simple and
not add any methods that aren't strictly needed by the test.
2017-06-30 10:24:36 -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
Ben Liblit bb032c9869 Add @Override annotations wherever possible
In the `com.ibm.wala.util` project, configure Eclipse to treat any
future violations of this as errors, not merely warnings.

However, in `com.ibm.wala.cast.java.test.data`, configure Eclipse to
silently ignore missing @Override annotations.  The JLex code in this
project is machine-generated, and we don't have a way to get the
generator to produce @Override annotations.
2017-06-30 08:54:12 -07:00
Julian Dolby 773fa68a3f made native test run on a linux vm 2017-06-29 09:07:29 +00:00
Achim D. Brucker 0e89268f4d Merge remote-tracking branch 'upstream/master' 2017-06-29 08:41:57 +01:00
Julian Dolby 5f0a7180d0 merge 2017-06-28 18:37:03 -04:00
Julian Dolby facb4d7e35 merge 2017-06-28 18:28:19 -04:00
Julian Dolby f3a38f50d8 more linking 2017-06-28 17:56:04 -04:00
Julian Dolby 9789eb4216 remove import 2017-06-28 17:36:34 -04:00
Julian Dolby 6a6bf888e8 try some static linking 2017-06-28 17:30:55 -04:00
Julian Dolby c51321f4ba try to load libs on linux 2017-06-28 16:26:03 -04:00
Julian Dolby a8ba39fa99 kill native test for now 2017-06-28 15:59:22 -04:00
Julian Dolby 5374ce3169 more linking 2017-06-28 15:38:38 -04:00
Julian Dolby d8f6bf2a26 more linking hacks 2017-06-28 15:24:22 -04:00
Julian Dolby 8c8f352325 link object file 2017-06-28 15:06:47 -04:00
Julian Dolby 9b6e29dcfd try extern "C" 2017-06-28 14:50:01 -04:00
Julian Dolby 3722190ece try extern "C" 2017-06-28 14:48:05 -04:00
Julian Dolby c57a21d4ef linking 2017-06-28 13:53:59 -04:00
Julian Dolby cf4b27a065 linking 2017-06-28 13:44:17 -04:00
Julian Dolby c979c9700e header needed on linux 2017-06-28 13:37:26 -04:00
Julian Dolby e21257f3e3 more lib paths 2017-06-28 13:33:13 -04:00
Julian Dolby 8138497ee2 more lib paths 2017-06-28 13:30:46 -04:00
Julian Dolby 1cd8db5571 jvm lib in different place on linux 2017-06-28 13:20:58 -04:00
Julian Dolby 2c5fb1aa1b linux perhaps needs more headers 2017-06-28 13:12:26 -04:00
Julian Dolby 5c242e8e10 more .. fussiness on linux
someone does not like -std=c++11
2017-06-28 13:04:51 -04:00
Julian Dolby b1c1ba8a48 linux seems fussier than the mac about .. 2017-06-28 12:57:33 -04:00
Julian Dolby 589da154a1 get realpath 2017-06-28 12:52:30 -04:00
Julian Dolby 7c476eac3d native interface for WALA 2017-06-28 12:42:49 -04:00
Julian Dolby 7ea9bca169 Merge branch 'master' of https://github.com/wala/WALA 2017-06-26 15:05:29 -04:00
Ben Liblit d32b2a29ad Ignore Eclipse warnings about potentially-static test code
In general, test code may do all sorts of things that would be
considered poor style in production code.  I assume that these
potentially-static methods are declared non-static by design.
2017-06-26 11:16:09 -07:00
Ben Liblit b3df445a4a Ignore Eclipse warnings about non-externalized string literals
There seems to be no effort to internationalize WALA, so such warnings
are just noise that we have no plans to fix.
2017-06-26 11:16:09 -07:00
Ben Liblit 3187d09c1f Roll some diagnostics back to ignore instead of warning or error
These should mostly be things that we've already decided earlier that
we explicitly don't want to "fix" because they simply disagree with
the WALA project's coding style.
2017-06-26 11:16:09 -07: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
Ben Liblit 457a294889 Treat API restriction diagnostics as warnings, not errors
The Eclipse IDE shows no such diagnostics, so it would be nice to
treat them as errors if any appear in the future.  However, the batch
Tycho-based build ("mvn clean install -DskipTests") does find and
report numerous such violations.  This discrepancy is strange; Manu
and I currently don't know why it's happening.  We suspect some
Maven-related weirdness may be creating slightly different
environments in the Eclipse GUI versus the command-line-driven build.
2017-06-26 11:16:09 -07:00
Ben Liblit 0b712f46b3 Simpler strategy for telling Tycho to use existing project settings
See
<https://eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html#useProjectSettings>
for more documentation on this feature, which first arrived in Tycho
0.22.
2017-06-26 11:16:09 -07:00
Manu Sridharan fbf4ff731d speed up some CG tests by disabling reflection handling
We should add some proper unit tests if we really care about how
reflection is handled for these tests; they take way too long to run
2017-06-26 10:57:31 -07:00
Julian Dolby 6c217a7ee4 Merge branch 'master' of https://github.com/wala/WALA 2017-06-24 18:13:22 -04:00
Julian Dolby f900eab5e2 fix classpath bug 2017-06-24 18:11:43 -04:00
Julian Dolby d774fdeb36 allow access from Scala wrappers 2017-06-24 18:51:27 +02:00
Julian Dolby 5e0703a4de code for SOAP/IMDEA talk 2017-06-24 18:46:57 +02:00
Julian Dolby a31dd02ab2 native support 2017-06-24 18:45:54 +02:00
Achim D. Brucker e448cf5634 Merge remote-tracking branch 'upstream/master' 2017-06-23 22:22:36 +01:00
Manu Sridharan 469734f61e Various fixes to nodejs project config files
* Fix pom.xml to be like other projects
* Check for existence of nodejs download before re-downloading
* Fix Eclipse config files to be like other projects
2017-06-23 07:01:18 +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 2bca30af01 Merge branch 'master' of https://github.com/wala/WALA 2017-06-22 11:01:59 +02:00
Julian Dolby ea844f0f4c Merge pull request #187 from liblit/warning-fixes-plug-in-development-misc
Fix nearly all Eclipse “Plug-in Development” warnings
2017-06-22 11:01:49 +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 83e82111fb Merge branch 'warning-fixes-plug-in-development-misc' of github.com:liblit/WALA into warning-fixes-plug-in-development-misc 2017-06-07 17:47:20 +02:00
Ben Liblit 69149ed472 Match classpath to JavaSE-1.7 execution environment
This fixes one Eclipse "The JRE container on the classpath is not a
perfect match to the 'JavaSE-1.7' execution environment" warning in
the "Plug-in Development" category.
2017-06-07 17:42:11 +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 4effd108f0 Remove "Bundle-Activator" header that names a missing class
This fixes one Eclipse "The type '...' is not on the plug-in
classpath" warning in the "Plug-in Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 140d75eacf Add missing output directories
This fixes five Eclipse "Source folder '...' does not have the output
folder in corresponding output entry 'output..'" warnings in the
"Plug-in Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 76fcaa5322 Add dependency on subproject containing plugin's Main class
This fixes two Eclipse "Referenced class '...' in attribute 'class' is
not on the plug-in classpath" warnings in the "Plug-in Development"
category.
2017-06-07 17:42:11 +02:00
Ben Liblit 4aef1be29f Set minimum required execution environments
This fixes two Eclipse "No required execution environment has been
set" warnings in the "Plug-in Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 9086f4c66c Remove unnecessary UTF-8 encoding overrides
Everything here seems to be ASCII.
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
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
Achim D. Brucker 52e8c0ecea Merge remote-tracking branch 'upstream/master' 2017-05-27 10:11:10 +01:00
Ben Liblit d45b598fb8 Match classpath to JavaSE-1.7 execution environment
This fixes one Eclipse "The JRE container on the classpath is not a
perfect match to the 'JavaSE-1.7' execution environment" warning in
the "Plug-in Development" category.
2017-05-27 00:57:33 -05:00
Ben Liblit 87f1535de7 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-05-27 00:57:33 -05:00
Ben Liblit 439d5245d3 Remove "Bundle-Activator" header that names a missing class
This fixes one Eclipse "The type '...' is not on the plug-in
classpath" warning in the "Plug-in Development" category.
2017-05-27 00:57:33 -05:00
Ben Liblit c9990d3808 Add missing output directories
This fixes five Eclipse "Source folder '...' does not have the output
folder in corresponding output entry 'output..'" warnings in the
"Plug-in Development" category.
2017-05-27 00:57:33 -05:00
Ben Liblit e59da85c08 Add dependency on subproject containing plugin's Main class
This fixes two Eclipse "Referenced class '...' in attribute 'class' is
not on the plug-in classpath" warnings in the "Plug-in Development"
category.
2017-05-27 00:57:33 -05:00
Ben Liblit eb15ab6e21 Set minimum required execution environments
This fixes two Eclipse "No required execution environment has been
set" warnings in the "Plug-in Development" category.
2017-05-27 00:57:33 -05:00
Ben Liblit 874a7dcde9 Remove unnecessary UTF-8 encoding overrides
Everything here seems to be ASCII.
2017-05-27 00:57:33 -05:00
Ben Liblit 2be5b289be 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-05-27 00:57:33 -05:00
Ben Liblit fc0204ae48 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-05-27 00:57:33 -05: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 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
Achim D. Brucker e93be68788 Merge remote-tracking branch 'upstream/master' 2017-05-26 20:39:36 +01:00
Achim D. Brucker f31df03cd3 Fixed markdown. 2017-05-26 20:39:08 +01:00
Julian Dolby d4607979ed Merge branch 'master' of https://github.com/wala/WALA 2017-05-26 15:13:28 -04: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
Achim D. Brucker ff298d67bf Added instructions for merging upstream changes. 2017-05-17 21:44:01 +01:00
Achim D. Brucker bc4bc846ac Merge remote-tracking branch 'upstream/master' 2017-05-16 10:56:33 +01: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
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 8747917c7b Merge branch 'master' of https://github.com/wala/WALA 2017-05-08 08:45:11 -04:00
Julian Dolby ba743ef19c Merge branch 'master' of https://github.com/wala/WALA 2017-05-08 08:45:02 -04: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
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
Julian Dolby 0575f40168 merge 2017-04-24 16:28:31 -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 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
Julian Dolby b33e7bce43 Merge branch 'master' of https://github.com/wala/WALA 2017-04-14 10:13:16 -04:00
Julian Dolby af83d11a4e Merge branch 'master' of https://github.com/wala/WALA 2017-04-14 10:13:04 -04: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
Julian Dolby 11585f3d34 Merge branch 'master' of https://github.com/wala/WALA 2017-03-30 21:58:56 -04:00
Julian Dolby 6cb422f707 merge 2017-03-30 21:58:46 -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 35aef3b383 Disable Eclipse unchecked-type-operation warnings in some test code
Often the easiest way to create a desired test scenario is to write
code that would make no sense in a complete, realistic application.
So we generally want to let test code do oddball things.
2017-03-28 20:01:31 -05:00
Ben Liblit bba887a810 Fix eclipse warnings about using raw versions of generic types
Along with these fixes, convert several for loops that used explicit
iterators into newer-style for-each loops that hide the iterators and
casts inside the syntactic sugar.  Nice!

However, I have not systematically tried to modernize *all* for loops
that could instead be for-each loops.  Someone could certainly do that
at some point.  In this commit, I only converted loops that I had to
touch anyway because they were using raw "Iterator" types.
2017-03-28 19:59:32 -05:00
Ben Liblit 91b9c9e28b Suppress/disable some Eclipse unnecessary-code warnings in test code
Often the easiest way to create a desired test scenario is to write
code that would make no sense in a complete, realistic application.
So we generally want to let test code do oddball things.
2017-03-28 19:25:08 -05:00
Ben Liblit 5f23949d9f Fix Eclipse warnings about unused type parameters 2017-03-28 18:22:30 -05:00
Ben Liblit 8dd3a78508 Fix Eclipse warnings about unnecessary casts 2017-03-28 18:20:39 -05:00
Ben Liblit b9c2890db6 Fix Eclipse warnings about unnecessary warning suppressions 2017-03-28 18:20:38 -05:00
Ben Liblit b197c231e0 Fix Eclipse warnings about declared but not-thrown exceptions 2017-03-28 18:20:36 -05:00
Ben Liblit 2bf662c342 Fix Eclipse warnings about redundant type arguments
These are all places where the compiler itself will infer the
arguments for us; we just need "<>" and inference will fill in the
rest.
2017-03-28 18:20:35 -05:00
Ben Liblit 2f7b52b01c Fix Eclipse warnings about unused imports 2017-03-28 18:20:33 -05:00
Ben Liblit c522344f67 Suppress 14 Eclipse warnings about discouraged access to restricted APIs
Based on what this code seems to be doing, there's really no
officially-sanctioned alternative to the APIs we're using here.
2017-03-28 17:25:53 -05:00
Manu Sridharan 7a160d4b06 Merge pull request #157 from liblit/warning-fixes-unnecessary-code-controversial
Fix 195 Eclipse warnings about unnecessary code ... controversially!
2017-03-28 14:09:04 -07: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 7bab9e7c08 Merge branch 'master' of github.com:wala/WALA 2017-03-25 22:09:33 -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
Ben Liblit 64dfd2d908 Turn off Eclipse warnings about unnecessary `else` clauses
If the true block of an `if` statement is guaranteed to exit early,
such as by a `return` or `throw`, then any code appearing in a
corresponding `else` clause could just as well have appeared after the
`if` statement entirely.  Eclipse can warn about this.

However, Manu prefers to let such code stay in the `else` clauses.
OK, sure: this is more a matter of personal taste than something truly
problematic.  Per Manu's request, then, we're turning off that Eclipse
warning in the subprojects in which it currently arises.
2017-03-25 16:37:09 -05:00
Ben Liblit 83a9201613 Revert "Fix 106 Eclipse warnings about unnecessary else clauses"
This reverts commit 04dafcf7f7.
2017-03-25 16:29:26 -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 c1b2151e08 make Maven Central files for wala.dalvik and wala.scandroid (#158) 2017-03-25 13:20:34 -07:00
Ben Liblit c94d4210ab Merge branch 'warning-fixes-unnecessary-code-uncontroversial' 2017-03-24 10:33:01 -05: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 67013a0d77 Fix 21 Eclipse warnings about unnecessary warning suppressions 2017-03-23 12:28:14 -05:00
Ben Liblit e52d872e3e Fix 19 Eclipse warnings about unnecessary casts 2017-03-23 12:28:14 -05:00
Ben Liblit 0f36e92f7e Remove "@inheritDoc" for classes; it's not allowed there 2017-03-22 20:40:53 -05:00
Ben Liblit 266b58970b Remove "@inheritDoc" for non-overriding methods 2017-03-22 20:40:53 -05:00
Ben Liblit b012b21147 Remove "@return" for void-returning functions 2017-03-22 20:40:53 -05:00
Ben Liblit 3b88d7be39 Remove advice to look at a deprecated class 2017-03-22 20:40:52 -05:00
Ben Liblit 5ec33b4636 Remove advice to use an alternate method that doesn't actually exist 2017-03-22 20:40:52 -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 98d5c02280 Don't warn about missing Javadoc tags
These changes turn off Eclipse warnings for Javadoc comments with
missing tags, such as "@throw" or "@param".

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 327 of them.  Apparently the WALA team's
implicit coding style says that omitting Javadoc tags is OK.  If
there's no intent to systematically add these tags, 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
Ben Liblit 49f08acb13 Don't warn about missing Javadoc comments
These changes turn off Eclipse warnings for documentable items without
Javadoc comments.  In some subprojects, we turn these off entirely.
In others, we leave these warnings on for public items but not for
items whose visibility is protected or below.

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 1,366 of them.  Apparently the WALA
team's implicit coding style says that omitting Javadoc comments is
OK.  If there's no intent to systematically add documentation, 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
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
Ben Liblit ff5e79c2d3 Merge remote-tracking branch 'official/master' 2017-03-22 15:29:24 -05:00
Julian Dolby dff76e1a82 Merge branch 'master' of https://github.com/wala/WALA 2017-03-22 15:43:03 -04:00
Manu Sridharan dce9ede601 Merge pull request #148 from liblit/automatic-dx-jar-download
Automatically download “dx.jar” when building
2017-03-22 12:31:25 -07: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
Ben Liblit ce2335c61f Merge branch 'master' of github.com:liblit/WALA 2017-03-22 12:00:46 -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 e04816ec7a Fix 2 Eclipse warnings about unused generic type parameters
Note: this changes some public APIs.
2017-03-20 00:44:42 -05:00
Ben Liblit 94fcc3966f Fix 2 Eclipse warnings about useless instanceof checks
Effectively these two checks could only be false if the instance being
tested were null.  So we replace the instanceof checks with null
checks.  Sometimes that, in turn, makes other surrounding code
simpler.  In the case of ApplicationLoaderFilter.test, for example,
a whole conditional case ("o instanceof LocalPointerKey") becomes
statically impossible.  That seems a bit strange to me, but that's
what the code was effectively doing.
2017-03-20 00:44:41 -05: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 04dafcf7f7 Fix 106 Eclipse warnings about unnecessary else clauses
Specifically, these warnings are always of the form "Statement
unnecessarily nested within else clause. The corresponding then clause
does not complete normally".  I can see this being a matter of
personal taste, actually.  If the WALA maintainers decide that they
prefer to keep this code as it was before, that's OK with me: I'll
replace this group of code changes with a group of settings changes
that tell Eclipse to quietly ignore this "problem".
2017-03-20 00:44:33 -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 16cb596947 Fix 10 Eclipse warnings about declared-but-never-thrown exceptions 2017-03-20 00:44:04 -05:00
Ben Liblit 4cd6e590a9 Fix 5 Eclipse warnings about local-but-unused constructors 2017-03-20 00:44:01 -05:00
Ben Liblit aa878f0b68 Fix 11 Eclipse warnings about redundant interfaces 2017-03-20 00:43:57 -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
Manu Sridharan fcd003f328 Merge pull request #149 from liblit/warning-fixes-deprecation
Resolve all Eclipse warnings about deprecated APIs
2017-03-18 13:59:51 -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 1ddbad17a3 Remove an assert before an "if" that checks the same thing
The assert will throw AssertionError if it finds a bad argument,
unless the code is running without assertion checking enabled.  The
"if" will throw an IllegalArgumentException if it finds the same bad
argument, and that check is always enabled.  Better to be consistent
in what exception is used to report a bad argument.  Since the "if" is
always active, let's go with that and remove the redundant,
not-always-active assert.
2017-03-17 21:59:11 -05: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 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 6a81cf8df2 Fix 19 Eclipse warnings about unnecessary semicolons 2017-03-17 21:49:22 -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
Ben Liblit 6caecce3e7 Suppress a deprecation warning about requesting an old AST version
Near as I can tell, the request for a deprecated version here is
intentional.  The non-deprecated version (AST.JLS8) is the latest and
greatest, but as far as I can tell we really do want the older version
here.
2017-03-17 21:18:36 -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
Ben Liblit 2a61306338 Download "dx.jar" from Maven, as we already do for "android.jar"
This should make it easier for newcomers to get WALA up and running
from sources.  One no longer needs to manually find "dx.jar" using
instructions given at
<http://wala.sourceforge.net/wiki/index.php/UserGuide:Getting_Started#Building_the_code>
or
<https://groups.google.com/forum/#!msg/wala-sourceforge-net/cBYsfEvYVG0/Ua52dyQQU-YJ>.
Those instructions were already out-of-date, anyway.

Given that an official release of "dx.jar" is available in Maven, it
would be nice to have Maven itself manage that dependency.
Unfortunately, it seems that WALA in general does not use Maven for
dependency management.  As far as I can tell, the Maven configuration
just calls out to Ant for doing builds, including having Ant download
other needed components.  If WALA ever moved to using Maven more
fully, downloading "dx.jar" could easily come along with that.
2017-03-16 19:51:11 -05:00
Ben Liblit ffa41a6120 Clone DroidBench in the desired place without pushhd/popd
IMHO this is a simpler way to achieve the desired result.
2017-03-16 19:51:08 -05:00
Ben Liblit 9c6e10cb1c Add trailing newlines, but remove other trailing white space 2017-03-16 19:51:02 -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
Manu Sridharan b144423ce4 Merge pull request #146 from liblit/warning-fixes-type-safety-and-raw-types
Fix Eclipse warnings about type safety and raw types
2017-03-15 13:08:26 -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 e56686ddf5 Suppress a few Eclipse warnings about unchecked casts
These are all ones that we cannot really fix statically.
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 85e7f7e623 Merge branch 'master' into IAnalysisCacheView 2017-03-15 10:27:45 -04:00
Manu Sridharan 1ba27cd576 Merge pull request #143 from liblit/gitignore-nodejs-lib
Ignore a "lib" subdirectory that Maven creates
2017-03-14 20:11:44 -07: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
Ben Liblit 7c1ec7d18a Ignore a "lib" subdirectory that Maven creates
This arises at some point during "mvn compile install".  I'm not sure
exactly when, but it's definitely automated, and therefore not
appropriate to track in git.
2017-03-13 14:01:13 -05:00
Julian Dolby bb0f38338e Merge branch 'warning-fixes-resource-management' of https://github.com/liblit/WALA 2017-03-13 10:44:38 -04:00
Julian Dolby 47f29192e6 Merge branch 'warning-fixes-generics-inference' of https://github.com/liblit/WALA 2017-03-13 10:42:52 -04:00
Ben Liblit 0165605c19 Simplify resource management using try-with-resource
This fixes the remaining 34 Eclipse "Resource '...' should be managed
by try-with-resource" warnings that were still left after the previous
commit.

Unlike the fixes in that previous commit, the changes here are *not*
plugging potential resource leaks.  However, in many cases that is
simply because the code before the close() call cannot currently throw
exceptions.  If exceptions became possible in the future, leaks could
result.  Using try-with-resource preemptively avoids that.
Furthermore, in code that was already dealing with exceptions, the
try-with-resource style is usually considerably simpler.
2017-03-12 21:38:43 -05:00
Ben Liblit b1678882b3 Plug numerous potential resource leaks
This fixes 33 out of 37 Eclipse "Potential resource leak: '...' may
not be closed" warnings.  It also fixes 3 out of 37 Eclipse "Resource
'...' should be managed by try-with-resource" warnings, although that
was not the main focus of this effort.

The remaining 4 warnings about potential resource leaks all involve a
leaked JarFile instance that is passed to a JarFileModule constructor
call.  JarFileModile never attempts to close its underlying JarFile;
this code is written as though JarFile cleanup were the caller's
responsibility.  However, the JarFile often cannot be closed by the
code that creates the JarFileModule either, since the JarFile needs to
remain open while the JarFileModule is in use, and some of these
JarFileModules stay around beyond the lifetime of the code that
created them.  Truly fixing this would essentially require making
JarFileModule implement Closeable, which in turn would probably
require that Module implement Closeable, which in turn would require
changes to lots of code that deals with Module instances to arrange
for them to be properly closed.  That's more invasive than I'm
prepared to take on right now.
2017-03-12 21:38:43 -05:00
Ben Liblit 7a3a23b2b4 When using Maven, compile using Java 1.7, not 1.6
We already switched to using Java 1.7 in the Eclipse settings.  This
applies the corresponding change to Maven-managed builds.
2017-03-12 21:38:43 -05:00
Julian Dolby d890045a60 Merge branch 'master' of https://github.com/wala/WALA 2017-03-12 19:46:01 -04:00
Julian Dolby 774db6978a nodejs support updated to latest WALA and now on Travis 2017-03-12 19:45:19 -04:00
Manu Sridharan 064fa9a503 Merge pull request #140 from liblit/remove-execute-bits-from-non-scripts
Remove execute bits from many non-executable (i.e., non-script) files
2017-03-12 10:27:08 -07:00
Ben Liblit 32ab3aaa9b When using Maven, compile using Java 1.7, not 1.6
We already switched to using Java 1.7 in the Eclipse settings.  This
applies the corresponding change to Maven-managed builds.
2017-03-11 22:19:43 -06:00
Ben Liblit 994a70500f Remove redundant generic type parameters where possible
Instead, rely on Java's ability to infer type parameters in many
contexts.  This removes 665 Eclipse warnings.

Note: a few of these changes are to files under "test" subdirectories.
Presumably those are files that serve as test inputs rather than being
part of WALA code proper.  As far as I can tell, these changes do not
break any WALA tests.  But if any of those tests were specifically
intended to exercise WALA on code with non-inferred generic type
parameters, then I really should be leaving those alone.
2017-03-11 21:20:51 -06:00
Ben Liblit 1cf7f0f3d3 Merge branch 'master' of github.com:wala/WALA 2017-03-11 20:21:51 -06: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 ef1994e146 Merge branch 'master' of https://github.com/wala/WALA 2017-03-11 16:21:16 -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 6a8696e6e1 Merge pull request #118 from joana-team/pull-request__dalvik_typeinference
Make a variant of TypeInference which supports dalvik bytecode
2017-03-11 16:12: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 5c6cf9724a Merge branch 'warning-fixes-java-versions' of https://github.com/liblit/WALA 2017-03-11 13:46:06 -05:00
Julian Dolby ffe355bc74 Merge branch 'warning-fixes-model-behavior-class' of https://github.com/liblit/WALA 2017-03-11 13:45:20 -05:00
Julian Dolby 70501da941 Revert "IFDS Null Analysis files"
This reverts commit df99517df0.
2017-03-11 13:25:19 -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 a2c388b83d Merge branch 'nodejs' of https://github.com/Pfarrer/WALA 2017-03-09 09:02:28 -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 f5c36d7411 Merge branch 'master' of https://github.com/d2an3/WALA 2017-03-09 08:53:30 -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 3be77aeb3b Merge pull request #139 from GrammaTech/intstackget
Add int size() and int get(int index) methods to IntStack.
2017-03-09 08:50:03 -05:00
Brian Alliet 9c854a4be6 Add int size() and int get(int index) methods to IntStack.
Accrue (http://people.seas.harvard.edu/~chong/accrue.html) uses IntStack
internally for various things and found these convenient.
2017-03-07 12:00:02 -05:00
Achim D. Brucker d32aff7e9a Merge remote-tracking branch 'upstream/master' 2017-02-26 15:05:40 +00:00
Julian Dolby 017a715cd5 build new code 2017-02-24 22:43:31 -05:00
Julian Dolby 7b393a7da2 fix for missing Java 8 feature 2017-02-24 22:29:14 -05:00
Julian Dolby 583cf37e59 type cleanups 2017-02-23 10:15:59 -05:00
Julian Dolby a8a3699ee1 type cleanups 2017-02-23 10:10:39 -05:00
Ben Liblit 5a5cccc062 Strip execute bits from many non-executable (i.e., non-script) files 2017-02-23 06:10:08 -06:00
Achim D. Brucker 3269312195 Merge remote-tracking branch 'upstream/master' 2017-02-13 23:02:04 +00:00
Andrei Dan df99517df0 IFDS Null Analysis files 2017-02-11 18:36:28 +01: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
Manu Sridharan 71b505cfc8 Merge pull request #134 from joana-team/pull-request__getridofhashcodecomparator
get rid of HashCodeComparator and all its usages
2017-01-26 08:17:08 -08:00
Martin Mohr 467bf8038d implement hashCode() and equals() for DexModuleEntry 2017-01-26 15:41:42 +01: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 50ce960170 fix to rewriter creation 2017-01-19 22:13:53 -05: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 46dddcfb66 Bug fix for CAst translation. When translating if statements, the system has a case where code to detect dead blocks mistakenly triggers even though the needed CFG edge will be added later. The if processing code now tells the CFG that the block is not dead, which prevents it from being prematurely removed. 2017-01-16 21:57:12 -05:00
Julian Dolby 8d04766aa9 more changes for CHAs 2017-01-12 16:36:26 -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 7a69f752d0 type cleanups 2017-01-11 08:04:37 -05:00
Achim D. Brucker da57da4762 Merge remote-tracking branch 'upstream/master' 2017-01-07 00:13:50 +00:00
Julian Dolby 137fed6e62 optionally dump CG 2017-01-05 14:10:11 -05:00
Julian Dolby 70dac5ca69 support for more languages 2017-01-05 14:09:52 -05:00
Julian Dolby 37989efb6a adapt to teavm changes 2017-01-03 21:06:21 -05:00
Julian Dolby 15c8d711db changes for working with TeaVM and compilation to JavaScript 2017-01-03 20:58:16 -05:00
Julian Dolby d85226fa93 nnotation 2017-01-03 20:55:46 -05:00
Julian Dolby 51e59ef0bd more support for more languages 2017-01-03 20:51:49 -05:00
Julian Dolby 12404a0ce6 Merge branch 'master' of https://github.com/wala/WALA 2017-01-03 18:59:24 -05:00
Manu Sridharan f12b1a3df9 Merge pull request #130 from joana-team/dexlib-fix
Dexlib fix
2017-01-03 10:38:10 -08:00
Martin Mohr fcb9c57e40 fix download location for dexlib 2017-01-03 18:17:34 +01:00
Martin Mohr e78e71fe71 fetch dexlib-1.3.4.jar from SCanDroid
This buys us some time to work on a proper solution, aka:
porting from dexlib to dexlib2
2017-01-03 18:09:23 +01:00
Manu Sridharan 63e3f82d38 Revert "fetch dexlib-1.3.4.jar from SCanDroid"
This reverts commit fc31fce698.
2017-01-02 16:12:53 -08:00
Martin Mohr fc31fce698 fetch dexlib-1.3.4.jar from SCanDroid
This buys us some time to work on a proper solution, aka:
porting from dexlib to dexlib2
2017-01-02 16:05:43 -08: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
Achim D. Brucker 973ba0a7ab Merge remote-tracking branch 'upstream/master' 2016-12-17 09:46:12 +00: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 Mohr ee22e177c5 Dalvik-Frontend: add catch-all handler at the end and not at the beginning 2016-12-09 16:40:14 +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 4905695e4a more interprocedural NullPointerException test cases 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 7293d18a89 another test case for the NullPointerException analysis 2016-12-07 17:56:59 +01:00
Martin Hecker c7f618eb6f add some tests both for intra and inter-procedural NullPointerException Analysis 2016-12-07 17:56:59 +01:00
Martin Hecker 4fca71c595 some more simple tests for intraprocedurel NullPointerException Analysis 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 6d0ba7d371 Make a variant of TypeInference which supports dalvik bytecode
Dalvik bytecode represents 'null' as 0 which may lead to problems
in phi instructions. This variant of TypeInference fixes these
problems by

- tracking whether an SSA value is constant zero and
- ignoring constant zeros in the transfer function of phi instructions
  when meeting with non-primitive types
2016-12-07 16:34:13 +01:00
Martin Mohr 9ada546c5d Activity.onStop is part of the loop 2016-12-07 16:11:19 +01:00
Martin Mohr 9a3e869dd1 use pi nodes in dalvik frontend 2016-12-07 16:11:19 +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 Mohr fd2d4aefbf further fixes in dalvik front-end to avoid NullPointerExceptions and other errors 2016-12-07 16:11:19 +01:00
Martin Mohr 42ae088c05 turn exception throwing into debug logging message 2016-12-07 16:11:19 +01:00
Martin Mohr a8cb767c63 allow action names starting with "."
According to [1], such action names are allowed and implicitly to be
prepended with the package name of the application.

[1] http://developer.android.com/guide/topics/manifest/activity-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr 7c657f5754 allow unqualified custom actions 2016-12-07 16:11:19 +01:00
Martin Mohr be635cf50d support for activity aliases 2016-12-07 16:11:19 +01:00
Martin Mohr 92f26a33c2 clarification 2016-12-07 16:11:19 +01:00
Martin Mohr 95031461f4 handle gracefully the case of intent-filter without action
According to [1], such intent-filters do not let any intent
pass but on the other hand do no harm

[1] http://developer.android.com/guide/topics/manifest/action-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr a1fa8a2057 update intent information instead of crashing 2016-12-07 16:11:18 +01:00
Julian Dolby 891bf3f585 Merge branch 'master' of https://github.com/wala/WALA 2016-12-06 12:50:09 -05:00
Julian Dolby 8fd17b3463 merge 2016-12-06 12:50:04 -05: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 5f617c19e3 Tests for the new JSR 308 type annotations implementation. 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 92dc2929f2 Shrike: low level reading of JSR 308 Type Annotations from Java bytecode 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 Hecker 1b74b906fc Add some tests that are meant to check both for precision and soundness of the intraprocedural NullPointer analyses. 2016-12-05 18:24:39 +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 c530fc3ae6 once again fix location of apache commons io lib 2016-12-05 18:21:17 +01:00
Juergen Graf 22b7db62f7 make output of dot util compatible with dot viewer eclipse plugin. prevent parser error. 2016-12-05 18:21:17 +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
Manu Sridharan 9ca450de48 Merge pull request #114 from liblit/error-fix-hamcrest-dependency
Add Hamcrest dependency
2016-12-01 08:56:15 -08:00
Ben Liblit 522c382a19 Use consistent Java versions, usually 1.7
Previously, the various Eclipse projects' Java configurations used
mixtures of 1.6, 1.7, and 1.8.  Many were internally inconsistent,
such as requiring 1.7 in "MANIFEST.MF" but 1.6 in the Eclipse JDT
build preferences.  The Travis-CI configuration tests against both 1.7
and 1.8, but does not test against 1.6.

Across all projects, the most common version was 1.7.  So I'm going to
assume that 1.7 is the intended build target.  This commit makes 1.7
the selected version nearly everywhere.

"com.ibm.wala.core.testdata" is the one exception.  This specific
project uses a few features only found in 1.8, such as lambda
expressions.  Previously, "com.ibm.wala.core.testdata" used 1.7 in
some aspects of its configuration but 1.8 in others.  Now it
consistently targets 1.8.  I wish this one project didn't need to be
inconsistent with the rest of WALA, but at least now it's consistent
with itself.

(Personally, I'd be happy to target 1.8 only.  But my impression
across all of these configuration files is that the WALA developers
still want to be compatible with 1.7.  If that is no longer a
requirement, let me know and I will adjust these changes accordingly
to target 1.8 only.)

This change eliminates 11 "There is no 'jre.compilation.profile' build
entry and the project has Java compliance preferences set" warnings
and 13 "The JRE container on the classpath is not a perfect match to
the 'JavaSE-1.7' execution environment" warnings.  However, it also
adds 450 "Redundant specification of type arguments <...>" warnings
and 17 "Resource '...' should be managed by try-with-resource"
warnings.  So this seems like a net step backward in my wish to reduce
WALA warnings.  However, those new warnings concern Java 1.7 language
features that we were not previously using to good effect in projects
that targeted 1.6.  If we all agree that we can now target 1.7
instead, then we can use these helpful features as the newly-added
warnings suggest.  So I call that a step in the right direction.
2016-11-29 21:29:30 -06:00
Manu Sridharan fc37430c13 Merge pull request #113 from liblit/warning-fixes-xml-validation
Eliminate all Eclipse XML validation warnings
2016-11-29 18:05:09 -08:00
Ben Liblit cc2dcb91a6 Add Hamcrest dependency
Some source files here definitely use Hamcrest, so listing it as a
dependency seems reasonable.  What I find confusing is the inconsistency
among my Eclipse installations.  On some of my various machines, Eclipse
reports an error if this dependency is not listed.  On others, Eclipse
finds the required jar and reports no error, even if this dependency is
not listed.  I don't know why the latter works, or why the inconsistency
exists at all.  Eclipse is a complex, subtle beast.  What I can say is
that this change fixes the error for my Eclipses that were reporting an
error, and does not introduce any new errors for my Eclipses that were
already happy before this change.
2016-11-29 15:12:54 -06:00
Ben Liblit 18b79bf0f9 Merge branch 'master' into warning-fixes-xml-validation 2016-11-29 10:08:00 -06:00
Manu Sridharan 1e5dcf46f7 Merge pull request #112 from liblit/warning-fixes-html-validation
Eliminate all Eclipse HTML validation warnings
2016-11-28 21:37:46 -08:00
Ben Liblit 391210bf2d Exclude Maven-generated Ant build scripts from XML validation
When Maven generates these "*/target/antrun/build-main.xml" Any build
scripts, it does not include any DTD or XML Schema declarations.
Eclipse's XML validator warns about the lack of grammar constraints.
The warning is sensible, but we are not in a position to do anything
about it.  Better, therefore, to suppress these warnings so that we
can more-clearly see warnings we *can* address.
2016-11-28 14:57:26 -06:00
Ben Liblit d83a05affc Add stub DOCTYPE declarations for Eclipse plug-in manifest files
We actually know the full grammar for these files: it is documented at
<http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fplugin_manifest.html>.
We ought to be able to extract that DTD into a file and give each
"plugin.xml" a "<!DOCTYPE plugin SYSTEM ...>" declaration referencing
it.  Unfortunately, that leads to a new warning: "External entity
resolution is not supported by PDE."  So a stub declaration is the
best we can do.  Fortunately, Eclipse's structured editor seems to
preserve these once we add them by hand.
2016-11-28 14:55:34 -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 c2d47ae99d Exclude Eclipse feature manifest files from XML validation
In theory, these files could be checked against the DTD given at
<http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Ffeature_manifest.html>.
In practice, Eclipse's structured editor for this file type discards
any "<!DOCTYPE ...>" declarations one might manually add.  So there's
no convenient way to tell Eclipse' XML validator what grammar to use.
Fortunately, that same structured editor makes it unlikely that anyone
will introduce invalid content.  So I don't mind excluding these files
from XML validation entirely.
2016-11-28 14:03:03 -06:00
Ben Liblit 18b02e2880 Exclude third-party XML files from validation
Eclipse's XML validator warns about missing grammar constraints in
several XML files that come from non-WALA projects.  We are not in a
position to do anything about these problems.
2016-11-28 13:33:07 -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 94f6933ff1 Exclude JUnit test result files from XML validation
As created by Tycho Surefire, these files are XML documents without
DTD or XML Schema declarations.  The XML validator warns about this
omission.  However, Surefire is not a WALA component.  We are not in a
suitable position to change it to include XML schema or DTD
declarations in the XML files it generates.  Better, then, to ignore
this benign problem so we can focus on warnings that we can act on
directly.
2016-11-28 12:42:30 -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 f33efbf991 Exclude some hand-written HTML test pages from validation
It's unclear whether the original authors of these pages intended them
to be valid or invalid.  Certainly there is merit in testing against
invalid HTML, since the vast majority of real-world HTML is indeed
invalid.  I'm going to assume that any errors in this collection of
test inputs are intentional, and therefore not worth reporting when
running Eclipse HTML validation.
2016-11-27 21:24:03 -06:00
Ben Liblit e5e51110c3 Exclude plugin-provided HTML pages from validation
Plugin documentation includes plenty of invalid HTML.  However, we
don't maintain 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
Ben Liblit 5962e1c9ee Exclude some hand-written HTML test pages from validation
It's unclear whether the original authors of these pages intended them
to be valid or invalid.  Certainly there is merit in testing against
invalid HTML, since the vast majority of real-world HTML is indeed
invalid.  I'm going to assume that any errors in this collection of
test inputs are intentional, and therefore not worth reporting when
running Eclipse HTML validation.
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
Ben Liblit 7d7a9c7e85 Exclude intentionally-malformed HTML pages from validation
Some test files are intentionally invalid HTML.  There's no point in
having Eclipse remind us of this fact.
2016-11-27 17:59:24 -06:00
Ben Liblit 5381bd1735 Exclude third-party HTML pages from validation
The WALA team does not maintain these pages, and therefore is not in a
good position to address HTML validation warnings arising within them.
2016-11-27 16:48:15 -06:00
Manu Sridharan 13bdb905c9 Merge pull request #110 from liblit/warning-fixes-packaging
Fix various Eclipse warnings about packaging
2016-11-26 21:24:05 -08:00
Ben Liblit b3293ecc3e Enforce restrictions on the model behavior class statically
If a client violates these restrictions, I prefer that their code fail
at compile time instead of run time.  Changing a few key types from
`Class` to `Class<? extends AbstractAndroidModel>` gives us precisely
the static enforcement we need and lets us remove an
`AbstractAndroidModel.class.isAssignableFrom` run-time check.

However, this does change the public API of `AndroidEntryPointManager`
in two ways.  The `getModelBehavior` and `setModelBehavior` methods now
respectively accept and return `Class<?  extends AbstractAndroidModel>`
instead of `Class`.  Is tightening up a public API in this manner
considered OK?
2016-11-26 22:39:37 -06:00
Ben Liblit 20014e2cb2 "plugin" does not exist here, and therefore needs no localization
This fixes one Eclipse "no valid properties files exist in the
localization directory specified" warning.

Ordinarily I would also change this project's configuration to treat
this warning as an error in the future.  That's a good way to
discourage regressions.  Unfortunately in this particular case I
cannot find a setting that has the desired effect, even after hunting
around in Eclipse PDE sources.  It seemed that setting
"compilers.p.unknown-resource=0" in
"com.ibm.wala.util/.settings/org.eclipse.pde.prefs" should do the
trick, but it does not.  I don't know why.
2016-11-26 21:01:53 -06:00
Ben Liblit d4a0a5ddd4 Delist a JAR that is not actually present
This resolves one Eclipse "'...' build entry is missing" warning.

Also update the project configuration to treat this warning as an
error.  This should discourage commits that create new instances of
this sort of problem in the future.
2016-11-26 20:39:26 -06:00
Ben Liblit 8b7a163110 The "lib" subdirectory contains no Java sources
This resolves one "'...' is not a source folder" Eclipse warning.

Also update the project configuration to treat this warning as an
error.  This should discourage commits that create new instances of
this sort of problem in the future.
2016-11-26 20:39:26 -06:00
Ben Liblit 173209a7bb Eclipse wants "META-INF/" to be included in "bin.includes"
Other subdirectories' "build.properties" generally seem to include this
already, so who am I to argue?

This resolves one "An entry for META-INF/ is required in bin.includes"
Eclipse warning.

Also update the project configuration to treat this warning as an
error.  This should discourage commits that create new instances of
this sort of problem in the future.
2016-11-26 20:39:12 -06:00
Manu Sridharan 4080e49a5a Merge pull request #109 from liblit/warning-fixes-missing-non-null-by-default
Ignore missing non-null-by-default annotations in Eclipse
2016-11-26 17:56:10 -08:00
Ben Liblit dace7b709f Ignore missing non-null-by-default annotations in Eclipse
In general, the WALA code base is not really ready for nullness
checking.  It would be nice if we got there some day, but I'm not
planning to take that on now or any time soon.  Until then, it's not
useful to warn about missing @NonNullByDefault declarations on WALA
packages.

See also older commit 7b6811b.
2016-11-26 18:47:35 -06:00
Ben Liblit c74d5094c8 Merge remote-tracking branch 'official/master' 2016-11-25 14:54:10 -06:00
Julian Dolby ae57a7e947 further work on fix to cast nonsense 2016-11-24 11:40:36 +08:00
Julian Dolby 66d9e896c4 remove unsafe cast 2016-11-22 10:37:04 +08:00
Julian Dolby 166af27427 clean up types 2016-11-22 10:35:56 +08:00
Ben Liblit 9d9d4d2d78 Merge branch 'master' of github.com:wala/WALA 2016-10-27 10:50:35 -05:00
Brian Pfretzschner 9de3da19fb NodeJS Support, including Ant build script to download Nodejs Core Library files 2016-10-27 16:37:33 +02:00
Achim D. Brucker 317ae02155 Merge remote-tracking branch 'upstream/master' 2016-10-09 10:23:03 +01: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
Achim D. Brucker 21c30f41c2 Removed Tycho configuration (Windows platform). 2016-09-25 04:52:45 +01:00
Achim D. Brucker 98d2ebbec4 Merged upstream, manually resolved conflict in com.ibm.wala.dalvik.test/build.xml (accepted pull request). 2016-09-21 22:14:28 +01:00
Manu Sridharan 9b5845034f Merge pull request #105 from mherzberg/copy-dx-jar
Added build script step to copy dx.jar from Android SDK.
2016-09-21 12:13:03 -07:00
Michael Herzberg 68707c1208 Added build script step to copy dx.jar from Android SDK. 2016-09-21 08:47:03 +01:00
Julian Dolby 83799f0fea dd edge labels when printing labeled graphs 2016-09-20 21:41:03 -04:00
Manu Sridharan 1a7c527dbe Remove unused conditionals 2016-09-20 14:04:03 -07:00
Manu Sridharan e21ee9f5cf Do a shallow clone of DroidBench
This should (very slightly) speed up build times.
2016-09-20 13:55:47 -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 2948ecf31d rationalize names to ECJ 2016-09-18 19:47:14 -04:00
Achim D. Brucker 37ed2d35e3 Merge remote-tracking branch 'upstream/master' 2016-09-18 02:36:30 +01:00
Julian Dolby c7971cb969 ajaxslt 0.8.1 2016-09-16 20:23:51 -04:00
Julian Dolby 2d150eae17 need to find new version of ajaxxslt; it is failing to download 2016-09-16 09:52:11 -04:00
Julian Dolby f5f2a9e778 need to find new version of ajaxxslt; it is failing to download 2016-09-16 09:01:53 -04:00
Julian Dolby 0475e2e712 need to find new version failing to download 2016-09-16 08:59:14 -04:00
Julian Dolby 93e165e64a CPA smoke tests 2016-09-16 08:14:33 -04:00
Julian Dolby d10a50fc32 CPA smoke test 2016-09-15 21:33:51 -04:00
Julian Dolby 8b2ab22335 support for full CPA, when desired. 2016-09-15 21:32:35 -04:00
Julian Dolby cfbef4fe47 clean up load additional file 2016-09-15 21:24:16 -04:00
Julian Dolby 7928e57435 clean up load additional file 2016-09-15 21:18:31 -04:00
Julian Dolby 5eb1c7bc1d HybriDroid support 2016-09-15 21:14:34 -04:00
Julian Dolby 1aa3d7fc59 fix bogus test of Date as property name 2016-09-15 21:08:05 -04:00
Michael Herzberg 0bcbe43596 Reverted visibility of private method. 2016-09-14 16:28:28 +01:00
Achim D. Brucker 57c59466ac Cleanup to minimize diff to upstream version. 2016-09-07 20:35:37 +01:00
Achim D. Brucker fd31148560 Merge remote-tracking branch 'upstream/master'. 2016-09-06 11:46:07 +01:00
Julian Dolby 30bc2858c4 fix for slicer issue in javascript 2016-08-23 20:59:08 -04:00
Achim D. Brucker 3608dcca5a Deleted whitespaces. 2016-08-21 11:45:28 +01:00
Achim D. Brucker 6d5da61f00 Removed m2e settings plugin configuration (to minimize difference with upstream WALA). 2016-08-21 11:42:06 +01:00
Achim D. Brucker 682a0adceb Merge remote-tracking branch 'upstream/master' 2016-08-20 10:22:35 +01: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
Achim D. Brucker abacd436a2 Merge remote-tracking branch 'upstream/master' 2016-08-13 23:22:55 +01: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
Achim D. Brucker 661634a4ab Use upstream implementation of getLastLine(). 2016-08-07 11:58:43 +01:00
Achim D. Brucker e8ea3615d1 Merged latest updates from upstream. 2016-08-06 21:02:35 +01:00
Julian Dolby 7d7dd17a47 minor fix to getting method annotations for dalvik 2016-07-28 16:11:16 -04:00
Julian Dolby 0b52e9389e Merge branch 'master' of https://github.com/wala/WALA 2016-07-25 21:41:11 -04:00
Julian Dolby 7b59f3141c fix analysis options in js engine 2016-07-25 18:34:40 -04: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 f5f75c7c66 find slf4j from maven 2016-07-05 20:01:04 -04:00
Julian Dolby 73747cbb86 fixes for work with ECJ 2016-07-05 19:37:36 -04:00
Ben Liblit 9db1494aa1 Merge branch 'master' of github.com:wala/WALA 2016-07-05 13:22:12 -05:00
Manu Sridharan 6daceaa0ed Merge pull request #103 from liblit/eclipse-neon-fixes
Build fixes for Eclipse Neon
2016-07-05 08:59:09 -07:00
Manu Sridharan 202ca8d02e Merge pull request #102 from liblit/null-analysis-errors-cleanup
Ignore potential null accesses in Eclipse
2016-07-05 08:58:42 -07:00
Ben Liblit c3cbfc1c69 Merge branch 'master' of github.com:wala/WALA 2016-07-04 19:18:36 -05:00
Ben Liblit 80c075b4e4 Merge remote branch 'origin/master' 2016-07-04 14:05:49 -05:00
Julian Dolby be6eec72a0 more temp file APIs 2016-07-01 10:51:30 -04:00
Julian Dolby e8dfe604a5 fix bug in pull 2016-06-29 22:08:33 -04:00
Ben Liblit 52b6c1b235 Merge branches 'null-analysis-errors-cleanup' and 'eclipse-neon-fixes' 2016-06-29 12:50:07 -05:00
Julian Dolby 22ce3d1144 Merge https://github.com/steohan/WALA 2016-06-29 13:03:50 -04:00
Ben Liblit c1aaec592c Accidental "warning" setting should be "ignore"
The original intent was to ignore this potential problem in all projects in which it occurs; this one escaped my attention.
2016-06-28 16:54:19 -05:00
Ben Liblit e7b328641e Add stub for ITypeBinding.isIntersectionType()
This interface method was added in Eclipse Neon, so we need to implement
it here to have a non-abstract class.  With this fix, WALA now builds
with no errors inside Eclipse Neon.  (There are still a few thousand
warnings, but that's nothing new.)
2016-06-27 18:47:02 -05:00
Achim D. Brucker dd3409e1ab Disabled (outdated and unused) polyglot project. 2016-06-27 20:35:23 +01:00
Ben Liblit 7b6811b2dd Ignore potential null accesses in Eclipse
Eclipse Mars Service Release 2 finds 45 potential null pointer accesses
across WALA's various Eclipse projects. Eclipse ignores these by
default, but any individual user may have changed their personal Eclipse
configuration to treat them as warnings or errors. Thus, some people
will find that the code builds while others find that it fails. Better
to explicitly use a known-good configuration.

In the long run someone should inspect these cases one-by-one and fix
them where appropriate. But that is probably better managed as part of a
larger effort to tidy up nulls in WALA. I'm not planning to take that on
now or any time soon, though, so this is a better setup for now.
2016-06-27 13:11:42 -05:00
Julian Dolby aeac2a6df0 check call has enough arguments 2016-06-22 13:05:02 -04:00
Julian Dolby 76286a330c make Android entrypoint locator work for source code 2016-06-10 21:21:08 -04:00
Manu Sridharan 21340b44cf Merge pull request #101 from sewe/master
SecurityExceptions when analyzing JARs with broken/expired signatures
2016-06-08 10:48:49 -07: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 a319b3e130 Switch back to using install for jars.
Just running 'verify' won't work since project dependencies are 
resolved via the local maven repository.
2016-05-25 16:30:59 +02:00
Manu Sridharan 327dd1752c Do 'verify' instead of 'install' in jar build
This way, we don't pollute the cache of .m2 every time the build runs.
2016-05-25 16:14:47 +02:00
Manu Sridharan bd9d6d6c62 Move building Maven Central jars to end 2016-05-25 15:34:22 +02:00
Manu Sridharan 71fda78c11 Tweak JDK setting in Travis config 2016-05-25 15:15:51 +02:00
Manu Sridharan c3472ef73b More output to debug maven jar script on Travis 2016-05-25 15:09:51 +02:00
Manu Sridharan 1cf922b927 Build Maven Central jars on Travis 2016-05-25 14:31:17 +02:00
Manu Sridharan 330692ad0e Include files from dat directory in jar 2016-05-25 11:51:50 +02:00
Manu Sridharan 8ac8b3d662 Change versions of Eclipse jars
This plays more nicely with Gradle
2016-05-25 11:51:25 +02:00
Manu Sridharan f73419c343 Script to build maven central jars 2016-05-25 08:12:59 +02:00
Manu Sridharan c549c246fc Small typo fix 2016-05-25 08:12:30 +02:00
Manu Sridharan f47e1a27b8 Add Maven Central build file 2016-05-24 11:59:59 +02:00
Manu Sridharan 8129d960b9 Create new com.ibm.wala.cast.java.ecj project.
The new project only depends on the minimal Eclipse plugins to make the
ECJ frontend work.  Hence, it should be amenable to creating a Maven
Central jar.
2016-05-24 11:39:00 +02:00
Manu Sridharan 94a4c5277f more EJC -> ECJ renaming 2016-05-24 11:17:11 +02:00
Manu Sridharan 29a306f4d0 Add launcher for ECJJavaIRTest 2016-05-24 10:54:51 +02:00
Manu Sridharan 57ff2a9dd5 Rename EJC* -> ECJ*, to match standard acronym 2016-05-24 10:51:58 +02:00
Manu Sridharan bd58bf4515 Remove cast.java dependence on org.eclipse.core 2016-05-18 21:18:52 -07:00
Manu Sridharan 217644ff84 Example driver for ECJ front end
This shows how with ECJ, the JDT source front end can be used from
the command-line (with no running Eclipse instance).
2016-05-18 21:10:59 -07:00
Manu Sridharan c26cddf65b Maven Central build file for wala.cast.java
Work in progress
2016-05-18 21:09:50 -07:00
Manu Sridharan c6e322e205 Remove Polyglot-based Java source front-end 2016-05-18 10:46:19 -07:00
Manu Sridharan 96d9f75660 Stop building Polyglot
Our script for pulling the Polyglot source from Google Code no longer
works.  We may remove Polyglot support itself pretty soon, as it
only supports old Java versions.
2016-05-12 10:01:57 -07: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
Manu Sridharan 88df462783 Update ignores 2016-04-03 12:44:32 -07:00
Manu Sridharan 6df8d1b32d Fix compilation in Eclipse Mars
Fixes #98
2016-04-03 12:43:57 -07:00
Julian Dolby e28b97b1ec fix null pointer exception handling tag 2016-03-28 12:56:36 -04:00
Julian Dolby e87b2e5d84 fixes for slicing of field-based CGs 2016-02-14 17:18:21 -05:00
Julian Dolby 970acf10db driver to dump APK IR 2016-02-11 13:49:09 -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 672876c595 Added Testcases for ExceptionAnalysis and ExceptionAnalysis2EdgeFilter. 2016-01-13 02:07:58 +01:00
Stephan Gocht 2869af24df Bugfixes, code and documentation improvements. 2016-01-13 02:07:11 +01:00
Stephan Gocht 0387bd1591 Removed Warning 2016-01-10 15:34:10 +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 a76486ef94 Depend on org.eclipse.e4.ui.workbench optionally
This makes IFDSExplorerExample work with more recent Eclipse versions.
2015-12-16 10:58:40 -08:00
Manu Sridharan 02c9929759 Use more call graph exclusions for Java 1.7 2015-12-16 10:56:49 -08: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
Julian Dolby f02c77ba08 Allow patching call sites for older jvms. Warning: the new
patch-calls option does not work in Java 8, due to verifier changes.
2015-12-15 12:57:50 -05:00
Julian Dolby ad64e958dc changes for language work 2015-12-15 12:53:36 -05:00
Manu Sridharan 0eabfa2d05 Add slicer test
This test relates to a mailing list question from 
Gebrehiwet Biyane Welearegai:

https://groups.google.com/forum/#!topic/wala-sourceforge-net/lS7lyCHfAaw
2015-12-14 10:34:10 -08: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
Julian Dolby 9267003c5b changes for language and solver work 2015-12-09 17:28:45 -05:00
Julian Dolby ab22d9abb0 enable specialization of source extractor for Web pages 2015-11-30 21:28:40 -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
Julian Dolby d010e36923 fix for NOP instructions 2015-11-13 09:57:02 -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 876e52c3f8 fixes for dalvik maven packaging 2015-11-06 18:36:03 -05:00
Julian Dolby 9c55f01d99 fixes to creation of jar file by maven 2015-11-06 18:26:01 -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
Julian Dolby 849177fa5e changes for new language support 2015-10-25 16:13:07 -04:00
Stephan Gocht 7d7e236fd6 Added test for exception pruning (including example for usage). 2015-10-23 14:56:33 +02:00
Stephan Gocht 851f9b2ef3 Added comments. 2015-10-23 14:56:02 +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
Achim D. Brucker 6508b75afb Merge branch 'master' of github.com:DASPA/WALA 2015-10-15 11:57:33 +02:00
Achim D. Brucker 5c3e8b6fa5 Configured m2e to ignore not supported lifecycle events. 2015-10-15 11:53:05 +02:00
Julian Dolby 556d8ff043 Eclipse Java Compiler standalone for WALA source front end 2015-10-14 13:41:23 -04:00
Julian Dolby 31e4028a94 adapt to wala changes 2015-10-14 13:36:48 -04:00
Julian Dolby 0265a1c2dc Eclipse Java Compiler as a standalone source code front end 2015-10-14 13:32:34 -04: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
Manu Sridharan ce10710125 Avoid repeatedly initializing possibleEntryPoints
Added while investigating #88, but this does not fix the problem
2015-10-11 16:12:13 -07: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
Julian Dolby d73e07b4c9 fixes for Scala interface to Polyglot-based Java source 2015-10-09 19:05:04 -04: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
Michael Herzberg f9dabf04fc Allow overriding of getScriptFromUrl. 2015-10-06 22:44:45 +02:00
Michael Herzberg 8227286b38 Implemented method to retrieve line numbers. 2015-10-06 22:44:16 +02:00
Michael Herzberg 130ac94991 Copy dx.jar from ANDROID_SDK dir. 2015-10-05 23:49:00 +02:00
Michael Herzberg ae9e06a95b Merge remote-tracking branch 'upstream/master' 2015-10-05 22:31:49 +02:00
Julian Dolby 95fde98533 Merge branch 'master' of https://github.com/wala/WALA 2015-09-25 13:42:54 -04:00
Julian Dolby 6c4d0de3c5 clean up for Eclipse/Maven 2015-09-25 13:39:47 -04:00
Manu Sridharan ae2a428394 Fix Ant build file 2015-09-21 10:43:30 -07:00
Julian Dolby 45af0414b7 more attempts to placate annoying ibm jvm 2015-09-18 21:48:13 -04:00
Julian Dolby 3ad0c2009a restructure tests 2015-09-16 13:27:31 -04:00
Julian Dolby 5517371a9b adapt to IField changes 2015-09-16 13:25:53 -04:00
Julian Dolby 26b126203d fix imports; restructure annotations tests 2015-09-16 13:25:21 -04:00
Julian Dolby 13de4a3bd1 add support for generic signatures 2015-09-16 13:23:21 -04:00
Julian Dolby 10e626bbce allow overriding to add operators 2015-09-16 13:22:23 -04:00
Stephan Gocht 6df7c85714 Changed class and construction modifier to public. 2015-09-07 23:11:41 +02:00
Stephan Gocht 2dc6322356 Extracted private class and made it public. 2015-09-07 21:49:03 +02:00
Stephan Gocht 52ea4af62c Added Support for creating pi nodes for more than on variable. 2015-08-19 17:46:58 +02:00
Manu Sridharan b544f0fa61 update mvncentral.xml for Rhino 1.7.6 2015-08-14 15:28:57 -07:00
Julian Dolby 972466d41c switch to tycho 23.1 2015-08-14 13:55:28 -04:00
Julian Dolby 487f6cc150 move to Rhino 1.7.6 2015-08-14 12:27:13 -04:00
Julian Dolby 3ddaa9eaf7 restore EPL headers 2015-08-13 12:34:34 -04:00
Julian Dolby ef9eb441dd Merge branch 'mohrm-master' 2015-08-13 11:27:33 -04:00
Julian Dolby 045537274f merge 2015-08-13 11:26:48 -04:00
Julian Dolby 671bd98977 Java 8 suport enhancements, mostly to model lambdas compiled to
invokedynamic
2015-08-12 15:20:21 -04:00
Julian Dolby f760672215 tests for java 8 default methods 2015-08-09 14:13:38 -04:00
Julian Dolby b1538aece6 Merge branch 'master' of https://github.com/wala/WALA 2015-08-09 13:47:01 -04:00
Julian Dolby 8470091225 Java 8 default methods 2015-08-09 13:46:03 -04:00
Julian Dolby 3f5ce89cb6 finalizer test 2015-08-09 13:43:40 -04:00
Manu Sridharan d47e2cfbde use execution environment to specify JRE 2015-08-06 13:25:55 -07:00
Manu Sridharan 13a46d8ea3 Fixes #82
PrunedCFG had been changed to always include an entry and exit node.
The logic for detecting an "empty" ExceptionPrunedCFG inside the PDG
construction code had not been updated appropriately.
2015-08-06 11:08:27 -07:00
Julian Dolby cb77169101 serialize dynamic callgraph in UTF-8 format, so as to handle Unicode
names in class files
2015-08-04 14:18:43 -04:00
Manu Sridharan 44699a619f Merge pull request #85 from msridhar/remove-eclipse-dep
Remove Eclipse dependence from cast.js(.rhino)
2015-07-31 07:26:25 -07:00
Julian Dolby 223fb8d439 try to be more precise about finalize methods 2015-07-31 09:20:46 -04:00
Manu Sridharan 4c3827bf49 more Maven-related changes 2015-07-30 20:39:26 -07:00
Manu Sridharan 753fc61fb3 remove Eclipse dependence from cast.js.rhino 2015-07-30 19:24:53 -07:00
Manu Sridharan 87d22be3fb Attempt to fix JSDT tests 2015-07-30 16:37:02 -07:00
Manu Sridharan b7ab80734f remove Eclipse dependendence from cast.js 2015-07-30 15:03:45 -07:00
Manu Sridharan 2a55d2e9e9 MVN central build file for com.ibm.wala.cast 2015-07-30 14:06:51 -07:00
Manu Sridharan 8ca3184429 Merge pull request #84 from msridhar/remove-eclipse-dep
Remove com.ibm.wala.cast's dependence on Eclipse
2015-07-30 11:01:13 -07:00
Manu Sridharan 7803787999 remove Bundle-Activator from MANIFEST.MF 2015-07-30 10:13:22 -07:00
Manu Sridharan 942a3d5343 Remove Eclipse dependence from com.ibm.wala.cast
Remove (presumably unused) AstPlugin classes
2015-07-30 10:07:03 -07:00
Manu Sridharan 93ff020285 Remove old package 2015-07-30 09:57:46 -07:00
Martin Mohr 5aae6234e8 give BasicNullaryStatements a toString() method
Before, fixed-point systems containing BasicNullaryStatements
caused crashes when trying to output them (because  toString()
 method of AbstractStatement assumes that there is Right-Hand-Side,
 but BasicNullaryStatements throw an UnsupportedOperationException
 when trying to get them).

Why shouldn't BasicNullaryStatements have a string representation?
2015-07-30 17:19:34 +02:00
Martin Mohr 9b8b323812 make configurable whether we apply an optimized version of hasExceptions() 2015-07-27 18:31:43 +02:00
Martin Mohr 65b9e97ae5 refine hasExceptions(): return true if there are *uncaught* exceptions 2015-07-27 14:17:18 +02:00
Julian Dolby a1159db2f4 switch to (one hopes) a more reliable javacup input file 2015-07-24 23:25:08 -04:00
Julian Dolby 519b98a0ea fixes to model of for ... in ... in JavaScript 2015-07-24 22:48:20 -04:00
Julian Dolby eb24a616f1 clean up 2015-07-24 22:45:25 -04:00
Julian Dolby 563b6ba6aa fixes for for ... in ... form in JavaScript 2015-07-24 22:44:10 -04:00
Julian Dolby 364fe7fa99 make dynamic and static analysis more consistent 2015-07-24 22:42:34 -04:00
Julian Dolby b721a3ceb0 updates to dynamic call graphs to better match static ones 2015-07-10 09:44:01 +02:00
Julian Dolby a6a060ed25 changes for handling of 'callbacks' in dynamic CGs 2015-06-28 17:06:21 -04:00
Martin Mohr 8d143dbf20 remove 'Custom Change' markers 2015-06-25 09:12:37 +02:00
Martin Mohr 0b92907149 Revert "cache for selectors"
This reverts commit 0af7f105ec.
2015-06-25 09:12:37 +02:00
Martin Mohr 620dd15d00 allow comments in exclusion files 2015-06-25 08:59:21 +02:00
Martin Mohr 53852ef2a3 fix dalvik eclipse project build path 2015-06-22 15:54:00 +02:00
Martin Mohr b727348af4 fix plugin build path for dalvik project 2015-06-22 14:20:57 +02:00
Martin Mohr 0d06d7caff com.ibm.wala.dalvik.test: get cup example file more reliably 2015-06-22 10:45:27 +02:00
Martin Mohr 0583450884 fix whitespace 2015-06-22 10:45:26 +02:00
Martin Mohr f4cef8db7a dalvik frontend: set target for SSAGotoInstructions 2015-06-22 10:45:26 +02:00
Juergen Graf bd96807d7c fix bug: npe on control dep computation when exceptions are ignored 2015-06-22 10:45:26 +02:00
Martin Mohr cecd2c950f support multiple intent actions and urls in manifest parser 2015-06-14 23:34:33 -07:00
Martin Mohr f2a4bba83f bugfix in debug output: only take item from worklist if it is not empty 2015-06-14 23:33:43 -07:00
Martin Mohr b66903c8de ignore lib folder of com.ibm.wala.cast project 2015-06-14 23:33:43 -07:00
Martin Mohr 8ac515a452 fix download location of apache commons io lib 2015-06-14 23:33:43 -07:00
Martin Mohr a56eeae51a kill deprecated method together with the last call of it 2015-06-14 23:33:43 -07:00
Martin Mohr 4bc25d3ddf also model outer loops as indefinite instead of infinite 2015-06-14 23:33:18 -07:00
Martin Mohr b378f8c458 custom change: include target in string representation of cond-branch 2015-06-14 23:31:35 -07:00
Martin Mohr 441cc6f279 bugfix in model: close inner loop using a *conditional* goto
This way, the rest of the outer loop (including the jump to the
beginning) is also reached in the control-flow which means that
the outer loop is modelled as a proper loop
2015-06-14 23:31:35 -07:00
Martin Mohr 29779f411a allow adding a conditional branch instruction 2015-06-14 23:31:35 -07:00
Martin Mohr ccb5b02abd do not add self-loops 2015-06-14 23:31:35 -07:00
Martin Mohr cfadf0104c substitute call to deprecated method 2015-06-14 23:31:35 -07:00
Martin Mohr a83ba08980 turn off debug output 2015-06-14 23:31:00 -07:00
Martin Mohr 80fd657675 transcribe non-overwritten reserved slots into "goto next" instructions 2015-06-14 23:31:00 -07:00
Martin Mohr b1c10b642f finish all sections only if a section was entered 2015-06-14 23:31:00 -07:00
Martin Mohr cfa005203a cover corner case of intent or intent's action being null 2015-06-14 23:31:00 -07:00
Martin Mohr 9c4c3507c4 cover corner case of method being null 2015-06-14 23:31:00 -07:00
Juergen Graf e1beb6aa90 add non-recursive dfs solution to compute backedges for large methods 2015-06-14 23:30:41 -07:00
Martin Mohr 3e4af27112 allow resetting the AndroidEntryPointManager - this is rudimentary support for running the android front-end *multiple times within the same VM* 2015-06-14 23:30:41 -07:00
Martin Mohr b5092637c8 improve recognition of intent action 2015-06-14 23:29:27 -07:00
Martin Mohr a5b6490951 fix getNextProgramCounter()
handle the case that the current program counter is free
2015-06-14 23:29:27 -07:00
Martin Mohr 8610ac29c7 allow to retrieve Android Model Class with different cha 2015-06-14 23:29:27 -07:00
Martin Mohr 1acbf4b9f7 preserve holes in instruction array when transcribing method summary
otherwise the iindex fields in the ssa instructions are inconsistent
with their index in the instruction array
2015-06-14 23:29:10 -07:00
Martin Mohr 7e3fb18fc0 BUGFIX: when reusing ssa value numbers, consider the case that an instruction may not have a def 2015-06-14 23:29:10 -07:00
Martin Mohr 1f105dc101 staticalize a method 2015-06-14 23:29:10 -07:00
Martin Mohr b03cd18ada handle case when exclusions are null 2015-06-14 23:29:10 -07:00
Martin Mohr 9e5be48138 only generate return statement if caller and callee are compatible 2015-06-14 23:27:57 -07:00
Martin Mohr 0af7f105ec cache for selectors 2015-06-14 23:27:57 -07:00
Martin Mohr 0af274a1f9 use class hierarchy for preflight-checking 2015-06-14 23:27:57 -07:00
Martin Mohr 86c65f0578 fix some issues of the IntentContextSelector 2015-06-14 23:27:57 -07:00
Martin Mohr 485b02a8e0 instantiate SpecializedInstanstiator only if given class is really special 2015-06-14 23:27:15 -07:00
1946 changed files with 41329 additions and 25220 deletions

6
.dir-locals.el Normal file
View File

@ -0,0 +1,6 @@
((groovy-mode
(c-file-style . "bsd")))
;; Local variables:
;; flycheck-disabled-checkers: (emacs-lisp emacs-lisp-checkdoc)
;; End:

70
.gitignore vendored
View File

@ -4,34 +4,48 @@
*.swp
*/bin/
*/bin/*
*/build/
*~
.classpath
.metadata/
com.ibm.wala.cast.java.jdt.test/
com.ibm.wala.cast.java.polyglot/lib/
com.ibm.wala.cast.java.test.data/src/JLex/
com.ibm.wala.cast.java.test/testdata/
com.ibm.wala.cast.js.html.nu_validator/lib/
com.ibm.wala.cast.js.rhino.test/*.dump
com.ibm.wala.cast.js.rhino.test/*.html*
com.ibm.wala.cast.js.rhino.test/2009_swine_flu_outbreak
com.ibm.wala.cast.js.rhino.test/?game*
com.ibm.wala.cast.js.rhino.test/BunnyHunt
com.ibm.wala.cast.js.rhino.test/digg_attack
com.ibm.wala.cast.js.rhino.test/game.php*
com.ibm.wala.cast.js.rhino.test/xxxx
com.ibm.wala.cast.js.rhino/lib/
com.ibm.wala.cast.js.test.data/examples-src/ajaxslt/
com.ibm.wala.cast.js.test/examples-src/ajaxslt/
com.ibm.wala.cast.js/lib/
com.ibm.wala.core.testdata/*.jar
com.ibm.wala.core.testdata/@dot/
com.ibm.wala.core.testdata/lib/
com.ibm.wala.core.tests/dat/wala.examples.properties
com.ibm.wala.core.tests/report
com.ibm.wala.core/@dot
com.ibm.wala.core/com.ibm.wala.core*.jar
com.ibm.wala.core/dat/wala.properties
com.ibm.wala.dalvik/src/logback.xml
com.ibm.wala.ide.jdt.test/testdata/
edu.kit.wala.smali.test/out/
.project
/*/.settings/org.eclipse.buildship.core.prefs
/.gradle/
/.settings/org.eclipse.buildship.core.prefs
/.vscode/settings.json
/build/
/com.ibm.wala.*/out/
/com.ibm.wala.cast.java.jdt.test/
/com.ibm.wala.cast.java.polyglot/lib/
/com.ibm.wala.cast.java.test.data/src/JLex/
/com.ibm.wala.cast.java.test/testdata/
/com.ibm.wala.cast.js.html.nu_validator/lib/
/com.ibm.wala.cast.js.nodejs/lib/
/com.ibm.wala.cast.js.rhino.test/*.dump
/com.ibm.wala.cast.js.rhino.test/*.html*
/com.ibm.wala.cast.js.rhino.test/2009_swine_flu_outbreak
/com.ibm.wala.cast.js.rhino.test/?game*
/com.ibm.wala.cast.js.rhino.test/BunnyHunt
/com.ibm.wala.cast.js.rhino.test/digg_attack
/com.ibm.wala.cast.js.rhino.test/game.php*
/com.ibm.wala.cast.js.rhino.test/xxxx
/com.ibm.wala.cast.js.rhino/lib/
/com.ibm.wala.cast.js.test.data/examples-src/ajaxslt/
/com.ibm.wala.cast.js.test/examples-src/ajaxslt/
/com.ibm.wala.cast.js/lib/
/com.ibm.wala.cast/lib/
/com.ibm.wala.core.testdata/*.jar
/com.ibm.wala.core.testdata/@dot/
/com.ibm.wala.core.testdata/lib/
/com.ibm.wala.core.tests/report
/com.ibm.wala.core/@dot
/com.ibm.wala.core/com.ibm.wala.core*.jar
/com.ibm.wala.core/dat/wala.properties
/com.ibm.wala.dalvik.test/data/sample.cup
/com.ibm.wala.dalvik.test/parser.java
/com.ibm.wala.dalvik.test/report
/com.ibm.wala.dalvik.test/sym.java
/com.ibm.wala.ide.jdt.test/testdata/
/edu.kit.wala.smali.test/out/
results
target/

6
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
*.iml
/libraries/*.xml
/modules.xml
/tasks.xml
/usage.statistics.xml
/workspace.xml

51
.idea/gradle.xml Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/buildSrc" />
<option value="$PROJECT_DIR$/com.ibm.wala-repository" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.java" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.java.ecj" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.java.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.java.test.data" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.html.nu_validator" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.nodejs" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.nodejs.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.rhino" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.rhino.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.js.test.data" />
<option value="$PROJECT_DIR$/com.ibm.wala.cast.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.core" />
<option value="$PROJECT_DIR$/com.ibm.wala.core.testdata" />
<option value="$PROJECT_DIR$/com.ibm.wala.core.tests" />
<option value="$PROJECT_DIR$/com.ibm.wala.dalvik" />
<option value="$PROJECT_DIR$/com.ibm.wala.dalvik.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide.jdt" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide.jdt.test" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide.jsdt" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide.jsdt.tests" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide.tests" />
<option value="$PROJECT_DIR$/com.ibm.wala.ide_feature" />
<option value="$PROJECT_DIR$/com.ibm.wala.scandroid" />
<option value="$PROJECT_DIR$/com.ibm.wala.shrike" />
<option value="$PROJECT_DIR$/com.ibm.wala.tests.ide_feature" />
<option value="$PROJECT_DIR$/com.ibm.wala.tests_feature" />
<option value="$PROJECT_DIR$/com.ibm.wala.util" />
<option value="$PROJECT_DIR$/com.ibm.wala_feature" />
</set>
</option>
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="Java 1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="After Opening Pristine Project" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="prepareIntelliJIDEA" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,18 +1,321 @@
language: android
jdk: oraclejdk8
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "pushd /tmp"
- "git clone https://github.com/secure-software-engineering/DroidBench.git"
- "popd"
- "mkdir -p $TRAVIS_BUILD_DIR/com.ibm.wala.dalvik.test/lib"
- "find /usr/local -name dx.jar -exec cp '{}' $TRAVIS_BUILD_DIR/com.ibm.wala.dalvik.test/lib/dx.jar ';'"
install: mvn clean verify -DskipTests=true -B -q
script: mvn clean verify -B -q
sudo: false
android:
components:
- build-tools-26.0.2
addons:
apt:
packages:
- realpath
- xvfb
before_install:
- set -e
- source "travis/before-install-$BUILD_SYSTEM"
install: source "travis/install-$BUILD_SYSTEM"
script: source "travis/script-$BUILD_SYSTEM"
before_cache: source "travis/before-cache-$BUILD_SYSTEM"
cache:
directories:
- $HOME/.m2
- $TRAVIS_BUILD_DIR/com.ibm.wala.core.testdata/ocaml/ocamljava-2.0-alpha1/lib
- "$HOME/.goomph"
- "$HOME/.gradle/caches"
- "$HOME/.gradle/wrapper"
- "$HOME/.m2"
- "$HOME/apache-maven-3.5.0"
- "$TRAVIS_BUILD_DIR/com.ibm.wala.core.testdata/ocaml/ocamljava-2.0-alpha1/lib"
env:
global:
- secure: KcugjQYnBqeZ7XenZD5QY7jhekVPO0QpQyjDUteLytaokhyRK2g6eNvr/pPerN2uWUvsPwO18P9F+oOupge1cpPZf4cEY8RzLIromyUoRWd6JA0SKciUYdN2kSqnC4uZSJGXeGLoroyEEL4Q2sqimpkbIGxgxYtVniWgJULOyR4=
- secure: jacvGPYX4ugG/HgwJEEpWnllWsS/ipX+qRJ7qM5mbDYryeqsz0eiaxBxQ6IpDyj0v6O4DUi74lSQs/UxCWcUxvOn/5AweCZfoF1U8vt1xivanR4MbC2kr6rJ6ohICuJ4PHDS4IffncgaP3Y8cfExHq6+d0tbibYkjRIiMUGpSik=
matrix:
include:
- os: linux
env: BUILD_SYSTEM=gradle
language: java
jdk: oraclejdk8
- os: linux
env: BUILD_SYSTEM=maven
language: android
jdk: oraclejdk8
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle
language: java
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.ecj
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.test.data
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.html.nu_validator
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.nodejs
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.nodejs.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.rhino
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.rhino.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.test.data
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core.testdata
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core.tests
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.dalvik
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.dalvik.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jdt
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jdt.test
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jsdt
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jsdt.tests
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.tests
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.scandroid
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.shrike
language: java
jdk: oraclejdk8
if: type = cron
- os: linux
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.util
language: java
jdk: oraclejdk8
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.ecj
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.java.test.data
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.html.nu_validator
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.nodejs
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.nodejs.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.rhino
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.rhino.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.js.test.data
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.cast.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core.testdata
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.core.tests
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.dalvik
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.dalvik.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jdt
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jdt.test
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jsdt
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.jsdt.tests
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.ide.tests
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.scandroid
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.shrike
language: java
if: type = cron
- os: osx
osx_image: xcode8.3
env: BUILD_SYSTEM=gradle BUILD_ONLY_SUBMODULE=com.ibm.wala.util
language: java
if: type = cron

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.buildship.core.launch.runconfiguration">
<listAttribute key="arguments"/>
<booleanAttribute key="build_scans_enabled" value="false"/>
<stringAttribute key="gradle_distribution" value="GRADLE_DISTRIBUTION(WRAPPER)"/>
<stringAttribute key="gradle_user_home" value=""/>
<listAttribute key="jvm_arguments"/>
<booleanAttribute key="offline_mode" value="false"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="override_workspace_settings" value="false"/>
<booleanAttribute key="show_console_view" value="true"/>
<booleanAttribute key="show_execution_view" value="true"/>
<listAttribute key="tasks">
<listEntry value="afterEclipseBuildshipImport"/>
</listAttribute>
<stringAttribute key="working_dir" value="${workspace_loc:/com.ibm.wala}"/>
</launchConfiguration>

277
LICENSE Normal file
View File

@ -0,0 +1,277 @@
Eclipse Public License - v 2.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial content
Distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from
and are Distributed by that particular Contributor. A Contribution
"originates" from a Contributor if it was added to the Program by
such Contributor itself or anyone acting on such Contributor's behalf.
Contributions do not include changes or additions to the Program that
are not Modified Works.
"Contributor" means any person or entity that Distributes the Program.
"Licensed Patents" mean patent claims licensable by a Contributor which
are necessarily infringed by the use or sale of its Contribution alone
or when combined with the Program.
"Program" means the Contributions Distributed in accordance with this
Agreement.
"Recipient" means anyone who receives the Program under this Agreement
or any Secondary License (as applicable), including Contributors.
"Derivative Works" shall mean any work, whether in Source Code or other
form, that is based on (or derived from) the Program and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship.
"Modified Works" shall mean any work in Source Code or other form that
results from an addition to, deletion from, or modification of the
contents of the Program, including, for purposes of clarity any new file
in Source Code form that contains any contents of the Program. Modified
Works shall not include works that contain only declarations,
interfaces, types, classes, structures, or files of the Program solely
in each case in order to link to, bind by name, or subclass the Program
or Modified Works thereof.
"Distribute" means the acts of a) distributing or b) making available
in any manner that enables the transfer of a copy.
"Source Code" means the form of a Program preferred for making
modifications, including but not limited to software source code,
documentation source, and configuration files.
"Secondary License" means either the GNU General Public License,
Version 2.0, or any later versions of that license, including any
exceptions or additional permissions as identified by the initial
Contributor.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free copyright
license to reproduce, prepare Derivative Works of, publicly display,
publicly perform, Distribute and sublicense the Contribution of such
Contributor, if any, and such Derivative Works.
b) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent
license under Licensed Patents to make, use, sell, offer to sell,
import and otherwise transfer the Contribution of such Contributor,
if any, in Source Code or other form. This patent license shall
apply to the combination of the Contribution and the Program if, at
the time the Contribution is added by the Contributor, such addition
of the Contribution causes such combination to be covered by the
Licensed Patents. The patent license shall not apply to any other
combinations which include the Contribution. No hardware per se is
licensed hereunder.
c) Recipient understands that although each Contributor grants the
licenses to its Contributions set forth herein, no assurances are
provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity.
Each Contributor disclaims any liability to Recipient for claims
brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby
assumes sole responsibility to secure any other intellectual
property rights needed, if any. For example, if a third party
patent license is required to allow Recipient to Distribute the
Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
d) Each Contributor represents that to its knowledge it has
sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.
e) Notwithstanding the terms of any Secondary License, no
Contributor makes additional grants to any Recipient (other than
those set forth in this Agreement) as a result of such Recipient's
receipt of the Program under the terms of a Secondary License
(if permitted under the terms of Section 3).
3. REQUIREMENTS
3.1 If a Contributor Distributes the Program in any form, then:
a) the Program must also be made available as Source Code, in
accordance with section 3.2, and the Contributor must accompany
the Program with a statement that the Source Code for the Program
is available under this Agreement, and informs Recipients how to
obtain it in a reasonable manner on or through a medium customarily
used for software exchange; and
b) the Contributor may Distribute the Program under a license
different than this Agreement, provided that such license:
i) effectively disclaims on behalf of all other Contributors all
warranties and conditions, express and implied, including
warranties or conditions of title and non-infringement, and
implied warranties or conditions of merchantability and fitness
for a particular purpose;
ii) effectively excludes on behalf of all other Contributors all
liability for damages, including direct, indirect, special,
incidental and consequential damages, such as lost profits;
iii) does not attempt to limit or alter the recipients' rights
in the Source Code under section 3.2; and
iv) requires any subsequent distribution of the Program by any
party to be under a license that satisfies the requirements
of this section 3.
3.2 When the Program is Distributed as Source Code:
a) it must be made available under this Agreement, or if the
Program (i) is combined with other material in a separate file or
files made available under a Secondary License, and (ii) the initial
Contributor attached to the Source Code the notice described in
Exhibit A of this Agreement, then the Program may be made available
under the terms of such Secondary Licenses, and
b) a copy of this Agreement must be included with each copy of
the Program.
3.3 Contributors may not remove or alter any copyright, patent,
trademark, attribution notices, disclaimers of warranty, or limitations
of liability ("notices") contained within the Program from any copy of
the Program which they Distribute, provided that Contributors may add
their own appropriate notices.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities
with respect to end users, business partners and the like. While this
license is intended to facilitate the commercial use of the Program,
the Contributor who includes the Program in a commercial product
offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes
the Program in a commercial product offering, such Contributor
("Commercial Contributor") hereby agrees to defend and indemnify every
other Contributor ("Indemnified Contributor") against any losses,
damages and costs (collectively "Losses") arising from claims, lawsuits
and other legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the Program
in a commercial product offering. The obligations in this section do not
apply to any claims or Losses relating to any actual or alleged
intellectual property infringement. In order to qualify, an Indemnified
Contributor must: a) promptly notify the Commercial Contributor in
writing of such claim, and b) allow the Commercial Contributor to control,
and cooperate with the Commercial Contributor in, the defense and any
related settlement negotiations. The Indemnified Contributor may
participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those performance
claims and warranties, and if a court requires any other Contributor to
pay any damages as a result, the Commercial Contributor must pay
those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE. Each Recipient is solely responsible for determining the
appropriateness of using and distributing the Program and assumes all
risks associated with its exercise of rights under this Agreement,
including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs
or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further
action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Program itself (excluding combinations of the Program with other software
or hardware) infringes such Recipient's patent(s), then such Recipient's
rights granted under Section 2(b) shall terminate as of the date such
litigation is filed.
All Recipient's rights under this Agreement shall terminate if it
fails to comply with any of the material terms or conditions of this
Agreement and does not cure such failure in a reasonable period of
time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use
and distribution of the Program as soon as reasonably practicable.
However, Recipient's obligations under this Agreement and any licenses
granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement,
but in order to avoid inconsistency the Agreement is copyrighted and
may only be modified in the following manner. The Agreement Steward
reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement
Steward has the right to modify this Agreement. The Eclipse Foundation
is the initial Agreement Steward. The Eclipse Foundation may assign the
responsibility to serve as the Agreement Steward to a suitable separate
entity. Each new version of the Agreement will be given a distinguishing
version number. The Program (including Contributions) may always be
Distributed subject to the version of the Agreement under which it was
received. In addition, after a new version of the Agreement is published,
Contributor may elect to Distribute the Program (including its
Contributions) under the new version.
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
receives no rights or licenses to the intellectual property of any
Contributor under this Agreement, whether expressly, by implication,
estoppel or otherwise. All rights in the Program not expressly granted
under this Agreement are reserved. Nothing in this Agreement is intended
to be enforceable by any entity that is not a Contributor or Recipient.
No third-party beneficiary rights are created under this Agreement.
Exhibit A - Form of Secondary Licenses Notice
"This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set forth
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
version(s), and exceptions or additional permissions here}."
Simply including a copy of this Agreement, including this Exhibit A
is not sufficient to license the Source Code under Secondary Licenses.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to
look for such a notice.
You may add additional accurate notices of copyright ownership.

340
README-Gradle.md Normal file
View File

@ -0,0 +1,340 @@
This document describes some WALA-specific aspects of our new Gradle
build system, plus a few general Gradle features that may be of
particular interest to WALA developers. However, it is not a Gradle
tutorial.
# Pros and Cons of Switching to Gradle
## Selected Gradle Advantages in Brief
- [more comprehensive management of external
dependencies](#comprehensive-external-dependencies)
- faster builds using [parallel task
execution](https://docs.gradle.org/current/userguide/multi_project_builds.html#sec:parallel_execution)
and [user-scoped
caching](https://docs.gradle.org/current/userguide/build_cache.html)
(both enabled by default)
- [trustworthy dependencies for incremental
builds](#trustworthy-dependencies-for-incremental-builds)
- [composite builds](#composite-builds) for easier integration of WALA
into larger projects
- [automated Travis CI testing on macOS](#travis-ci-macos)
## Known Shortcomings
The Gradle build system is not yet ready to replace Maven, due to a
few [known shortcomings](https://github.com/liblit/WALA/milestone/1).
Paramount among these is that [Gradle WALA builds do not yet package
up Eclipse plug-ins / features in the proper
manner](https://github.com/liblit/WALA/issues/6). I have [poked at
this a
bit](https://github.com/liblit/WALA/tree/gradle-artifact-publishing),
but I simply do not understand Eclipse and/or OSGi well enough to get
the job done. I welcome help from anyone with the right knowledge!
Either Gradle or Maven can be used to build WALA from the command
line. However, it was not possible to extend this dual-build-system
support to Eclipse. Working with WALA in Eclipse *requires* [doing
things the Gradle way](#eclipse). Fortunately, this is rather
seamless; I see no reason why an Eclipse-using WALA developer should
need to avoid this switch.
As noted [below](#classpath-and-project-as-generated-files), Eclipse
`.classpath` and `.project` files are now generated rather than being
repository-tracked source files. However, a few Maven-run tests
depend on having certain of these files present. One way to create
them is to [import WALA into
Eclipse](#importing-wala-projects-into-eclipse) before starting your
Maven tests. If you prefer a non-interactive approach, you can
instead run `./gradlew prepareMavenBuild` before starting your Maven
tests.
# Getting Started
## External Dependencies: Patience is a Virtue
Gradle downloads many packages and supporting Java libraries as
needed. Your first Gradle build may take a long time. On a fast
workstation with a University-grade network and no local caches, my
initial run of `./gradlew assemble processTestResources` took five
minutes. On a decent laptop with residential DSL and no local caches,
the same initial build took twenty minutes. Fortunately, user- and
project-level Gradle caches will make incremental rebuilds much
faster. Rerunning `./gradlew assemble processTestResources` with a
warm cache in an already-built tree takes under three seconds.
Maven is the same, really. You may already have most of what Maven
needs downloaded and cached locally, but your first Maven WALA build
was probably slow as well. Recent Travis CI runs have showed Gradle
and Maven builds completing in fifteen to twenty minutes, without
significant variation between the two build systems.
<a id="comprehensive-external-dependencies"/>The good news is that the
Gradle build knows about all of its external dependencies and will
download them as needed. This even includes some complex dependencies
that the Maven build does not automate. For example, the Gradle build
will automatically gather required Android SDK components: setting
`$ANDROID_HOME` is not needed. Gradle builds will also download
`/tmp/DroidBench` when needed to run tests; the Maven build system
required that each developer do this by hand.
## Eclipse
### One-Time Eclipse Configuration
To work with WALA inside Eclipse, first **install Eclipse Buildship**
using either [the Eclipse
Marketplace](http://www.vogella.com/tutorials/EclipseGradle/article.html#installation-via-the-marketplace)
or [the Eclipse update
manager](http://www.vogella.com/tutorials/EclipseGradle/article.html#installation-via-the-eclipse-update-manager).
Buildship integrates Eclipse with Gradle, much like how M2Eclipse
integrates Eclipse with Maven. Restart Eclipse after installing this
feature.
### Importing WALA Projects Into Eclipse
Once you are running a Buildship-enabled Eclipse, **[use the “Existing
Gradle Project” import
wizard](http://www.vogella.com/tutorials/EclipseGradle/article.html#import-an-existing-gradle-project)
to import WALA into Eclipse.** Select and import the topmost level of
your WALA source tree. On the “Import Options” page of the import
wizard, leave all settings at their defaults: the “Override workspace
settings” option should be off, and the grayed-out “Gradle
distribution” choice should be set to “Gradle wrapper”. You do not
need to select each of WALAs sub-projects; import only the top-level
WALA source tree, and the rest will follow.
After the lengthy import process completes, **use “Run → After
Importing WALA Into Eclipse” to perform some post-import cleanup and
configuration.** Immediately after importing, you may see some errors
in the Eclipse “Problems” view. These should all go away after
running the “After Importing WALA Into Eclipse” step.
Note: a pristine WALA source tree is *not* pre-configured as a group
of Eclipse projects. Using the standard Eclipse “Existing Projects
into Workspace” import wizard will not work correctly. You must [use
the “Existing Gradle Project” import
wizard](http://www.vogella.com/tutorials/EclipseGradle/article.html#import-an-existing-gradle-project)
instead.
### `.classpath` and `.project` as Generated Files
You will find no `.classpath` or `.project` files anywhere in [the
Gradle fork of WALAs git repository](https://github.com/liblit/WALA).
Importing using the “Existing Gradle Project” wizard creates these
Eclipse project configuration files automatically based on the
underlying Gradle configuration.
Therefore, when working with Eclipse + Gradle, you should **treat
`.classpath` and `.project` files as *generated* artifacts,** not as
files to edit directly or through the Eclipse project configuration
GUI. For example, avoid using the Java Build Path settings dialog to
make changes that are stored in a `.classpath` file: the modified
`.classpath` file is not git-tracked, so your changes will eventually
be lost or overwritten.
The right way to change the contents of any of a `.classpath` or
`.project` file is to change the Gradle configuration such that the
generated `.classpath` and `.project` files will have the desired
contents, likely by using [Gradles `eclipse`
plugin](https://docs.gradle.org/current/userguide/eclipse_plugin.html).
A few WALA sub-projects already use this: look for `eclipse.project`
in `*/build.gradle` for examples.
## IntelliJ IDEA
### Opening WALA in IntelliJ IDEA
WALA comes preconfigured as an openable IntelliJ IDEA project. Open
the top-level WALA directory as a project; it should have a
distinctive badge on its folder icon marking it as a directory
containing a recognized IntelliJ IDEA project. Do *not* open the
top-level WALA `build.gradle` in that directory as a project: this
will begin an “Import Project from Gradle” process that is *not* the
recommended way to bring WALA up in IntelliJ IDEA.
The first time you open the WALA project, IntelliJ IDEA will
synchronize its project model with the Gradle build configuration,
including downloading some large supporting libraries. After the
lengthy import process completes, **use “Run → Run… → After Opening
Pristine Project” to perform some post-import configuration.** This
also can take tens of minutes, but is only necessary in a clean,
never-previously-built tree. Immediately after importing, you may see
some Java compilation errors in the IntelliJ IDEA “Messages” view.
These should all go away after running the “After Opening Pristine
Project” step. [Be
patient](#external-dependencies-patience-is-a-virtue) during the
initial project open and also during the “After Opening Pristine
Project” step, especially if you have a slow network connection.
If you prefer a non-interactive approach, instead of using “After
Opening Pristine Project” you can run `./gradlew prepareIntelliJIDEA`
either before or after opening WALA in IntelliJ IDEA.
### Benign Warning About Non-Managed Maven Project
Each time you open the WALA project, IntelliJ IDEA may report
“Non-managed pom.xml file found” in its event log. This arises
because WALA supports both Gradle and Maven, but WALA in IntelliJ IDEA
needs only the Gradle configuration. You can safely ignore this
notification, permanently disable it using the offered “Disable
notification” link, or even disable the IntelliJ IDEA Maven plugin
entirely if you have no other need for it.
### Project Configuration as Derived Model
IntelliJ IDEA automatically derives its project models from the Gradle
build configuration, including all information about both internal and
external build dependencies. However, this synchronization only goes
in one direction: from Gradle to IntelliJ IDEA, not from IntelliJ IDEA
back into Gradle. If you manipulate the project structure using the
IntelliJ IDEAs user interface, your changes will likely be
overwritten the next time IntelliJ IDEA scans the Gradle build
configuration.
This particularly applies to settings found in the “Modules” and
“Libraries” sections of the “Project Structure” dialog. The right way
to change module and library settings is to change the Gradle
configuration such that the *derived* IntelliJ IDEA model is what you
want it to be.
## Gradle Command Line
You do not need to install Gradle separately. **WALA includes its own
copy of Gradle, available as the `gradlew` script in the top-level
WALA directory.** Use this script for all command-line Gradle actions.
For example, to compile all of WALAs main (non-test) code and gather
it into jar archives, run `./gradlew assemble`.
In general, most Gradle-generated artifacts will appear somewhere
under `*/build`. For example the jar archives created by the
`assemble` task can be found as `*/build/libs/*.jar`. Note, however,
that Eclipse-generated artifacts will still appear in the same places
as before, such as `*/bin` and `*/target`.
### Trustworthy Dependencies For Incremental Builds
Gradle has excellent understanding of task and file dependencies. You
can trust it to perform incremental rebuilds rather than always
rebuilding from scratch. If you are used to always running `mvn clean
compile` instead of `mvn compile`, or `mvn clean install` instead of
`mvn install`, I recommend that you drop `clean` as a reflexive extra
step and **trust Gradle to do incremental builds correctly.**
### Favorite Build Tasks
Some useful Gradle tasks include:
- `assemble`: build WALAs main (non-test) code
- `build`: build all WALA code and run all automated tests
- `javadoc`: build all Javadoc documentation
- `publishToMavenLocal`: install WALAs jar files under `~/.m2`
- `clean`: remove all Gradle-generated artifacts
### Tasks in Specific Sub-Projects
When you run `./gradlew` in the top-level WALA directory, any tasks
you list will be built in all sub-projects. For example, `./gradlew
assemble` builds all non-test WALA jars in all sub-projects. If you
want to build tasks only in specific sub-projects, you have two options:
1. Give the fully-qualified name of the sub-project task. For
example, to assemble only the Dalvik jar, you could run `./gradlew
:com.ibm.wala.dalvik:assemble`.
1. Run Gradle from within some sub-project directory. For example, to
assemble only the Dalvik jar, you could `cd com.ibm.wala.dalvik`
and then run `../gradlew assemble`. Note the proper relative path
to the top-level Gradle script: `../gradle` instead of `./gradlew`.
### Task Name Abbreviation
[Any build task can be
abbreviated](https://docs.gradle.org/current/userguide/command_line_interface.html#_task_name_abbreviation)
by shortening each camel-case-delimited word in its name. For
example, the `processTestResources` task can probably be abbreviated
as `procTeRes` or even `pTR`.
### Useful Command-Line Flags
Among Gradles command-line flags, I have found the following
particularly useful:
- [`--continue`](https://docs.gradle.org/current/userguide/command_line_interface.html#sec:continue_build_on_failure):
keep building non-dependent sub-tasks even after an initial failure.
Especially useful in conjunction with the `build` or `test` tasks to
see multiple test failures rather than giving up after the first
failure.
- [`-t`,
`--continuous`](https://docs.gradle.org/current/userguide/command_line_interface.html#_continuous_build):
keep Gradle process running and re-execute the given tasks whenever
input files change. Similar to Eclipses behavior of updating the
build whenever you change and save a file.
- [`--tests=...`](https://docs.gradle.org/current/userguide/java_plugin.html#test_filtering):
run only the selected tests. Use in conjunction with the `build` or
`test` tasks for faster turnaround if you are focusing on getting
just one or a few failing tests to pass.
- [`--scan`](https://scans.gradle.com/): upload a detailed report of
the build process to a Gradle-hosted server for further exploration
and analysis. The only security here is the obscurity of the
generated URL for the build report. If you are not concerned about
potentially making your build details public, then `--scan` is a
good way to gain insights into why Gradle did what it did, and how
long each piece took.
### Composite Builds
Gradles [composite
builds](https://docs.gradle.org/current/userguide/composite_builds.html)
allow a Gradle-managed project to recursively include other
Gradle-managed projects, with Gradle managing the entire build process
in a coherent, integrated manner. Thus, if you use Gradle to build
your WALA-based project, you can easily have it use WALA from your
own, private WALA tree instead of from `~/.m2` or the public Maven
repository.
This is especially useful if you frequently find yourself switching
between multiple different personal or experimental WALA builds. By
avoiding `~/.m2`, each WALA-based project can be its own composite
build, with its own WALA subtree, and no project interferes with any
other.
# Travis CI
I use a [Travis CI build
matrix](https://docs.travis-ci.com/user/customizing-the-build/#Build-Matrix)
to perform automated testing in three configurations:
1. Gradle build on Ubuntu 14 (Trusty Tahr)
1. Maven build on Ubuntu 14 (Trusty Tahr)
1. Gradle build on macOS 10.12 (Sierra)
Until we are ready to completely replace Maven with Gradle, it is
important that both keep working. Therefore, I use Travis CI to build
and test WALA on Ubuntu using both Gradle and Maven. Every new pull
request must be validated in both of these configurations before I
will accept it onto the `gradle-and-buildship` branch.
<a id="travis-ci-macos"/>The official WALA repository has no macOS CI
testing. However, [macOS is the main development platform for at
least one WALA
maintainer](https://github.com/liblit/WALA/issues/3#issuecomment-356823287),
so it is great to have Travis CI helping us keep that platform
working. I will not accept pull requests that introduce regressions
into Gradle macOS builds. However, I am not using Travis CI to test
Maven macOS builds. Initial attempts using [the official WALA master
sources](https://github.com/wala/WALA) failed. As it is my goal to
replace Maven entirely, investigating Maven+macOS failures further is
not a priority.
<!--
LocalWords: processTestResources pre classpath gradlew mvn
LocalWords: javadoc buildship issuecomment
-->

View File

@ -1 +1,82 @@
This is a fork of WALA, tracking minor bug-fixes and enhancements required for DASCA.
# WALA for DASCA
This is a fork of WALA, tracking minor bug-fixes and enhancements required for
[DASCA](https://git.logicalhacking.com/DASCA/DASCA).
## Integrating Updates from Upstream
After cloning the repostistory, you need to manually configure the upstream URL
of the remote fork:
``` sh
git remote add upstream https://github.com/wala/WALA.git
```
The default steps for merging with upstream are:
``` sh
git fetch upstream
git checkout master
git merge upstream/master
```
## Building Artifacts
This fork uses the gradle setup of the WALA build system. Thus, for details, please
consult the instructions in the file [README-Gradle](README-Gradle.md). In general,
for rebuilding all WALA artifacts, use:
``` sh
./gradlew clean assemble
```
## Publishing Artifacts
### Configuration
For publishing artifacts, you need to configure the username and password required
for uploading to the remote artifacts repository, i.e., you need to add the following
properties to your `GRADLE_USER_HOME/gradle.properties` (default: `$HOME/.gradle/gradle.properties`)
file:
``` gradle
comLogicalhackingArtifactsUser=<USER>
comLogicalhackingArtifactsPassword=<PASSWORD>
```
### Preparation
Before publishing new artifacts to the artifacts repository, please update the version identifier in the file `build.gradle` by removing the `SNAPSHOT` postfix
and updating the `<WALAVERSION>` identifier.
``` gradle
version '<WALAVERSION>.[R|S].DASCA.<DASCAVERSION>'
```
with the version that should be published. Next, commit your changes and tag the
new version:
``` gradle
git commit -m "Preparing release of version <VERSION>." build.gradle
git tag -s "<VERSION>" -m "Tagging version <VERSION>."
```
Finally, mark the development version by appending `-SNAPSHOT`
``` gradle
version '<WALAVERSION>.[R|S].DASCA.<DASCAVERSION>-SNAPSHOT'
```
and commit your changes:
``` gradle
git commit -m "Marked development version" build.gradle
```
### Uploading Artifacts
Publishing artifacts is as easy as calling
``` sh
./gradlew publish
```

25
appveyor.yml.disabled Normal file
View File

@ -0,0 +1,25 @@
os: Visual Studio 2015
install:
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven" )) {
(new-object System.Net.WebClient).DownloadFile(
'http://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip',
'C:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
}
- cmd: SET PATH=C:\maven\apache-maven-3.3.9\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
build_script:
- mvn clean verify -DskipTests=true -B -q
test_script:
- mvn clean verify -B -q
cache:
- C:\maven\
- C:\Users\appveyor\.m2

42
build-maven-jars.py Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
# script to build jars for maven central
import sys
import subprocess
import os
# action should be either 'install' (for local test)
# or 'deploy' (for deployment to maven central).
# if current version is SNAPSHOT, will only be deployed
# to sonatype's staging servers. otherwise, will be
# deployed to maven central
action = sys.argv[1]
# projects for which we should build jars, in order
# will be prefixed with 'com.ibm.wala.'
projects = [
"util",
"shrike",
"core",
"cast",
"cast.java",
"cast.java.ecj",
"cast.js",
"cast.js.rhino",
"dalvik",
"scandroid"
]
for proj in projects:
full_proj = "com.ibm.wala." + proj
print(full_proj)
os.chdir(full_proj)
mvnCmd = "mvn -f mvncentral.xml clean " + action
try:
subprocess.check_output(mvnCmd, shell=True)
except subprocess.CalledProcessError as e:
print("OUTPUT")
print(e.output)
raise
os.chdir("..")

196
build.gradle Normal file
View File

@ -0,0 +1,196 @@
////////////////////////////////////////////////////////////////////////
//
// plugin configuration must precede everything else
//
plugins {
id 'com.diffplug.gradle.p2.asmaven' version '3.10.0'
id 'com.github.hauner.jarTest' version '1.0.1' apply false
id 'de.undercouch.download'
id 'nebula.lint' version '8.3.1'
id 'nebula.source-jar' version '7.0.1' apply false
}
////////////////////////////////////////////////////////////////////////
//
// required Eclipse components
//
p2AsMaven {
group 'eclipse-deps', {
repoEclipse '4.7.2'
slicingOption 'latestVersionOnly', 'true'
iu 'org.eclipse.core.commands'
iu 'org.eclipse.core.contenttype'
iu 'org.eclipse.core.jobs'
iu 'org.eclipse.core.resources'
iu 'org.eclipse.core.runtime'
iu 'org.eclipse.equinox.app'
iu 'org.eclipse.equinox.common'
iu 'org.eclipse.equinox.preferences'
iu 'org.eclipse.jdt.core'
iu 'org.eclipse.jface'
iu 'org.eclipse.osgi'
iu 'org.eclipse.pde.core'
iu 'org.eclipse.swt'
iu 'org.eclipse.ui.ide'
iu 'org.eclipse.ui.workbench'
}
group 'wst-deps', {
repo 'http://download.eclipse.org/releases/oxygen'
slicingOption 'latestVersionOnly', 'true'
iu 'org.eclipse.wst.jsdt.core'
iu 'org.eclipse.wst.jsdt.ui'
}
}
////////////////////////////////////////////////////////////////////////
//
// common Java setup shared by multiple projects
//
group name
version '1.5.1.S.DASCA.1.0.0-SNAPSHOT'
subprojects { subproject ->
// skip generic Java setup for the few projects that have no Java code whatsoever
switch (subproject.name) {
case 'com.ibm.wala-repository':
case ~/.*_feature/:
return
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'nebula.source-jar'
version rootProject.version
repositories {
mavenCentral()
maven {
url "$rootProject.buildDir/p2asmaven/maven"
}
}
jar.manifest.from('META-INF/MANIFEST.MF')
publishing.publications {
mavenJava(MavenPublication) {
from components.java
}
}
publishing {
repositories {
maven {
url = "sftp://artifacts.logicalhacking.com:22/home/brucker/www/artifacts.logicalhacking.com/htdocs/maven3/"
credentials {
username comLogicalhackingArtifactsUser
password comLogicalhackingArtifactsPassword
}
}
}
}
task afterEclipseBuildshipImport(dependsOn: processTestResources)
task prepareIntelliJIDEA
test {
include '**/*Test.class'
include '**/*TestCase.class'
include '**/*Tests.class'
include '**/Test*.class'
exclude '**/*AndroidLibs*.class'
maxParallelForks = Integer.MAX_VALUE
}
}
task afterEclipseBuildshipImport(type: Exec) {
commandLine './revert-launchers.sh'
}
////////////////////////////////////////////////////////////////////////
//
// find platform-specific SWT implementations
//
def osgi_platform
switch (System.getProperty('os.name')) {
case ~/Mac OS X/:
osgi_platform = 'cocoa.macosx.x86_64'
break
case ~/Windows.*/:
osgi_platform = 'win32.win32.x86_64'
break
case ~/Linux/:
osgi_platform = 'gtk.linux.x86_64'
break
}
System.setProperty('osgi.platform', osgi_platform)
subprojects {
configurations.all {
resolutionStrategy {
// failOnVersionConflict()
dependencySubstitution {
substitute module('eclipse-deps:org.eclipse.swt.${osgi.platform}') with module("eclipse-deps:org.eclipse.swt.${System.getProperty('osgi.platform')}:3.+")
}
}
}
}
////////////////////////////////////////////////////////////////////////
//
// optional lint checking of Gradle scripts
//
allprojects {
apply plugin: 'nebula.lint'
gradleLint.alwaysRun = false
gradleLint {
rules = ['all-dependency']
excludedRules = [
'duplicate-dependency-class',
'transitive-duplicate-dependency-class',
'unused-dependency',
]
}
}
////////////////////////////////////////////////////////////////////////
//
// disable Javadoc linter until documentation is in better shape
//
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
////////////////////////////////////////////////////////////////////////
//
// Eclipse IDE integration
//
// workaround for <https://github.com/gradle/gradle/issues/4802>
allprojects {
apply plugin: 'eclipse'
eclipse.classpath.file.whenMerged {
entries.each {
if (it in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry && it.entryAttributes['gradle_used_by_scope'] == 'test')
it.entryAttributes['test'] = true
}
}
}

1
buildSrc/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.gradle/

7
buildSrc/build.gradle Normal file
View File

@ -0,0 +1,7 @@
repositories {
mavenCentral()
}
dependencies {
compile 'de.undercouch:gradle-download-task:3.4.3'
}

View File

@ -0,0 +1,31 @@
import org.gradle.api.tasks.*
////////////////////////////////////////////////////////////////////////
//
// create a Javadoc-style "package-list" file
//
@CacheableTask
class CreatePackageList extends org.gradle.api.DefaultTask {
@PathSensitive(PathSensitivity.RELATIVE)
@Input Object sourceSet
@OutputFile File packageList = new File("$temporaryDir/package-list")
@TaskAction
def create() {
sourceSet.sourceCollections.collect { collection ->
def sourceRoot = collection.tree.dir.toPath()
collection.collect { source ->
def javaSourceFilePath = source.toPath()
def parentPath = javaSourceFilePath.parent
def relativePath = sourceRoot.relativize(parentPath)
relativePath.toString().replace(File.separator, '.')
}
}.flatten().sort().unique().each {
packageList << "$it\n"
}
}
}

View File

@ -0,0 +1,53 @@
import org.gradle.api.tasks.*
////////////////////////////////////////////////////////////////////////
//
// download and use checksum to verify that we got what we expected
//
@CacheableTask
class VerifiedDownload extends org.gradle.api.DefaultTask {
// URL of resource to download
def @Input src
// expected checksum of resource as hex digits
def @Input checksum
// algorithm to use for computing checksum
def @Input algorithm = 'MD5'
// whether to use ETag for selective downloading
def @Input useETag = true
// local file into which resource should be saved
def @OutputFile dest
File getDest() {
return project.file(dest)
}
VerifiedDownload() {
outputs.upToDateWhen {
getDest().exists()
}
}
@TaskAction
downloadAndVerify() {
def destFile = getDest()
project.download {
src this.src
dest destFile
overwrite true
onlyIfModified true
useETag this.useETag
}
project.verifyChecksum {
src destFile
algorithm this.algorithm
checksum this.checksum
}
}
}

View File

@ -5,6 +5,10 @@
import sys
import subprocess
def runAndPrint(cmd):
print cmd
subprocess.check_output(cmd, shell=True)
oldVersion = sys.argv[1]
newVersion = sys.argv[2]
@ -13,13 +17,11 @@ print oldVersion + " --> " + newVersion
oldVersion = oldVersion.replace(".", "\.")
newVersion = newVersion.replace(".", "\.")
cleanCmd = "mvn clean -q"
print cleanCmd
subprocess.check_output(cleanCmd, shell=True)
runAndPrint("mvn clean -q")
xmlCmd = "find -E ./ -regex \".*(pom|mvncentral)\.xml\" | xargs -n 1 perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\'"
print xmlCmd
subprocess.check_output(xmlCmd, shell=True)
runAndPrint("find -E ./ -regex \".*(pom|mvncentral)\.xml\" | xargs -n 1 perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\'")
runAndPrint("perl -pi -e \'s/" + oldVersion + "/" + newVersion + "/g\' build.gradle")
oldIsSnapshot = oldVersion.endswith("SNAPSHOT")
newIsSnapShot = newVersion.endswith("SNAPSHOT")
@ -27,10 +29,7 @@ newIsSnapShot = newVersion.endswith("SNAPSHOT")
bundleOld = oldVersion if not oldIsSnapshot else oldVersion.replace("-SNAPSHOT","\.qualifier")
bundleNew = newVersion if not newIsSnapShot else newVersion.replace("-SNAPSHOT","\.qualifier")
otherCmd = "find -E ./ -regex \".*(MANIFEST\.MF|feature\.xml)\" | xargs -n 1 perl -pi -e \'s/" + bundleOld + "/" + bundleNew + "/g\'"
print otherCmd
subprocess.check_output(otherCmd, shell=True)
runAndPrint("find -E ./ -regex \".*(MANIFEST\.MF|feature\.xml)\" | xargs -n 1 perl -pi -e \'s/" + bundleOld + "/" + bundleNew + "/g\'")
print "done"

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,9 @@
DELEGATES_PREFERENCE=delegateValidatorList
USER_BUILD_PREFERENCE=enabledBuildValidatorList
USER_MANUAL_PREFERENCE=enabledManualValidatorList
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201610061600
eclipse.preferences.version=1
override=true
suspend=false
vals/org.eclipse.wst.html.core.HTMLValidator/groups=0107include06111contentType136org.eclipse.wst.html.core.htmlsourceT07fileext04htmlF07fileext05xhtmlF07fileext03htmF07fileext04htplF07fileext03wmlF0107exclude0104file139target/site/dependency-convergence.htmlT03
vf.version=3

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="com.ibm.wala-feature">
<feature id="com.ibm.wala_feature">
<category name="main"/>
</feature>
<feature id="com.ibm.wala-feature.source">
<feature id="com.ibm.wala_feature.source">
<category name="main"/>
</feature>
<feature id="com.ibm.wala.ide-feature">
<feature id="com.ibm.wala.ide_feature">
<category name="main"/>
</feature>
<feature id="com.ibm.wala.ide-feature.source">
<feature id="com.ibm.wala.ide_feature.source">
<category name="main"/>
</feature>
<category-def name="main" label="Wala"/>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.ibm.wala</groupId>
<artifactId>WALA</artifactId>
<version>1.3.8-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>
</parent>
<artifactId>com.ibm.wala-repository</artifactId>
<packaging>eclipse-repository</packaging>

View File

@ -0,0 +1,113 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=error
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=error
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=error
org.eclipse.jdt.core.compiler.problem.finalParameterBound=error
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=no_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=error
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=error
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=error
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=error
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=error
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=error
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=error
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
org.eclipse.jdt.core.compiler.problem.unusedParameter=error
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,32 @@
compilers.f.unresolved-features=0
compilers.f.unresolved-plugins=0
compilers.incompatible-environment=0
compilers.p.build=0
compilers.p.build.bin.includes=0
compilers.p.build.encodings=0
compilers.p.build.java.compiler=0
compilers.p.build.java.compliance=0
compilers.p.build.missing.output=0
compilers.p.build.output.library=0
compilers.p.build.source.library=0
compilers.p.build.src.includes=0
compilers.p.deprecated=0
compilers.p.discouraged-class=0
compilers.p.internal=0
compilers.p.missing-packages=0
compilers.p.missing-version-export-package=2
compilers.p.missing-version-import-package=0
compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0
compilers.p.not-externalized-att=0
compilers.p.unknown-attribute=0
compilers.p.unknown-class=0
compilers.p.unknown-element=0
compilers.p.unknown-identifier=0
compilers.p.unknown-resource=0
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=0
eclipse.preferences.version=1

View File

@ -0,0 +1,10 @@
DELEGATES_PREFERENCE=delegateValidatorList
USER_BUILD_PREFERENCE=enabledBuildValidatorList
USER_MANUAL_PREFERENCE=enabledManualValidatorList
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201610061600
eclipse.preferences.version=1
override=true
suspend=false
vals/org.eclipse.wst.html.core.HTMLValidator/groups=0107include06111contentType136org.eclipse.wst.html.core.htmlsourceT07fileext04htmlF07fileext05xhtmlF07fileext03htmF07fileext04htplF07fileext03wmlF0107exclude0104file139target/site/dependency-convergence.htmlT03
vals/org.eclipse.wst.xml.core.xml/groups=0107include05111contentType128org.eclipse.core.runtime.xmlT111contentType134org.eclipse.wst.xml.core.xmlsourceT111contentType134org.eclipse.wst.xml.core.xslsourceT111contentType134org.eclipse.jst.jsp.core.tldsourceT07fileext03xmlF0107exclude07113projectNature134org.eclipse.jst.j2ee.ejb.EJBNature113projectNature130org.eclipse.jst.j2ee.EARNature04file08.projectT0104file110.classpathT0104file110.settings/T0204file122target/p2artifacts.xmlT0304file120target/p2content.xmlT03
vf.version=3

View File

@ -0,0 +1,17 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.ibm.wala.cast.java.ecj
Bundle-Version: 1.5.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.ibm.wala.cast.java,
com.ibm.wala.core,
org.eclipse.core.runtime,
org.eclipse.jdt.core,
com.ibm.wala.cast,
com.ibm.wala.shrike
Export-Package: com.ibm.wala.cast.java.client,
com.ibm.wala.cast.java.ecj.util,
com.ibm.wala.cast.java.translator.jdt,
com.ibm.wala.cast.java.translator.jdt.ecj

View File

@ -0,0 +1,3 @@
#Properties file for com.ibm.wala.cast.java.ecj
Bundle-Name = WALA CAst Java ECJ frontend
Bundle-Vendor = IBM

View File

@ -0,0 +1,15 @@
sourceSets.main.java.srcDirs = ['src']
dependencies {
compile(
'eclipse-deps:org.eclipse.core.runtime:+',
'eclipse-deps:org.eclipse.equinox.common:+',
'eclipse-deps:org.eclipse.jdt.core:+',
'org.osgi:org.osgi.core:4.2.0',
project(':com.ibm.wala.cast'),
project(':com.ibm.wala.cast.java'),
project(':com.ibm.wala.core'),
project(':com.ibm.wala.shrike'),
project(':com.ibm.wala.util'),
)
}

View File

@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/
javacProjectSettings = true

View File

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.cast.java.ecj</artifactId>
<version>1.5.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>WALA CAst Java ECJ</name>
<description>WALA Common AST Java ECJ front-end</description>
<url>http://wala.sourceforge.net</url>
<licenses>
<license>
<name>Eclipse Public License, Version 1.0</name>
<url>https://www.eclipse.org/legal/epl-v10.html</url>
</license>
</licenses>
<developers>
<developer>
<name>Manu Sridharan</name>
<email>m.sridharan@samsung.com</email>
<organization>Samsung Research America</organization>
<organizationUrl>http://www.sisa.samsung.com/</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git@github.com:wala/WALA.git</connection>
<developerConnection>scm:git:git@github.com:example/example-application.git</developerConnection>
<url>git@github.com:example/example-application.git</url>
</scm>
<properties>
<src.dir>src</src.dir>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.util</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.cast</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.cast.java</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.core</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ibm.wala</groupId>
<artifactId>com.ibm.wala.shrike</artifactId>
<version>1.5.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.10.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<profiles>
<profile>
<id>jdk18</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<javadoc.options>-Xdoclint:none</javadoc.options>
</properties>
</profile>
</profiles>
<build>
<sourceDirectory>${src.dir}</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>${javadoc.options}</additionalparam>
</configuration>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>WALA</artifactId>
<groupId>com.ibm.wala</groupId>
<version>1.5.1-SNAPSHOT</version>
</parent>
<artifactId>com.ibm.wala.cast.java.ecj</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View File

@ -8,21 +8,18 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.cast.java.translator.polyglot;
package com.ibm.wala.cast.java.client;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.translator.jdt.ecj.ECJClassLoaderFactory;
import com.ibm.wala.classLoader.ClassLoaderFactory;
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.util.config.SetOfClasses;
public class PolyglotJavaSourceAnalysisEngine extends JavaSourceAnalysisEngine {
public IRTranslatorExtension getTranslatorExtension() {
return new JavaIRTranslatorExtension();
}
public class ECJJavaSourceAnalysisEngine<I extends InstanceKey> extends JavaSourceAnalysisEngine<I> {
@Override
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions) {
return new PolyglotClassLoaderFactory(exclusions, getTranslatorExtension());
return new ECJClassLoaderFactory(exclusions);
}
}

View File

@ -0,0 +1,82 @@
package com.ibm.wala.cast.java.ecj.util;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.jar.JarFile;
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
import com.ibm.wala.cast.java.client.impl.ZeroOneContainerCFABuilderFactory;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.translator.jdt.ecj.ECJClassLoaderFactory;
import com.ibm.wala.classLoader.SourceDirectoryTreeModule;
import com.ibm.wala.ipa.callgraph.AnalysisCacheImpl;
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.CallGraph;
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
import com.ibm.wala.ipa.callgraph.CallGraphBuilderCancelException;
import com.ibm.wala.ipa.callgraph.CallGraphStats;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.cha.ClassHierarchyException;
import com.ibm.wala.ipa.cha.ClassHierarchyFactory;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.properties.WalaProperties;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.io.CommandLine;
import com.ibm.wala.util.warnings.Warnings;
/**
* Driver that constructs a call graph for an application specified as a directory of source code.
* Example of using the JDT front-end based on ECJ.
* Useful for getting some code to copy-paste.
*/
public class SourceDirCallGraph {
/**
* Usage: ScopeFileCallGraph -sourceDir file_path -mainClass class_name
*
* If given -mainClass, uses main() method of class_name as entrypoint. Class
* name should start with an 'L'.
*
* Example args: -sourceDir /tmp/srcTest -mainClass LFoo
*
*/
public static void main(String[] args) throws ClassHierarchyException, IllegalArgumentException, CallGraphBuilderCancelException, IOException {
long start = System.currentTimeMillis();
Properties p = CommandLine.parse(args);
String sourceDir = p.getProperty("sourceDir");
String mainClass = p.getProperty("mainClass");
AnalysisScope scope = new JavaSourceAnalysisScope();
// add standard libraries to scope
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
scope.addToScope(ClassLoaderReference.Primordial, new JarFile(stdlib));
}
// add the source directory
scope.addToScope(JavaSourceAnalysisScope.SOURCE, new SourceDirectoryTreeModule(new File(sourceDir)));
// build the class hierarchy
IClassHierarchy cha = ClassHierarchyFactory.make(scope, new ECJClassLoaderFactory(scope.getExclusions()));
System.out.println(cha.getNumberOfClasses() + " classes");
System.out.println(Warnings.asString());
Warnings.clear();
AnalysisOptions options = new AnalysisOptions();
Iterable<Entrypoint> entrypoints = Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, new String[] { mainClass } );
options.setEntrypoints(entrypoints);
// you can dial down reflection handling if you like
// options.setReflectionOptions(ReflectionOptions.NONE);
IAnalysisCacheView cache = new AnalysisCacheImpl(AstIRFactory.makeDefaultFactory());
//CallGraphBuilder builder = new ZeroCFABuilderFactory().make(options, cache, cha, scope, false);
CallGraphBuilder<?> builder = new ZeroOneContainerCFABuilderFactory().make(options, cache, cha, scope);
System.out.println("building call graph...");
CallGraph cg = builder.makeCallGraph(options, null);
long end = System.currentTimeMillis();
System.out.println("done");
System.out.println("took " + (end-start) + "ms");
System.out.println(CallGraphStats.getStats(cg));
}
}

View File

@ -91,6 +91,11 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
return false;
}
@Override
public int hashCode() {
return exceptionBinaryName.hashCode();
}
// --- rest not needed
@Override
@ -297,6 +302,12 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
return false;
}
// add @Override here once Eclipse Mars is no longer supported
public boolean isIntersectionType() {
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
return false;
}
@Override
public boolean isLocal() {
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
@ -441,15 +452,23 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
}
// do not put @Override here, to avoid breaking compilation on Juno
@Override
public IMethodBinding getFunctionalInterfaceMethod() {
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
return null;
}
// do not put @Override here, to avoid breaking compilation on Juno
@Override
public IAnnotationBinding[] getTypeAnnotations() {
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
return null;
}
// do not put @Override here, to avoid breaking compilation on older Eclipse versions
public IBinding getDeclaringMember() {
// TODO Auto-generated method stub
return null;
}
}

View File

@ -61,7 +61,7 @@ import com.ibm.wala.util.debug.Assertions;
public class JDT2CAstUtils {
public static Collection<CAstQualifier> mapModifiersToQualifiers(int modifiers, boolean isInterface, boolean isAnnotation) {
Set<CAstQualifier> quals = new LinkedHashSet<CAstQualifier>();
Set<CAstQualifier> quals = new LinkedHashSet<>();
if (isInterface)
quals.add(CAstQualifier.INTERFACE);
@ -174,7 +174,6 @@ public class JDT2CAstUtils {
* Returns true if type is char, byte, short, int, or long. Return false otherwise (including boolean!)
*
* @param type
* @return
*/
public static boolean isLongOrLess(ITypeBinding type) {
String t = type.getBinaryName();
@ -186,11 +185,10 @@ public class JDT2CAstUtils {
* CAstSymbol.NULL_DEFAULT_VALUE.
*
* @param type
* @return
*/
public static Object defaultValueForType(ITypeBinding type) {
if (isLongOrLess(type))
return new Integer(0);
return Integer.valueOf(0);
else if (type.getBinaryName().equals("D") || type.getBinaryName().equals("F"))
return new Double(0.0);
else
@ -237,7 +235,6 @@ public class JDT2CAstUtils {
*
* @param returnType
* @param ast
* @return
*/
public static ITypeBinding getErasedType(ITypeBinding returnType, AST ast) {
if (returnType.isTypeVariable() || returnType.isCapture())
@ -299,7 +296,7 @@ public class JDT2CAstUtils {
}
public static Collection<IMethodBinding> getOverriddenMethod(IMethodBinding met) {
HashMap<ITypeBinding, IMethodBinding> overridden = new HashMap<ITypeBinding, IMethodBinding>();
HashMap<ITypeBinding, IMethodBinding> overridden = new HashMap<>();
if (met == null)
return null;
getMethodInClassOrSuperclass(met, met.getDeclaringClass(), true, overridden);

View File

@ -88,7 +88,7 @@ public class JDTIdentityMapper {
* This method canonicalizes the TypeReferences
*/
public TypeReference getTypeRef(ITypeBinding type) {
type = JDT2CAstUtils.getErasedType((ITypeBinding) type, fAst); // GENERICS: erasure...
type = JDT2CAstUtils.getErasedType(type, fAst); // GENERICS: erasure...
if (!fTypeMap.containsKey(type.getKey())) {
TypeName typeName = TypeName.string2TypeName(typeToTypeID(type));

View File

@ -51,7 +51,7 @@ import com.ibm.wala.cast.tree.CAstType;
import com.ibm.wala.cast.tree.impl.CAstTypeDictionaryImpl;
import com.ibm.wala.util.debug.Assertions;
public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
// TODO: better way of getting type "ObjecT" that doesn't require us to keep AST? although this is similar to
// polyglot.
@ -62,7 +62,6 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
/**
*
* @param ast Needed to get root type "java.lang.Object"
* @param translator
*/
public JDTTypeDictionary(AST ast, JDTIdentityMapper identityMapper) {
fAst = ast;
@ -89,7 +88,7 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
type = new JdtJavaArrayType(jdtType);
} else
Assertions.UNREACHABLE("getCAstTypeFor() passed type that is not primitive, array, or class?");
super.map(astType, type); // put in cache
super.map((ITypeBinding)astType, type); // put in cache
}
return type;
}
@ -121,15 +120,14 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
}
@Override
@SuppressWarnings("unchecked")
public Collection getSupertypes() {
public Collection<CAstType> getSupertypes() {
if (fEltJdtType.isPrimitive())
return Collections.singleton(getCAstTypeFor(fAst.resolveWellKnownType("java.lang.Object")));
// TODO: there is no '.isReference()' as in Polyglot: is this right? enum? I think if it's another array it will
// just ignore it
// TEST DOUBLE ARRAYS! and maybe ask someone?
assert fEltJdtType.isArray() || fEltJdtType.isClass() : "Non-primitive, non-reference array element type!";
Collection<CAstType> supers = new ArrayList<CAstType>();
Collection<CAstType> supers = new ArrayList<>();
for (ITypeBinding type : fEltJdtType.getInterfaces()) {
supers.add(getCAstTypeFor(type));
}
@ -160,8 +158,7 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
}
@Override
@SuppressWarnings("unchecked")
public Collection getSupertypes() {
public Collection<CAstType> getSupertypes() {
if (fSuperTypes == null) {
buildSuperTypes();
}
@ -175,7 +172,7 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
.getSuperclass();
int N = fType.getInterfaces().length + 1;
fSuperTypes = new ArrayList<CAstType>(N);
fSuperTypes = new ArrayList<>(N);
// Following assumes that noone can call getSupertypes() before we have
// created CAstType's for every type in the program being analyzed.
fSuperTypes.add(getCAstTypeFor(superType));

View File

@ -0,0 +1,39 @@
package com.ibm.wala.cast.java.translator.jdt.ecj;
import java.io.IOException;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.classLoader.ClassLoaderFactoryImpl;
import com.ibm.wala.classLoader.ClassLoaderImpl;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.config.SetOfClasses;
public class ECJClassLoaderFactory extends ClassLoaderFactoryImpl {
public ECJClassLoaderFactory(SetOfClasses exclusions) {
super(exclusions);
}
// TODO remove code duplication with JDTClassLoaderFactory
@Override
protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent,
AnalysisScope scope) throws IOException {
if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) {
ClassLoaderImpl cl = makeSourceLoader(classLoaderReference, cha, parent);
cl.init(scope.getModules(classLoaderReference));
return cl;
} else {
return super.makeNewClassLoader(classLoaderReference, cha, parent, scope);
}
}
protected JavaSourceLoaderImpl makeSourceLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent) {
return new ECJSourceLoaderImpl(classLoaderReference, parent, cha, false);
}
}

View File

@ -0,0 +1,62 @@
/*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html.
*
* This file is a derivative of code released by the University of
* California under the terms listed below.
*
* WALA JDT Frontend is Copyright (c) 2008 The Regents of the
* University of California (Regents). Provided that this notice and
* the following two paragraphs are included in any distribution of
* Refinement Analysis Tools or its derivative work, Regents agrees
* not to assert any of Regents' copyright rights in Refinement
* Analysis Tools against recipient for recipient's reproduction,
* preparation of derivative works, public display, public
* performance, distribution or sublicensing of Refinement Analysis
* Tools and derivative works, in source code and object code form.
* This agreement not to assert does not confer, by implication,
* estoppel, or otherwise any license or rights in any intellectual
* property of Regents, including, but not limited to, any patents
* of Regents or Regents' employees.
*
* IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
* INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE
* AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY
* WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING
* DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
* IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
package com.ibm.wala.cast.java.translator.jdt.ecj;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
public class ECJSourceLoaderImpl extends JavaSourceLoaderImpl {
private final boolean dump;
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, IClassHierarchy cha) {
this(loaderRef, parent, cha, false);
}
public ECJSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, IClassHierarchy cha, boolean dump) {
super(loaderRef, parent, cha);
this.dump = dump;
}
@Override
protected SourceModuleTranslator getTranslator() {
return new ECJSourceModuleTranslator(cha.getScope(), this, dump);
}
}

View File

@ -0,0 +1,210 @@
/*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html.
*
* This file is a derivative of code released by the University of
* California under the terms listed below.
*
* WALA JDT Frontend is Copyright (c) 2008 The Regents of the
* University of California (Regents). Provided that this notice and
* the following two paragraphs are included in any distribution of
* Refinement Analysis Tools or its derivative work, Regents agrees
* not to assert any of Regents' copyright rights in Refinement
* Analysis Tools against recipient for recipient's reproduction,
* preparation of derivative works, public display, public
* performance, distribution or sublicensing of Refinement Analysis
* Tools and derivative works, in source code and object code form.
* This agreement not to assert does not confer, by implication,
* estoppel, or otherwise any license or rights in any intellectual
* property of Regents, including, but not limited to, any patents
* of Regents or Regents' employees.
*
* IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
* INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE
* AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY
* WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING
* DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
* IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
package com.ibm.wala.cast.java.translator.jdt.ecj;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.FileASTRequestor;
import com.ibm.wala.cast.java.translator.Java2IRTranslator;
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
import com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator;
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
import com.ibm.wala.cast.tree.impl.RangePosition;
import com.ibm.wala.classLoader.DirectoryTreeModule;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.JarStreamModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.classLoader.SourceFileModule;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.Pair;
import com.ibm.wala.util.io.TemporaryFile;
/**
* A SourceModuleTranslator whose implementation of loadAllSources() uses the PolyglotFrontEnd pseudo-compiler to generate DOMO IR
* for the sources in the compile-time classpath.
*
* @author rfuhrer
*/
// remove me comment: Jdt little-case = not OK, upper case = OK
public class ECJSourceModuleTranslator implements SourceModuleTranslator {
private final class ECJAstToIR extends FileASTRequestor {
private final Map<String, ModuleEntry> sourceMap;
public ECJAstToIR(Map<String, ModuleEntry> sourceMap) {
this.sourceMap = sourceMap;
}
@Override
public void acceptAST(String source, CompilationUnit ast) {
JDTJava2CAstTranslator<Position> jdt2cast = makeCAstTranslator(ast, source);
final Java2IRTranslator java2ir = makeIRTranslator();
java2ir.translate(sourceMap.get(source), jdt2cast.translateToCAst());
if (! "true".equals(System.getProperty("wala.jdt.quiet"))) {
IProblem[] problems = ast.getProblems();
int length = problems.length;
if (length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
buffer.append(problems[i].getMessage());
buffer.append('\n');
}
if (length != 0)
System.err.println("Unexpected problems in " + source + "\n " + buffer.toString());
}
}
}
}
protected boolean dump;
protected ECJSourceLoaderImpl sourceLoader;
private final String[] sources;
private final String[] libs;
public ECJSourceModuleTranslator(AnalysisScope scope, ECJSourceLoaderImpl sourceLoader) {
this(scope, sourceLoader, false);
}
public ECJSourceModuleTranslator(AnalysisScope scope, ECJSourceLoaderImpl sourceLoader, boolean dump) {
this.sourceLoader = sourceLoader;
this.dump = dump;
Pair<String[], String[]> paths = computeClassPath(scope);
sources = paths.fst;
libs = paths.snd;
}
private static Pair<String[],String[]> computeClassPath(AnalysisScope scope) {
List<String> sources = new LinkedList<>();
List<String> libs = new LinkedList<>();
for (ClassLoaderReference cl : scope.getLoaders()) {
while (cl != null) {
List<Module> modules = scope.getModules(cl);
for (Module m : modules) {
if (m instanceof JarFileModule) {
JarFileModule jarFileModule = (JarFileModule) m;
libs.add(jarFileModule.getAbsolutePath());
} else if (m instanceof JarStreamModule) {
try {
File F = File.createTempFile("tmp", "jar");
F.deleteOnExit();
TemporaryFile.streamToFile(F, ((JarStreamModule)m));
libs.add(F.getAbsolutePath());
} catch (IOException e) {
assert false : e;
}
} else if (m instanceof DirectoryTreeModule) {
DirectoryTreeModule directoryTreeModule = (DirectoryTreeModule) m;
sources.add(directoryTreeModule.getPath());
} else {
//Assertions.UNREACHABLE("Module entry is neither jar file nor directory");
}
}
cl = cl.getParent();
}
}
return Pair.make(sources.toArray(new String[ sources.size() ]), libs.toArray(new String[ libs.size() ]));
}
/*
* Project -> AST code from org.eclipse.jdt.core.tests.performance
*/
@Override
public void loadAllSources(Set<ModuleEntry> modules) {
List<String> sources = new LinkedList<>();
Map<String, ModuleEntry> sourceMap = HashMapFactory.make();
for(ModuleEntry m : modules) {
if (m.isSourceFile()) {
SourceFileModule s = (SourceFileModule)m;
sourceMap.put(s.getAbsolutePath(), s);
sources.add(s.getAbsolutePath());
}
}
String[] sourceFiles = sources.toArray(new String[ sources.size() ]);
final ASTParser parser = ASTParser.newParser(AST.JLS8);
parser.setResolveBindings(true);
parser.setEnvironment(libs, this.sources, null, false);
Hashtable<String, String> options = JavaCore.getOptions();
options.put(JavaCore.COMPILER_SOURCE, "1.8");
parser.setCompilerOptions(options);
parser.createASTs(sourceFiles, null, new String[0], new ECJAstToIR(sourceMap), new NullProgressMonitor());
}
protected Java2IRTranslator makeIRTranslator() {
return new Java2IRTranslator(sourceLoader);
}
protected JDTJava2CAstTranslator<Position> makeCAstTranslator(CompilationUnit cu, String fullPath) {
return new JDTJava2CAstTranslator<Position>(sourceLoader, cu, fullPath, false, dump) {
@Override
public Position makePosition(int start, int end) {
try {
return new RangePosition(new URL("file://" + fullPath), this.cu.getLineNumber(start), start, end);
} catch (MalformedURLException e) {
throw new RuntimeException("bad file: " + fullPath, e);
}
}
};
}
}

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.ide.jdt.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="source"/>
<classpathentry kind="lib" path="/com.ibm.wala.cast.java.polyglot/lib/polyglot.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.java.polyglot.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,4 +0,0 @@
#Mon Apr 13 15:21:17 EDT 2009
eclipse.preferences.version=1
formatter_profile=_WALA
formatter_settings_version=11

View File

@ -1,19 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WALA Cast Java Polyglot Test Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.java.polyglot.test
Bundle-Version: 1.3.8.qualifier
Bundle-Activator: com.ibm.wala.cast.java.polyglot.test.Activator
Bundle-Vendor: IBM
Require-Bundle: com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.cast.java;bundle-version="1.0.0",
com.ibm.wala.cast.java.test;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.core.tests;bundle-version="1.1.3",
org.eclipse.core.runtime,
com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.cast.java.polyglot;bundle-version="1.0.0",
org.junit;bundle-version="4.0.0",
com.ibm.wala.cast.java.test.data;bundle-version="1.3.4"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy

View File

@ -1,4 +0,0 @@
source.. = source/
output.. = bin/
bin.includes = META-INF/,\
.

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<stringAttribute key="bad_container_name" value="/com.ibm.wala.cast.java.polyglottest/launchers"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.wala.cast.java.polyglot.test/source/com/ibm/wala/cast/java/test/PolyglotJLexTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="/tmp/jlexpolytest.out"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.PolyglotJLexTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.java.polyglot.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcom.ibm.wala.tracefile=/tmp/jlexpolytrace.txt"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:com.ibm.wala.cast.java.test.data}"/>
</launchConfiguration>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<stringAttribute key="bad_container_name" value="/com.ibm.wala.cast.java.polyglottest/launchers"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.wala.cast.java.polyglot.test/source/com/ibm/wala/cast/java/test/PolyglotJavaIRTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[run]" value="org.eclipse.jdt.junit.launchconfig"/>
</mapAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="/tmp/console.txt"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.PolyglotJavaIRTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.java.polyglot.test"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -Xmx512M"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:com.ibm.wala.cast.java.test.data}"/>
</launchConfiguration>

View File

@ -1,60 +0,0 @@
/*******************************************************************************
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package com.ibm.wala.cast.java.polyglot.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.ibm.wala.cast.java.polyglot.test";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -1,36 +0,0 @@
/*******************************************************************************
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package com.ibm.wala.cast.java.test;
import java.util.Collection;
import java.util.List;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.cha.IClassHierarchy;
public class PolyglotJLexTest extends JLexTest {
@Override
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
@Override
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, new String[] { "LJLex/Main" });
}
};
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
populateScope(engine, sources, libs);
return engine;
}
}

View File

@ -1,55 +0,0 @@
/*******************************************************************************
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package com.ibm.wala.cast.java.test;
import java.util.Collection;
import java.util.List;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.examples.ast.SynchronizedBlockDuplicator;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.translator.polyglot.IRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.JavaIRTranslatorExtension;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJavaSourceAnalysisEngine;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.callgraph.Entrypoint;
import com.ibm.wala.ipa.callgraph.impl.Util;
import com.ibm.wala.ipa.cha.IClassHierarchy;
public class PolyglotSyncDuplicatorTest extends SyncDuplicatorTest {
@Override
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
@Override
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
}
@Override
public IRTranslatorExtension getTranslatorExtension() {
JavaIRTranslatorExtension ext = new JavaIRTranslatorExtension();
ext.setCAstRewriterFactory(new CAstRewriterFactory() {
@Override
public CAstRewriter createCAstRewriter(CAst ast) {
return new SynchronizedBlockDuplicator(ast, true, testMethod);
}
});
return ext;
}
};
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
populateScope(engine, sources, libs);
return engine;
}
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="source"/>
<classpathentry exported="true" kind="lib" path="lib/java_cup.jar"/>
<classpathentry exported="true" kind="lib" path="lib/polyglot.jar"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.java.polyglot</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,4 +0,0 @@
#Mon Apr 13 15:38:50 EDT 2009
eclipse.preferences.version=1
formatter_profile=_WALA
formatter_settings_version=11

View File

@ -1,48 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WALA CAst Java Polyglot Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.java.polyglot
Bundle-Version: 1.3.8.qualifier
Bundle-Vendor: IBM
Require-Bundle: com.ibm.wala.cast.java,
com.ibm.wala.cast,
com.ibm.wala.core,
org.eclipse.core.runtime,
com.ibm.wala.shrike,
org.eclipse.jdt.core,
org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.translator.polyglot;
uses:="com.ibm.wala.types,
polyglot.types,
polyglot.util,
polyglot.ast,
com.ibm.wala.ipa.cha,
com.ibm.wala.cast.java.client,
com.ibm.wala.classLoader,
com.ibm.wala.cast.tree,
com.ibm.wala.cast.java.loader,
com.ibm.wala.ipa.callgraph.impl,
com.ibm.wala.ipa.callgraph,
polyglot.frontend.goals,
com.ibm.wala.cast.tree.impl,
com.ibm.wala.cast.java.translator,
com.ibm.wala.cast.java.types",
java_cup,
java_cup.runtime,
polyglot.ast,
polyglot.dispatch,
polyglot.frontend,
polyglot.lex,
polyglot.main,
polyglot.parse,
polyglot.qq,
polyglot.types,
polyglot.types.reflect,
polyglot.util,
polyglot.util.typedump,
polyglot.visit
Bundle-ClassPath: lib/java_cup.jar,
lib/polyglot.jar,
.

View File

@ -1,6 +0,0 @@
source.. = source/
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/java_cup.jar,\
lib/polyglot.jar

View File

@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.ibm.wala.cast.java.polyglot" default="getJars" basedir=".">
<property name="basews" value="${ws}"/>
<property name="baseos" value="${os}"/>
<property name="basearch" value="${arch}"/>
<property name="basenl" value="${nl}"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="true"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="logExtension" value=".log"/>
<property name="compilerArg" value=""/>
<property name="javacSource" value="1.5"/>
<property name="javacTarget" value="1.5"/>
<!-- This property has been updated to correspond to the paths used by the latest Java update
on Mac OS X 10.6 (Java version 1.6.0_22). If you are not using this version of Mac OS X or Java,
try changing the value of the property to "${java.home}/../../../Classes" -->
<!-- <condition property="dir_bootclasspath" value="${java.home}/../Classes">
<os family="mac"/>
</condition>
<property name="dir_bootclasspath" value="${java.home}/lib"/>
<path id="path_bootclasspath">
<fileset dir="${dir_bootclasspath}">
<include name="*.jar"/>
</fileset>
</path>
<property name="bootclasspath" refid="path_bootclasspath"/>
<property name="bundleJavacSource" value="${javacSource}"/>
<property name="bundleJavacTarget" value="${javacTarget}"/>
<property name="bundleBootClasspath" value="${bootclasspath}"/> -->
<target name="PolyglotPresent" depends="init">
<available file="${plugin.destination}/lib/polyglot.jar" property="polyglot.present"/>
</target>
<target name="fetchPolyglot" depends="PolyglotPresent" unless="polyglot.present">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<echo message="Getting polyglot from svn; may take a few minutes"/>
<exec executable="svn"
dir="${temp.folder}">
<arg value="--quiet"/>
<arg value="checkout"/>
<arg value="http://polyglot-compiler.googlecode.com/svn/trunk/"/>
<arg value="polyglot-compiler-read-only"/>
</exec>
<ant target="jar" inheritAll="false" dir="${temp.folder}/polyglot-compiler-read-only/polyglot/" />
<copy file="${temp.folder}/polyglot-compiler-read-only/polyglot/lib/polyglot.jar" tofile="${plugin.destination}/lib/polyglot.jar" />
<copy file="${temp.folder}/polyglot-compiler-read-only/polyglot/lib/java_cup.jar" tofile="${plugin.destination}/lib/java_cup.jar" />
<delete dir="${temp.folder}"/>
</target>
<target name="getJars" depends="fetchPolyglot" />
<target name="init" depends="properties">
<condition property="pluginTemp" value="${buildTempFolder}/plugins">
<isset property="buildTempFolder"/>
</condition>
<property name="pluginTemp" value="${basedir}"/>
<condition property="build.result.folder" value="${pluginTemp}/com.ibm.wala.core.testdata">
<isset property="buildTempFolder"/>
</condition>
<property name="build.result.folder" value="${basedir}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<property name="plugin.destination" value="${basedir}"/>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
</project>

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>WALA</artifactId>
<groupId>com.ibm.wala</groupId>
<version>1.3.8-SNAPSHOT</version>
</parent>
<artifactId>com.ibm.wala.cast.java.polyglot</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>
<property name="compile_classpath" refid="maven.compile.classpath" />
<ant antfile="${basedir}/build.xml" target="getJars" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,204 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Sep 1, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import polyglot.ast.ArrayAccess;
import polyglot.ast.ArrayAccessAssign;
import polyglot.ast.ArrayInit;
import polyglot.ast.ArrayTypeNode;
import polyglot.ast.Assert;
import polyglot.ast.Binary;
import polyglot.ast.Block;
import polyglot.ast.BooleanLit;
import polyglot.ast.Branch;
import polyglot.ast.Call;
import polyglot.ast.CanonicalTypeNode;
import polyglot.ast.Case;
import polyglot.ast.Cast;
import polyglot.ast.Catch;
import polyglot.ast.CharLit;
import polyglot.ast.ClassBody;
import polyglot.ast.ClassDecl;
import polyglot.ast.ClassLit;
import polyglot.ast.Conditional;
import polyglot.ast.ConstructorCall;
import polyglot.ast.ConstructorDecl;
import polyglot.ast.Do;
import polyglot.ast.Empty;
import polyglot.ast.Eval;
import polyglot.ast.Field;
import polyglot.ast.FieldAssign;
import polyglot.ast.FieldDecl;
import polyglot.ast.FloatLit;
import polyglot.ast.For;
import polyglot.ast.Formal;
import polyglot.ast.If;
import polyglot.ast.Import;
import polyglot.ast.Initializer;
import polyglot.ast.Instanceof;
import polyglot.ast.IntLit;
import polyglot.ast.Labeled;
import polyglot.ast.Local;
import polyglot.ast.LocalAssign;
import polyglot.ast.LocalClassDecl;
import polyglot.ast.LocalDecl;
import polyglot.ast.MethodDecl;
import polyglot.ast.New;
import polyglot.ast.NewArray;
import polyglot.ast.Node;
import polyglot.ast.NullLit;
import polyglot.ast.PackageNode;
import polyglot.ast.Return;
import polyglot.ast.Special;
import polyglot.ast.StringLit;
import polyglot.ast.Switch;
import polyglot.ast.SwitchBlock;
import polyglot.ast.Synchronized;
import polyglot.ast.Throw;
import polyglot.ast.Try;
import polyglot.ast.Unary;
import polyglot.ast.While;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator.MethodContext;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator.WalkContext;
import com.ibm.wala.cast.tree.CAstNode;
import com.ibm.wala.util.debug.Assertions;
/**
* Wrapper for the logic (nasty cascaded instanceof tests) necessary to visit a Polyglot AST and dispatch to the appropriate
* TranslatingVisitor methods for each AST node type.
*
* @author rfuhrer
*/
public class ASTTraverser {
protected ASTTraverser() {
}
public static CAstNode visit(Node n, TranslatingVisitor tv, WalkContext wc) {
if (n instanceof MethodDecl) {
return tv.visit((MethodDecl) n, (MethodContext) wc);
} else if (n instanceof ConstructorDecl) {
return tv.visit((ConstructorDecl) n, (MethodContext) wc);
} else if (n instanceof FieldDecl) {
return tv.visit((FieldDecl) n, (MethodContext) wc);
} else if (n instanceof Import) {
return tv.visit((Import) n, wc);
} else if (n instanceof PackageNode) {
return tv.visit((PackageNode) n, wc);
} else if (n instanceof CanonicalTypeNode) {
return tv.visit((CanonicalTypeNode) n, wc);
} else if (n instanceof ArrayTypeNode) {
return tv.visit((ArrayTypeNode) n, wc);
} else if (n instanceof ArrayInit) {
return tv.visit((ArrayInit) n, wc);
} else if (n instanceof ArrayAccessAssign) {
return tv.visit((ArrayAccessAssign) n, wc);
} else if (n instanceof FieldAssign) {
return tv.visit((FieldAssign) n, wc);
} else if (n instanceof LocalAssign) {
return tv.visit((LocalAssign) n, wc);
} else if (n instanceof Binary) {
return tv.visit((Binary) n, wc);
} else if (n instanceof Call) {
return tv.visit((Call) n, wc);
} else if (n instanceof ConstructorCall) {
return tv.visit((ConstructorCall) n, wc);
} else if (n instanceof Cast) {
return tv.visit((Cast) n, wc);
} else if (n instanceof Conditional) {
return tv.visit((Conditional) n, wc);
} else if (n instanceof Instanceof) {
return tv.visit((Instanceof) n, wc);
} else if (n instanceof BooleanLit) {
return tv.visit((BooleanLit) n, wc);
} else if (n instanceof ClassLit) {
return tv.visit((ClassLit) n, wc);
} else if (n instanceof FloatLit) {
return tv.visit((FloatLit) n, wc);
} else if (n instanceof NullLit) {
return tv.visit((NullLit) n, wc);
} else if (n instanceof CharLit) {
return tv.visit((CharLit) n, wc);
} else if (n instanceof IntLit) {
return tv.visit((IntLit) n, wc);
} else if (n instanceof StringLit) {
return tv.visit((StringLit) n, wc);
} else if (n instanceof New) {
return tv.visit((New) n, wc);
} else if (n instanceof NewArray) {
return tv.visit((NewArray) n, wc);
} else if (n instanceof Special) {
return tv.visit((Special) n, wc);
} else if (n instanceof Unary) {
return tv.visit((Unary) n, wc);
} else if (n instanceof ArrayAccess) {
return tv.visit((ArrayAccess) n, wc);
} else if (n instanceof Field) {
return tv.visit((Field) n, wc);
} else if (n instanceof Local) {
return tv.visit((Local) n, wc);
} else if (n instanceof ClassBody) {
return tv.visit((ClassBody) n, wc);
} else if (n instanceof ClassDecl) {
return tv.visit((ClassDecl) n, wc);
} else if (n instanceof Initializer) {
return tv.visit((Initializer) n, wc);
} else if (n instanceof Assert) {
return tv.visit((Assert) n, wc);
} else if (n instanceof Branch) {
return tv.visit((Branch) n, wc);
} else if (n instanceof SwitchBlock) { // must test for this one before Block
return tv.visit((SwitchBlock) n, wc);
} else if (n instanceof Block) { // must test for this one before Block
return tv.visit((Block) n, wc);
} else if (n instanceof Catch) {
return tv.visit((Catch) n, wc);
} else if (n instanceof If) {
return tv.visit((If) n, wc);
} else if (n instanceof Labeled) {
return tv.visit((Labeled) n, wc);
} else if (n instanceof LocalClassDecl) {
return tv.visit((LocalClassDecl) n, wc);
} else if (n instanceof Do) {
return tv.visit((Do) n, wc);
} else if (n instanceof For) {
return tv.visit((For) n, wc);
} else if (n instanceof While) {
return tv.visit((While) n, wc);
} else if (n instanceof Switch) {
return tv.visit((Switch) n, wc);
} else if (n instanceof Synchronized) {
return tv.visit((Synchronized) n, wc);
} else if (n instanceof Try) {
return tv.visit((Try) n, wc);
} else if (n instanceof Empty) {
return tv.visit((Empty) n, wc);
} else if (n instanceof Eval) {
return tv.visit((Eval) n, wc);
} else if (n instanceof LocalDecl) {
return tv.visit((LocalDecl) n, wc);
} else if (n instanceof Return) {
return tv.visit((Return) n, wc);
} else if (n instanceof Case) {
return tv.visit((Case) n, wc);
} else if (n instanceof Throw) {
return tv.visit((Throw) n, wc);
} else if (n instanceof Formal) {
return tv.visit((Formal) n, wc);
} else {
Assertions.UNREACHABLE("Unhandled node " + n + " of type " + n.getClass().getName() + " in ASTTraverser.visit().");
return null;
}
}
}

View File

@ -1,48 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java.translator.polyglot;
import polyglot.ast.ArrayInit;
import polyglot.ast.Expr;
import polyglot.frontend.Job;
import polyglot.frontend.Scheduler;
import polyglot.frontend.VisitorGoal;
import polyglot.types.SemanticException;
import polyglot.types.Type;
import polyglot.visit.AscriptionVisitor;
/**
* Runs an AscriptionVisitor to make sure that empty array literals actually get a type.
* @author rfuhrer
*/
public class AscriptionGoal extends VisitorGoal {
/**
*
*/
private static final long serialVersionUID = 7416951196743862079L;
public AscriptionGoal(Job job) {
super(job,
new AscriptionVisitor(job, job.extensionInfo().typeSystem(), job.extensionInfo().nodeFactory()) {
@Override
public Expr ascribe(Expr e, Type toType) throws SemanticException {
if (e instanceof ArrayInit && e.type().isNull()) {
return e.type(toType);
}
return super.ascribe(e, toType);
}
}
);
Scheduler scheduler= job.extensionInfo().scheduler();
addPrereq(scheduler.TypeChecked(job));
}
}

View File

@ -1,73 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java.translator.polyglot;
import polyglot.frontend.ExtensionInfo;
import polyglot.frontend.Job;
import polyglot.frontend.Scheduler;
import polyglot.frontend.SourceGoal_c;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.cast.java.translator.Java2IRTranslator;
/**
* A kind of EndGoal that indicates that WALA IR has been generated for the given compilation unit.
* @author rfuhrer
*/
public class IRGoal extends SourceGoal_c /* PORT1.7 removed 'implements EndGoal' */ {
/**
*
*/
private static final long serialVersionUID = -8023929848709826817L;
private JavaSourceLoaderImpl fSourceLoader;
protected Java2IRTranslator fTranslator;
public IRGoal(Job job, JavaSourceLoaderImpl sourceLoader) {
super(job);
fSourceLoader = sourceLoader;
Scheduler scheduler= job.extensionInfo().scheduler();
addPrereq(scheduler.TypeChecked(job));
// PORT1.7 - TypeChecked will suffice for what used to require ConstantsChecked.
// Need ConstantsChecked in order to make sure that case statements have non-zero labels.
// addPrereq(scheduler.ConstantsChecked(job));
// Need to add an AscriptionGoal as a prereq to make sure that empty array initializers get a type ascribed.
addPrereq(new AscriptionGoal(job));
}
@Override
public boolean runTask() {
ExtensionInfo extInfo= job.extensionInfo();
fTranslator= new Java2IRTranslator(
fSourceLoader,
((IRTranslatorExtension)extInfo).getCAstRewriterFactory());
ModuleSource src = (ModuleSource) job.source();
fTranslator.translate(
src.getModule(),
new PolyglotJava2CAstTranslator(
job.ast(),
fSourceLoader.getReference(),
extInfo.nodeFactory(),
extInfo.typeSystem(),
new PolyglotIdentityMapper(fSourceLoader.getReference()),
((IRTranslatorExtension)extInfo).getReplicateForDoLoops()).translateToCAst());
return true;
}
@Override
public String name() {
return "<WALA IR goal for " + job.source().path() + ">";
}
}

View File

@ -1,32 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Oct 21, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
public interface IRTranslatorExtension {
void setSourceLoader(PolyglotSourceLoaderImpl jsli);
/**
* @return the identity mapper, for mapping AST nodes to WALA TypeReferences, MethodReferences and FieldReferences. Helps clients
* to correlate analysis results to AST nodes.
*/
PolyglotIdentityMapper getIdentityMapper();
/**
*/
CAstRewriterFactory<?,?> getCAstRewriterFactory();
boolean getReplicateForDoLoops();
}

View File

@ -1,79 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Oct 6, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.util.List;
import polyglot.frontend.Goal;
import polyglot.frontend.JLExtensionInfo;
import polyglot.frontend.JLScheduler;
import polyglot.frontend.Job;
import polyglot.frontend.Scheduler;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
/**
* A Polyglot extension descriptor for a test harness extension that generates WALA IR for
* the sources and class files in the classpath.
* @author rfuhrer
*/
public class JavaIRTranslatorExtension extends JLExtensionInfo implements IRTranslatorExtension {
protected PolyglotSourceLoaderImpl fSourceLoader;
protected PolyglotIdentityMapper fMapper;
protected CAstRewriterFactory<?,?> rewriterFactory;
//PORT1.7 getCompileGoal() no longer exists; set the compile goal by manipulating the End goal for the job
@Override
protected Scheduler createScheduler() {
return new JLScheduler(this) {
@Override
public List<Goal> goals(Job job) {
List<Goal> goals= super.goals(job);
Goal endGoal = goals.get(goals.size()-1);
if (!(endGoal.name().equals("End"))) {
throw new IllegalStateException("Last goal is not an End goal?");
}
endGoal.addPrereq(new IRGoal(job, fSourceLoader));
return goals;
}
};
}
@Override
public void setSourceLoader(PolyglotSourceLoaderImpl sourceLoader) {
fSourceLoader= sourceLoader;
fMapper= new PolyglotIdentityMapper(sourceLoader.getReference());
}
@Override
public PolyglotIdentityMapper getIdentityMapper() {
return fMapper;
}
public void setCAstRewriterFactory(CAstRewriterFactory<?,?> factory) {
rewriterFactory = factory;
}
@Override
public CAstRewriterFactory<?,?> getCAstRewriterFactory() {
return rewriterFactory;
}
@Override
public boolean getReplicateForDoLoops() {
return false;
}
}

View File

@ -1,63 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Oct 6, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import polyglot.frontend.FileSource;
import polyglot.frontend.Resource;
import com.ibm.wala.classLoader.SourceModule;
/**
* A Polyglot Source whose input comes from an InputStream.<br>
* Currently extends FileSource since that's all that the Polyglot Compiler class
* will accept.
* @author rfuhrer
*/
public class ModuleSource extends FileSource {
private final SourceModule module;
SourceModule getModule() {
return module;
}
public ModuleSource(final SourceModule module) throws IOException {
super(new Resource() {
@Override
public File file() {
return new File(module.getURL().getFile());
}
@Override
public InputStream getInputStream() throws IOException {
return module.getInputStream();
}
@Override
public String name() {
String fullPath = module.getURL().getFile();
int idx= fullPath.lastIndexOf(File.separatorChar);
return (idx > 0) ? fullPath.substring(idx+1) : fullPath;
}
@Override
public String toString() {
return module.getName();
}
}, true);
this.module = module;
}
}

View File

@ -1,58 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Oct 7, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.classLoader.ClassLoaderFactoryImpl;
import com.ibm.wala.classLoader.ClassLoaderImpl;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.config.SetOfClasses;
public class PolyglotClassLoaderFactory extends ClassLoaderFactoryImpl {
/**
* A map from ClassLoaderReference to IRTranslatorExtension, so that source files in different languages are processed by the
* right kind of IRTranslatorExtension.
*/
final protected Map<ClassLoaderReference, IRTranslatorExtension> fExtensionMap = new HashMap<ClassLoaderReference, IRTranslatorExtension>();
public PolyglotClassLoaderFactory(SetOfClasses exclusions, IRTranslatorExtension javaExtInfo) {
super(exclusions);
fExtensionMap.put(JavaSourceAnalysisScope.SOURCE, javaExtInfo);
}
protected IRTranslatorExtension getExtensionFor(ClassLoaderReference clr) {
return fExtensionMap.get(clr);
}
@Override
protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent,
AnalysisScope scope) throws IOException {
if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) {
ClassLoaderImpl cl = new PolyglotSourceLoaderImpl(classLoaderReference, parent, getExclusions(), cha,
getExtensionFor(classLoaderReference));
cl.init(scope.getModules(classLoaderReference));
return cl;
} else {
return super.makeNewClassLoader(classLoaderReference, cha, parent, scope);
}
}
}

View File

@ -1,243 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2014 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/**
*
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import polyglot.types.ArrayType;
import polyglot.types.ClassType;
import polyglot.types.CodeInstance;
import polyglot.types.ConstructorInstance;
import polyglot.types.FieldInstance;
import polyglot.types.InitializerInstance;
import polyglot.types.MemberDef;
import polyglot.types.MethodInstance;
import polyglot.types.PrimitiveType;
import polyglot.types.ProcedureInstance;
import polyglot.types.Type;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator.IdentityMapper;
import com.ibm.wala.cast.java.types.JavaPrimitiveTypeMap;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.types.Descriptor;
import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.MethodReference;
import com.ibm.wala.types.Selector;
import com.ibm.wala.types.TypeName;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.strings.Atom;
/**
* Class responsible for mapping Polyglot type system objects representing types,
* methods and fields to the corresponding WALA TypeReferences, MethodReferences
* and FieldReferences. Used during translation and by clients to help correlate
* WALA analysis results to the various AST nodes.
* @author rfuhrer
*/
public class PolyglotIdentityMapper implements IdentityMapper<Type, CodeInstance, FieldInstance> {
private final Map<Type, TypeReference> fTypeMap = HashMapFactory.make();
private final Map<FieldInstance, FieldReference> fFieldMap = HashMapFactory.make();
private final Map<CodeInstance, MethodReference> fMethodMap = HashMapFactory.make();
/**
* Map from Polyglot local ClassTypes to their enclosing methods. Used by localTypeToTypeID().<br>
* Needed since Polyglot doesn't provide this information. (It doesn't need to, since it
* doesn't need to generate unambiguous names for such entities -- it hands the source
* off to javac to generate bytecode. It probably also wouldn't want to, since that would
* create back-pointers from Type objects in the TypeSystem to AST's.)
*/
protected Map<ClassType, CodeInstance> fLocalTypeMap = new LinkedHashMap<ClassType, CodeInstance>();
protected final ClassLoaderReference fClassLoaderRef;
public PolyglotIdentityMapper(ClassLoaderReference clr) {
fClassLoaderRef= clr;
}
@Override
public FieldReference getFieldRef(FieldInstance field) {
if (!fFieldMap.containsKey(field)) {
FieldReference ref= referenceForField(field);
fFieldMap.put(field, ref);
return ref;
}
return fFieldMap.get(field);
}
@Override
public TypeReference getTypeRef(Type type) {
if (!fTypeMap.containsKey(type)) {
TypeReference ref= referenceForType(type);
fTypeMap.put(type, ref);
return ref;
}
return fTypeMap.get(type);
}
@Override
public MethodReference getMethodRef(CodeInstance method) {
if (!fMethodMap.containsKey(method)) {
MethodReference sel= referenceForMethod(method);
fMethodMap.put(method, sel);
return sel;
}
return fMethodMap.get(method);
}
public void mapLocalAnonTypeToMethod(ClassType anonLocalType, CodeInstance owningProc) {
fLocalTypeMap.put(anonLocalType, owningProc);
}
/**
* Create a FieldReference for the given Polyglot FieldInstance.<br>
* N.B.: This method <b>does not canonicalize</b> the FieldReferences,
* but rather creates a new one for each call.
* You more likely want to call getFieldRef(). This method is exposed
* so that multiple Polyglot instances can use the translation services
* without having FieldInstances collide (producing the dreaded "we are
* TypeSystem_c but type Foo is from TypeSystem_c" exception).
*/
public FieldReference referenceForField(FieldInstance field) {
Type targetType= field.container();
Type fieldType= field.type();
TypeReference targetTypeRef= TypeReference.findOrCreate(fClassLoaderRef, typeToTypeID(targetType));
TypeReference fieldTypeRef= TypeReference.findOrCreate(fClassLoaderRef, typeToTypeID(fieldType));
Atom fieldName= Atom.findOrCreateUnicodeAtom(field.name().toString());
FieldReference fieldRef= FieldReference.findOrCreate(targetTypeRef, fieldName, fieldTypeRef);
return fieldRef;
}
/**
* Create a TypeReference for the given Polyglot Type.<br>
* N.B.: This method <b>does not canonicalize</b> the TypeReferences,
* but rather creates a new one for each call.
* You more likely want to call getTypeRef(). This method is exposed
* so that multiple Polyglot instances can use the translation services
* without having Types collide (producing the dreaded "we are
* TypeSystem_c but type Foo is from TypeSystem_c" exception).
*/
public TypeReference referenceForType(Type type) {
TypeName typeName= TypeName.string2TypeName(typeToTypeID(type));
TypeReference typeRef= TypeReference.findOrCreate(fClassLoaderRef, typeName);
return typeRef;
}
private Selector selectorForMethod(CodeInstance procInstance) {
Atom name=
(procInstance instanceof ConstructorInstance) ?
MethodReference.initAtom :
(procInstance instanceof InitializerInstance) ?
MethodReference.clinitName :
Atom.findOrCreateUnicodeAtom(((MethodInstance) procInstance).name().toString());
TypeName[] argTypeNames = null;
if (! (procInstance instanceof InitializerInstance)) {
List formalTypes = ((ProcedureInstance)procInstance).formalTypes();
int numArgs = formalTypes.size();
// Descriptor prefers null to an empty array
if (numArgs > 0) {
argTypeNames = new TypeName[numArgs];
int i = 0;
for(Iterator iter = formalTypes.iterator(); iter.hasNext(); i++) {
Type argType= (Type) iter.next();
argTypeNames[i]= TypeName.string2TypeName(typeToTypeID(argType));
}
}
}
Type retType=
(procInstance instanceof MethodInstance) ? ((MethodInstance) procInstance).returnType() : procInstance.typeSystem().Void();
TypeName retTypeName= TypeName.string2TypeName(typeToTypeID(retType));
Descriptor desc= Descriptor.findOrCreate(argTypeNames, retTypeName);
return new Selector(name, desc);
}
/**
* Create a MethodReference for the given Polyglot MethodInstance.<br>
* N.B.: This method <b>does not canonicalize</b> the MethodReferences,
* but rather creates a new one for each call.
* You more likely want to call getMethodRef(). This method is exposed
* so that multiple Polyglot instances can use the translation services
* without having MethodInstances collide (producing the dreaded "we are
* TypeSystem_c but type Foo is from TypeSystem_c" exception).
*/
public MethodReference referenceForMethod(CodeInstance procInstance) {
// Handles both ConstructorInstance's and MethodInstance's
TypeName ownerType= TypeName.string2TypeName(typeToTypeID(((MemberDef) procInstance.def()).container().get()));
TypeReference ownerTypeRef= TypeReference.findOrCreate(fClassLoaderRef, ownerType);
MethodReference methodRef= MethodReference.findOrCreate(ownerTypeRef, selectorForMethod(procInstance));
return methodRef;
}
/**
* Translates the given Polyglot type to a name suitable for use in a WALA TypeReference
* (i.e. a bytecode-compliant type name).
*/
public String typeToTypeID(Type type) {
if (type.isPrimitive()) {
PrimitiveType ptype= (PrimitiveType) type;
return JavaPrimitiveTypeMap.getShortName(ptype.name().toString());
} else if (type.isArray()) {
ArrayType atype= (ArrayType) type;
return "[" + typeToTypeID(atype.base());
} else if (type.isNull()) {
Assertions.UNREACHABLE("typeToTypeID() encountered a null type!");
return null;
}
Assertions.productionAssertion(type.isClass(), "typeToTypeID() encountered the type " + type + " that is neither primitive, array, nor class!");
ClassType ctype= (ClassType) type;
return (ctype.isLocal() || ctype.isAnonymous()) ? anonLocalTypeToTypeID(ctype) : composeWALATypeDescriptor(ctype);
}
public String anonLocalTypeToTypeID(ClassType ctype) {
CodeInstance procInstance= fLocalTypeMap.get(ctype);
String outerTypeID= typeToTypeID(ctype.outer());
String shortName= (ctype.isAnonymous()) ? PolyglotJava2CAstTranslator.anonTypeName(ctype) : ctype.fullName().name().toString();
return outerTypeID + '/' + getMethodRef(procInstance).getSelector() + '/' + shortName;
}
public String composeWALATypeDescriptor(ClassType ctype) {
return "L" + composeWALATypeName(ctype);
}
public String composeWALATypeName(ClassType ctype) {
if (ctype.package_() != null) {
String packageName = ctype.package_().fullName().toString();
Assertions.productionAssertion(ctype.fullName().toString().startsWith(packageName));
return packageName.replace('.','/') + "/" + ctype.fullName().toString().substring( packageName.length()+1 ).replace('.','$');
} else {
return ctype.fullName().toString().replace('.', '$');
}
}
}

View File

@ -1,43 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Oct 7, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.io.IOException;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl;
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
import com.ibm.wala.classLoader.IClassLoader;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.config.SetOfClasses;
public class PolyglotSourceLoaderImpl extends JavaSourceLoaderImpl {
protected final IRTranslatorExtension fExtInfo;
public PolyglotSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions,
IClassHierarchy cha, IRTranslatorExtension extInfo) throws IOException {
super(loaderRef, parent, exclusions, cha);
this.fExtInfo = extInfo;
}
public IRTranslatorExtension getTranslatorExtension() {
return fExtInfo;
}
@Override
protected SourceModuleTranslator getTranslator() {
return new PolyglotSourceModuleTranslator(cha.getScope(), fExtInfo, this, JavaSourceAnalysisScope.SOURCE);
}
}

View File

@ -1,156 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java.translator.polyglot;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import polyglot.frontend.Compiler;
import polyglot.frontend.ExtensionInfo;
import polyglot.frontend.Globals;
import polyglot.frontend.Source;
import polyglot.main.Options;
import polyglot.main.UsageError;
import polyglot.util.ErrorInfo;
import polyglot.util.Position;
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
import com.ibm.wala.classLoader.DirectoryTreeModule;
import com.ibm.wala.classLoader.FileModule;
import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.classLoader.SourceFileModule;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.debug.Assertions;
/**
* A SourceModuleTranslator whose implementation of loadAllSources() uses a suitably
* configured Polyglot-based compiler to generate WALA IR for the sources in the
* compile-time classpath.
* @author rfuhrer
*/
public class PolyglotSourceModuleTranslator implements SourceModuleTranslator {
private final ExtensionInfo fExtInfo;
/**
* A client-supplied ClassLoaderReference to identify the innermost class loader
* to use when populating the classpath with loader Modules.
*/
private final ClassLoaderReference fSearchPathStart;
protected String fClassPath;
protected String fSourcePath;
public PolyglotSourceModuleTranslator(AnalysisScope scope, IRTranslatorExtension extInfo,
PolyglotSourceLoaderImpl sourceLoader, ClassLoaderReference searchPathStart) {
fSearchPathStart = searchPathStart;
fExtInfo= (ExtensionInfo) extInfo;
computeClassPath(scope);
computeSourcePath(scope);
extInfo.setSourceLoader(sourceLoader);
}
protected void computeClassPath(AnalysisScope scope) {
StringBuilder sb= new StringBuilder();
ClassLoaderReference cl= fSearchPathStart;
while (cl != null) {
addModulesForLoader(scope, cl, sb);
cl= cl.getParent();
}
fClassPath= sb.toString();
}
protected void addModulesForLoader(AnalysisScope scope, ClassLoaderReference cl, StringBuilder sb) {
for(Module m: scope.getModules(cl)) {
if (sb.length() > 0)
sb.append(File.pathSeparator);
if (m instanceof JarFileModule) {
JarFileModule jarFileModule= (JarFileModule) m;
sb.append(jarFileModule.getAbsolutePath());
} else if (m instanceof DirectoryTreeModule) {
DirectoryTreeModule directoryTreeModule= (DirectoryTreeModule) m;
sb.append(directoryTreeModule.getPath());
} else if (m instanceof FileModule) {
// do nothing
} else
Assertions.UNREACHABLE("Module entry is neither jar file nor directory");
}
}
protected void computeSourcePath(AnalysisScope scope) {
// Ordinarily, the source files to process are specified using absolute paths (see
// loadAllSources()), so the source path won't be needed. However, derived classes
// may choose to place entries on the source path to resolve source entities that
// were not explicitly specified. E.g., the X10 1.7 runtime jar contains source
// code, since class files don't contain all of the necessary type information.
// Given all of the above, the following value will either be correct or do no
// harm (even if the source path isn't used).
fSourcePath = ".";
}
@Override
public void loadAllSources(Set<ModuleEntry> modules) {
Options opts= fExtInfo.getOptions();
opts.assertions = true;
try {
opts.parseCommandLine(new String[] { "-noserial", "-cp", fClassPath, "-sourcepath", fSourcePath }, new HashSet<String>());
} catch (UsageError e) {
// Assertions.UNREACHABLE("Error parsing classpath spec???");
}
Compiler compiler= new Compiler(fExtInfo);
List<Source> streams= new ArrayList<Source>();
Globals.initialize(compiler);//PORT1.7 Must initialize before actually calling compiler
// N.B.: 'modules' is a flat set of source file ModuleEntry's.
for(Iterator<ModuleEntry> it= modules.iterator(); it.hasNext(); ) {
SourceFileModule entry= (SourceFileModule) it.next();
Assertions.productionAssertion(entry.isSourceFile());
if (skipSourceFile(entry)) {
continue;
}
try {
ModuleSource srcStream= new ModuleSource(entry);
streams.add(srcStream);
} catch (IOException e) {
compiler.errorQueue().enqueue(new ErrorInfo(ErrorInfo.IO_ERROR, "Unable to open source file '" + entry.getName() + "'", Position.COMPILER_GENERATED));
}
}
compiler.compile(streams);
// At this point, WALA now "knows" about all the source-originated stuff
}
/**
* @return true if the given source file module should not be processed,
* e.g. because it is generated on behalf of some upstream source.
*/
protected boolean skipSourceFile(SourceFileModule entry) {
return false;
}
}

View File

@ -1,110 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Sep 28, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import polyglot.types.ArrayType;
import polyglot.types.ClassType;
import polyglot.types.ObjectType;
import polyglot.types.PrimitiveType;
import polyglot.types.Type;
import polyglot.types.TypeSystem;
import com.ibm.wala.cast.java.types.JavaPrimitiveTypeMap;
import com.ibm.wala.cast.tree.CAstType;
import com.ibm.wala.cast.tree.impl.CAstTypeDictionaryImpl;
import com.ibm.wala.util.debug.Assertions;
public class PolyglotTypeDictionary extends CAstTypeDictionaryImpl {
private final class PolyglotJavaArrayType implements CAstType.Array {
private final Type fEltPolyglotType;
private final CAstType fEltCAstType;
private PolyglotJavaArrayType(ArrayType arrayType) {
super();
fEltPolyglotType = arrayType.base();
fEltCAstType = getCAstTypeFor(fEltPolyglotType);
}
@Override
public int getNumDimensions() {
return 1; // always 1 for Java
}
@Override
public CAstType getElementType() {
return fEltCAstType;
}
@Override
public String getName() {
return "[" + fEltCAstType.getName();
}
@Override
public Collection<CAstType> getSupertypes() {
if (fEltPolyglotType.isPrimitive())
return Collections.singleton(getCAstTypeFor(fTypeSystem.Object()));
Assertions.productionAssertion(fEltPolyglotType.isReference(), "Non-primitive, non-reference array element type!");
ObjectType baseRefType = (ObjectType) fEltPolyglotType;
Collection<CAstType> supers = new ArrayList<CAstType>();
for (Iterator<Type> superIter = baseRefType.interfaces().iterator(); superIter.hasNext(); ) {
supers.add(getCAstTypeFor(superIter.next()));
}
if (baseRefType instanceof ClassType) {
ClassType baseClassType = (ClassType) baseRefType;
if (baseClassType.superClass() != null)
supers.add(getCAstTypeFor(baseRefType.superClass()));
}
return supers;
}
}
protected final TypeSystem fTypeSystem;
protected final PolyglotJava2CAstTranslator fTranslator;
public PolyglotTypeDictionary(TypeSystem typeSystem, PolyglotJava2CAstTranslator translator) {
fTypeSystem = typeSystem;
fTranslator = translator;
}
@Override
public CAstType getCAstTypeFor(Object astType) {
CAstType type = super.getCAstTypeFor(astType);
// Handle the case where we haven't seen an AST decl for some type before
// processing a reference. This can certainly happen with classes in byte-
// code libraries, for which we never see an AST decl.
// In this case, just create a new type and return that.
if (type == null) {
final Type polyglotType = (Type) astType;
if (polyglotType.isClass())
type = fTranslator.new PolyglotJavaType((ClassType) astType, this, fTypeSystem);
else if (polyglotType.isPrimitive()) {
type = JavaPrimitiveTypeMap.lookupType(((PrimitiveType) polyglotType).name().toString());
} else if (polyglotType.isArray()) {
type = new PolyglotJavaArrayType((ArrayType) polyglotType);
} else
Assertions.UNREACHABLE("getCAstTypeFor() passed type that is not primitive, array, or class?");
super.map(astType, type);
}
return type;
}
}

View File

@ -1,37 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.wala.cast.java.translator.polyglot;
import com.ibm.wala.cast.tree.CAst;
import com.ibm.wala.cast.tree.rewrite.AstLoopUnwinder;
import com.ibm.wala.cast.tree.rewrite.CAstRewriter;
import com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory;
public class PolyglotUnwoundIRTranslatorExtension
extends JavaIRTranslatorExtension
{
private final int unrollDepth;
public PolyglotUnwoundIRTranslatorExtension(int unrollDepth) {
this.unrollDepth = unrollDepth;
}
@Override
public CAstRewriterFactory<CAstRewriter.RewriteContext<AstLoopUnwinder.UnwindKey>,AstLoopUnwinder.UnwindKey> getCAstRewriterFactory() {
return new CAstRewriterFactory<CAstRewriter.RewriteContext<AstLoopUnwinder.UnwindKey>,AstLoopUnwinder.UnwindKey>() {
@Override
public AstLoopUnwinder createCAstRewriter(CAst ast) {
return new AstLoopUnwinder(ast, true, unrollDepth);
}
};
}
}

View File

@ -1,192 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
/*
* Created on Sep 1, 2005
*/
package com.ibm.wala.cast.java.translator.polyglot;
import polyglot.ast.ArrayAccess;
import polyglot.ast.ArrayAccessAssign;
import polyglot.ast.ArrayInit;
import polyglot.ast.ArrayTypeNode;
import polyglot.ast.Assert;
import polyglot.ast.Binary;
import polyglot.ast.Block;
import polyglot.ast.BooleanLit;
import polyglot.ast.Branch;
import polyglot.ast.Call;
import polyglot.ast.CanonicalTypeNode;
import polyglot.ast.Case;
import polyglot.ast.Cast;
import polyglot.ast.Catch;
import polyglot.ast.CharLit;
import polyglot.ast.ClassBody;
import polyglot.ast.ClassDecl;
import polyglot.ast.ClassLit;
import polyglot.ast.Conditional;
import polyglot.ast.ConstructorCall;
import polyglot.ast.ConstructorDecl;
import polyglot.ast.Do;
import polyglot.ast.Empty;
import polyglot.ast.Eval;
import polyglot.ast.Field;
import polyglot.ast.FieldAssign;
import polyglot.ast.FieldDecl;
import polyglot.ast.FloatLit;
import polyglot.ast.For;
import polyglot.ast.Formal;
import polyglot.ast.If;
import polyglot.ast.Import;
import polyglot.ast.Initializer;
import polyglot.ast.Instanceof;
import polyglot.ast.IntLit;
import polyglot.ast.Labeled;
import polyglot.ast.Local;
import polyglot.ast.LocalAssign;
import polyglot.ast.LocalClassDecl;
import polyglot.ast.LocalDecl;
import polyglot.ast.MethodDecl;
import polyglot.ast.New;
import polyglot.ast.NewArray;
import polyglot.ast.NullLit;
import polyglot.ast.PackageNode;
import polyglot.ast.Return;
import polyglot.ast.Special;
import polyglot.ast.StringLit;
import polyglot.ast.Switch;
import polyglot.ast.SwitchBlock;
import polyglot.ast.Synchronized;
import polyglot.ast.Throw;
import polyglot.ast.Try;
import polyglot.ast.Unary;
import polyglot.ast.While;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator.MethodContext;
import com.ibm.wala.cast.java.translator.polyglot.PolyglotJava2CAstTranslator.WalkContext;
import com.ibm.wala.cast.tree.CAstNode;
/**
* An alternative visitor API for Polyglot, whose API is somewhat brain-damaged...
*
* @author rfuhrer
*/
public interface TranslatingVisitor {
CAstNode visit(MethodDecl m, MethodContext context);
CAstNode visit(ConstructorDecl cd, MethodContext cc);
CAstNode visit(FieldDecl f, MethodContext mc); // yes, a MethodContext; we process FieldDecl's only to add their initializers to
// each constructor
CAstNode visit(Import i, WalkContext wc);
CAstNode visit(PackageNode p, WalkContext wc);
CAstNode visit(CanonicalTypeNode ctn, WalkContext wc);
CAstNode visit(ArrayTypeNode ctn, WalkContext wc);
CAstNode visit(ArrayInit ai, WalkContext wc);
CAstNode visit(ArrayAccessAssign aaa, WalkContext wc);
CAstNode visit(FieldAssign fa, WalkContext wc);
CAstNode visit(LocalAssign la, WalkContext wc);
CAstNode visit(Binary b, WalkContext wc);
CAstNode visit(Call c, WalkContext wc);
CAstNode visit(ConstructorCall cc, WalkContext wc);
CAstNode visit(Cast c, WalkContext wc);
CAstNode visit(Conditional c, WalkContext wc);
CAstNode visit(Instanceof io, WalkContext wc);
CAstNode visit(BooleanLit bl, WalkContext wc);
CAstNode visit(ClassLit cl, WalkContext wc);
CAstNode visit(FloatLit fl, WalkContext wc);
CAstNode visit(NullLit nl, WalkContext wc);
CAstNode visit(CharLit cl, WalkContext wc);
CAstNode visit(IntLit il, WalkContext wc);
CAstNode visit(StringLit sl, WalkContext wc);
CAstNode visit(New n, WalkContext wc);
CAstNode visit(NewArray na, WalkContext wc);
CAstNode visit(Special s, WalkContext wc);
CAstNode visit(Unary u, WalkContext wc);
CAstNode visit(ArrayAccess aa, WalkContext wc);
CAstNode visit(Field f, WalkContext wc);
CAstNode visit(Local l, WalkContext wc);
CAstNode visit(ClassBody cb, WalkContext wc); // should never see this when producing CAstNodes
CAstNode visit(ClassDecl cd, WalkContext wc); // should never see this when producing CAstNodes
CAstNode visit(Initializer i, WalkContext wc); // should never see this when producing CAstNodes
CAstNode visit(Assert a, WalkContext wc);
CAstNode visit(Branch b, WalkContext wc);
CAstNode visit(Block b, WalkContext wc);
CAstNode visit(SwitchBlock sb, WalkContext wc);
CAstNode visit(Catch c, WalkContext wc);
CAstNode visit(If i, WalkContext wc);
CAstNode visit(Labeled l, WalkContext wc);
CAstNode visit(LocalClassDecl lcd, WalkContext wc);
CAstNode visit(Do d, WalkContext wc);
CAstNode visit(For f, WalkContext wc);
CAstNode visit(While w, WalkContext wc);
CAstNode visit(Switch s, WalkContext wc);
CAstNode visit(Synchronized s, WalkContext wc);
CAstNode visit(Try t, WalkContext wc);
CAstNode visit(Empty e, WalkContext wc);
CAstNode visit(Eval e, WalkContext wc);
CAstNode visit(LocalDecl ld, WalkContext wc);
CAstNode visit(Return r, WalkContext wc);
CAstNode visit(Case c, WalkContext wc);
CAstNode visit(Throw t, WalkContext wc);
CAstNode visit(Formal f, WalkContext wc); // may not see these (might be handled by parent)
}

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,103 +0,0 @@
/p
/A.class
/AnonymousClass.class
/AnonymousClass.java
/AnonymousClass$1.class
/AnonymousClass$1FooImpl.class
/AnonymousClass$2.class
/AnonymousClass$Foo.class
/Array1.class
/Array1.java
/ArrayLiteral1.class
/ArrayLiteral1.java
/ArrayLiteral2.class
/ArrayLiteral2.java
/B.class
/BadLanguageExceptionEx1.class
/BadLanguageExceptionF1.class
/Bar.class
/Base.class
/Breaks.class
/Breaks.java
/Breaks$1.class
/Breaks$Ref.class
/CastFromNull.class
/CastFromNull.java
/Casts.class
/Casts.java
/Derived.class
/Exception1.class
/Exception1.java
/Exception2.class
/Exception2.java
/Finally1.class
/Finally1.java
/FooEx1.class
/FooEx2.class
/FooF1.class
/FooIT1.class
/FooQ.class
/IFoo.class
/Inheritance1.class
/Inheritance1.java
/InheritedField.class
/InheritedField.java
/InnerClass.class
/InnerClass.java
/InnerClass$WhatsIt.class
/InnerClass$WhatsIt$NotAgain.class
/InnerClass$WhatsThat.class
/InnerClassA.class
/InnerClassA.java
/InnerClassA$AA.class
/InnerClassA$AB.class
/InnerClassA$AB$ABA.class
/InnerClassA$AB$ABA$ABAA.class
/InnerClassA$AB$ABA$ABAB.class
/InnerClassA$AB$ABSubA.class
/InnerClassA$AB$ABSubA$ABSubAA.class
/InnerClassSuper.class
/InnerClassSuper.java
/InnerClassSuper$SuperOuter.class
/InterfaceTest1.class
/InterfaceTest1.java
/IntWrapper.class
/LocalClass.class
/LocalClass.java
/LocalClass$1Foo.class
/LocalClass$2Foo.class
/MiniaturList.class
/MiniaturList.java
/MiniaturSliceBug.class
/MiniaturSliceBug.java
/Monitor.class
/Monitor.java
/NullArrayInit.class
/NullArrayInit.java
/PrimitiveWrapper.class
/QualifiedStatic.class
/QualifiedStatic.java
/R.class
/Scoping1.class
/Scoping1.java
/Scoping2.class
/Scoping2.java
/Scoping2$1.class
/Simple1.class
/Simple1.java
/StaticInitializers.class
/StaticInitializers.java
/StaticInitializers$X.class
/StaticNesting.class
/StaticNesting.java
/StaticNesting$WhatsIt.class
/Sub.class
/Sub$SubInner.class
/Switch1.class
/Switch1.java
/Thread1.class
/Thread1.java
/TwoClasses.class
/TwoClasses.java
/WhileTest1.class
/WhileTest1.java

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.java.test.data</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/java.test.data JLex download.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -1,41 +1,46 @@
eclipse.preferences.version=1
instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.APILeak=error
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.comparingIdentical=ignore
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecation=error
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
@ -43,9 +48,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
@ -57,56 +62,66 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=error
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=ignore
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=error
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=error
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=error
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=error
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=error
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=ignore
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View File

@ -0,0 +1,32 @@
compilers.f.unresolved-features=1
compilers.f.unresolved-plugins=1
compilers.incompatible-environment=1
compilers.p.build=1
compilers.p.build.bin.includes=1
compilers.p.build.encodings=1
compilers.p.build.java.compiler=0
compilers.p.build.java.compliance=1
compilers.p.build.missing.output=1
compilers.p.build.output.library=1
compilers.p.build.source.library=1
compilers.p.build.src.includes=1
compilers.p.deprecated=1
compilers.p.discouraged-class=1
compilers.p.internal=1
compilers.p.missing-packages=2
compilers.p.missing-version-export-package=1
compilers.p.missing-version-import-package=1
compilers.p.missing-version-require-bundle=1
compilers.p.no-required-att=0
compilers.p.not-externalized-att=1
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
compilers.p.unknown-element=1
compilers.p.unknown-identifier=1
compilers.p.unknown-resource=1
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=1
eclipse.preferences.version=1

View File

@ -0,0 +1,10 @@
DELEGATES_PREFERENCE=delegateValidatorList
USER_BUILD_PREFERENCE=enabledBuildValidatorList
USER_MANUAL_PREFERENCE=enabledManualValidatorList
USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.700.v201610061600
eclipse.preferences.version=1
override=true
suspend=false
vals/org.eclipse.wst.html.core.HTMLValidator/groups=0107include06111contentType136org.eclipse.wst.html.core.htmlsourceT07fileext04htmlF07fileext05xhtmlF07fileext03htmF07fileext04htplF07fileext03wmlF0107exclude0104file139target/site/dependency-convergence.htmlT03
vals/org.eclipse.wst.xml.core.xml/groups=0107include05111contentType128org.eclipse.core.runtime.xmlT111contentType134org.eclipse.wst.xml.core.xmlsourceT111contentType134org.eclipse.wst.xml.core.xslsourceT111contentType134org.eclipse.jst.jsp.core.tldsourceT07fileext03xmlF0107exclude08113projectNature134org.eclipse.jst.j2ee.ejb.EJBNature113projectNature130org.eclipse.jst.j2ee.EARNature04file08.projectT0104file110.classpathT0104file110.settings/T0204file122target/p2artifacts.xmlT0304file120target/p2content.xmlT0304file128target/antrun/build-main.xmlT03
vf.version=3

View File

@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Data Plug-in
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.ibm.wala.cast.java.test.data
Bundle-Version: 1.3.8.qualifier
Bundle-Vendor: IBM
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Version: 1.5.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

View File

@ -0,0 +1,3 @@
#Properties file for com.ibm.wala.cast.java.test.data
Bundle-Vendor = IBM
Bundle-Name = Data Plug-in

View File

@ -0,0 +1,35 @@
plugins {
id 'eclipse'
}
sourceSets.test.java.srcDirs = ['src']
////////////////////////////////////////////////////////////////////////
//
// download JLex
//
task downloadJLex(type: VerifiedDownload) {
src 'http://www.cs.princeton.edu/~appel/modern/java/JLex/current/Main.java'
checksum 'fe0cff5db3e2f0f5d67a153cf6c783af'
dest 'src/JLex/Main.java'
}
task cleanDownloadJLex(type: Delete) {
delete downloadJLex.dest.parent
}
compileTestJava.dependsOn downloadJLex
clean.dependsOn cleanDownloadJLex
////////////////////////////////////////////////////////////////////////
//
// create Eclipse metadata for use by Maven when running
// com.ibm.wala.cast.java.test.JDTJavaIRTests and
// com.ibm.wala.cast.java.test.JDTJava15IRTests tests
//
task prepareMavenBuild(dependsOn: [eclipseClasspath, eclipseProject]) {
}

View File

@ -1,4 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
OSGI-INF/l10n/bundle.properties,\
OSGI-INF/
javacProjectSettings = true

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="com.ibm.wala.cast.java.test.data" default="jar" basedir=".">
<property name="basews" value="${ws}"/>
@ -12,8 +13,8 @@
<property name="javacVerbose" value="false"/>
<property name="logExtension" value=".log"/>
<property name="compilerArg" value=""/>
<property name="javacSource" value="1.7"/>
<property name="javacTarget" value="1.7"/>
<property name="javacSource" value="1.8"/>
<property name="javacTarget" value="1.8"/>
<!-- This property has been updated to correspond to the paths used by the latest Java update
on Mac OS X 10.6 (Java version 1.6.0_22). If you are not using this version of Mac OS X or Java,
try changing the value of the property to "${java.home}/../../../Classes" -->

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.ibm.wala</groupId>
<artifactId>WALA</artifactId>
<version>1.3.8-SNAPSHOT</version>
<version>1.5.1-SNAPSHOT</version>
</parent>
<artifactId>com.ibm.wala.cast.java.test.data</artifactId>
<packaging>eclipse-plugin</packaging>

View File

@ -15,13 +15,15 @@ public class AnonymousClass {
}
public static void main(String[] args) {
final Integer base = new Integer(6);
final Integer base = Integer.valueOf(6);
Foo f= new Foo() {
int value = 3;
@Override
public int getValue() { return value; }
@Override
public int getValueBase() { return value - base.intValue(); }
};
@ -32,12 +34,13 @@ public class AnonymousClass {
}
public void method() {
final Integer base = new Integer(7);
final Integer base = Integer.valueOf(7);
abstract class FooImpl implements Foo {
int y;
@Override
public abstract int getValue();
FooImpl(int _y) {
@ -45,6 +48,7 @@ public class AnonymousClass {
}
@Override
public int getValueBase() {
return y + getValue() - base.intValue();
}
@ -52,6 +56,7 @@ public class AnonymousClass {
Foo f= new FooImpl(-4) {
@Override
public int getValue() { return 7; }
};

View File

@ -26,4 +26,4 @@ public class Array1 {
sum += ary[j];
}
}
}
}

View File

@ -12,6 +12,6 @@ public class ArrayLiteral1 {
public static void main(String[] args) {
ArrayLiteral1 al1= new ArrayLiteral1();
int[] a= new int[] { 0, 1, 2, 3, 5 };
Object[] b= new Object[] { null, "hi", new Integer(55), new int[] { 3, 1, 4 } };
Object[] b= new Object[] { null, "hi", Integer.valueOf(55), new int[] { 3, 1, 4 } };
}
}
}

View File

@ -42,4 +42,4 @@ public class Breaks {
(new Breaks()).testBreakFromIf("whatever", new Ref(args));
}
}
}

View File

@ -34,4 +34,4 @@ public class Casts {
int i2 = i1 + s1;
}
}
}

View File

@ -15,6 +15,7 @@ import java.io.IOException;
public final class Exception2 {
@SuppressWarnings("resource")
public static void main(String[] args) {
Exception2 e2= new Exception2();
FileInputStream fis = null;

View File

@ -22,6 +22,7 @@ public class FunkySupers {
class SubFunkySupers extends FunkySupers {
@Override
int funky(FunkySupers fs) {
SubFunkySupers.super.funky(fs);
SubFunkySupers.this.funky(fs);
@ -35,4 +36,4 @@ class SubFunkySupers extends FunkySupers {
//class EE { class X {} }
//class Y extends EE.X { Y(EE e) { e.super(); } }
// DOESNT WORK IN POLYGLOT!!!
// DOESNT WORK IN POLYGLOT!!!

View File

@ -30,11 +30,13 @@ class Base {
}
class Derived extends Base {
@Override
public void foo() {
super.foo();
}
@Override
public String bar(int x) {
return Integer.toHexString(x);
}
}
}

View File

@ -32,6 +32,7 @@ public class InnerClassLexicalReads {
* 1 return v2:com.ibm.wala.ssa.SymbolTable$1@16b18b6[11:4] -> [11:13]
*/
@Override
public int getConstant() {
return y;
}

View File

@ -26,4 +26,4 @@ class Sub extends InnerClassSuper {
so.test();
}
}
}
}

View File

@ -26,6 +26,7 @@ class FooIT1 implements IFoo {
fValue= ch;
}
@Override
public char getValue() {
return fValue;
}

View File

@ -10,7 +10,7 @@
*****************************************************************************/
public class LocalClass {
public static void main(String[] args) {
final Integer base = new Integer(6);
final Integer base = Integer.valueOf(6);
class Foo {
int value;
@ -27,7 +27,7 @@ public class LocalClass {
}
public void method() {
final Integer base = new Integer(6);
final Integer base = Integer.valueOf(6);
class Foo {
int value;

View File

@ -30,6 +30,7 @@ abstract class PrimitiveWrapper {
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
abstract public boolean equals(Object o);
}
@ -49,6 +50,8 @@ final class IntWrapper extends PrimitiveWrapper {
* @see com.ibm.miniatur.tests.sequential.PrimitiveWrapper#intValue()
*/
@Override
@SuppressWarnings("javadoc")
public int intValue() {
return val;
}
@ -58,6 +61,8 @@ final class IntWrapper extends PrimitiveWrapper {
* @see com.ibm.miniatur.tests.sequential.PrimitiveWrapper#setIntValue(int)
*/
@Override
@SuppressWarnings("javadoc")
public void setIntValue(int i) {
this.val = i;
}
@ -67,6 +72,8 @@ final class IntWrapper extends PrimitiveWrapper {
* @see com.ibm.miniatur.tests.sequential.PrimitiveWrapper#equals(java.lang.Object)
*/
@Override
@SuppressWarnings("javadoc")
public boolean equals(Object o) {
return o instanceof IntWrapper && ((IntWrapper)o).val==val;
}
@ -84,4 +91,4 @@ public class MiniaturSliceBug {
(new MiniaturSliceBug()).validNonDispatchedCall(new IntWrapper(-1));
}
}
}

Some files were not shown because too many files have changed in this diff Show More