Compare commits
No commits in common. "master" and "R_1.3.4" have entirely different histories.
|
@ -1,6 +0,0 @@
|
|||
((groovy-mode
|
||||
(c-file-style . "bsd")))
|
||||
|
||||
;; Local variables:
|
||||
;; flycheck-disabled-checkers: (emacs-lisp emacs-lisp-checkdoc)
|
||||
;; End:
|
|
@ -1,51 +1,12 @@
|
|||
*.DS_Store
|
||||
*.class
|
||||
*.out
|
||||
*.swp
|
||||
*/bin/
|
||||
*/bin/*
|
||||
*/build/
|
||||
*~
|
||||
.classpath
|
||||
com.ibm.wala.cast.js.rhino/lib/
|
||||
com.ibm.wala.cast.js/lib/
|
||||
com.ibm.wala.cast.java.polyglot/lib/
|
||||
com.ibm.wala.cast.java.test.data/src/JLex/
|
||||
.metadata/
|
||||
.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/
|
||||
*~
|
||||
com.ibm.wala.cast.js.test/examples-src/ajaxslt/
|
||||
com.ibm.wala.core.testdata/@dot/
|
||||
com.ibm.wala.core.testdata/lib/
|
||||
com.ibm.wala.core/dat/wala.properties
|
||||
com.ibm.wala.cast.js.html.nu_validator/lib/
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
*.iml
|
||||
/libraries/*.xml
|
||||
/modules.xml
|
||||
/tasks.xml
|
||||
/usage.statistics.xml
|
||||
/workspace.xml
|
|
@ -1,51 +0,0 @@
|
|||
<?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>
|
|
@ -1,7 +0,0 @@
|
|||
<?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>
|
|
@ -1,20 +0,0 @@
|
|||
<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>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
321
.travis.yml
321
.travis.yml
|
@ -1,321 +0,0 @@
|
|||
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/.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
|
|
@ -1,19 +0,0 @@
|
|||
<?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
277
LICENSE
|
@ -1,277 +0,0 @@
|
|||
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
340
README-Gradle.md
|
@ -1,340 +0,0 @@
|
|||
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 WALA’s 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 WALA’s 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 [Gradle’s `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 IDEA’s 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 WALA’s 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 WALA’s main (non-test) code
|
||||
|
||||
- `build`: build all WALA code and run all automated tests
|
||||
|
||||
- `javadoc`: build all Javadoc documentation
|
||||
|
||||
- `publishToMavenLocal`: install WALA’s 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 Gradle’s 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 Eclipse’s 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
|
||||
|
||||
Gradle’s [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
|
||||
-->
|
87
README.md
87
README.md
|
@ -1,82 +1,5 @@
|
|||
# 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
|
||||
```
|
||||
This is a mirror of the <a
|
||||
href="http://wala.svn.sourceforge.net/viewvc/wala/">WALA SVN repository</a>. It
|
||||
is maintained manually for now, but more official support may be added in the
|
||||
future. For more details on WALA, see <a href="http://wala.sourceforge.net">the
|
||||
WALA home page</a>.
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
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
|
|
@ -1,42 +0,0 @@
|
|||
#!/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
196
build.gradle
|
@ -1,196 +0,0 @@
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 +0,0 @@
|
|||
/.gradle/
|
|
@ -1,7 +0,0 @@
|
|||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'de.undercouch:gradle-download-task:3.4.3'
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# specify versions as version number, optionally followed by
|
||||
# '-SNAPSHOT' for a snapshot version
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
def runAndPrint(cmd):
|
||||
print cmd
|
||||
subprocess.check_output(cmd, shell=True)
|
||||
|
||||
oldVersion = sys.argv[1]
|
||||
newVersion = sys.argv[2]
|
||||
|
||||
print oldVersion + " --> " + newVersion
|
||||
|
||||
oldVersion = oldVersion.replace(".", "\.")
|
||||
newVersion = newVersion.replace(".", "\.")
|
||||
|
||||
runAndPrint("mvn clean -q")
|
||||
|
||||
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")
|
||||
|
||||
bundleOld = oldVersion if not oldIsSnapshot else oldVersion.replace("-SNAPSHOT","\.qualifier")
|
||||
bundleNew = newVersion if not newIsSnapShot else newVersion.replace("-SNAPSHOT","\.qualifier")
|
||||
|
||||
runAndPrint("find -E ./ -regex \".*(MANIFEST\.MF|feature\.xml)\" | xargs -n 1 perl -pi -e \'s/" + bundleOld + "/" + bundleNew + "/g\'")
|
||||
|
||||
print "done"
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?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>
|
|
@ -1,4 +1,4 @@
|
|||
bin.includes = feature.xml,\
|
||||
feature.properties,\
|
||||
license.html,\
|
||||
notice.html
|
||||
bin.includes = feature.xml,\
|
||||
feature.properties,\
|
||||
license.html,\
|
||||
notice.html
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
# NLS_ENCODING=UTF-8
|
||||
# NLS_MESSAGEFORMAT_VAR
|
||||
|
||||
#
|
||||
# Feature details
|
||||
#
|
||||
featureName = WALA Bundles
|
||||
|
||||
# NLS_ENCODING=UTF-8
|
||||
# NLS_MESSAGEFORMAT_VAR
|
||||
|
||||
#
|
||||
# Feature details
|
||||
#
|
||||
featureName = WALA Bundles
|
||||
providerName = IBM
|
|
@ -1,43 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="com.ibm.wala_feature"
|
||||
label="%featureName"
|
||||
version="1.5.1.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.core"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.shrike"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.cast"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.cast.java"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.util"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="com.ibm.wala"
|
||||
label="%featureName"
|
||||
version="1.1.3.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<copyright url="%copyrightURL">
|
||||
%copyright
|
||||
</copyright>
|
||||
|
||||
<license url="%licenseURL">
|
||||
%license
|
||||
</license>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.core"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.shrike"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.cast"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.cast.java"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.ibm.wala.util"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
|
@ -1,9 +0,0 @@
|
|||
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
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site>
|
||||
<feature id="com.ibm.wala_feature">
|
||||
<category name="main"/>
|
||||
</feature>
|
||||
<feature id="com.ibm.wala_feature.source">
|
||||
<category name="main"/>
|
||||
</feature>
|
||||
<feature id="com.ibm.wala.ide_feature">
|
||||
<category name="main"/>
|
||||
</feature>
|
||||
<feature id="com.ibm.wala.ide_feature.source">
|
||||
<category name="main"/>
|
||||
</feature>
|
||||
<category-def name="main" label="Wala"/>
|
||||
</site>
|
|
@ -1,12 +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>
|
||||
<groupId>com.ibm.wala</groupId>
|
||||
<artifactId>WALA</artifactId>
|
||||
<version>1.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.ibm.wala-repository</artifactId>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
</project>
|
|
@ -1,113 +0,0 @@
|
|||
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
|
|
@ -1,32 +0,0 @@
|
|||
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
|
|
@ -1,10 +0,0 @@
|
|||
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
|
|
@ -1,17 +0,0 @@
|
|||
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
|
|
@ -1,3 +0,0 @@
|
|||
#Properties file for com.ibm.wala.cast.java.ecj
|
||||
Bundle-Name = WALA CAst Java ECJ frontend
|
||||
Bundle-Vendor = IBM
|
|
@ -1,15 +0,0 @@
|
|||
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'),
|
||||
)
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
OSGI-INF/
|
||||
javacProjectSettings = true
|
|
@ -1,173 +0,0 @@
|
|||
<?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>
|
|
@ -1,12 +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.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>com.ibm.wala.cast.java.ecj</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
|
@ -1,25 +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.client;
|
||||
|
||||
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 ECJJavaSourceAnalysisEngine<I extends InstanceKey> extends JavaSourceAnalysisEngine<I> {
|
||||
|
||||
@Override
|
||||
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new ECJClassLoaderFactory(exclusions);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
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));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,210 +0,0 @@
|
|||
/*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="source"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.ibm.wala.cast.java.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>
|
|
@ -1,125 +1,10 @@
|
|||
#Thu Feb 03 10:12:26 EST 2011
|
||||
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=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.doc.comment.support=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
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=error
|
||||
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.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
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=error
|
||||
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.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
|
||||
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=error
|
||||
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=error
|
||||
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=error
|
||||
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
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
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
|
||||
|
@ -198,12 +83,9 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
|||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=2
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
|
@ -1,4 +1,4 @@
|
|||
#Mon Apr 13 10:03:21 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_WALA
|
||||
formatter_settings_version=11
|
||||
#Mon Apr 13 10:03:21 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_WALA
|
||||
formatter_settings_version=11
|
|
@ -0,0 +1,22 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: WALA CAst Java JDT Test Plug-in
|
||||
Bundle-SymbolicName: com.ibm.wala.cast.java.jdt.test
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Activator: com.ibm.wala.cast.java.jdt.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.cast.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",
|
||||
com.ibm.wala.cast.java.jdt;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime,
|
||||
com.ibm.wala.ide;bundle-version="1.1.3",
|
||||
org.eclipse.core.resources;bundle-version="3.4.1",
|
||||
com.ibm.wala.ide.tests;bundle-version="1.1.3",
|
||||
org.eclipse.jdt.core;bundle-version="3.4.2",
|
||||
org.junit4;bundle-version="4.3.1"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
|
@ -0,0 +1,4 @@
|
|||
source.. = source/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -62,7 +62,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
|
@ -73,7 +72,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
|
@ -6,129 +6,174 @@
|
|||
*****************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.ibm.wala.util.CancelException;
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
|
||||
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
|
||||
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;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
|
||||
public class JDTJava15IRTests extends JDTJavaTest {
|
||||
public class JDTJava15IRTests extends IRTests {
|
||||
|
||||
public JDTJava15IRTests() {
|
||||
super(JDTJavaIRTests.PROJECT);
|
||||
super(JDTJavaIRTests.PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
IDEIRTestUtil.populateScope(projectName, (JDTJavaSourceAnalysisEngine)engine, sources, libs);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor());
|
||||
System.err.println("finish importing project");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClass() {
|
||||
EclipseTestUtil.destroyProject(JDTJavaIRTests.PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new JDTJavaSourceAnalysisEngine(JDTJavaIRTests.PROJECT_NAME) {
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
engine.setExclusionsFile(FileProvider
|
||||
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assert.assertFalse("Cannot find exclusions file", true);
|
||||
}
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnonGeneNullarySimple() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testAnonGeneNullarySimple() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnonymousGenerics() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testAnonymousGenerics() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBasicsGenerics() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testBasicsGenerics() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCocovariant() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testCocovariant() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomGenericsAndFields() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testCustomGenericsAndFields() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnumSwitch() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testEnumSwitch() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExplicitBoxingTest() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testExplicitBoxingTest() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGenericArrays() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testGenericArrays() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGenericMemberClasses() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testGenericMemberClasses() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGenericSuperSink() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testGenericSuperSink() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMethodGenerics() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testMethodGenerics() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMoreOverriddenGenerics() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testMoreOverriddenGenerics() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotSoSimpleEnums() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testNotSoSimpleEnums() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOverridesOnePointFour() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testOverridesOnePointFour() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleEnums() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testSimpleEnums() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleEnums2() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testSimpleEnums2() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargs() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testVarargs() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargsCovariant() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testVarargsCovariant() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVarargsOverriding() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testVarargsOverriding() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWildcards() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testWildcards() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotations() throws IllegalArgumentException, CancelException, IOException {
|
||||
public void testAnnotations() {
|
||||
runTest(singlePkgTestSrc("javaonepointfive"), rtJar, simplePkgTestEntryPoint("javaonepointfive"), emptyList, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTypeInferencePrimAndStringOp() throws IllegalArgumentException, CancelException, IOException {
|
||||
String pkgName = "javaonepointfive";
|
||||
runTest(singlePkgTestSrc(pkgName), rtJar, simplePkgTestEntryPoint(pkgName),
|
||||
Arrays.asList(new TypeInferenceAssertion(pkgName + File.separator + singleInputForTest())), false);
|
||||
}
|
||||
}
|
|
@ -41,40 +41,67 @@ import java.io.IOException;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.wala.cast.java.jdt.test.Activator;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
import com.ibm.wala.ide.tests.util.EclipseTestUtil.ZippedProjectData;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
|
||||
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
|
||||
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
|
||||
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
|
||||
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;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
|
||||
public class JDTJavaIRTests extends JavaIRTests {
|
||||
|
||||
|
||||
public static final String PROJECT_NAME = "com.ibm.wala.cast.java.test.data";
|
||||
|
||||
public static final String PROJECT_ZIP = "test_project.zip";
|
||||
|
||||
public static final ZippedProjectData PROJECT;
|
||||
static {
|
||||
try {
|
||||
PROJECT = new ZippedProjectData(Activator.getDefault(), PROJECT_NAME, PROJECT_ZIP);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
private final ZippedProjectData project;
|
||||
|
||||
public JDTJavaIRTests() {
|
||||
this(PROJECT);
|
||||
}
|
||||
|
||||
private JDTJavaIRTests(ZippedProjectData project) {
|
||||
super(project.projectName);
|
||||
this.project = project;
|
||||
this.dump = Boolean.parseBoolean(System.getProperty("wala.cast.dump", "false"));
|
||||
super(PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <I extends InstanceKey> AbstractAnalysisEngine<I, CallGraphBuilder<I>, ?> getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
return JDTJavaTest.makeAnalysisEngine(mainClassDescriptors, project);
|
||||
protected void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
IDEIRTestUtil.populateScope(projectName, (JDTJavaSourceAnalysisEngine)engine, sources, libs);
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void beforeClass() {
|
||||
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
|
||||
System.err.println("finish importing project");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void afterClass() {
|
||||
EclipseTestUtil.destroyProject(PROJECT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new JDTJavaSourceAnalysisEngine(PROJECT_NAME) {
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
engine.setExclusionsFile(FileProvider
|
||||
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assert.assertFalse("Cannot find exclusions file", true);
|
||||
}
|
||||
|
||||
return engine;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/******************************************************************************
|
||||
* 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 3, 2005
|
||||
*/
|
||||
package com.ibm.wala.cast.java.test.ide;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.classLoader.JarFileModule;
|
||||
|
||||
public class IDEIRTestUtil {
|
||||
|
||||
public static void populateScope(String projectName, JDTJavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) throws IOException {
|
||||
|
||||
boolean foundLib = false;
|
||||
for (String lib : libs) {
|
||||
File libFile = new File(lib);
|
||||
if (libFile.exists()) {
|
||||
foundLib = true;
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile)));
|
||||
}
|
||||
}
|
||||
assert foundLib : "couldn't find library file from " + libs;
|
||||
|
||||
for (String srcFilePath : sources) {
|
||||
engine.addSourceModule(srcFilePath);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="source"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.ibm.wala.cast.java.jdt</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>
|
|
@ -1,125 +1,13 @@
|
|||
#Thu Feb 03 10:12:26 EST 2011
|
||||
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=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.doc.comment.support=enabled
|
||||
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=error
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=error
|
||||
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.emptyStatement=warning
|
||||
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.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
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=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.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
|
||||
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=error
|
||||
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=error
|
||||
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
|
||||
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.localPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.localSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
|
||||
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
|
||||
|
@ -198,12 +86,9 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
|||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=2
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,20 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Jdt Plug-in
|
||||
Bundle-SymbolicName: com.ibm.wala.cast.java.jdt
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Activator: com.ibm.wala.cast.java.jdt.Activator
|
||||
Bundle-Vendor: IBM
|
||||
Require-Bundle: com.ibm.wala.cast,
|
||||
com.ibm.wala.cast.java,
|
||||
com.ibm.wala.core,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.jdt.core,
|
||||
org.eclipse.core.resources,
|
||||
com.ibm.wala.shrike,
|
||||
com.ibm.wala.ide
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.ibm.wala.cast.java.client,
|
||||
com.ibm.wala.cast.java.jdt,
|
||||
com.ibm.wala.cast.java.translator.jdt
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|
@ -0,0 +1,4 @@
|
|||
source.. = source/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -37,78 +37,58 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.java.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
|
||||
import com.ibm.wala.cast.java.client.impl.ZeroCFABuilderFactory;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.cast.java.translator.jdt.JDTClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.ClassLoaderFactory;
|
||||
import com.ibm.wala.ide.client.EclipseProjectSourceAnalysisEngine;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath.AnalysisScopeType;
|
||||
import com.ibm.wala.ide.util.JavaEclipseProjectPath;
|
||||
import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
|
||||
import com.ibm.wala.ide.util.JdtUtil;
|
||||
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.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.callgraph.IAnalysisCacheView;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.util.config.SetOfClasses;
|
||||
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
||||
|
||||
public class JDTJavaSourceAnalysisEngine extends JavaSourceAnalysisEngine {
|
||||
protected final IJavaProject project;
|
||||
|
||||
public class JDTJavaSourceAnalysisEngine<I extends InstanceKey> extends EclipseProjectSourceAnalysisEngine<IJavaProject, I> {
|
||||
private boolean dump;
|
||||
|
||||
public JDTJavaSourceAnalysisEngine(IJavaProject project) {
|
||||
super(project);
|
||||
super();
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public JDTJavaSourceAnalysisEngine(String projectName) {
|
||||
this(JdtUtil.getNamedProject(projectName));
|
||||
}
|
||||
|
||||
public void setDump(boolean dump) {
|
||||
this.dump = dump;
|
||||
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new JDTClassLoaderFactory(exclusions);
|
||||
}
|
||||
|
||||
public void addSourceModule(IResource file) {
|
||||
IProject proj = project.getProject();
|
||||
IPath path = file.getProjectRelativePath();
|
||||
if (file.getType() == IResource.FILE) {
|
||||
addSourceModule(EclipseSourceFileModule.createEclipseSourceFileModule(proj.getFile(path)));
|
||||
} else {
|
||||
assert file.getType() == IResource.FOLDER;
|
||||
IFolder dir = proj.getFolder(path);
|
||||
try {
|
||||
for(IResource x : dir.members()) {
|
||||
assert x.getType() == IResource.FILE || x.getType() == IResource.FOLDER;
|
||||
addSourceModule(x);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
throw new RuntimeException("trouble with " + file, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassLoaderFactory makeClassLoaderFactory(SetOfClasses exclusions) {
|
||||
return new JDTClassLoaderFactory(exclusions, dump);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AnalysisScope makeAnalysisScope() {
|
||||
return new JavaSourceAnalysisScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassLoaderReference getSourceLoader() {
|
||||
return JavaSourceAnalysisScope.SOURCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnalysisCacheView makeDefaultCache() {
|
||||
return new AnalysisCacheImpl(AstIRFactory.makeDefaultFactory());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EclipseProjectPath<?, IJavaProject> createProjectPath(
|
||||
IJavaProject project) throws IOException, CoreException {
|
||||
project.open(new NullProgressMonitor());
|
||||
return JavaEclipseProjectPath.make(project, AnalysisScopeType.SOURCE_FOR_PROJ_AND_LINKED_PROJS);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CallGraphBuilder<? super I> getCallGraphBuilder(IClassHierarchy cha,
|
||||
AnalysisOptions options, IAnalysisCacheView cache) {
|
||||
return new ZeroCFABuilderFactory().make(options, cache, cha, scope);
|
||||
public void addSourceModule(String fileName) {
|
||||
IResource file = project.getProject().findMember(fileName);
|
||||
assert file != null;
|
||||
addSourceModule(file);
|
||||
}
|
||||
|
||||
}
|
|
@ -35,7 +35,7 @@
|
|||
* IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
|
||||
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
package com.ibm.wala.ide.test;
|
||||
package com.ibm.wala.cast.java.jdt;
|
||||
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
@ -46,7 +46,7 @@ import org.osgi.framework.BundleContext;
|
|||
public class Activator extends Plugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.ibm.wala.ide.tests";
|
||||
public static final String PLUGIN_ID = "com.ibm.wala.cast.java.jdt";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
@ -62,7 +62,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
|
@ -73,7 +72,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
|
@ -76,13 +76,11 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
|
|||
this.exceptionBinaryName = exceptionBinaryName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAssignmentCompatible(ITypeBinding variableType) {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof FakeExceptionTypeBinding)
|
||||
return this == o;
|
||||
|
@ -91,266 +89,213 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return exceptionBinaryName.hashCode();
|
||||
}
|
||||
|
||||
// --- rest not needed
|
||||
|
||||
@Override
|
||||
public ITypeBinding createArrayType(int dimension) {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding createArrayType");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBinaryName() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getBound() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getComponentType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVariableBinding[] getDeclaredFields() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMethodBinding[] getDeclaredMethods() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeclaredModifiers() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding[] getDeclaredTypes() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getDeclaringClass() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMethodBinding getDeclaringMethod() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDimensions() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getElementType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getErasure() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding[] getInterfaces() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getModifiers() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPackageBinding getPackage() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQualifiedName() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getSuperclass() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding[] getTypeArguments() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding[] getTypeBounds() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getTypeDeclaration() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding[] getTypeParameters() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getWildcard() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAnnotation() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAnonymous() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArray() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCapture() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCastCompatible(ITypeBinding type) {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClass() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnum() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFromSource() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGenericType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterface() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
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 ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMember() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNested() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNullType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isParameterizedType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrimitive() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRawType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubTypeCompatible(ITypeBinding type) {
|
||||
String name = type.getBinaryName();
|
||||
if (exceptionBinaryName.endsWith("Error;")) {
|
||||
|
@ -368,107 +313,73 @@ public class FakeExceptionTypeBinding implements ITypeBinding {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTopLevel() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTypeVariable() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpperbound() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWildcardType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAnnotationBinding[] getAnnotations() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IJavaElement getJavaElement() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getKind() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDeprecated() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEqualTo(IBinding binding) {
|
||||
return this.equals(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecovered() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSynthetic() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITypeBinding getGenericTypeOfWildcardType() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRank() {
|
||||
Assertions.UNREACHABLE("FakeExceptionTypeBinding ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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<>();
|
||||
Set<CAstQualifier> quals = new LinkedHashSet<CAstQualifier>();
|
||||
|
||||
if (isInterface)
|
||||
quals.add(CAstQualifier.INTERFACE);
|
||||
|
@ -174,6 +174,7 @@ 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();
|
||||
|
@ -185,10 +186,11 @@ public class JDT2CAstUtils {
|
|||
* CAstSymbol.NULL_DEFAULT_VALUE.
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static Object defaultValueForType(ITypeBinding type) {
|
||||
if (isLongOrLess(type))
|
||||
return Integer.valueOf(0);
|
||||
return new Integer(0);
|
||||
else if (type.getBinaryName().equals("D") || type.getBinaryName().equals("F"))
|
||||
return new Double(0.0);
|
||||
else
|
||||
|
@ -235,6 +237,7 @@ public class JDT2CAstUtils {
|
|||
*
|
||||
* @param returnType
|
||||
* @param ast
|
||||
* @return
|
||||
*/
|
||||
public static ITypeBinding getErasedType(ITypeBinding returnType, AST ast) {
|
||||
if (returnType.isTypeVariable() || returnType.isCapture())
|
||||
|
@ -296,7 +299,7 @@ public class JDT2CAstUtils {
|
|||
}
|
||||
|
||||
public static Collection<IMethodBinding> getOverriddenMethod(IMethodBinding met) {
|
||||
HashMap<ITypeBinding, IMethodBinding> overridden = new HashMap<>();
|
||||
HashMap<ITypeBinding, IMethodBinding> overridden = new HashMap<ITypeBinding, IMethodBinding>();
|
||||
if (met == null)
|
||||
return null;
|
||||
getMethodInClassOrSuperclass(met, met.getDeclaringClass(), true, overridden);
|
|
@ -40,28 +40,26 @@ package com.ibm.wala.cast.java.translator.jdt;
|
|||
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.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.util.config.SetOfClasses;
|
||||
|
||||
public class JDTClassLoaderFactory extends ClassLoaderFactoryImpl {
|
||||
protected boolean dump;
|
||||
|
||||
|
||||
// /**
|
||||
// * A map from ClassLoaderReference to IRTranslatorExtension, so that source files
|
||||
// * in different languages are processed by the right kind of IRTranslatorExtension.
|
||||
// */
|
||||
// that's nice, but there's only one kind of IRTransatorExtension.
|
||||
|
||||
public JDTClassLoaderFactory(SetOfClasses exclusions) {
|
||||
this(exclusions, false);
|
||||
}
|
||||
|
||||
public JDTClassLoaderFactory(SetOfClasses exclusions, boolean dump) {
|
||||
super(exclusions);
|
||||
this.dump = dump;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IClassLoader makeNewClassLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent,
|
||||
AnalysisScope scope) throws IOException {
|
||||
if (classLoaderReference.equals(JavaSourceAnalysisScope.SOURCE)) {
|
||||
|
@ -73,7 +71,8 @@ public class JDTClassLoaderFactory extends ClassLoaderFactoryImpl {
|
|||
}
|
||||
}
|
||||
|
||||
protected JavaSourceLoaderImpl makeSourceLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent) {
|
||||
return new JDTSourceLoaderImpl(classLoaderReference, parent, cha, dump);
|
||||
protected JDTSourceLoaderImpl makeSourceLoader(ClassLoaderReference classLoaderReference, IClassHierarchy cha, IClassLoader parent)
|
||||
throws IOException {
|
||||
return new JDTSourceLoaderImpl(classLoaderReference, parent, getExclusions(), cha);
|
||||
}
|
||||
}
|
|
@ -88,7 +88,7 @@ public class JDTIdentityMapper {
|
|||
* This method canonicalizes the TypeReferences
|
||||
*/
|
||||
public TypeReference getTypeRef(ITypeBinding type) {
|
||||
type = JDT2CAstUtils.getErasedType(type, fAst); // GENERICS: erasure...
|
||||
type = JDT2CAstUtils.getErasedType((ITypeBinding) type, fAst); // GENERICS: erasure...
|
||||
|
||||
if (!fTypeMap.containsKey(type.getKey())) {
|
||||
TypeName typeName = TypeName.string2TypeName(typeToTypeID(type));
|
File diff suppressed because it is too large
Load Diff
|
@ -37,26 +37,25 @@
|
|||
*/
|
||||
package com.ibm.wala.cast.java.translator.jdt;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
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.classLoader.Module;
|
||||
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
|
||||
public class JDTSourceLoaderImpl extends JavaSourceLoaderImpl {
|
||||
private final boolean dump;
|
||||
|
||||
public JDTSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, IClassHierarchy cha) {
|
||||
this(loaderRef, parent, cha, false);
|
||||
}
|
||||
|
||||
public JDTSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, IClassHierarchy cha, boolean dump) {
|
||||
super(loaderRef, parent, cha);
|
||||
this.dump = dump;
|
||||
public JDTSourceLoaderImpl(ClassLoaderReference loaderRef, IClassLoader parent, SetOfClasses exclusions, IClassHierarchy cha)
|
||||
throws IOException {
|
||||
super(loaderRef, parent, exclusions, cha);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SourceModuleTranslator getTranslator() {
|
||||
return new JDTSourceModuleTranslator(cha.getScope(), this, dump);
|
||||
return new JDTSourceModuleTranslator(cha.getScope(), this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,197 +1,176 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.jdt.core.ICompilationUnit;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
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.ASTRequestor;
|
||||
import org.eclipse.jdt.core.dom.CompilationUnit;
|
||||
|
||||
import com.ibm.wala.cast.java.translator.Java2IRTranslator;
|
||||
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
|
||||
import com.ibm.wala.classLoader.DirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.JarFileModule;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.classLoader.ModuleEntry;
|
||||
import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
|
||||
import com.ibm.wala.ide.util.JdtPosition;
|
||||
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 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 JDTSourceModuleTranslator implements SourceModuleTranslator {
|
||||
private final class JdtAstToIR extends ASTRequestor {
|
||||
private final Entry<IProject, Map<ICompilationUnit, EclipseSourceFileModule>> proj;
|
||||
|
||||
private JdtAstToIR(Entry<IProject, Map<ICompilationUnit, EclipseSourceFileModule>> proj) {
|
||||
this.proj = proj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
|
||||
|
||||
try {
|
||||
JDTJava2CAstTranslator<JdtPosition> jdt2cast = makeCAstTranslator(ast, proj.getValue().get(source).getIFile(), source.getUnderlyingResource().getLocation().toOSString());
|
||||
final Java2IRTranslator java2ir = makeIRTranslator();
|
||||
java2ir.translate(proj.getValue().get(source), jdt2cast.translateToCAst());
|
||||
} catch (JavaModelException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
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.getElementName() + buffer.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean dump;
|
||||
protected JDTSourceLoaderImpl sourceLoader;
|
||||
|
||||
public JDTSourceModuleTranslator(AnalysisScope scope, JDTSourceLoaderImpl sourceLoader) {
|
||||
this(scope, sourceLoader, false);
|
||||
}
|
||||
|
||||
public JDTSourceModuleTranslator(AnalysisScope scope, JDTSourceLoaderImpl sourceLoader, boolean dump) {
|
||||
computeClassPath(scope);
|
||||
this.sourceLoader = sourceLoader;
|
||||
this.dump = dump;
|
||||
}
|
||||
|
||||
private static void computeClassPath(AnalysisScope scope) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
ClassLoaderReference cl = scope.getApplicationLoader();
|
||||
|
||||
while (cl != null) {
|
||||
List<Module> modules = scope.getModules(cl);
|
||||
|
||||
for (Module m : modules) {
|
||||
if (buf.length() > 0)
|
||||
buf.append(File.pathSeparator);
|
||||
if (m instanceof JarFileModule) {
|
||||
JarFileModule jarFileModule = (JarFileModule) m;
|
||||
|
||||
buf.append(jarFileModule.getAbsolutePath());
|
||||
} else if (m instanceof DirectoryTreeModule) {
|
||||
DirectoryTreeModule directoryTreeModule = (DirectoryTreeModule) m;
|
||||
|
||||
buf.append(directoryTreeModule.getPath());
|
||||
} else
|
||||
Assertions.UNREACHABLE("Module entry is neither jar file nor directory");
|
||||
}
|
||||
cl = cl.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Project -> AST code from org.eclipse.jdt.core.tests.performance
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void loadAllSources(Set<ModuleEntry> modules) {
|
||||
// TODO: we might need one AST (-> "Object" class) for all files.
|
||||
// TODO: group by project and send 'em in
|
||||
|
||||
// sort files into projects
|
||||
Map<IProject, Map<ICompilationUnit,EclipseSourceFileModule>> projectsFiles = new HashMap<>();
|
||||
for (ModuleEntry m : modules) {
|
||||
assert m instanceof EclipseSourceFileModule : "Expecing EclipseSourceFileModule, not " + m.getClass();
|
||||
EclipseSourceFileModule entry = (EclipseSourceFileModule) m;
|
||||
IProject proj = entry.getIFile().getProject();
|
||||
if (!projectsFiles.containsKey(proj)) {
|
||||
projectsFiles.put(proj, new HashMap<ICompilationUnit,EclipseSourceFileModule>());
|
||||
}
|
||||
projectsFiles.get(proj).put(JavaCore.createCompilationUnitFrom(entry.getIFile()), entry);
|
||||
}
|
||||
|
||||
final ASTParser parser = ASTParser.newParser(AST.JLS8);
|
||||
|
||||
for (final Map.Entry<IProject,Map<ICompilationUnit,EclipseSourceFileModule>> proj : projectsFiles.entrySet()) {
|
||||
parser.setProject(JavaCore.create(proj.getKey()));
|
||||
parser.setResolveBindings(true);
|
||||
|
||||
Set<ICompilationUnit> units = proj.getValue().keySet();
|
||||
parser.createASTs(units.toArray(new ICompilationUnit[units.size()]), new String[0], new JdtAstToIR(proj), null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected Java2IRTranslator makeIRTranslator() {
|
||||
return new Java2IRTranslator(sourceLoader);
|
||||
}
|
||||
|
||||
protected JDTJava2CAstTranslator<JdtPosition> makeCAstTranslator(CompilationUnit cu, final IFile sourceFile, String fullPath) {
|
||||
return new JDTJava2CAstTranslator<JdtPosition>(sourceLoader, cu, fullPath, false, dump) {
|
||||
@Override
|
||||
public JdtPosition makePosition(int start, int end) {
|
||||
return new JdtPosition(start, end, this.cu.getLineNumber(start), this.cu.getLineNumber(end), sourceFile, this.fullPath);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.jdt.core.ICompilationUnit;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
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.ASTRequestor;
|
||||
import org.eclipse.jdt.core.dom.CompilationUnit;
|
||||
|
||||
import com.ibm.wala.cast.java.translator.Java2IRTranslator;
|
||||
import com.ibm.wala.cast.java.translator.SourceModuleTranslator;
|
||||
import com.ibm.wala.classLoader.DirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.JarFileModule;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.classLoader.ModuleEntry;
|
||||
import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
|
||||
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 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 JDTSourceModuleTranslator implements SourceModuleTranslator {
|
||||
protected JDTSourceLoaderImpl sourceLoader;
|
||||
|
||||
public JDTSourceModuleTranslator(AnalysisScope scope, JDTSourceLoaderImpl sourceLoader) {
|
||||
computeClassPath(scope);
|
||||
this.sourceLoader = sourceLoader;
|
||||
}
|
||||
|
||||
private void computeClassPath(AnalysisScope scope) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
ClassLoaderReference cl = scope.getApplicationLoader();
|
||||
|
||||
while (cl != null) {
|
||||
List<Module> modules = scope.getModules(cl);
|
||||
|
||||
for (Iterator<Module> iter = modules.iterator(); iter.hasNext();) {
|
||||
Module m = (Module) iter.next();
|
||||
|
||||
if (buf.length() > 0)
|
||||
buf.append(File.pathSeparator);
|
||||
if (m instanceof JarFileModule) {
|
||||
JarFileModule jarFileModule = (JarFileModule) m;
|
||||
|
||||
buf.append(jarFileModule.getAbsolutePath());
|
||||
} else if (m instanceof DirectoryTreeModule) {
|
||||
DirectoryTreeModule directoryTreeModule = (DirectoryTreeModule) m;
|
||||
|
||||
buf.append(directoryTreeModule.getPath());
|
||||
} else
|
||||
Assertions.UNREACHABLE("Module entry is neither jar file nor directory");
|
||||
}
|
||||
cl = cl.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Project -> AST code from org.eclipse.jdt.core.tests.performance
|
||||
*/
|
||||
|
||||
public void loadAllSources(Set<ModuleEntry> modules) {
|
||||
// TODO: we might need one AST (-> "Object" class) for all files.
|
||||
// TODO: group by project and send 'em in
|
||||
|
||||
System.out.println(modules);
|
||||
|
||||
// sort files into projects
|
||||
Map<IProject, Map<ICompilationUnit,EclipseSourceFileModule>> projectsFiles = new HashMap<IProject, Map<ICompilationUnit,EclipseSourceFileModule>>();
|
||||
for (ModuleEntry m : modules) {
|
||||
assert m instanceof EclipseSourceFileModule : "Expecing EclipseSourceFileModule, not " + m.getClass();
|
||||
EclipseSourceFileModule entry = (EclipseSourceFileModule) m;
|
||||
IProject proj = entry.getIFile().getProject();
|
||||
if (!projectsFiles.containsKey(proj)) {
|
||||
projectsFiles.put(proj, new HashMap<ICompilationUnit,EclipseSourceFileModule>());
|
||||
}
|
||||
projectsFiles.get(proj).put(JavaCore.createCompilationUnitFrom(entry.getIFile()), entry);
|
||||
}
|
||||
|
||||
final ASTParser parser = ASTParser.newParser(AST.JLS3);
|
||||
|
||||
for (final Map.Entry<IProject,Map<ICompilationUnit,EclipseSourceFileModule>> proj : projectsFiles.entrySet()) {
|
||||
parser.setProject(JavaCore.create(proj.getKey()));
|
||||
parser.setResolveBindings(true);
|
||||
|
||||
Set<ICompilationUnit> units = proj.getValue().keySet();
|
||||
parser.createASTs(units.toArray(new ICompilationUnit[units.size()]), new String[0], new ASTRequestor() {
|
||||
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
|
||||
|
||||
try {
|
||||
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
|
||||
final Java2IRTranslator java2ir = makeIRTranslator();
|
||||
java2ir.translate(proj.getValue().get(source), jdt2cast.translateToCAst());
|
||||
} catch (JavaModelException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
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.getElementName() + buffer.toString());
|
||||
}
|
||||
}
|
||||
}, null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected Java2IRTranslator makeIRTranslator() {
|
||||
return new Java2IRTranslator(sourceLoader);
|
||||
}
|
||||
|
||||
protected JDTJava2CAstTranslator makeCAstTranslator(CompilationUnit cu, String fullPath) {
|
||||
return new JDTJava2CAstTranslator(sourceLoader, cu, fullPath, false);
|
||||
}
|
||||
|
||||
}
|
|
@ -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<ITypeBinding> {
|
||||
public class JDTTypeDictionary extends CAstTypeDictionaryImpl {
|
||||
|
||||
// TODO: better way of getting type "ObjecT" that doesn't require us to keep AST? although this is similar to
|
||||
// polyglot.
|
||||
|
@ -62,13 +62,13 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
/**
|
||||
*
|
||||
* @param ast Needed to get root type "java.lang.Object"
|
||||
* @param translator
|
||||
*/
|
||||
public JDTTypeDictionary(AST ast, JDTIdentityMapper identityMapper) {
|
||||
fAst = ast;
|
||||
fIdentityMapper = identityMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CAstType getCAstTypeFor(Object astType) {
|
||||
|
||||
ITypeBinding jdtType = JDT2CAstUtils.getErasedType((ITypeBinding) astType, fAst);
|
||||
|
@ -88,7 +88,7 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
type = new JdtJavaArrayType(jdtType);
|
||||
} else
|
||||
Assertions.UNREACHABLE("getCAstTypeFor() passed type that is not primitive, array, or class?");
|
||||
super.map((ITypeBinding)astType, type); // put in cache
|
||||
super.map(astType, type); // put in cache
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
@ -104,30 +104,27 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
fEltCAstType = getCAstTypeFor(fEltJdtType);
|
||||
}
|
||||
|
||||
@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() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Collection 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<>();
|
||||
Collection<CAstType> supers = new ArrayList<CAstType>();
|
||||
for (ITypeBinding type : fEltJdtType.getInterfaces()) {
|
||||
supers.add(getCAstTypeFor(type));
|
||||
}
|
||||
|
@ -142,7 +139,6 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
|
||||
private Collection<CAstType> fSuperTypes = null;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + ":" + getName();
|
||||
}
|
||||
|
@ -152,13 +148,12 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
fType = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return fIdentityMapper.getTypeRef(fType).getName().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CAstType> getSupertypes() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Collection getSupertypes() {
|
||||
if (fSuperTypes == null) {
|
||||
buildSuperTypes();
|
||||
}
|
||||
|
@ -172,7 +167,7 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
.getSuperclass();
|
||||
int N = fType.getInterfaces().length + 1;
|
||||
|
||||
fSuperTypes = new ArrayList<>(N);
|
||||
fSuperTypes = new ArrayList<CAstType>(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));
|
||||
|
@ -180,12 +175,10 @@ public class JDTTypeDictionary extends CAstTypeDictionaryImpl<ITypeBinding> {
|
|||
fSuperTypes.add(getCAstTypeFor(t));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CAstQualifier> getQualifiers() {
|
||||
return JDT2CAstUtils.mapModifiersToQualifiers(fType.getModifiers(), fType.isInterface(), fType.isAnnotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInterface() {
|
||||
return fType.isInterface();
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||
<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="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,28 @@
|
|||
<?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>
|
|
@ -1,125 +1,10 @@
|
|||
#Thu Feb 03 10:12:26 EST 2011
|
||||
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=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.doc.comment.support=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
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=error
|
||||
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.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
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=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.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
|
||||
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=error
|
||||
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=warning
|
||||
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=error
|
||||
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=warning
|
||||
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
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
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
|
||||
|
@ -198,12 +83,9 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
|||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=2
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
|
@ -0,0 +1,4 @@
|
|||
#Mon Apr 13 15:21:17 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_WALA
|
||||
formatter_settings_version=11
|
|
@ -0,0 +1,18 @@
|
|||
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.0.0
|
||||
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.junit4;bundle-version="4.3.1"
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ActivationPolicy: lazy
|
|
@ -0,0 +1,4 @@
|
|||
source.. = source/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -0,0 +1,19 @@
|
|||
<?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>
|
|
@ -0,0 +1,19 @@
|
|||
<?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/PolyglotJavaIRTests.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<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.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/java 1.6"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.PolyglotJavaIRTests"/>
|
||||
<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>
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?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.ide.jdt.test/source/com/ibm/wala/cast/java/test/ECJJavaIRTest.java"/>
|
||||
<listEntry value="/com.ibm.wala.cast.java.polyglot.test/source/com/ibm/wala/cast/java/test/PolyglotSyncDuplicatorTest.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
|
@ -10,9 +11,7 @@
|
|||
<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"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.ECJJavaIRTest"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.ide.jdt.test"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.wala.cast.java.test.PolyglotSyncDuplicatorTest"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.wala.cast.java.polyglot.test"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:com.ibm.wala.cast.java.test.data}"/>
|
||||
</launchConfiguration>
|
|
@ -1,21 +1,21 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 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.ide.jsdt.tests;
|
||||
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.ide.jsdt.tests";
|
||||
public static final String PLUGIN_ID = "com.ibm.wala.cast.java.polyglot.test";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
@ -31,7 +31,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
|
@ -42,7 +41,6 @@ public class Activator extends Plugin {
|
|||
*
|
||||
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
|
@ -0,0 +1,31 @@
|
|||
/*******************************************************************************
|
||||
* 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 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) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, new String[] { "LJLex/Main" });
|
||||
}
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
return engine;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,37 +6,29 @@
|
|||
*******************************************************************************/
|
||||
package com.ibm.wala.cast.java.test;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.wala.cast.java.client.ECJJavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
|
||||
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
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.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
|
||||
public class ECJJavaIRTest extends JavaIRTests {
|
||||
public class PolyglotJavaIRTests extends JavaIRTests {
|
||||
|
||||
public ECJJavaIRTest() {
|
||||
public PolyglotJavaIRTests() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <I extends InstanceKey> AbstractAnalysisEngine<I, CallGraphBuilder<I>, ?> getAnalysisEngine(final String[] mainClassDescriptors, Collection<String> sources, List<String> libs) {
|
||||
JavaSourceAnalysisEngine<I> engine = new ECJJavaSourceAnalysisEngine<I>() {
|
||||
@Override
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
populateScope(engine, sources, libs);
|
||||
return engine;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/*******************************************************************************
|
||||
* 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 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.impl.CAstRewriter;
|
||||
import com.ibm.wala.cast.tree.impl.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 {
|
||||
|
||||
protected JavaSourceAnalysisEngine getAnalysisEngine(final String[] mainClassDescriptors) {
|
||||
JavaSourceAnalysisEngine engine = new PolyglotJavaSourceAnalysisEngine() {
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha, mainClassDescriptors);
|
||||
}
|
||||
|
||||
public IRTranslatorExtension getTranslatorExtension() {
|
||||
JavaIRTranslatorExtension ext = new JavaIRTranslatorExtension();
|
||||
ext.setCAstRewriterFactory(new CAstRewriterFactory() {
|
||||
public CAstRewriter createCAstRewriter(CAst ast) {
|
||||
return new SynchronizedBlockDuplicator(ast, true, testMethod);
|
||||
}
|
||||
});
|
||||
return ext;
|
||||
}
|
||||
|
||||
};
|
||||
engine.setExclusionsFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS);
|
||||
return engine;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="source"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/polyglot.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/java_cup.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,28 @@
|
|||
<?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>
|
|
@ -1,394 +1,263 @@
|
|||
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=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.doc.comment.support=enabled
|
||||
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=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=ignore
|
||||
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.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
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=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.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
|
||||
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=error
|
||||
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=error
|
||||
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
|
||||
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
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=2
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=132
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=2
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
#Mon Apr 13 15:38:50 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
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_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=132
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=132
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=space
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=2
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
|
@ -0,0 +1,4 @@
|
|||
#Mon Apr 13 15:38:50 EDT 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_WALA
|
||||
formatter_settings_version=11
|
|
@ -0,0 +1,35 @@
|
|||
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.0.0
|
||||
Bundle-Activator: com.ibm.wala.cast.java.polyglot.Activator
|
||||
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,
|
||||
com.ibm.wala.ide
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.ibm.wala.cast.java.client.polyglot,
|
||||
com.ibm.wala.cast.java.polyglot;uses:="org.osgi.framework,org.eclipse.core.runtime",
|
||||
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"
|
|
@ -0,0 +1,4 @@
|
|||
source.. = source/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -1,95 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE project>
|
||||
<project name="com.ibm.wala.dalvik.test" 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.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" -->
|
||||
<condition property="dir_bootclasspath" value="${java.home}/../Classes">
|
||||
<and>
|
||||
<os family="mac"/>
|
||||
<equals arg1="${ant.java.version}" arg2="1.6" />
|
||||
</and>
|
||||
</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}"/>
|
||||
|
||||
<property environment="env" />
|
||||
<condition property="androiddir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<target name="sampleLexPresent" depends="init">
|
||||
<available file="${plugin.destination}/data/sample.lex" property="sample.lex.present"/>
|
||||
</target>
|
||||
|
||||
<target name="fetchSampleLex" depends="sampleLexPresent" unless="sample.lex.present">
|
||||
<get src="https://www.cs.princeton.edu/~appel/modern/java/JLex/current/sample.lex" dest="${plugin.destination}/data/sample.lex" />
|
||||
</target>
|
||||
|
||||
<target name="fetchSampleCup" depends="sampleCupPresent" unless="sample.cup.present">
|
||||
<get src="http://www.cc.gatech.edu/gvu/people/faculty/hudson/java_cup/classes.v0.9e/java_cup/parser.cup" dest="${plugin.destination}/data/sample.cup" />
|
||||
</target>
|
||||
|
||||
<target name="sampleCupPresent" depends="init">
|
||||
<available file="${plugin.destination}/data/sample.cup" property="sample.cup.present"/>
|
||||
</target>
|
||||
|
||||
<target name="fetchAndroidJar" depends="androidJarPresent" unless="android.jar.present">
|
||||
<get src="http://central.maven.org/maven2/com/google/android/android/4.1.1.4/android-4.1.1.4.jar" dest="${plugin.destination}/data/android.jar" />
|
||||
</target>
|
||||
|
||||
<target name="androidJarPresent" depends="init">
|
||||
<available file="${plugin.destination}/data/android.jar" property="android.jar.present"/>
|
||||
</target>
|
||||
|
||||
<target name="fetchDxJar">
|
||||
<mkdir dir="${basedir}/lib/"/>
|
||||
<copy
|
||||
file="${androiddir}/build-tools/26.0.2/lib/dx.jar"
|
||||
tofile="${basedir}/lib/dx.jar" force="true"/>
|
||||
</target>
|
||||
|
||||
<target name="getJars" depends="fetchSampleLex,fetchSampleCup,fetchAndroidJar,fetchDxJar" />
|
||||
|
||||
<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>
|
||||
<?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>
|
|
@ -0,0 +1,64 @@
|
|||
/*******************************************************************************
|
||||
* 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.client.polyglot;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
|
||||
import com.ibm.wala.cast.java.client.impl.ZeroCFABuilderFactory;
|
||||
import com.ibm.wala.client.AbstractAnalysisEngine;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraphBuilder;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
|
||||
public class EclipseProjectAnalysisEngine extends AbstractAnalysisEngine {
|
||||
|
||||
protected final IPath workspaceRootPath;
|
||||
|
||||
protected final IJavaProject project;
|
||||
|
||||
protected final EclipseProjectPath ePath;
|
||||
|
||||
public EclipseProjectAnalysisEngine(IJavaProject project) throws IOException, CoreException {
|
||||
super();
|
||||
this.project = project;
|
||||
this.workspaceRootPath = ResourcesPlugin.getWorkspace().getRoot().getLocation();
|
||||
assert project != null;
|
||||
assert workspaceRootPath != null;
|
||||
this.ePath = createProjectPath(project);
|
||||
// setCallGraphBuilderFactory(new ZeroCFABuilderFactory());
|
||||
}
|
||||
|
||||
protected EclipseProjectPath createProjectPath(IJavaProject project) throws IOException, CoreException {
|
||||
return EclipseProjectPath.make(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildAnalysisScope() throws IOException {
|
||||
super.scope = ePath.toAnalysisScope(new File(getExclusionsFile()));
|
||||
}
|
||||
|
||||
public EclipseProjectPath getEclipseProjectPath() {
|
||||
return ePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CallGraphBuilder getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache) {
|
||||
return new ZeroCFABuilderFactory().make(options, cache, cha, scope, false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
/******************************************************************************
|
||||
* 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.client.polyglot;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
|
||||
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
|
||||
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.PolyglotClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.BinaryDirectoryTreeModule;
|
||||
import com.ibm.wala.classLoader.ClassLoaderFactory;
|
||||
import com.ibm.wala.classLoader.Module;
|
||||
import com.ibm.wala.classLoader.SourceDirectoryTreeModule;
|
||||
import com.ibm.wala.core.plugin.CorePlugin;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath;
|
||||
import com.ibm.wala.ide.util.EclipseProjectPath.Loader;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisCache;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisOptions;
|
||||
import com.ibm.wala.ipa.callgraph.AnalysisScope;
|
||||
import com.ibm.wala.ipa.callgraph.Entrypoint;
|
||||
import com.ibm.wala.ipa.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.callgraph.impl.Util;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchy;
|
||||
import com.ibm.wala.ipa.cha.ClassHierarchyException;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.ssa.SSAOptions;
|
||||
import com.ibm.wala.ssa.SymbolTable;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
import com.ibm.wala.util.config.FileOfClasses;
|
||||
import com.ibm.wala.util.debug.Assertions;
|
||||
import com.ibm.wala.util.io.FileProvider;
|
||||
|
||||
/**
|
||||
* An {@link EclipseProjectAnalysisEngine} specialized for source code analysis with CAst
|
||||
*/
|
||||
public class EclipseProjectSourceAnalysisEngine extends EclipseProjectAnalysisEngine {
|
||||
|
||||
public static final String defaultFileExt = "java";
|
||||
|
||||
/**
|
||||
* file extension for source files in this Eclipse project
|
||||
*/
|
||||
final String fileExt;
|
||||
|
||||
public EclipseProjectSourceAnalysisEngine(IJavaProject project) throws IOException, CoreException {
|
||||
this(project, defaultFileExt);
|
||||
}
|
||||
|
||||
public EclipseProjectSourceAnalysisEngine(IJavaProject project, String fileExt) throws IOException, CoreException {
|
||||
super(project);
|
||||
this.fileExt = fileExt;
|
||||
try {
|
||||
setExclusionsFile(FileProvider.getFileFromPlugin(CorePlugin.getDefault(), "J2SEClassHierarchyExclusions.txt")
|
||||
.getAbsolutePath());
|
||||
} catch (IOException e) {
|
||||
Assertions.UNREACHABLE("Cannot find exclusions file");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnalysisCache makeDefaultCache() {
|
||||
return new AnalysisCache(AstIRFactory.makeDefaultFactory());
|
||||
}
|
||||
|
||||
protected AnalysisScope makeSourceAnalysisScope() {
|
||||
return new JavaSourceAnalysisScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildAnalysisScope() {
|
||||
try {
|
||||
scope = makeSourceAnalysisScope();
|
||||
if (getExclusionsFile() != null) {
|
||||
scope.setExclusions(FileOfClasses.createFileOfClasses(new File(getExclusionsFile())));
|
||||
}
|
||||
EclipseProjectPath epath = getEclipseProjectPath();
|
||||
|
||||
for (Module m : epath.getModules(Loader.PRIMORDIAL, true)) {
|
||||
scope.addToScope(scope.getPrimordialLoader(), m);
|
||||
}
|
||||
ClassLoaderReference app = scope.getApplicationLoader();
|
||||
ClassLoaderReference src = ((JavaSourceAnalysisScope) scope).getSourceLoader();
|
||||
for (Module m : epath.getModules(Loader.APPLICATION, true)) {
|
||||
if (m instanceof SourceDirectoryTreeModule) {
|
||||
scope.addToScope(src, m);
|
||||
} else {
|
||||
scope.addToScope(app, m);
|
||||
}
|
||||
}
|
||||
for (Module m : epath.getModules(Loader.EXTENSION, true)) {
|
||||
if (!(m instanceof BinaryDirectoryTreeModule))
|
||||
scope.addToScope(app, m);
|
||||
}
|
||||
/*
|
||||
* ClassLoaderReference src = ((JavaSourceAnalysisScope)scope).getSourceLoader(); for (Module m :
|
||||
* epath.getModules(Loader.APPLICATION, false)) { scope.addToScope(src, m); }
|
||||
*/
|
||||
|
||||
} catch (IOException e) {
|
||||
Assertions.UNREACHABLE(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public IRTranslatorExtension getTranslatorExtension() {
|
||||
return new JavaIRTranslatorExtension();
|
||||
}
|
||||
|
||||
protected ClassLoaderFactory getClassLoaderFactory(SetOfClasses exclusions, IRTranslatorExtension extInfo) {
|
||||
return new PolyglotClassLoaderFactory(exclusions, extInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassHierarchy buildClassHierarchy() {
|
||||
IClassHierarchy cha = null;
|
||||
ClassLoaderFactory factory = getClassLoaderFactory(scope.getExclusions(), getTranslatorExtension());
|
||||
|
||||
try {
|
||||
cha = ClassHierarchy.make(getScope(), factory);
|
||||
} catch (ClassHierarchyException e) {
|
||||
System.err.println("Class Hierarchy construction failed");
|
||||
System.err.println(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return cha;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE, cha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnalysisOptions getDefaultOptions(Iterable<Entrypoint> entrypoints) {
|
||||
AnalysisOptions options = new AnalysisOptions(getScope(), entrypoints);
|
||||
|
||||
SSAOptions ssaOptions = new SSAOptions();
|
||||
ssaOptions.setDefaultValues(new SSAOptions.DefaultValues() {
|
||||
public int getDefaultValue(SymbolTable symtab, int valueNumber) {
|
||||
return symtab.getDefaultValue(valueNumber);
|
||||
}
|
||||
});
|
||||
|
||||
options.setSSAOptions(ssaOptions);
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.ibm.wala.cast.java.polyglot;
|
||||
|
||||
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";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,204 @@
|
|||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/******************************************************************************
|
||||
* 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()) {
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
||||
public String name() {
|
||||
return "<WALA IR goal for " + job.source().path() + ">";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/******************************************************************************
|
||||
* 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.impl.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();
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/******************************************************************************
|
||||
* 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.impl.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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void setSourceLoader(PolyglotSourceLoaderImpl sourceLoader) {
|
||||
fSourceLoader= sourceLoader;
|
||||
fMapper= new PolyglotIdentityMapper(sourceLoader.getReference());
|
||||
}
|
||||
|
||||
public PolyglotIdentityMapper getIdentityMapper() {
|
||||
return fMapper;
|
||||
}
|
||||
|
||||
public void setCAstRewriterFactory(CAstRewriterFactory<?,?> factory) {
|
||||
rewriterFactory = factory;
|
||||
}
|
||||
|
||||
public CAstRewriterFactory<?,?> getCAstRewriterFactory() {
|
||||
return rewriterFactory;
|
||||
}
|
||||
|
||||
public boolean getReplicateForDoLoops() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/******************************************************************************
|
||||
* 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 com.ibm.wala.classLoader.SourceModule;
|
||||
|
||||
import polyglot.frontend.FileSource;
|
||||
import polyglot.frontend.Resource;
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
public File file() {
|
||||
return new File(module.getURL().getFile());
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return module.getInputStream();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/******************************************************************************
|
||||
* 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.callgraph.impl.SetOfClasses;
|
||||
import com.ibm.wala.ipa.cha.IClassHierarchy;
|
||||
import com.ibm.wala.types.ClassLoaderReference;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,229 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
public FieldReference getFieldRef(FieldInstance field) {
|
||||
if (!fFieldMap.containsKey(field)) {
|
||||
FieldReference ref= referenceForField(field);
|
||||
fFieldMap.put(field, ref);
|
||||
return ref;
|
||||
}
|
||||
return fFieldMap.get(field);
|
||||
}
|
||||
|
||||
public TypeReference getTypeRef(Type type) {
|
||||
if (!fTypeMap.containsKey(type)) {
|
||||
TypeReference ref= referenceForType(type);
|
||||
fTypeMap.put(type, ref);
|
||||
return ref;
|
||||
}
|
||||
return fTypeMap.get(type);
|
||||
}
|
||||
|
||||
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= (CodeInstance) 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('.', '$');
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue