diff --git a/.github/workflows/comparison-results.yml b/.github/workflows/comparison-results.yml new file mode 100644 index 000000000000..9fa880b33c9b --- /dev/null +++ b/.github/workflows/comparison-results.yml @@ -0,0 +1,149 @@ +name: Monitoring Stability and Comparing Results + +# Triggers when a pull_request is created +on: + pull_request_target: + branches: + - "**" + +jobs: + start_workflow: + runs-on: ubuntu-latest + steps: + - name: Send message to slack + id: initial-message + uses: archive/github-actions-slack@master + with: + slack-optional-parse: full + slack-bot-user-oauth-access-token: ${{ secrets.SLACK_TOKEN }} + slack-channel: ${{ secrets.SLACK_CHANNEL_ID }} + slack-text: "Comparison workflow started for ${{github.event.pull_request.html_url}}" + + - name: Save output to env + id: save-output + run: echo "INIT_MSG_TS=${{ fromJson(steps.initial-message.outputs.slack-result).response.message.ts }}" >> $GITHUB_OUTPUT + outputs: + init_message_ts: ${{steps.save-output.outputs.INIT_MSG_TS}} + setup_and_scan: + needs: start_workflow + strategy: + matrix: + language: ['java-1', 'java-2' ,'python', 'js', 'ruby-1', 'ruby-2', 'go', 'kotlin'] + continue-on-error: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install JDK-18 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '18' + + - name: Export Java Home Path + run: export PATH=$JAVA_HOME/bin:$PATH + + - name: Install sbt + run: mkdir -p ~/bin && curl -Ls https://raw.githubusercontent.com/dwijnand/sbt-extras/master/sbt > ~/bin/sbt && chmod 0755 ~/bin/sbt + - name: Install Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Clone standalone-monitoring-stability/main + uses: actions/checkout@v3 + with: + repository: Privado-Inc/standalone-monitoring-stability + path: ./temp/standalone-monitoring-stability + ref: custom-joern-build + + # langauge specific repository file + - name: Run the script for ${{github.head_ref}} and ${{github.base_ref}} + run: export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} && cd ./temp/standalone-monitoring-stability && pip install -r requirements.txt && python3 ./run.py -r ./repos/${{matrix.language}}.txt -b main -h main -guf --custom-joern True --custom-joern-base-branch ${{ github.base_ref }} --custom-joern-head-branch ${{ github.head_ref }} + + - name: Run aws-export + run: cd ./temp/standalone-monitoring-stability/ && python3 aws-export.py ${{matrix.language}}-${{github.event.number}} + + - name: Move results to a folder + run: cd ./temp/standalone-monitoring-stability/ && mkdir results && mv output-${{matrix.language}}-${{github.event.number}}.xlsx ./results/output-${{matrix.language}}-${{github.event.number}}.xlsx && mv ./temp/result-${{matrix.language}}-${{github.event.number}}.zip ./results/result-${{matrix.language}}-${{github.event.number}}.zip && mv slack_summary.txt ./results/slack_summary.txt + + # Zip the results by name + - name: Zip the results + run: cd /home/runner/work/joern/joern/temp/standalone-monitoring-stability && zip result-${{matrix.language}}-${{github.event.number}}.zip -r ./results + + - name: Set summary variable + run: | + echo "MESSAGE<> $GITHUB_ENV + echo "$(cat /home/runner/work/joern/joern/temp/standalone-monitoring-stability/results/slack_summary.txt)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Post results to slack + uses: adrey/slack-file-upload-action@master + with: + thread_ts: ${{needs.start_workflow.outputs.init_message_ts}} + channel: ${{ secrets.SLACK_CHANNEL_ID }} # check + path: "/home/runner/work/joern/joern/temp/standalone-monitoring-stability/result-${{matrix.language}}-${{github.event.number}}.zip" + initial_comment: "Comparison Results generated on ${{github.event.repository.name}} by PR ${{github.event.number}} from branch ${{github.head_ref}} to ${{github.base_ref}} \nPR link ${{github.event.pull_request.html_url}}\n Language: ${{matrix.language}} \nSummary Report:\n ${{ env.MESSAGE }}" + filetype: "zip" + token: ${{ secrets.SLACK_TOKEN }} + + - name: Export workflow output + run: cd ./temp/standalone-monitoring-stability && python3 ./workflow_check.py /home/runner/work/joern/joern/temp/standalone-monitoring-stability/results/slack_summary.txt + + - name: Set summary variable + run: | + echo "MESSAGE<> $GITHUB_ENV + echo "$(cat ./temp/standalone-monitoring-stability/action_result.txt)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Print action result + run: cat ./temp/standalone-monitoring-stability/action_result.txt + + - name: Upload summary file + uses: actions/upload-artifact@master + with: + name: ${{matrix.language}} + path: /home/runner/work/joern/joern/temp/standalone-monitoring-stability/results/slack_summary.txt + + - name: Workflow report analysis + if: ${{ env.MESSAGE != 'true' }} + run: exit 1 + + collate_summary: + needs: [start_workflow, setup_and_scan] + runs-on: ubuntu-latest + steps: + - name: Download summary file + uses: actions/download-artifact@master + with: + path: ./language_summary + + - name: Install Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Clone standalone-monitoring-stability/flow-test + uses: actions/checkout@v3 + with: + repository: Privado-Inc/standalone-monitoring-stability + path: ./temp/standalone-monitoring-stability + ref: main + + - name: Collate summary + run: cd ./temp/standalone-monitoring-stability && pip install -r requirements.txt && python3 ./collate_summary.py -s /home/runner/work/joern/joern/language_summary + + - name: Set summary variable + run: | + echo "MESSAGE<> $GITHUB_ENV + echo "$(cat /home/runner/work/joern/joern/temp/standalone-monitoring-stability/global_summary.txt)" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Send summary to slack + uses: slackapi/slack-github-action@v1.24.0 + with: + update-ts: ${{needs.start_workflow.outputs.init_message_ts}} + channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + slack-message: "\nComparison Results generated on ${{github.event.repository.name}} by PR ${{github.event.number}} from branch ${{github.head_ref}} to ${{github.base_ref}} \nPR link ${{github.event.pull_request.html_url}}\nLanguage: All \nSummary Report:\n ${{ env.MESSAGE }}" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }} + diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c006c4c434ae..f80104f01956 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -107,7 +107,10 @@ jobs: ./joern --src /tmp/foo --run scan ./joern-scan /tmp/foo ./joern-scan --dump - ./joern-slice data-flow -o target/slice + - run: | + mkdir /tmp/slice + ./joern-slice data-flow tests/code/javasrc/SliceTest.java -o /tmp/slice/dataflow-slice-javasrc.json + ./joern --script "./test-dataflow-slice.sc" --param sliceFile=/tmp/slice/dataflow-slice-javasrc.json | grep -q 'List(boolean b, b, this, s, "MALICIOUS", s, new Foo("MALICIOUS"), s, s, "SAFE", s, b, this, this, b, s, System.out)' - run: | cd joern-cli/target/universal/stage export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} && ./schema-extender/test.sh diff --git a/.gitignore b/.gitignore index 49324d538645..8f72cc50071b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,6 @@ null **/SwiftAstGen-mac **/SwiftAstGen-linux **/php2cpg/bin -**/c2cpg/lib /foo.c /woo.c /cpg_*.bin.zip diff --git a/Dockerfile b/Dockerfile index 9c82db69dc19..72207da3ea3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM alpine:3.17.3 +FROM alpine:3.20 # dependencies RUN apk update && apk upgrade && apk add --no-cache openjdk17-jdk python3 git curl gnupg bash nss ncurses php RUN ln -sf python3 /usr/bin/python # sbt -ENV SBT_VERSION 1.8.0 +ENV SBT_VERSION 1.10.0 ENV SBT_HOME /usr/local/sbt ENV PATH ${PATH}:${SBT_HOME}/bin RUN curl -sL "https://github.com/sbt/sbt/releases/download/v$SBT_VERSION/sbt-$SBT_VERSION.tgz" | gunzip | tar -x -C /usr/local diff --git a/README.md b/README.md index b721678413eb..77627b4192af 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Specification: https://cpg.joern.io ## News / Changelog +- Joern v4.0.0 [migrates from overflowdb to flatgraph](changelog/4.0.0-flatgraph.md) - Joern v2.0.0 [upgrades from Scala2 to Scala3](changelog/2.0.0-scala3.md) - Joern v1.2.0 removes the `overflowdb.traversal.Traversal` class. This change is not completely backwards compatible. See [here](changelog/traversal_removal.md) for a detailed writeup. @@ -125,19 +126,3 @@ sbt stage ``` The last command prints all available queries - add your own in querydb, run the above commands again to see that your query got deployed. More details in the [separate querydb readme](querydb/README.md) - -## Benchmarks - -Various static analysis benchmarks that measure Joern are contained under the `benchmarks`. The benchmarks are -implemented in ScalaTest and can be run using the `joern-benchmarks` script. The benchmark results can be found on -the `benchmarks` subproject's `README`. The currently implemented benchmarks along with the language frontends tested -are: - -* [Securibench Micro](http://too4words.github.io/securibench-micro/) [`javasrc2cpg`, `jimple2cpg`] -* [IFSpec](https://link.springer.com/chapter/10.1007/978-3-030-03638-6_27) ([paper](https://pp.ipd.kit.edu/uploads/publikationen/ifspec18nordsec.pdf)) [`javasrc2cpg`, `jimple2cpg`] -* [JInfoFlow](https://github.com/plast-lab/JInfoFlow-bench) ([paper](https://yanniss.github.io/ptaint-oopsla17-prelim.pdf)) [`javasrc2cpg`, `jimple2cpg`] - -For more instructions on how to run benchmarks individually head over to the `benchmarks` subproject. If you would -like the benchmark results to be written to a file instead of printed to STDOUT, set the path to the environment -variable `JOERN_BENCHMARK_RESULT_FILE`. - diff --git a/benchmarks/.gitignore b/benchmarks/.gitignore deleted file mode 100644 index 314f02b1bc59..000000000000 --- a/benchmarks/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.txt \ No newline at end of file diff --git a/benchmarks/README.md b/benchmarks/README.md deleted file mode 100644 index 5bed1064c873..000000000000 --- a/benchmarks/README.md +++ /dev/null @@ -1,112 +0,0 @@ - -### Securibench Micro - -Securibench Micro is a series of small test cases designed to exercise different parts of a static security analyzer. -Securibench Micro may be used to compare the effectiveness of runtime techniques such as penetration testing tools. - -* Java source: `sbt "benchmarks / testOnly *.securibench.micro.java.*"` -* JVM bytecode: `sbt "benchmarks / testOnly *.securibench.micro.jvm.*"` - -#### Java Source Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Aliasing | 14 | 1 | 4 | 1 | 8 | -| Arrays | 15 | 1 | 7 | 5 | 2 | -| Basic | 67 | 0 | 59 | 6 | 2 | -| Collections | 22 | 6 | 14 | 2 | 0 | -| Data Structures | 8 | 1 | 2 | 2 | 3 | -| Factories | 6 | 0 | 3 | 3 | 0 | -| Inter-procedural | 25 | 0 | 12 | 10 | 3 | -| Predicates | 9 | 4 | 5 | 0 | 0 | -| Reflection | 4 | 1 | 2 | 0 | 1 | -| Sanitizers | 9 | 3 | 2 | 2 | 2 | -| Session | 4 | 1 | 3 | 0 | 0 | -| Strong Updates | 5 | 0 | 0 | 4 | 1 | -| *Total* | *188* | *18* | *113* | *35* | *22* | - -Total accuracy: 78,723% -#### JVM Bytecode Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Aliasing | 14 | 1 | 10 | 1 | 2 | -| Arrays | 15 | 2 | 7 | 4 | 2 | -| Basic | 67 | 0 | 59 | 6 | 2 | -| Collections | 22 | 7 | 14 | 1 | 0 | -| Data Structures | 8 | 2 | 3 | 1 | 2 | -| Factories | 6 | 0 | 3 | 3 | 0 | -| Inter-procedural | 25 | 0 | 8 | 10 | 7 | -| Predicates | 9 | 3 | 5 | 1 | 0 | -| Reflection | 4 | 1 | 2 | 0 | 1 | -| Sanitizers | 9 | 3 | 2 | 2 | 2 | -| Session | 4 | 1 | 3 | 0 | 0 | -| Strong Updates | 5 | 0 | 0 | 4 | 1 | -| *Total* | *188* | *20* | *116* | *33* | *19* | - -Total accuracy: 79,255% - -### IFSpec - -IFSpec contains a diverse set of information flow benchmarks for Java programs. - -* Java source: `sbt "benchmarks / testOnly *.ifspec.java.*"` -* JVM bytecode: `sbt "benchmarks / testOnly *.ifspec.jvm.*"` - -#### Java Source Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Aliasing | 11 | 0 | 0 | 6 | 5 | -| Arrays | 12 | 2 | 1 | 5 | 4 | -| Casting | 2 | 1 | 0 | 0 | 1 | -| Class Initializer | 7 | 2 | 2 | 2 | 1 | -| High Conditional | 12 | 5 | 4 | 2 | 1 | -| Implicit Flows | 32 | 10 | 11 | 5 | 6 | -| Exceptions | 9 | 2 | 4 | 1 | 2 | -| Explicit Flows | 41 | 13 | 10 | 12 | 6 | -| Library | 7 | 2 | 4 | 0 | 1 | -| Simple | 18 | 9 | 6 | 3 | 0 | -| *Total* | *73* | *23* | *21* | *17* | *12* | - -Total accuracy: 52,055% -#### JVM Bytecode Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Aliasing | 11 | 0 | 0 | 6 | 5 | -| Arrays | 12 | 2 | 1 | 5 | 4 | -| Casting | 2 | 1 | 1 | 0 | 0 | -| Class Initializer | 7 | 2 | 2 | 2 | 1 | -| High Conditional | 12 | 5 | 4 | 2 | 1 | -| Implicit Flows | 32 | 10 | 12 | 5 | 5 | -| Exceptions | 9 | 2 | 5 | 1 | 1 | -| Explicit Flows | 41 | 12 | 10 | 13 | 6 | -| Library | 7 | 2 | 4 | 0 | 1 | -| Simple | 18 | 8 | 6 | 4 | 0 | -| *Total* | *73* | *22* | *22* | *18* | *11* | - -Total accuracy: 54,795% - -### JInfoFlow - -JInfoFlow-bench is a taint analysis benchmark suite containing 12 plain Java benchmarks exercising reflection, -event-driven architecture, and popular software engineering patterns. - -* Java source: `sbt "benchmarks / testOnly *.jinfoflow.java.*"` -* JVM bytecode: `sbt "benchmarks / testOnly *.jinfoflow.jvm.*"` - -#### Java Source Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Basic | 4 | 0 | 1 | 2 | 1 | -| Context | 8 | 2 | 1 | 1 | 4 | -| Event | 8 | 0 | 0 | 3 | 5 | -| *Total* | *20* | *2* | *2* | *6* | *10* | - -Total accuracy: 40,000% -#### JVM Bytecode Results -| Category | # | FP | TP | TN | FN | -| ------------------ | ---- | ---- | ---- | ---- | ---- | -| Basic | 4 | 0 | 1 | 2 | 1 | -| Context | 8 | 2 | 2 | 1 | 3 | -| Event | 8 | 0 | 0 | 3 | 5 | -| *Total* | *20* | *2* | *3* | *6* | *9* | - -Total accuracy: 45,000% diff --git a/benchmarks/build.sbt b/benchmarks/build.sbt deleted file mode 100644 index dccc5402fa99..000000000000 --- a/benchmarks/build.sbt +++ /dev/null @@ -1,24 +0,0 @@ -name := "benchmarks" - -dependsOn(Projects.dataflowengineoss) -dependsOn(Projects.semanticcpg) -dependsOn(Projects.console) -dependsOn(Projects.x2cpg) -dependsOn(Projects.joerncli) -dependsOn(Projects.javasrc2cpg) -dependsOn(Projects.jimple2cpg) - -libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % Versions.scalatest % Test) - -Compile / doc / sources ~= (_ filter (_ => false)) - -trapExit := false -Test / fork := true - -credentials += - Credentials( - "GitHub Package Registry", - "maven.pkg.github.com", - "Privado-Inc", - sys.env.getOrElse("GITHUB_TOKEN", "N/A") - ) diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1$A.class deleted file mode 100644 index acca0b301a5a..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.class deleted file mode 100644 index 31719cc3c602..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.java deleted file mode 100644 index d333fd75ec62..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing1.java +++ /dev/null @@ -1,23 +0,0 @@ -class Aliasing1 { - - static class A { - int val; - - A(int val) { - this.val = val; - } - } - - static private int secret = 42; - - public static void main(String[] args) { - A a = new A(1); - A b = a; - - if (secret == 42) { - a.val = 2; - } - - System.out.println(b.val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10$A.class deleted file mode 100644 index 116f559d6fb9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.class deleted file mode 100644 index 4647a65b256d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.java deleted file mode 100755 index f8648d7a6a8d..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing10.java +++ /dev/null @@ -1,5580 +0,0 @@ -class Aliasing10 { - public static class A { - private boolean x; - - public A(boolean x) { - this.x = x; - } - - public boolean get() { - return (this.x); - } - } - - public static boolean foo(boolean h) { - A a1 = new A(h); - A a2 = new A(true); - - A a3 = new A(a1.get()); - A a4 = new A(a2.get()); - - A a5 = new A(a3.get()); - A a6 = new A(a4.get()); - - A a7 = new A(a5.get()); - A a8 = new A(a6.get()); - - A a9 = new A(a7.get()); - A a10 = new A(a8.get()); - - A a11 = new A(a9.get()); - A a12 = new A(a10.get()); - - A a13 = new A(a11.get()); - A a14 = new A(a12.get()); - - A a15 = new A(a13.get()); - A a16 = new A(a14.get()); - - A a17 = new A(a15.get()); - A a18 = new A(a16.get()); - - A a19 = new A(a17.get()); - A a20 = new A(a18.get()); - - A a21 = new A(a19.get()); - A a22 = new A(a20.get()); - - A a23 = new A(a21.get()); - A a24 = new A(a22.get()); - - A a25 = new A(a23.get()); - A a26 = new A(a24.get()); - - A a27 = new A(a25.get()); - A a28 = new A(a26.get()); - - A a29 = new A(a27.get()); - A a30 = new A(a28.get()); - - A a31 = new A(a29.get()); - A a32 = new A(a30.get()); - - A a33 = new A(a31.get()); - A a34 = new A(a32.get()); - - A a35 = new A(a33.get()); - A a36 = new A(a34.get()); - - A a37 = new A(a35.get()); - A a38 = new A(a36.get()); - - A a39 = new A(a37.get()); - A a40 = new A(a38.get()); - - A a41 = new A(a39.get()); - A a42 = new A(a40.get()); - - A a43 = new A(a41.get()); - A a44 = new A(a42.get()); - - A a45 = new A(a43.get()); - A a46 = new A(a44.get()); - - A a47 = new A(a45.get()); - A a48 = new A(a46.get()); - - A a49 = new A(a47.get()); - A a50 = new A(a48.get()); - - A a51 = new A(a49.get()); - A a52 = new A(a50.get()); - - A a53 = new A(a51.get()); - A a54 = new A(a52.get()); - - A a55 = new A(a53.get()); - A a56 = new A(a54.get()); - - A a57 = new A(a55.get()); - A a58 = new A(a56.get()); - - A a59 = new A(a57.get()); - A a60 = new A(a58.get()); - - A a61 = new A(a59.get()); - A a62 = new A(a60.get()); - - A a63 = new A(a61.get()); - A a64 = new A(a62.get()); - - A a65 = new A(a63.get()); - A a66 = new A(a64.get()); - - A a67 = new A(a65.get()); - A a68 = new A(a66.get()); - - A a69 = new A(a67.get()); - A a70 = new A(a68.get()); - - A a71 = new A(a69.get()); - A a72 = new A(a70.get()); - - A a73 = new A(a71.get()); - A a74 = new A(a72.get()); - - A a75 = new A(a73.get()); - A a76 = new A(a74.get()); - - A a77 = new A(a75.get()); - A a78 = new A(a76.get()); - - A a79 = new A(a77.get()); - A a80 = new A(a78.get()); - - A a81 = new A(a79.get()); - A a82 = new A(a80.get()); - - A a83 = new A(a81.get()); - A a84 = new A(a82.get()); - - A a85 = new A(a83.get()); - A a86 = new A(a84.get()); - - A a87 = new A(a85.get()); - A a88 = new A(a86.get()); - - A a89 = new A(a87.get()); - A a90 = new A(a88.get()); - - A a91 = new A(a89.get()); - A a92 = new A(a90.get()); - - A a93 = new A(a91.get()); - A a94 = new A(a92.get()); - - A a95 = new A(a93.get()); - A a96 = new A(a94.get()); - - A a97 = new A(a95.get()); - A a98 = new A(a96.get()); - - A a99 = new A(a97.get()); - A a100 = new A(a98.get()); - - A a101 = new A(a99.get()); - A a102 = new A(a100.get()); - - A a103 = new A(a101.get()); - A a104 = new A(a102.get()); - - A a105 = new A(a103.get()); - A a106 = new A(a104.get()); - - A a107 = new A(a105.get()); - A a108 = new A(a106.get()); - - A a109 = new A(a107.get()); - A a110 = new A(a108.get()); - - A a111 = new A(a109.get()); - A a112 = new A(a110.get()); - - A a113 = new A(a111.get()); - A a114 = new A(a112.get()); - - A a115 = new A(a113.get()); - A a116 = new A(a114.get()); - - A a117 = new A(a115.get()); - A a118 = new A(a116.get()); - - A a119 = new A(a117.get()); - A a120 = new A(a118.get()); - - A a121 = new A(a119.get()); - A a122 = new A(a120.get()); - - A a123 = new A(a121.get()); - A a124 = new A(a122.get()); - - A a125 = new A(a123.get()); - A a126 = new A(a124.get()); - - A a127 = new A(a125.get()); - A a128 = new A(a126.get()); - - A a129 = new A(a127.get()); - A a130 = new A(a128.get()); - - A a131 = new A(a129.get()); - A a132 = new A(a130.get()); - - A a133 = new A(a131.get()); - A a134 = new A(a132.get()); - - A a135 = new A(a133.get()); - A a136 = new A(a134.get()); - - A a137 = new A(a135.get()); - A a138 = new A(a136.get()); - - A a139 = new A(a137.get()); - A a140 = new A(a138.get()); - - A a141 = new A(a139.get()); - A a142 = new A(a140.get()); - - A a143 = new A(a141.get()); - A a144 = new A(a142.get()); - - A a145 = new A(a143.get()); - A a146 = new A(a144.get()); - - A a147 = new A(a145.get()); - A a148 = new A(a146.get()); - - A a149 = new A(a147.get()); - A a150 = new A(a148.get()); - - A a151 = new A(a149.get()); - A a152 = new A(a150.get()); - - A a153 = new A(a151.get()); - A a154 = new A(a152.get()); - - A a155 = new A(a153.get()); - A a156 = new A(a154.get()); - - A a157 = new A(a155.get()); - A a158 = new A(a156.get()); - - A a159 = new A(a157.get()); - A a160 = new A(a158.get()); - - A a161 = new A(a159.get()); - A a162 = new A(a160.get()); - - A a163 = new A(a161.get()); - A a164 = new A(a162.get()); - - A a165 = new A(a163.get()); - A a166 = new A(a164.get()); - - A a167 = new A(a165.get()); - A a168 = new A(a166.get()); - - A a169 = new A(a167.get()); - A a170 = new A(a168.get()); - - A a171 = new A(a169.get()); - A a172 = new A(a170.get()); - - A a173 = new A(a171.get()); - A a174 = new A(a172.get()); - - A a175 = new A(a173.get()); - A a176 = new A(a174.get()); - - A a177 = new A(a175.get()); - A a178 = new A(a176.get()); - - A a179 = new A(a177.get()); - A a180 = new A(a178.get()); - - A a181 = new A(a179.get()); - A a182 = new A(a180.get()); - - A a183 = new A(a181.get()); - A a184 = new A(a182.get()); - - A a185 = new A(a183.get()); - A a186 = new A(a184.get()); - - A a187 = new A(a185.get()); - A a188 = new A(a186.get()); - - A a189 = new A(a187.get()); - A a190 = new A(a188.get()); - - A a191 = new A(a189.get()); - A a192 = new A(a190.get()); - - A a193 = new A(a191.get()); - A a194 = new A(a192.get()); - - A a195 = new A(a193.get()); - A a196 = new A(a194.get()); - - A a197 = new A(a195.get()); - A a198 = new A(a196.get()); - - A a199 = new A(a197.get()); - A a200 = new A(a198.get()); - - A a201 = new A(a199.get()); - A a202 = new A(a200.get()); - - A a203 = new A(a201.get()); - A a204 = new A(a202.get()); - - A a205 = new A(a203.get()); - A a206 = new A(a204.get()); - - A a207 = new A(a205.get()); - A a208 = new A(a206.get()); - - A a209 = new A(a207.get()); - A a210 = new A(a208.get()); - - A a211 = new A(a209.get()); - A a212 = new A(a210.get()); - - A a213 = new A(a211.get()); - A a214 = new A(a212.get()); - - A a215 = new A(a213.get()); - A a216 = new A(a214.get()); - - A a217 = new A(a215.get()); - A a218 = new A(a216.get()); - - A a219 = new A(a217.get()); - A a220 = new A(a218.get()); - - A a221 = new A(a219.get()); - A a222 = new A(a220.get()); - - A a223 = new A(a221.get()); - A a224 = new A(a222.get()); - - A a225 = new A(a223.get()); - A a226 = new A(a224.get()); - - A a227 = new A(a225.get()); - A a228 = new A(a226.get()); - - A a229 = new A(a227.get()); - A a230 = new A(a228.get()); - - A a231 = new A(a229.get()); - A a232 = new A(a230.get()); - - A a233 = new A(a231.get()); - A a234 = new A(a232.get()); - - A a235 = new A(a233.get()); - A a236 = new A(a234.get()); - - A a237 = new A(a235.get()); - A a238 = new A(a236.get()); - - A a239 = new A(a237.get()); - A a240 = new A(a238.get()); - - A a241 = new A(a239.get()); - A a242 = new A(a240.get()); - - A a243 = new A(a241.get()); - A a244 = new A(a242.get()); - - A a245 = new A(a243.get()); - A a246 = new A(a244.get()); - - A a247 = new A(a245.get()); - A a248 = new A(a246.get()); - - A a249 = new A(a247.get()); - A a250 = new A(a248.get()); - - A a251 = new A(a249.get()); - A a252 = new A(a250.get()); - - A a253 = new A(a251.get()); - A a254 = new A(a252.get()); - - A a255 = new A(a253.get()); - A a256 = new A(a254.get()); - - A a257 = new A(a255.get()); - A a258 = new A(a256.get()); - - A a259 = new A(a257.get()); - A a260 = new A(a258.get()); - - A a261 = new A(a259.get()); - A a262 = new A(a260.get()); - - A a263 = new A(a261.get()); - A a264 = new A(a262.get()); - - A a265 = new A(a263.get()); - A a266 = new A(a264.get()); - - A a267 = new A(a265.get()); - A a268 = new A(a266.get()); - - A a269 = new A(a267.get()); - A a270 = new A(a268.get()); - - A a271 = new A(a269.get()); - A a272 = new A(a270.get()); - - A a273 = new A(a271.get()); - A a274 = new A(a272.get()); - - A a275 = new A(a273.get()); - A a276 = new A(a274.get()); - - A a277 = new A(a275.get()); - A a278 = new A(a276.get()); - - A a279 = new A(a277.get()); - A a280 = new A(a278.get()); - - A a281 = new A(a279.get()); - A a282 = new A(a280.get()); - - A a283 = new A(a281.get()); - A a284 = new A(a282.get()); - - A a285 = new A(a283.get()); - A a286 = new A(a284.get()); - - A a287 = new A(a285.get()); - A a288 = new A(a286.get()); - - A a289 = new A(a287.get()); - A a290 = new A(a288.get()); - - A a291 = new A(a289.get()); - A a292 = new A(a290.get()); - - A a293 = new A(a291.get()); - A a294 = new A(a292.get()); - - A a295 = new A(a293.get()); - A a296 = new A(a294.get()); - - A a297 = new A(a295.get()); - A a298 = new A(a296.get()); - - A a299 = new A(a297.get()); - A a300 = new A(a298.get()); - - A a301 = new A(a299.get()); - A a302 = new A(a300.get()); - - A a303 = new A(a301.get()); - A a304 = new A(a302.get()); - - A a305 = new A(a303.get()); - A a306 = new A(a304.get()); - - A a307 = new A(a305.get()); - A a308 = new A(a306.get()); - - A a309 = new A(a307.get()); - A a310 = new A(a308.get()); - - A a311 = new A(a309.get()); - A a312 = new A(a310.get()); - - A a313 = new A(a311.get()); - A a314 = new A(a312.get()); - - A a315 = new A(a313.get()); - A a316 = new A(a314.get()); - - A a317 = new A(a315.get()); - A a318 = new A(a316.get()); - - A a319 = new A(a317.get()); - A a320 = new A(a318.get()); - - A a321 = new A(a319.get()); - A a322 = new A(a320.get()); - - A a323 = new A(a321.get()); - A a324 = new A(a322.get()); - - A a325 = new A(a323.get()); - A a326 = new A(a324.get()); - - A a327 = new A(a325.get()); - A a328 = new A(a326.get()); - - A a329 = new A(a327.get()); - A a330 = new A(a328.get()); - - A a331 = new A(a329.get()); - A a332 = new A(a330.get()); - - A a333 = new A(a331.get()); - A a334 = new A(a332.get()); - - A a335 = new A(a333.get()); - A a336 = new A(a334.get()); - - A a337 = new A(a335.get()); - A a338 = new A(a336.get()); - - A a339 = new A(a337.get()); - A a340 = new A(a338.get()); - - A a341 = new A(a339.get()); - A a342 = new A(a340.get()); - - A a343 = new A(a341.get()); - A a344 = new A(a342.get()); - - A a345 = new A(a343.get()); - A a346 = new A(a344.get()); - - A a347 = new A(a345.get()); - A a348 = new A(a346.get()); - - A a349 = new A(a347.get()); - A a350 = new A(a348.get()); - - A a351 = new A(a349.get()); - A a352 = new A(a350.get()); - - A a353 = new A(a351.get()); - A a354 = new A(a352.get()); - - A a355 = new A(a353.get()); - A a356 = new A(a354.get()); - - A a357 = new A(a355.get()); - A a358 = new A(a356.get()); - - A a359 = new A(a357.get()); - A a360 = new A(a358.get()); - - A a361 = new A(a359.get()); - A a362 = new A(a360.get()); - - A a363 = new A(a361.get()); - A a364 = new A(a362.get()); - - A a365 = new A(a363.get()); - A a366 = new A(a364.get()); - - A a367 = new A(a365.get()); - A a368 = new A(a366.get()); - - A a369 = new A(a367.get()); - A a370 = new A(a368.get()); - - A a371 = new A(a369.get()); - A a372 = new A(a370.get()); - - A a373 = new A(a371.get()); - A a374 = new A(a372.get()); - - A a375 = new A(a373.get()); - A a376 = new A(a374.get()); - - A a377 = new A(a375.get()); - A a378 = new A(a376.get()); - - A a379 = new A(a377.get()); - A a380 = new A(a378.get()); - - A a381 = new A(a379.get()); - A a382 = new A(a380.get()); - - A a383 = new A(a381.get()); - A a384 = new A(a382.get()); - - A a385 = new A(a383.get()); - A a386 = new A(a384.get()); - - A a387 = new A(a385.get()); - A a388 = new A(a386.get()); - - A a389 = new A(a387.get()); - A a390 = new A(a388.get()); - - A a391 = new A(a389.get()); - A a392 = new A(a390.get()); - - A a393 = new A(a391.get()); - A a394 = new A(a392.get()); - - A a395 = new A(a393.get()); - A a396 = new A(a394.get()); - - A a397 = new A(a395.get()); - A a398 = new A(a396.get()); - - A a399 = new A(a397.get()); - A a400 = new A(a398.get()); - - A a401 = new A(a399.get()); - A a402 = new A(a400.get()); - - A a403 = new A(a401.get()); - A a404 = new A(a402.get()); - - A a405 = new A(a403.get()); - A a406 = new A(a404.get()); - - A a407 = new A(a405.get()); - A a408 = new A(a406.get()); - - A a409 = new A(a407.get()); - A a410 = new A(a408.get()); - - A a411 = new A(a409.get()); - A a412 = new A(a410.get()); - - A a413 = new A(a411.get()); - A a414 = new A(a412.get()); - - A a415 = new A(a413.get()); - A a416 = new A(a414.get()); - - A a417 = new A(a415.get()); - A a418 = new A(a416.get()); - - A a419 = new A(a417.get()); - A a420 = new A(a418.get()); - - A a421 = new A(a419.get()); - A a422 = new A(a420.get()); - - A a423 = new A(a421.get()); - A a424 = new A(a422.get()); - - A a425 = new A(a423.get()); - A a426 = new A(a424.get()); - - A a427 = new A(a425.get()); - A a428 = new A(a426.get()); - - A a429 = new A(a427.get()); - A a430 = new A(a428.get()); - - A a431 = new A(a429.get()); - A a432 = new A(a430.get()); - - A a433 = new A(a431.get()); - A a434 = new A(a432.get()); - - A a435 = new A(a433.get()); - A a436 = new A(a434.get()); - - A a437 = new A(a435.get()); - A a438 = new A(a436.get()); - - A a439 = new A(a437.get()); - A a440 = new A(a438.get()); - - A a441 = new A(a439.get()); - A a442 = new A(a440.get()); - - A a443 = new A(a441.get()); - A a444 = new A(a442.get()); - - A a445 = new A(a443.get()); - A a446 = new A(a444.get()); - - A a447 = new A(a445.get()); - A a448 = new A(a446.get()); - - A a449 = new A(a447.get()); - A a450 = new A(a448.get()); - - A a451 = new A(a449.get()); - A a452 = new A(a450.get()); - - A a453 = new A(a451.get()); - A a454 = new A(a452.get()); - - A a455 = new A(a453.get()); - A a456 = new A(a454.get()); - - A a457 = new A(a455.get()); - A a458 = new A(a456.get()); - - A a459 = new A(a457.get()); - A a460 = new A(a458.get()); - - A a461 = new A(a459.get()); - A a462 = new A(a460.get()); - - A a463 = new A(a461.get()); - A a464 = new A(a462.get()); - - A a465 = new A(a463.get()); - A a466 = new A(a464.get()); - - A a467 = new A(a465.get()); - A a468 = new A(a466.get()); - - A a469 = new A(a467.get()); - A a470 = new A(a468.get()); - - A a471 = new A(a469.get()); - A a472 = new A(a470.get()); - - A a473 = new A(a471.get()); - A a474 = new A(a472.get()); - - A a475 = new A(a473.get()); - A a476 = new A(a474.get()); - - A a477 = new A(a475.get()); - A a478 = new A(a476.get()); - - A a479 = new A(a477.get()); - A a480 = new A(a478.get()); - - A a481 = new A(a479.get()); - A a482 = new A(a480.get()); - - A a483 = new A(a481.get()); - A a484 = new A(a482.get()); - - A a485 = new A(a483.get()); - A a486 = new A(a484.get()); - - A a487 = new A(a485.get()); - A a488 = new A(a486.get()); - - A a489 = new A(a487.get()); - A a490 = new A(a488.get()); - - A a491 = new A(a489.get()); - A a492 = new A(a490.get()); - - A a493 = new A(a491.get()); - A a494 = new A(a492.get()); - - A a495 = new A(a493.get()); - A a496 = new A(a494.get()); - - A a497 = new A(a495.get()); - A a498 = new A(a496.get()); - - A a499 = new A(a497.get()); - A a500 = new A(a498.get()); - - A a501 = new A(a499.get()); - A a502 = new A(a500.get()); - - A a503 = new A(a501.get()); - A a504 = new A(a502.get()); - - A a505 = new A(a503.get()); - A a506 = new A(a504.get()); - - A a507 = new A(a505.get()); - A a508 = new A(a506.get()); - - A a509 = new A(a507.get()); - A a510 = new A(a508.get()); - - A a511 = new A(a509.get()); - A a512 = new A(a510.get()); - - A a513 = new A(a511.get()); - A a514 = new A(a512.get()); - - A a515 = new A(a513.get()); - A a516 = new A(a514.get()); - - A a517 = new A(a515.get()); - A a518 = new A(a516.get()); - - A a519 = new A(a517.get()); - A a520 = new A(a518.get()); - - A a521 = new A(a519.get()); - A a522 = new A(a520.get()); - - A a523 = new A(a521.get()); - A a524 = new A(a522.get()); - - A a525 = new A(a523.get()); - A a526 = new A(a524.get()); - - A a527 = new A(a525.get()); - A a528 = new A(a526.get()); - - A a529 = new A(a527.get()); - A a530 = new A(a528.get()); - - A a531 = new A(a529.get()); - A a532 = new A(a530.get()); - - A a533 = new A(a531.get()); - A a534 = new A(a532.get()); - - A a535 = new A(a533.get()); - A a536 = new A(a534.get()); - - A a537 = new A(a535.get()); - A a538 = new A(a536.get()); - - A a539 = new A(a537.get()); - A a540 = new A(a538.get()); - - A a541 = new A(a539.get()); - A a542 = new A(a540.get()); - - A a543 = new A(a541.get()); - A a544 = new A(a542.get()); - - A a545 = new A(a543.get()); - A a546 = new A(a544.get()); - - A a547 = new A(a545.get()); - A a548 = new A(a546.get()); - - A a549 = new A(a547.get()); - A a550 = new A(a548.get()); - - A a551 = new A(a549.get()); - A a552 = new A(a550.get()); - - A a553 = new A(a551.get()); - A a554 = new A(a552.get()); - - A a555 = new A(a553.get()); - A a556 = new A(a554.get()); - - A a557 = new A(a555.get()); - A a558 = new A(a556.get()); - - A a559 = new A(a557.get()); - A a560 = new A(a558.get()); - - A a561 = new A(a559.get()); - A a562 = new A(a560.get()); - - A a563 = new A(a561.get()); - A a564 = new A(a562.get()); - - A a565 = new A(a563.get()); - A a566 = new A(a564.get()); - - A a567 = new A(a565.get()); - A a568 = new A(a566.get()); - - A a569 = new A(a567.get()); - A a570 = new A(a568.get()); - - A a571 = new A(a569.get()); - A a572 = new A(a570.get()); - - A a573 = new A(a571.get()); - A a574 = new A(a572.get()); - - A a575 = new A(a573.get()); - A a576 = new A(a574.get()); - - A a577 = new A(a575.get()); - A a578 = new A(a576.get()); - - A a579 = new A(a577.get()); - A a580 = new A(a578.get()); - - A a581 = new A(a579.get()); - A a582 = new A(a580.get()); - - A a583 = new A(a581.get()); - A a584 = new A(a582.get()); - - A a585 = new A(a583.get()); - A a586 = new A(a584.get()); - - A a587 = new A(a585.get()); - A a588 = new A(a586.get()); - - A a589 = new A(a587.get()); - A a590 = new A(a588.get()); - - A a591 = new A(a589.get()); - A a592 = new A(a590.get()); - - A a593 = new A(a591.get()); - A a594 = new A(a592.get()); - - A a595 = new A(a593.get()); - A a596 = new A(a594.get()); - - A a597 = new A(a595.get()); - A a598 = new A(a596.get()); - - A a599 = new A(a597.get()); - A a600 = new A(a598.get()); - - A a601 = new A(a599.get()); - A a602 = new A(a600.get()); - - A a603 = new A(a601.get()); - A a604 = new A(a602.get()); - - A a605 = new A(a603.get()); - A a606 = new A(a604.get()); - - A a607 = new A(a605.get()); - A a608 = new A(a606.get()); - - A a609 = new A(a607.get()); - A a610 = new A(a608.get()); - - A a611 = new A(a609.get()); - A a612 = new A(a610.get()); - - A a613 = new A(a611.get()); - A a614 = new A(a612.get()); - - A a615 = new A(a613.get()); - A a616 = new A(a614.get()); - - A a617 = new A(a615.get()); - A a618 = new A(a616.get()); - - A a619 = new A(a617.get()); - A a620 = new A(a618.get()); - - A a621 = new A(a619.get()); - A a622 = new A(a620.get()); - - A a623 = new A(a621.get()); - A a624 = new A(a622.get()); - - A a625 = new A(a623.get()); - A a626 = new A(a624.get()); - - A a627 = new A(a625.get()); - A a628 = new A(a626.get()); - - A a629 = new A(a627.get()); - A a630 = new A(a628.get()); - - A a631 = new A(a629.get()); - A a632 = new A(a630.get()); - - A a633 = new A(a631.get()); - A a634 = new A(a632.get()); - - A a635 = new A(a633.get()); - A a636 = new A(a634.get()); - - A a637 = new A(a635.get()); - A a638 = new A(a636.get()); - - A a639 = new A(a637.get()); - A a640 = new A(a638.get()); - - A a641 = new A(a639.get()); - A a642 = new A(a640.get()); - - A a643 = new A(a641.get()); - A a644 = new A(a642.get()); - - A a645 = new A(a643.get()); - A a646 = new A(a644.get()); - - A a647 = new A(a645.get()); - A a648 = new A(a646.get()); - - A a649 = new A(a647.get()); - A a650 = new A(a648.get()); - - A a651 = new A(a649.get()); - A a652 = new A(a650.get()); - - A a653 = new A(a651.get()); - A a654 = new A(a652.get()); - - A a655 = new A(a653.get()); - A a656 = new A(a654.get()); - - A a657 = new A(a655.get()); - A a658 = new A(a656.get()); - - A a659 = new A(a657.get()); - A a660 = new A(a658.get()); - - A a661 = new A(a659.get()); - A a662 = new A(a660.get()); - - A a663 = new A(a661.get()); - A a664 = new A(a662.get()); - - A a665 = new A(a663.get()); - A a666 = new A(a664.get()); - - A a667 = new A(a665.get()); - A a668 = new A(a666.get()); - - A a669 = new A(a667.get()); - A a670 = new A(a668.get()); - - A a671 = new A(a669.get()); - A a672 = new A(a670.get()); - - A a673 = new A(a671.get()); - A a674 = new A(a672.get()); - - A a675 = new A(a673.get()); - A a676 = new A(a674.get()); - - A a677 = new A(a675.get()); - A a678 = new A(a676.get()); - - A a679 = new A(a677.get()); - A a680 = new A(a678.get()); - - A a681 = new A(a679.get()); - A a682 = new A(a680.get()); - - A a683 = new A(a681.get()); - A a684 = new A(a682.get()); - - A a685 = new A(a683.get()); - A a686 = new A(a684.get()); - - A a687 = new A(a685.get()); - A a688 = new A(a686.get()); - - A a689 = new A(a687.get()); - A a690 = new A(a688.get()); - - A a691 = new A(a689.get()); - A a692 = new A(a690.get()); - - A a693 = new A(a691.get()); - A a694 = new A(a692.get()); - - A a695 = new A(a693.get()); - A a696 = new A(a694.get()); - - A a697 = new A(a695.get()); - A a698 = new A(a696.get()); - - A a699 = new A(a697.get()); - A a700 = new A(a698.get()); - - A a701 = new A(a699.get()); - A a702 = new A(a700.get()); - - A a703 = new A(a701.get()); - A a704 = new A(a702.get()); - - A a705 = new A(a703.get()); - A a706 = new A(a704.get()); - - A a707 = new A(a705.get()); - A a708 = new A(a706.get()); - - A a709 = new A(a707.get()); - A a710 = new A(a708.get()); - - A a711 = new A(a709.get()); - A a712 = new A(a710.get()); - - A a713 = new A(a711.get()); - A a714 = new A(a712.get()); - - A a715 = new A(a713.get()); - A a716 = new A(a714.get()); - - A a717 = new A(a715.get()); - A a718 = new A(a716.get()); - - A a719 = new A(a717.get()); - A a720 = new A(a718.get()); - - A a721 = new A(a719.get()); - A a722 = new A(a720.get()); - - A a723 = new A(a721.get()); - A a724 = new A(a722.get()); - - A a725 = new A(a723.get()); - A a726 = new A(a724.get()); - - A a727 = new A(a725.get()); - A a728 = new A(a726.get()); - - A a729 = new A(a727.get()); - A a730 = new A(a728.get()); - - A a731 = new A(a729.get()); - A a732 = new A(a730.get()); - - A a733 = new A(a731.get()); - A a734 = new A(a732.get()); - - A a735 = new A(a733.get()); - A a736 = new A(a734.get()); - - A a737 = new A(a735.get()); - A a738 = new A(a736.get()); - - A a739 = new A(a737.get()); - A a740 = new A(a738.get()); - - A a741 = new A(a739.get()); - A a742 = new A(a740.get()); - - A a743 = new A(a741.get()); - A a744 = new A(a742.get()); - - A a745 = new A(a743.get()); - A a746 = new A(a744.get()); - - A a747 = new A(a745.get()); - A a748 = new A(a746.get()); - - A a749 = new A(a747.get()); - A a750 = new A(a748.get()); - - A a751 = new A(a749.get()); - A a752 = new A(a750.get()); - - A a753 = new A(a751.get()); - A a754 = new A(a752.get()); - - A a755 = new A(a753.get()); - A a756 = new A(a754.get()); - - A a757 = new A(a755.get()); - A a758 = new A(a756.get()); - - A a759 = new A(a757.get()); - A a760 = new A(a758.get()); - - A a761 = new A(a759.get()); - A a762 = new A(a760.get()); - - A a763 = new A(a761.get()); - A a764 = new A(a762.get()); - - A a765 = new A(a763.get()); - A a766 = new A(a764.get()); - - A a767 = new A(a765.get()); - A a768 = new A(a766.get()); - - A a769 = new A(a767.get()); - A a770 = new A(a768.get()); - - A a771 = new A(a769.get()); - A a772 = new A(a770.get()); - - A a773 = new A(a771.get()); - A a774 = new A(a772.get()); - - A a775 = new A(a773.get()); - A a776 = new A(a774.get()); - - A a777 = new A(a775.get()); - A a778 = new A(a776.get()); - - A a779 = new A(a777.get()); - A a780 = new A(a778.get()); - - A a781 = new A(a779.get()); - A a782 = new A(a780.get()); - - A a783 = new A(a781.get()); - A a784 = new A(a782.get()); - - A a785 = new A(a783.get()); - A a786 = new A(a784.get()); - - A a787 = new A(a785.get()); - A a788 = new A(a786.get()); - - A a789 = new A(a787.get()); - A a790 = new A(a788.get()); - - A a791 = new A(a789.get()); - A a792 = new A(a790.get()); - - A a793 = new A(a791.get()); - A a794 = new A(a792.get()); - - A a795 = new A(a793.get()); - A a796 = new A(a794.get()); - - A a797 = new A(a795.get()); - A a798 = new A(a796.get()); - - A a799 = new A(a797.get()); - A a800 = new A(a798.get()); - - A a801 = new A(a799.get()); - A a802 = new A(a800.get()); - - A a803 = new A(a801.get()); - A a804 = new A(a802.get()); - - A a805 = new A(a803.get()); - A a806 = new A(a804.get()); - - A a807 = new A(a805.get()); - A a808 = new A(a806.get()); - - A a809 = new A(a807.get()); - A a810 = new A(a808.get()); - - A a811 = new A(a809.get()); - A a812 = new A(a810.get()); - - A a813 = new A(a811.get()); - A a814 = new A(a812.get()); - - A a815 = new A(a813.get()); - A a816 = new A(a814.get()); - - A a817 = new A(a815.get()); - A a818 = new A(a816.get()); - - A a819 = new A(a817.get()); - A a820 = new A(a818.get()); - - A a821 = new A(a819.get()); - A a822 = new A(a820.get()); - - A a823 = new A(a821.get()); - A a824 = new A(a822.get()); - - A a825 = new A(a823.get()); - A a826 = new A(a824.get()); - - A a827 = new A(a825.get()); - A a828 = new A(a826.get()); - - A a829 = new A(a827.get()); - A a830 = new A(a828.get()); - - A a831 = new A(a829.get()); - A a832 = new A(a830.get()); - - A a833 = new A(a831.get()); - A a834 = new A(a832.get()); - - A a835 = new A(a833.get()); - A a836 = new A(a834.get()); - - A a837 = new A(a835.get()); - A a838 = new A(a836.get()); - - A a839 = new A(a837.get()); - A a840 = new A(a838.get()); - - A a841 = new A(a839.get()); - A a842 = new A(a840.get()); - - A a843 = new A(a841.get()); - A a844 = new A(a842.get()); - - A a845 = new A(a843.get()); - A a846 = new A(a844.get()); - - A a847 = new A(a845.get()); - A a848 = new A(a846.get()); - - A a849 = new A(a847.get()); - A a850 = new A(a848.get()); - - A a851 = new A(a849.get()); - A a852 = new A(a850.get()); - - A a853 = new A(a851.get()); - A a854 = new A(a852.get()); - - A a855 = new A(a853.get()); - A a856 = new A(a854.get()); - - A a857 = new A(a855.get()); - A a858 = new A(a856.get()); - - A a859 = new A(a857.get()); - A a860 = new A(a858.get()); - - A a861 = new A(a859.get()); - A a862 = new A(a860.get()); - - A a863 = new A(a861.get()); - A a864 = new A(a862.get()); - - A a865 = new A(a863.get()); - A a866 = new A(a864.get()); - - A a867 = new A(a865.get()); - A a868 = new A(a866.get()); - - A a869 = new A(a867.get()); - A a870 = new A(a868.get()); - - A a871 = new A(a869.get()); - A a872 = new A(a870.get()); - - A a873 = new A(a871.get()); - A a874 = new A(a872.get()); - - A a875 = new A(a873.get()); - A a876 = new A(a874.get()); - - A a877 = new A(a875.get()); - A a878 = new A(a876.get()); - - A a879 = new A(a877.get()); - A a880 = new A(a878.get()); - - A a881 = new A(a879.get()); - A a882 = new A(a880.get()); - - A a883 = new A(a881.get()); - A a884 = new A(a882.get()); - - A a885 = new A(a883.get()); - A a886 = new A(a884.get()); - - A a887 = new A(a885.get()); - A a888 = new A(a886.get()); - - A a889 = new A(a887.get()); - A a890 = new A(a888.get()); - - A a891 = new A(a889.get()); - A a892 = new A(a890.get()); - - A a893 = new A(a891.get()); - A a894 = new A(a892.get()); - - A a895 = new A(a893.get()); - A a896 = new A(a894.get()); - - A a897 = new A(a895.get()); - A a898 = new A(a896.get()); - - A a899 = new A(a897.get()); - A a900 = new A(a898.get()); - - A a901 = new A(a899.get()); - A a902 = new A(a900.get()); - - A a903 = new A(a901.get()); - A a904 = new A(a902.get()); - - A a905 = new A(a903.get()); - A a906 = new A(a904.get()); - - A a907 = new A(a905.get()); - A a908 = new A(a906.get()); - - A a909 = new A(a907.get()); - A a910 = new A(a908.get()); - - A a911 = new A(a909.get()); - A a912 = new A(a910.get()); - - A a913 = new A(a911.get()); - A a914 = new A(a912.get()); - - A a915 = new A(a913.get()); - A a916 = new A(a914.get()); - - A a917 = new A(a915.get()); - A a918 = new A(a916.get()); - - A a919 = new A(a917.get()); - A a920 = new A(a918.get()); - - A a921 = new A(a919.get()); - A a922 = new A(a920.get()); - - A a923 = new A(a921.get()); - A a924 = new A(a922.get()); - - A a925 = new A(a923.get()); - A a926 = new A(a924.get()); - - A a927 = new A(a925.get()); - A a928 = new A(a926.get()); - - A a929 = new A(a927.get()); - A a930 = new A(a928.get()); - - A a931 = new A(a929.get()); - A a932 = new A(a930.get()); - - A a933 = new A(a931.get()); - A a934 = new A(a932.get()); - - A a935 = new A(a933.get()); - A a936 = new A(a934.get()); - - A a937 = new A(a935.get()); - A a938 = new A(a936.get()); - - A a939 = new A(a937.get()); - A a940 = new A(a938.get()); - - A a941 = new A(a939.get()); - A a942 = new A(a940.get()); - - A a943 = new A(a941.get()); - A a944 = new A(a942.get()); - - A a945 = new A(a943.get()); - A a946 = new A(a944.get()); - - A a947 = new A(a945.get()); - A a948 = new A(a946.get()); - - A a949 = new A(a947.get()); - A a950 = new A(a948.get()); - - A a951 = new A(a949.get()); - A a952 = new A(a950.get()); - - A a953 = new A(a951.get()); - A a954 = new A(a952.get()); - - A a955 = new A(a953.get()); - A a956 = new A(a954.get()); - - A a957 = new A(a955.get()); - A a958 = new A(a956.get()); - - A a959 = new A(a957.get()); - A a960 = new A(a958.get()); - - A a961 = new A(a959.get()); - A a962 = new A(a960.get()); - - A a963 = new A(a961.get()); - A a964 = new A(a962.get()); - - A a965 = new A(a963.get()); - A a966 = new A(a964.get()); - - A a967 = new A(a965.get()); - A a968 = new A(a966.get()); - - A a969 = new A(a967.get()); - A a970 = new A(a968.get()); - - A a971 = new A(a969.get()); - A a972 = new A(a970.get()); - - A a973 = new A(a971.get()); - A a974 = new A(a972.get()); - - A a975 = new A(a973.get()); - A a976 = new A(a974.get()); - - A a977 = new A(a975.get()); - A a978 = new A(a976.get()); - - A a979 = new A(a977.get()); - A a980 = new A(a978.get()); - - A a981 = new A(a979.get()); - A a982 = new A(a980.get()); - - A a983 = new A(a981.get()); - A a984 = new A(a982.get()); - - A a985 = new A(a983.get()); - A a986 = new A(a984.get()); - - A a987 = new A(a985.get()); - A a988 = new A(a986.get()); - - A a989 = new A(a987.get()); - A a990 = new A(a988.get()); - - A a991 = new A(a989.get()); - A a992 = new A(a990.get()); - - A a993 = new A(a991.get()); - A a994 = new A(a992.get()); - - A a995 = new A(a993.get()); - A a996 = new A(a994.get()); - - A a997 = new A(a995.get()); - A a998 = new A(a996.get()); - - A a999 = new A(a997.get()); - A a1000 = new A(a998.get()); - - A a1001 = new A(a999.get()); - A a1002 = new A(a1000.get()); - - A a1003 = new A(a1001.get()); - A a1004 = new A(a1002.get()); - - A a1005 = new A(a1003.get()); - A a1006 = new A(a1004.get()); - - A a1007 = new A(a1005.get()); - A a1008 = new A(a1006.get()); - - A a1009 = new A(a1007.get()); - A a1010 = new A(a1008.get()); - - A a1011 = new A(a1009.get()); - A a1012 = new A(a1010.get()); - - A a1013 = new A(a1011.get()); - A a1014 = new A(a1012.get()); - - A a1015 = new A(a1013.get()); - A a1016 = new A(a1014.get()); - - A a1017 = new A(a1015.get()); - A a1018 = new A(a1016.get()); - - A a1019 = new A(a1017.get()); - A a1020 = new A(a1018.get()); - - A a1021 = new A(a1019.get()); - A a1022 = new A(a1020.get()); - - A a1023 = new A(a1021.get()); - A a1024 = new A(a1022.get()); - - A a1025 = new A(a1023.get()); - A a1026 = new A(a1024.get()); - - A a1027 = new A(a1025.get()); - A a1028 = new A(a1026.get()); - - A a1029 = new A(a1027.get()); - A a1030 = new A(a1028.get()); - - A a1031 = new A(a1029.get()); - A a1032 = new A(a1030.get()); - - A a1033 = new A(a1031.get()); - A a1034 = new A(a1032.get()); - - A a1035 = new A(a1033.get()); - A a1036 = new A(a1034.get()); - - A a1037 = new A(a1035.get()); - A a1038 = new A(a1036.get()); - - A a1039 = new A(a1037.get()); - A a1040 = new A(a1038.get()); - - A a1041 = new A(a1039.get()); - A a1042 = new A(a1040.get()); - - A a1043 = new A(a1041.get()); - A a1044 = new A(a1042.get()); - - A a1045 = new A(a1043.get()); - A a1046 = new A(a1044.get()); - - A a1047 = new A(a1045.get()); - A a1048 = new A(a1046.get()); - - A a1049 = new A(a1047.get()); - A a1050 = new A(a1048.get()); - - A a1051 = new A(a1049.get()); - A a1052 = new A(a1050.get()); - - A a1053 = new A(a1051.get()); - A a1054 = new A(a1052.get()); - - A a1055 = new A(a1053.get()); - A a1056 = new A(a1054.get()); - - A a1057 = new A(a1055.get()); - A a1058 = new A(a1056.get()); - - A a1059 = new A(a1057.get()); - A a1060 = new A(a1058.get()); - - A a1061 = new A(a1059.get()); - A a1062 = new A(a1060.get()); - - A a1063 = new A(a1061.get()); - A a1064 = new A(a1062.get()); - - A a1065 = new A(a1063.get()); - A a1066 = new A(a1064.get()); - - A a1067 = new A(a1065.get()); - A a1068 = new A(a1066.get()); - - A a1069 = new A(a1067.get()); - A a1070 = new A(a1068.get()); - - A a1071 = new A(a1069.get()); - A a1072 = new A(a1070.get()); - - A a1073 = new A(a1071.get()); - A a1074 = new A(a1072.get()); - - A a1075 = new A(a1073.get()); - A a1076 = new A(a1074.get()); - - A a1077 = new A(a1075.get()); - A a1078 = new A(a1076.get()); - - A a1079 = new A(a1077.get()); - A a1080 = new A(a1078.get()); - - A a1081 = new A(a1079.get()); - A a1082 = new A(a1080.get()); - - A a1083 = new A(a1081.get()); - A a1084 = new A(a1082.get()); - - A a1085 = new A(a1083.get()); - A a1086 = new A(a1084.get()); - - A a1087 = new A(a1085.get()); - A a1088 = new A(a1086.get()); - - A a1089 = new A(a1087.get()); - A a1090 = new A(a1088.get()); - - A a1091 = new A(a1089.get()); - A a1092 = new A(a1090.get()); - - A a1093 = new A(a1091.get()); - A a1094 = new A(a1092.get()); - - A a1095 = new A(a1093.get()); - A a1096 = new A(a1094.get()); - - A a1097 = new A(a1095.get()); - A a1098 = new A(a1096.get()); - - A a1099 = new A(a1097.get()); - A a1100 = new A(a1098.get()); - - A a1101 = new A(a1099.get()); - A a1102 = new A(a1100.get()); - - A a1103 = new A(a1101.get()); - A a1104 = new A(a1102.get()); - - A a1105 = new A(a1103.get()); - A a1106 = new A(a1104.get()); - - A a1107 = new A(a1105.get()); - A a1108 = new A(a1106.get()); - - A a1109 = new A(a1107.get()); - A a1110 = new A(a1108.get()); - - A a1111 = new A(a1109.get()); - A a1112 = new A(a1110.get()); - - A a1113 = new A(a1111.get()); - A a1114 = new A(a1112.get()); - - A a1115 = new A(a1113.get()); - A a1116 = new A(a1114.get()); - - A a1117 = new A(a1115.get()); - A a1118 = new A(a1116.get()); - - A a1119 = new A(a1117.get()); - A a1120 = new A(a1118.get()); - - A a1121 = new A(a1119.get()); - A a1122 = new A(a1120.get()); - - A a1123 = new A(a1121.get()); - A a1124 = new A(a1122.get()); - - A a1125 = new A(a1123.get()); - A a1126 = new A(a1124.get()); - - A a1127 = new A(a1125.get()); - A a1128 = new A(a1126.get()); - - A a1129 = new A(a1127.get()); - A a1130 = new A(a1128.get()); - - A a1131 = new A(a1129.get()); - A a1132 = new A(a1130.get()); - - A a1133 = new A(a1131.get()); - A a1134 = new A(a1132.get()); - - A a1135 = new A(a1133.get()); - A a1136 = new A(a1134.get()); - - A a1137 = new A(a1135.get()); - A a1138 = new A(a1136.get()); - - A a1139 = new A(a1137.get()); - A a1140 = new A(a1138.get()); - - A a1141 = new A(a1139.get()); - A a1142 = new A(a1140.get()); - - A a1143 = new A(a1141.get()); - A a1144 = new A(a1142.get()); - - A a1145 = new A(a1143.get()); - A a1146 = new A(a1144.get()); - - A a1147 = new A(a1145.get()); - A a1148 = new A(a1146.get()); - - A a1149 = new A(a1147.get()); - A a1150 = new A(a1148.get()); - - A a1151 = new A(a1149.get()); - A a1152 = new A(a1150.get()); - - A a1153 = new A(a1151.get()); - A a1154 = new A(a1152.get()); - - A a1155 = new A(a1153.get()); - A a1156 = new A(a1154.get()); - - A a1157 = new A(a1155.get()); - A a1158 = new A(a1156.get()); - - A a1159 = new A(a1157.get()); - A a1160 = new A(a1158.get()); - - A a1161 = new A(a1159.get()); - A a1162 = new A(a1160.get()); - - A a1163 = new A(a1161.get()); - A a1164 = new A(a1162.get()); - - A a1165 = new A(a1163.get()); - A a1166 = new A(a1164.get()); - - A a1167 = new A(a1165.get()); - A a1168 = new A(a1166.get()); - - A a1169 = new A(a1167.get()); - A a1170 = new A(a1168.get()); - - A a1171 = new A(a1169.get()); - A a1172 = new A(a1170.get()); - - A a1173 = new A(a1171.get()); - A a1174 = new A(a1172.get()); - - A a1175 = new A(a1173.get()); - A a1176 = new A(a1174.get()); - - A a1177 = new A(a1175.get()); - A a1178 = new A(a1176.get()); - - A a1179 = new A(a1177.get()); - A a1180 = new A(a1178.get()); - - A a1181 = new A(a1179.get()); - A a1182 = new A(a1180.get()); - - A a1183 = new A(a1181.get()); - A a1184 = new A(a1182.get()); - - A a1185 = new A(a1183.get()); - A a1186 = new A(a1184.get()); - - A a1187 = new A(a1185.get()); - A a1188 = new A(a1186.get()); - - A a1189 = new A(a1187.get()); - A a1190 = new A(a1188.get()); - - A a1191 = new A(a1189.get()); - A a1192 = new A(a1190.get()); - - A a1193 = new A(a1191.get()); - A a1194 = new A(a1192.get()); - - A a1195 = new A(a1193.get()); - A a1196 = new A(a1194.get()); - - A a1197 = new A(a1195.get()); - A a1198 = new A(a1196.get()); - - A a1199 = new A(a1197.get()); - A a1200 = new A(a1198.get()); - - A a1201 = new A(a1199.get()); - A a1202 = new A(a1200.get()); - - A a1203 = new A(a1201.get()); - A a1204 = new A(a1202.get()); - - A a1205 = new A(a1203.get()); - A a1206 = new A(a1204.get()); - - A a1207 = new A(a1205.get()); - A a1208 = new A(a1206.get()); - - A a1209 = new A(a1207.get()); - A a1210 = new A(a1208.get()); - - A a1211 = new A(a1209.get()); - A a1212 = new A(a1210.get()); - - A a1213 = new A(a1211.get()); - A a1214 = new A(a1212.get()); - - A a1215 = new A(a1213.get()); - A a1216 = new A(a1214.get()); - - A a1217 = new A(a1215.get()); - A a1218 = new A(a1216.get()); - - A a1219 = new A(a1217.get()); - A a1220 = new A(a1218.get()); - - A a1221 = new A(a1219.get()); - A a1222 = new A(a1220.get()); - - A a1223 = new A(a1221.get()); - A a1224 = new A(a1222.get()); - - A a1225 = new A(a1223.get()); - A a1226 = new A(a1224.get()); - - A a1227 = new A(a1225.get()); - A a1228 = new A(a1226.get()); - - A a1229 = new A(a1227.get()); - A a1230 = new A(a1228.get()); - - A a1231 = new A(a1229.get()); - A a1232 = new A(a1230.get()); - - A a1233 = new A(a1231.get()); - A a1234 = new A(a1232.get()); - - A a1235 = new A(a1233.get()); - A a1236 = new A(a1234.get()); - - A a1237 = new A(a1235.get()); - A a1238 = new A(a1236.get()); - - A a1239 = new A(a1237.get()); - A a1240 = new A(a1238.get()); - - A a1241 = new A(a1239.get()); - A a1242 = new A(a1240.get()); - - A a1243 = new A(a1241.get()); - A a1244 = new A(a1242.get()); - - A a1245 = new A(a1243.get()); - A a1246 = new A(a1244.get()); - - A a1247 = new A(a1245.get()); - A a1248 = new A(a1246.get()); - - A a1249 = new A(a1247.get()); - A a1250 = new A(a1248.get()); - - A a1251 = new A(a1249.get()); - A a1252 = new A(a1250.get()); - - A a1253 = new A(a1251.get()); - A a1254 = new A(a1252.get()); - - A a1255 = new A(a1253.get()); - A a1256 = new A(a1254.get()); - - A a1257 = new A(a1255.get()); - A a1258 = new A(a1256.get()); - - A a1259 = new A(a1257.get()); - A a1260 = new A(a1258.get()); - - A a1261 = new A(a1259.get()); - A a1262 = new A(a1260.get()); - - A a1263 = new A(a1261.get()); - A a1264 = new A(a1262.get()); - - A a1265 = new A(a1263.get()); - A a1266 = new A(a1264.get()); - - A a1267 = new A(a1265.get()); - A a1268 = new A(a1266.get()); - - A a1269 = new A(a1267.get()); - A a1270 = new A(a1268.get()); - - A a1271 = new A(a1269.get()); - A a1272 = new A(a1270.get()); - - A a1273 = new A(a1271.get()); - A a1274 = new A(a1272.get()); - - A a1275 = new A(a1273.get()); - A a1276 = new A(a1274.get()); - - A a1277 = new A(a1275.get()); - A a1278 = new A(a1276.get()); - - A a1279 = new A(a1277.get()); - A a1280 = new A(a1278.get()); - - A a1281 = new A(a1279.get()); - A a1282 = new A(a1280.get()); - - A a1283 = new A(a1281.get()); - A a1284 = new A(a1282.get()); - - A a1285 = new A(a1283.get()); - A a1286 = new A(a1284.get()); - - A a1287 = new A(a1285.get()); - A a1288 = new A(a1286.get()); - - A a1289 = new A(a1287.get()); - A a1290 = new A(a1288.get()); - - A a1291 = new A(a1289.get()); - A a1292 = new A(a1290.get()); - - A a1293 = new A(a1291.get()); - A a1294 = new A(a1292.get()); - - A a1295 = new A(a1293.get()); - A a1296 = new A(a1294.get()); - - A a1297 = new A(a1295.get()); - A a1298 = new A(a1296.get()); - - A a1299 = new A(a1297.get()); - A a1300 = new A(a1298.get()); - - A a1301 = new A(a1299.get()); - A a1302 = new A(a1300.get()); - - A a1303 = new A(a1301.get()); - A a1304 = new A(a1302.get()); - - A a1305 = new A(a1303.get()); - A a1306 = new A(a1304.get()); - - A a1307 = new A(a1305.get()); - A a1308 = new A(a1306.get()); - - A a1309 = new A(a1307.get()); - A a1310 = new A(a1308.get()); - - A a1311 = new A(a1309.get()); - A a1312 = new A(a1310.get()); - - A a1313 = new A(a1311.get()); - A a1314 = new A(a1312.get()); - - A a1315 = new A(a1313.get()); - A a1316 = new A(a1314.get()); - - A a1317 = new A(a1315.get()); - A a1318 = new A(a1316.get()); - - A a1319 = new A(a1317.get()); - A a1320 = new A(a1318.get()); - - A a1321 = new A(a1319.get()); - A a1322 = new A(a1320.get()); - - A a1323 = new A(a1321.get()); - A a1324 = new A(a1322.get()); - - A a1325 = new A(a1323.get()); - A a1326 = new A(a1324.get()); - - A a1327 = new A(a1325.get()); - A a1328 = new A(a1326.get()); - - A a1329 = new A(a1327.get()); - A a1330 = new A(a1328.get()); - - A a1331 = new A(a1329.get()); - A a1332 = new A(a1330.get()); - - A a1333 = new A(a1331.get()); - A a1334 = new A(a1332.get()); - - A a1335 = new A(a1333.get()); - A a1336 = new A(a1334.get()); - - A a1337 = new A(a1335.get()); - A a1338 = new A(a1336.get()); - - A a1339 = new A(a1337.get()); - A a1340 = new A(a1338.get()); - - A a1341 = new A(a1339.get()); - A a1342 = new A(a1340.get()); - - A a1343 = new A(a1341.get()); - A a1344 = new A(a1342.get()); - - A a1345 = new A(a1343.get()); - A a1346 = new A(a1344.get()); - - A a1347 = new A(a1345.get()); - A a1348 = new A(a1346.get()); - - A a1349 = new A(a1347.get()); - A a1350 = new A(a1348.get()); - - A a1351 = new A(a1349.get()); - A a1352 = new A(a1350.get()); - - A a1353 = new A(a1351.get()); - A a1354 = new A(a1352.get()); - - A a1355 = new A(a1353.get()); - A a1356 = new A(a1354.get()); - - A a1357 = new A(a1355.get()); - A a1358 = new A(a1356.get()); - - A a1359 = new A(a1357.get()); - A a1360 = new A(a1358.get()); - - A a1361 = new A(a1359.get()); - A a1362 = new A(a1360.get()); - - A a1363 = new A(a1361.get()); - A a1364 = new A(a1362.get()); - - A a1365 = new A(a1363.get()); - A a1366 = new A(a1364.get()); - - A a1367 = new A(a1365.get()); - A a1368 = new A(a1366.get()); - - A a1369 = new A(a1367.get()); - A a1370 = new A(a1368.get()); - - A a1371 = new A(a1369.get()); - A a1372 = new A(a1370.get()); - - A a1373 = new A(a1371.get()); - A a1374 = new A(a1372.get()); - - A a1375 = new A(a1373.get()); - A a1376 = new A(a1374.get()); - - A a1377 = new A(a1375.get()); - A a1378 = new A(a1376.get()); - - A a1379 = new A(a1377.get()); - A a1380 = new A(a1378.get()); - - A a1381 = new A(a1379.get()); - A a1382 = new A(a1380.get()); - - A a1383 = new A(a1381.get()); - A a1384 = new A(a1382.get()); - - A a1385 = new A(a1383.get()); - A a1386 = new A(a1384.get()); - - A a1387 = new A(a1385.get()); - A a1388 = new A(a1386.get()); - - A a1389 = new A(a1387.get()); - A a1390 = new A(a1388.get()); - - A a1391 = new A(a1389.get()); - A a1392 = new A(a1390.get()); - - A a1393 = new A(a1391.get()); - A a1394 = new A(a1392.get()); - - A a1395 = new A(a1393.get()); - A a1396 = new A(a1394.get()); - - A a1397 = new A(a1395.get()); - A a1398 = new A(a1396.get()); - - A a1399 = new A(a1397.get()); - A a1400 = new A(a1398.get()); - - A a1401 = new A(a1399.get()); - A a1402 = new A(a1400.get()); - - A a1403 = new A(a1401.get()); - A a1404 = new A(a1402.get()); - - A a1405 = new A(a1403.get()); - A a1406 = new A(a1404.get()); - - A a1407 = new A(a1405.get()); - A a1408 = new A(a1406.get()); - - A a1409 = new A(a1407.get()); - A a1410 = new A(a1408.get()); - - A a1411 = new A(a1409.get()); - A a1412 = new A(a1410.get()); - - A a1413 = new A(a1411.get()); - A a1414 = new A(a1412.get()); - - A a1415 = new A(a1413.get()); - A a1416 = new A(a1414.get()); - - A a1417 = new A(a1415.get()); - A a1418 = new A(a1416.get()); - - A a1419 = new A(a1417.get()); - A a1420 = new A(a1418.get()); - - A a1421 = new A(a1419.get()); - A a1422 = new A(a1420.get()); - - A a1423 = new A(a1421.get()); - A a1424 = new A(a1422.get()); - - A a1425 = new A(a1423.get()); - A a1426 = new A(a1424.get()); - - A a1427 = new A(a1425.get()); - A a1428 = new A(a1426.get()); - - A a1429 = new A(a1427.get()); - A a1430 = new A(a1428.get()); - - A a1431 = new A(a1429.get()); - A a1432 = new A(a1430.get()); - - A a1433 = new A(a1431.get()); - A a1434 = new A(a1432.get()); - - A a1435 = new A(a1433.get()); - A a1436 = new A(a1434.get()); - - A a1437 = new A(a1435.get()); - A a1438 = new A(a1436.get()); - - A a1439 = new A(a1437.get()); - A a1440 = new A(a1438.get()); - - A a1441 = new A(a1439.get()); - A a1442 = new A(a1440.get()); - - A a1443 = new A(a1441.get()); - A a1444 = new A(a1442.get()); - - A a1445 = new A(a1443.get()); - A a1446 = new A(a1444.get()); - - A a1447 = new A(a1445.get()); - A a1448 = new A(a1446.get()); - - A a1449 = new A(a1447.get()); - A a1450 = new A(a1448.get()); - - A a1451 = new A(a1449.get()); - A a1452 = new A(a1450.get()); - - A a1453 = new A(a1451.get()); - A a1454 = new A(a1452.get()); - - A a1455 = new A(a1453.get()); - A a1456 = new A(a1454.get()); - - A a1457 = new A(a1455.get()); - A a1458 = new A(a1456.get()); - - A a1459 = new A(a1457.get()); - A a1460 = new A(a1458.get()); - - A a1461 = new A(a1459.get()); - A a1462 = new A(a1460.get()); - - A a1463 = new A(a1461.get()); - A a1464 = new A(a1462.get()); - - A a1465 = new A(a1463.get()); - A a1466 = new A(a1464.get()); - - A a1467 = new A(a1465.get()); - A a1468 = new A(a1466.get()); - - A a1469 = new A(a1467.get()); - A a1470 = new A(a1468.get()); - - A a1471 = new A(a1469.get()); - A a1472 = new A(a1470.get()); - - A a1473 = new A(a1471.get()); - A a1474 = new A(a1472.get()); - - A a1475 = new A(a1473.get()); - A a1476 = new A(a1474.get()); - - A a1477 = new A(a1475.get()); - A a1478 = new A(a1476.get()); - - A a1479 = new A(a1477.get()); - A a1480 = new A(a1478.get()); - - A a1481 = new A(a1479.get()); - A a1482 = new A(a1480.get()); - - A a1483 = new A(a1481.get()); - A a1484 = new A(a1482.get()); - - A a1485 = new A(a1483.get()); - A a1486 = new A(a1484.get()); - - A a1487 = new A(a1485.get()); - A a1488 = new A(a1486.get()); - - A a1489 = new A(a1487.get()); - A a1490 = new A(a1488.get()); - - A a1491 = new A(a1489.get()); - A a1492 = new A(a1490.get()); - - A a1493 = new A(a1491.get()); - A a1494 = new A(a1492.get()); - - A a1495 = new A(a1493.get()); - A a1496 = new A(a1494.get()); - - A a1497 = new A(a1495.get()); - A a1498 = new A(a1496.get()); - - A a1499 = new A(a1497.get()); - A a1500 = new A(a1498.get()); - - A a1501 = new A(a1499.get()); - A a1502 = new A(a1500.get()); - - A a1503 = new A(a1501.get()); - A a1504 = new A(a1502.get()); - - A a1505 = new A(a1503.get()); - A a1506 = new A(a1504.get()); - - A a1507 = new A(a1505.get()); - A a1508 = new A(a1506.get()); - - A a1509 = new A(a1507.get()); - A a1510 = new A(a1508.get()); - - A a1511 = new A(a1509.get()); - A a1512 = new A(a1510.get()); - - A a1513 = new A(a1511.get()); - A a1514 = new A(a1512.get()); - - A a1515 = new A(a1513.get()); - A a1516 = new A(a1514.get()); - - A a1517 = new A(a1515.get()); - A a1518 = new A(a1516.get()); - - A a1519 = new A(a1517.get()); - A a1520 = new A(a1518.get()); - - A a1521 = new A(a1519.get()); - A a1522 = new A(a1520.get()); - - A a1523 = new A(a1521.get()); - A a1524 = new A(a1522.get()); - - A a1525 = new A(a1523.get()); - A a1526 = new A(a1524.get()); - - A a1527 = new A(a1525.get()); - A a1528 = new A(a1526.get()); - - A a1529 = new A(a1527.get()); - A a1530 = new A(a1528.get()); - - A a1531 = new A(a1529.get()); - A a1532 = new A(a1530.get()); - - A a1533 = new A(a1531.get()); - A a1534 = new A(a1532.get()); - - A a1535 = new A(a1533.get()); - A a1536 = new A(a1534.get()); - - A a1537 = new A(a1535.get()); - A a1538 = new A(a1536.get()); - - A a1539 = new A(a1537.get()); - A a1540 = new A(a1538.get()); - - A a1541 = new A(a1539.get()); - A a1542 = new A(a1540.get()); - - A a1543 = new A(a1541.get()); - A a1544 = new A(a1542.get()); - - A a1545 = new A(a1543.get()); - A a1546 = new A(a1544.get()); - - A a1547 = new A(a1545.get()); - A a1548 = new A(a1546.get()); - - A a1549 = new A(a1547.get()); - A a1550 = new A(a1548.get()); - - A a1551 = new A(a1549.get()); - A a1552 = new A(a1550.get()); - - A a1553 = new A(a1551.get()); - A a1554 = new A(a1552.get()); - - A a1555 = new A(a1553.get()); - A a1556 = new A(a1554.get()); - - A a1557 = new A(a1555.get()); - A a1558 = new A(a1556.get()); - - A a1559 = new A(a1557.get()); - A a1560 = new A(a1558.get()); - - A a1561 = new A(a1559.get()); - A a1562 = new A(a1560.get()); - - A a1563 = new A(a1561.get()); - A a1564 = new A(a1562.get()); - - A a1565 = new A(a1563.get()); - A a1566 = new A(a1564.get()); - - A a1567 = new A(a1565.get()); - A a1568 = new A(a1566.get()); - - A a1569 = new A(a1567.get()); - A a1570 = new A(a1568.get()); - - A a1571 = new A(a1569.get()); - A a1572 = new A(a1570.get()); - - A a1573 = new A(a1571.get()); - A a1574 = new A(a1572.get()); - - A a1575 = new A(a1573.get()); - A a1576 = new A(a1574.get()); - - A a1577 = new A(a1575.get()); - A a1578 = new A(a1576.get()); - - A a1579 = new A(a1577.get()); - A a1580 = new A(a1578.get()); - - A a1581 = new A(a1579.get()); - A a1582 = new A(a1580.get()); - - A a1583 = new A(a1581.get()); - A a1584 = new A(a1582.get()); - - A a1585 = new A(a1583.get()); - A a1586 = new A(a1584.get()); - - A a1587 = new A(a1585.get()); - A a1588 = new A(a1586.get()); - - A a1589 = new A(a1587.get()); - A a1590 = new A(a1588.get()); - - A a1591 = new A(a1589.get()); - A a1592 = new A(a1590.get()); - - A a1593 = new A(a1591.get()); - A a1594 = new A(a1592.get()); - - A a1595 = new A(a1593.get()); - A a1596 = new A(a1594.get()); - - A a1597 = new A(a1595.get()); - A a1598 = new A(a1596.get()); - - A a1599 = new A(a1597.get()); - A a1600 = new A(a1598.get()); - - A a1601 = new A(a1599.get()); - A a1602 = new A(a1600.get()); - - A a1603 = new A(a1601.get()); - A a1604 = new A(a1602.get()); - - A a1605 = new A(a1603.get()); - A a1606 = new A(a1604.get()); - - A a1607 = new A(a1605.get()); - A a1608 = new A(a1606.get()); - - A a1609 = new A(a1607.get()); - A a1610 = new A(a1608.get()); - - A a1611 = new A(a1609.get()); - A a1612 = new A(a1610.get()); - - A a1613 = new A(a1611.get()); - A a1614 = new A(a1612.get()); - - A a1615 = new A(a1613.get()); - A a1616 = new A(a1614.get()); - - A a1617 = new A(a1615.get()); - A a1618 = new A(a1616.get()); - - A a1619 = new A(a1617.get()); - A a1620 = new A(a1618.get()); - - A a1621 = new A(a1619.get()); - A a1622 = new A(a1620.get()); - - A a1623 = new A(a1621.get()); - A a1624 = new A(a1622.get()); - - A a1625 = new A(a1623.get()); - A a1626 = new A(a1624.get()); - - A a1627 = new A(a1625.get()); - A a1628 = new A(a1626.get()); - - A a1629 = new A(a1627.get()); - A a1630 = new A(a1628.get()); - - A a1631 = new A(a1629.get()); - A a1632 = new A(a1630.get()); - - A a1633 = new A(a1631.get()); - A a1634 = new A(a1632.get()); - - A a1635 = new A(a1633.get()); - A a1636 = new A(a1634.get()); - - A a1637 = new A(a1635.get()); - A a1638 = new A(a1636.get()); - - A a1639 = new A(a1637.get()); - A a1640 = new A(a1638.get()); - - A a1641 = new A(a1639.get()); - A a1642 = new A(a1640.get()); - - A a1643 = new A(a1641.get()); - A a1644 = new A(a1642.get()); - - A a1645 = new A(a1643.get()); - A a1646 = new A(a1644.get()); - - A a1647 = new A(a1645.get()); - A a1648 = new A(a1646.get()); - - A a1649 = new A(a1647.get()); - A a1650 = new A(a1648.get()); - - A a1651 = new A(a1649.get()); - A a1652 = new A(a1650.get()); - - A a1653 = new A(a1651.get()); - A a1654 = new A(a1652.get()); - - A a1655 = new A(a1653.get()); - A a1656 = new A(a1654.get()); - - A a1657 = new A(a1655.get()); - A a1658 = new A(a1656.get()); - - A a1659 = new A(a1657.get()); - A a1660 = new A(a1658.get()); - - A a1661 = new A(a1659.get()); - A a1662 = new A(a1660.get()); - - A a1663 = new A(a1661.get()); - A a1664 = new A(a1662.get()); - - A a1665 = new A(a1663.get()); - A a1666 = new A(a1664.get()); - - A a1667 = new A(a1665.get()); - A a1668 = new A(a1666.get()); - - A a1669 = new A(a1667.get()); - A a1670 = new A(a1668.get()); - - A a1671 = new A(a1669.get()); - A a1672 = new A(a1670.get()); - - A a1673 = new A(a1671.get()); - A a1674 = new A(a1672.get()); - - A a1675 = new A(a1673.get()); - A a1676 = new A(a1674.get()); - - A a1677 = new A(a1675.get()); - A a1678 = new A(a1676.get()); - - A a1679 = new A(a1677.get()); - A a1680 = new A(a1678.get()); - - A a1681 = new A(a1679.get()); - A a1682 = new A(a1680.get()); - - A a1683 = new A(a1681.get()); - A a1684 = new A(a1682.get()); - - A a1685 = new A(a1683.get()); - A a1686 = new A(a1684.get()); - - A a1687 = new A(a1685.get()); - A a1688 = new A(a1686.get()); - - A a1689 = new A(a1687.get()); - A a1690 = new A(a1688.get()); - - A a1691 = new A(a1689.get()); - A a1692 = new A(a1690.get()); - - A a1693 = new A(a1691.get()); - A a1694 = new A(a1692.get()); - - A a1695 = new A(a1693.get()); - A a1696 = new A(a1694.get()); - - A a1697 = new A(a1695.get()); - A a1698 = new A(a1696.get()); - - A a1699 = new A(a1697.get()); - A a1700 = new A(a1698.get()); - - A a1701 = new A(a1699.get()); - A a1702 = new A(a1700.get()); - - A a1703 = new A(a1701.get()); - A a1704 = new A(a1702.get()); - - A a1705 = new A(a1703.get()); - A a1706 = new A(a1704.get()); - - A a1707 = new A(a1705.get()); - A a1708 = new A(a1706.get()); - - A a1709 = new A(a1707.get()); - A a1710 = new A(a1708.get()); - - A a1711 = new A(a1709.get()); - A a1712 = new A(a1710.get()); - - A a1713 = new A(a1711.get()); - A a1714 = new A(a1712.get()); - - A a1715 = new A(a1713.get()); - A a1716 = new A(a1714.get()); - - A a1717 = new A(a1715.get()); - A a1718 = new A(a1716.get()); - - A a1719 = new A(a1717.get()); - A a1720 = new A(a1718.get()); - - A a1721 = new A(a1719.get()); - A a1722 = new A(a1720.get()); - - A a1723 = new A(a1721.get()); - A a1724 = new A(a1722.get()); - - A a1725 = new A(a1723.get()); - A a1726 = new A(a1724.get()); - - A a1727 = new A(a1725.get()); - A a1728 = new A(a1726.get()); - - A a1729 = new A(a1727.get()); - A a1730 = new A(a1728.get()); - - A a1731 = new A(a1729.get()); - A a1732 = new A(a1730.get()); - - A a1733 = new A(a1731.get()); - A a1734 = new A(a1732.get()); - - A a1735 = new A(a1733.get()); - A a1736 = new A(a1734.get()); - - A a1737 = new A(a1735.get()); - A a1738 = new A(a1736.get()); - - A a1739 = new A(a1737.get()); - A a1740 = new A(a1738.get()); - - A a1741 = new A(a1739.get()); - A a1742 = new A(a1740.get()); - - A a1743 = new A(a1741.get()); - A a1744 = new A(a1742.get()); - - A a1745 = new A(a1743.get()); - A a1746 = new A(a1744.get()); - - A a1747 = new A(a1745.get()); - A a1748 = new A(a1746.get()); - - A a1749 = new A(a1747.get()); - A a1750 = new A(a1748.get()); - - A a1751 = new A(a1749.get()); - A a1752 = new A(a1750.get()); - - A a1753 = new A(a1751.get()); - A a1754 = new A(a1752.get()); - - A a1755 = new A(a1753.get()); - A a1756 = new A(a1754.get()); - - A a1757 = new A(a1755.get()); - A a1758 = new A(a1756.get()); - - A a1759 = new A(a1757.get()); - A a1760 = new A(a1758.get()); - - A a1761 = new A(a1759.get()); - A a1762 = new A(a1760.get()); - - A a1763 = new A(a1761.get()); - A a1764 = new A(a1762.get()); - - A a1765 = new A(a1763.get()); - A a1766 = new A(a1764.get()); - - A a1767 = new A(a1765.get()); - A a1768 = new A(a1766.get()); - - A a1769 = new A(a1767.get()); - A a1770 = new A(a1768.get()); - - A a1771 = new A(a1769.get()); - A a1772 = new A(a1770.get()); - - A a1773 = new A(a1771.get()); - A a1774 = new A(a1772.get()); - - A a1775 = new A(a1773.get()); - A a1776 = new A(a1774.get()); - - A a1777 = new A(a1775.get()); - A a1778 = new A(a1776.get()); - - A a1779 = new A(a1777.get()); - A a1780 = new A(a1778.get()); - - A a1781 = new A(a1779.get()); - A a1782 = new A(a1780.get()); - - A a1783 = new A(a1781.get()); - A a1784 = new A(a1782.get()); - - A a1785 = new A(a1783.get()); - A a1786 = new A(a1784.get()); - - A a1787 = new A(a1785.get()); - A a1788 = new A(a1786.get()); - - A a1789 = new A(a1787.get()); - A a1790 = new A(a1788.get()); - - A a1791 = new A(a1789.get()); - A a1792 = new A(a1790.get()); - - A a1793 = new A(a1791.get()); - A a1794 = new A(a1792.get()); - - A a1795 = new A(a1793.get()); - A a1796 = new A(a1794.get()); - - A a1797 = new A(a1795.get()); - A a1798 = new A(a1796.get()); - - A a1799 = new A(a1797.get()); - A a1800 = new A(a1798.get()); - - A a1801 = new A(a1799.get()); - A a1802 = new A(a1800.get()); - - A a1803 = new A(a1801.get()); - A a1804 = new A(a1802.get()); - - A a1805 = new A(a1803.get()); - A a1806 = new A(a1804.get()); - - A a1807 = new A(a1805.get()); - A a1808 = new A(a1806.get()); - - A a1809 = new A(a1807.get()); - A a1810 = new A(a1808.get()); - - A a1811 = new A(a1809.get()); - A a1812 = new A(a1810.get()); - - A a1813 = new A(a1811.get()); - A a1814 = new A(a1812.get()); - - A a1815 = new A(a1813.get()); - A a1816 = new A(a1814.get()); - - A a1817 = new A(a1815.get()); - A a1818 = new A(a1816.get()); - - A a1819 = new A(a1817.get()); - A a1820 = new A(a1818.get()); - - A a1821 = new A(a1819.get()); - A a1822 = new A(a1820.get()); - - A a1823 = new A(a1821.get()); - A a1824 = new A(a1822.get()); - - A a1825 = new A(a1823.get()); - A a1826 = new A(a1824.get()); - - A a1827 = new A(a1825.get()); - A a1828 = new A(a1826.get()); - - A a1829 = new A(a1827.get()); - A a1830 = new A(a1828.get()); - - A a1831 = new A(a1829.get()); - A a1832 = new A(a1830.get()); - - A a1833 = new A(a1831.get()); - A a1834 = new A(a1832.get()); - - A a1835 = new A(a1833.get()); - A a1836 = new A(a1834.get()); - - A a1837 = new A(a1835.get()); - A a1838 = new A(a1836.get()); - - A a1839 = new A(a1837.get()); - A a1840 = new A(a1838.get()); - - A a1841 = new A(a1839.get()); - A a1842 = new A(a1840.get()); - - A a1843 = new A(a1841.get()); - A a1844 = new A(a1842.get()); - - A a1845 = new A(a1843.get()); - A a1846 = new A(a1844.get()); - - A a1847 = new A(a1845.get()); - A a1848 = new A(a1846.get()); - - A a1849 = new A(a1847.get()); - A a1850 = new A(a1848.get()); - - A a1851 = new A(a1849.get()); - A a1852 = new A(a1850.get()); - - A a1853 = new A(a1851.get()); - A a1854 = new A(a1852.get()); - - A a1855 = new A(a1853.get()); - A a1856 = new A(a1854.get()); - - A a1857 = new A(a1855.get()); - A a1858 = new A(a1856.get()); - - A a1859 = new A(a1857.get()); - A a1860 = new A(a1858.get()); - - A a1861 = new A(a1859.get()); - A a1862 = new A(a1860.get()); - - A a1863 = new A(a1861.get()); - A a1864 = new A(a1862.get()); - - A a1865 = new A(a1863.get()); - A a1866 = new A(a1864.get()); - - A a1867 = new A(a1865.get()); - A a1868 = new A(a1866.get()); - - A a1869 = new A(a1867.get()); - A a1870 = new A(a1868.get()); - - A a1871 = new A(a1869.get()); - A a1872 = new A(a1870.get()); - - A a1873 = new A(a1871.get()); - A a1874 = new A(a1872.get()); - - A a1875 = new A(a1873.get()); - A a1876 = new A(a1874.get()); - - A a1877 = new A(a1875.get()); - A a1878 = new A(a1876.get()); - - A a1879 = new A(a1877.get()); - A a1880 = new A(a1878.get()); - - A a1881 = new A(a1879.get()); - A a1882 = new A(a1880.get()); - - A a1883 = new A(a1881.get()); - A a1884 = new A(a1882.get()); - - A a1885 = new A(a1883.get()); - A a1886 = new A(a1884.get()); - - A a1887 = new A(a1885.get()); - A a1888 = new A(a1886.get()); - - A a1889 = new A(a1887.get()); - A a1890 = new A(a1888.get()); - - A a1891 = new A(a1889.get()); - A a1892 = new A(a1890.get()); - - A a1893 = new A(a1891.get()); - A a1894 = new A(a1892.get()); - - A a1895 = new A(a1893.get()); - A a1896 = new A(a1894.get()); - - A a1897 = new A(a1895.get()); - A a1898 = new A(a1896.get()); - - A a1899 = new A(a1897.get()); - A a1900 = new A(a1898.get()); - - A a1901 = new A(a1899.get()); - A a1902 = new A(a1900.get()); - - A a1903 = new A(a1901.get()); - A a1904 = new A(a1902.get()); - - A a1905 = new A(a1903.get()); - A a1906 = new A(a1904.get()); - - A a1907 = new A(a1905.get()); - A a1908 = new A(a1906.get()); - - A a1909 = new A(a1907.get()); - A a1910 = new A(a1908.get()); - - A a1911 = new A(a1909.get()); - A a1912 = new A(a1910.get()); - - A a1913 = new A(a1911.get()); - A a1914 = new A(a1912.get()); - - A a1915 = new A(a1913.get()); - A a1916 = new A(a1914.get()); - - A a1917 = new A(a1915.get()); - A a1918 = new A(a1916.get()); - - A a1919 = new A(a1917.get()); - A a1920 = new A(a1918.get()); - - A a1921 = new A(a1919.get()); - A a1922 = new A(a1920.get()); - - A a1923 = new A(a1921.get()); - A a1924 = new A(a1922.get()); - - A a1925 = new A(a1923.get()); - A a1926 = new A(a1924.get()); - - A a1927 = new A(a1925.get()); - A a1928 = new A(a1926.get()); - - A a1929 = new A(a1927.get()); - A a1930 = new A(a1928.get()); - - A a1931 = new A(a1929.get()); - A a1932 = new A(a1930.get()); - - A a1933 = new A(a1931.get()); - A a1934 = new A(a1932.get()); - - A a1935 = new A(a1933.get()); - A a1936 = new A(a1934.get()); - - A a1937 = new A(a1935.get()); - A a1938 = new A(a1936.get()); - - A a1939 = new A(a1937.get()); - A a1940 = new A(a1938.get()); - - A a1941 = new A(a1939.get()); - A a1942 = new A(a1940.get()); - - A a1943 = new A(a1941.get()); - A a1944 = new A(a1942.get()); - - A a1945 = new A(a1943.get()); - A a1946 = new A(a1944.get()); - - A a1947 = new A(a1945.get()); - A a1948 = new A(a1946.get()); - - A a1949 = new A(a1947.get()); - A a1950 = new A(a1948.get()); - - A a1951 = new A(a1949.get()); - A a1952 = new A(a1950.get()); - - A a1953 = new A(a1951.get()); - A a1954 = new A(a1952.get()); - - A a1955 = new A(a1953.get()); - A a1956 = new A(a1954.get()); - - A a1957 = new A(a1955.get()); - A a1958 = new A(a1956.get()); - - A a1959 = new A(a1957.get()); - A a1960 = new A(a1958.get()); - - A a1961 = new A(a1959.get()); - A a1962 = new A(a1960.get()); - - A a1963 = new A(a1961.get()); - A a1964 = new A(a1962.get()); - - A a1965 = new A(a1963.get()); - A a1966 = new A(a1964.get()); - - A a1967 = new A(a1965.get()); - A a1968 = new A(a1966.get()); - - A a1969 = new A(a1967.get()); - A a1970 = new A(a1968.get()); - - A a1971 = new A(a1969.get()); - A a1972 = new A(a1970.get()); - - A a1973 = new A(a1971.get()); - A a1974 = new A(a1972.get()); - - A a1975 = new A(a1973.get()); - A a1976 = new A(a1974.get()); - - A a1977 = new A(a1975.get()); - A a1978 = new A(a1976.get()); - - A a1979 = new A(a1977.get()); - A a1980 = new A(a1978.get()); - - A a1981 = new A(a1979.get()); - A a1982 = new A(a1980.get()); - - A a1983 = new A(a1981.get()); - A a1984 = new A(a1982.get()); - - A a1985 = new A(a1983.get()); - A a1986 = new A(a1984.get()); - - A a1987 = new A(a1985.get()); - A a1988 = new A(a1986.get()); - - A a1989 = new A(a1987.get()); - A a1990 = new A(a1988.get()); - - A a1991 = new A(a1989.get()); - A a1992 = new A(a1990.get()); - - A a1993 = new A(a1991.get()); - A a1994 = new A(a1992.get()); - - A a1995 = new A(a1993.get()); - A a1996 = new A(a1994.get()); - - A a1997 = new A(a1995.get()); - A a1998 = new A(a1996.get()); - - A a1999 = new A(a1997.get()); - A a2000 = new A(a1998.get()); - - A a2001 = new A(a1999.get()); - A a2002 = new A(a2000.get()); - - A a2003 = new A(a2001.get()); - A a2004 = new A(a2002.get()); - - A a2005 = new A(a2003.get()); - A a2006 = new A(a2004.get()); - - A a2007 = new A(a2005.get()); - A a2008 = new A(a2006.get()); - - A a2009 = new A(a2007.get()); - A a2010 = new A(a2008.get()); - - A a2011 = new A(a2009.get()); - A a2012 = new A(a2010.get()); - - A a2013 = new A(a2011.get()); - A a2014 = new A(a2012.get()); - - A a2015 = new A(a2013.get()); - A a2016 = new A(a2014.get()); - - A a2017 = new A(a2015.get()); - A a2018 = new A(a2016.get()); - - A a2019 = new A(a2017.get()); - A a2020 = new A(a2018.get()); - - A a2021 = new A(a2019.get()); - A a2022 = new A(a2020.get()); - - A a2023 = new A(a2021.get()); - A a2024 = new A(a2022.get()); - - A a2025 = new A(a2023.get()); - A a2026 = new A(a2024.get()); - - A a2027 = new A(a2025.get()); - A a2028 = new A(a2026.get()); - - A a2029 = new A(a2027.get()); - A a2030 = new A(a2028.get()); - - A a2031 = new A(a2029.get()); - A a2032 = new A(a2030.get()); - - A a2033 = new A(a2031.get()); - A a2034 = new A(a2032.get()); - - A a2035 = new A(a2033.get()); - A a2036 = new A(a2034.get()); - - A a2037 = new A(a2035.get()); - A a2038 = new A(a2036.get()); - - A a2039 = new A(a2037.get()); - A a2040 = new A(a2038.get()); - - A a2041 = new A(a2039.get()); - A a2042 = new A(a2040.get()); - - A a2043 = new A(a2041.get()); - A a2044 = new A(a2042.get()); - - A a2045 = new A(a2043.get()); - A a2046 = new A(a2044.get()); - - A a2047 = new A(a2045.get()); - A a2048 = new A(a2046.get()); - - A a2049 = new A(a2047.get()); - A a2050 = new A(a2048.get()); - - A a2051 = new A(a2049.get()); - A a2052 = new A(a2050.get()); - - A a2053 = new A(a2051.get()); - A a2054 = new A(a2052.get()); - - A a2055 = new A(a2053.get()); - A a2056 = new A(a2054.get()); - - A a2057 = new A(a2055.get()); - A a2058 = new A(a2056.get()); - - A a2059 = new A(a2057.get()); - A a2060 = new A(a2058.get()); - - A a2061 = new A(a2059.get()); - A a2062 = new A(a2060.get()); - - A a2063 = new A(a2061.get()); - A a2064 = new A(a2062.get()); - - A a2065 = new A(a2063.get()); - A a2066 = new A(a2064.get()); - - A a2067 = new A(a2065.get()); - A a2068 = new A(a2066.get()); - - A a2069 = new A(a2067.get()); - A a2070 = new A(a2068.get()); - - A a2071 = new A(a2069.get()); - A a2072 = new A(a2070.get()); - - A a2073 = new A(a2071.get()); - A a2074 = new A(a2072.get()); - - A a2075 = new A(a2073.get()); - A a2076 = new A(a2074.get()); - - A a2077 = new A(a2075.get()); - A a2078 = new A(a2076.get()); - - A a2079 = new A(a2077.get()); - A a2080 = new A(a2078.get()); - - A a2081 = new A(a2079.get()); - A a2082 = new A(a2080.get()); - - A a2083 = new A(a2081.get()); - A a2084 = new A(a2082.get()); - - A a2085 = new A(a2083.get()); - A a2086 = new A(a2084.get()); - - A a2087 = new A(a2085.get()); - A a2088 = new A(a2086.get()); - - A a2089 = new A(a2087.get()); - A a2090 = new A(a2088.get()); - - A a2091 = new A(a2089.get()); - A a2092 = new A(a2090.get()); - - A a2093 = new A(a2091.get()); - A a2094 = new A(a2092.get()); - - A a2095 = new A(a2093.get()); - A a2096 = new A(a2094.get()); - - A a2097 = new A(a2095.get()); - A a2098 = new A(a2096.get()); - - A a2099 = new A(a2097.get()); - A a2100 = new A(a2098.get()); - - A a2101 = new A(a2099.get()); - A a2102 = new A(a2100.get()); - - A a2103 = new A(a2101.get()); - A a2104 = new A(a2102.get()); - - A a2105 = new A(a2103.get()); - A a2106 = new A(a2104.get()); - - A a2107 = new A(a2105.get()); - A a2108 = new A(a2106.get()); - - A a2109 = new A(a2107.get()); - A a2110 = new A(a2108.get()); - - A a2111 = new A(a2109.get()); - A a2112 = new A(a2110.get()); - - A a2113 = new A(a2111.get()); - A a2114 = new A(a2112.get()); - - A a2115 = new A(a2113.get()); - A a2116 = new A(a2114.get()); - - A a2117 = new A(a2115.get()); - A a2118 = new A(a2116.get()); - - A a2119 = new A(a2117.get()); - A a2120 = new A(a2118.get()); - - A a2121 = new A(a2119.get()); - A a2122 = new A(a2120.get()); - - A a2123 = new A(a2121.get()); - A a2124 = new A(a2122.get()); - - A a2125 = new A(a2123.get()); - A a2126 = new A(a2124.get()); - - A a2127 = new A(a2125.get()); - A a2128 = new A(a2126.get()); - - A a2129 = new A(a2127.get()); - A a2130 = new A(a2128.get()); - - A a2131 = new A(a2129.get()); - A a2132 = new A(a2130.get()); - - A a2133 = new A(a2131.get()); - A a2134 = new A(a2132.get()); - - A a2135 = new A(a2133.get()); - A a2136 = new A(a2134.get()); - - A a2137 = new A(a2135.get()); - A a2138 = new A(a2136.get()); - - A a2139 = new A(a2137.get()); - A a2140 = new A(a2138.get()); - - A a2141 = new A(a2139.get()); - A a2142 = new A(a2140.get()); - - A a2143 = new A(a2141.get()); - A a2144 = new A(a2142.get()); - - A a2145 = new A(a2143.get()); - A a2146 = new A(a2144.get()); - - A a2147 = new A(a2145.get()); - A a2148 = new A(a2146.get()); - - A a2149 = new A(a2147.get()); - A a2150 = new A(a2148.get()); - - A a2151 = new A(a2149.get()); - A a2152 = new A(a2150.get()); - - A a2153 = new A(a2151.get()); - A a2154 = new A(a2152.get()); - - A a2155 = new A(a2153.get()); - A a2156 = new A(a2154.get()); - - A a2157 = new A(a2155.get()); - A a2158 = new A(a2156.get()); - - A a2159 = new A(a2157.get()); - A a2160 = new A(a2158.get()); - - A a2161 = new A(a2159.get()); - A a2162 = new A(a2160.get()); - - A a2163 = new A(a2161.get()); - A a2164 = new A(a2162.get()); - - A a2165 = new A(a2163.get()); - A a2166 = new A(a2164.get()); - - A a2167 = new A(a2165.get()); - A a2168 = new A(a2166.get()); - - A a2169 = new A(a2167.get()); - A a2170 = new A(a2168.get()); - - A a2171 = new A(a2169.get()); - A a2172 = new A(a2170.get()); - - A a2173 = new A(a2171.get()); - A a2174 = new A(a2172.get()); - - A a2175 = new A(a2173.get()); - A a2176 = new A(a2174.get()); - - A a2177 = new A(a2175.get()); - A a2178 = new A(a2176.get()); - - A a2179 = new A(a2177.get()); - A a2180 = new A(a2178.get()); - - A a2181 = new A(a2179.get()); - A a2182 = new A(a2180.get()); - - A a2183 = new A(a2181.get()); - A a2184 = new A(a2182.get()); - - A a2185 = new A(a2183.get()); - A a2186 = new A(a2184.get()); - - A a2187 = new A(a2185.get()); - A a2188 = new A(a2186.get()); - - A a2189 = new A(a2187.get()); - A a2190 = new A(a2188.get()); - - A a2191 = new A(a2189.get()); - A a2192 = new A(a2190.get()); - - A a2193 = new A(a2191.get()); - A a2194 = new A(a2192.get()); - - A a2195 = new A(a2193.get()); - A a2196 = new A(a2194.get()); - - A a2197 = new A(a2195.get()); - A a2198 = new A(a2196.get()); - - A a2199 = new A(a2197.get()); - A a2200 = new A(a2198.get()); - - A a2201 = new A(a2199.get()); - A a2202 = new A(a2200.get()); - - A a2203 = new A(a2201.get()); - A a2204 = new A(a2202.get()); - - A a2205 = new A(a2203.get()); - A a2206 = new A(a2204.get()); - - A a2207 = new A(a2205.get()); - A a2208 = new A(a2206.get()); - - A a2209 = new A(a2207.get()); - A a2210 = new A(a2208.get()); - - A a2211 = new A(a2209.get()); - A a2212 = new A(a2210.get()); - - A a2213 = new A(a2211.get()); - A a2214 = new A(a2212.get()); - - A a2215 = new A(a2213.get()); - A a2216 = new A(a2214.get()); - - A a2217 = new A(a2215.get()); - A a2218 = new A(a2216.get()); - - A a2219 = new A(a2217.get()); - A a2220 = new A(a2218.get()); - - A a2221 = new A(a2219.get()); - A a2222 = new A(a2220.get()); - - A a2223 = new A(a2221.get()); - A a2224 = new A(a2222.get()); - - A a2225 = new A(a2223.get()); - A a2226 = new A(a2224.get()); - - A a2227 = new A(a2225.get()); - A a2228 = new A(a2226.get()); - - A a2229 = new A(a2227.get()); - A a2230 = new A(a2228.get()); - - A a2231 = new A(a2229.get()); - A a2232 = new A(a2230.get()); - - A a2233 = new A(a2231.get()); - A a2234 = new A(a2232.get()); - - A a2235 = new A(a2233.get()); - A a2236 = new A(a2234.get()); - - A a2237 = new A(a2235.get()); - A a2238 = new A(a2236.get()); - - A a2239 = new A(a2237.get()); - A a2240 = new A(a2238.get()); - - A a2241 = new A(a2239.get()); - A a2242 = new A(a2240.get()); - - A a2243 = new A(a2241.get()); - A a2244 = new A(a2242.get()); - - A a2245 = new A(a2243.get()); - A a2246 = new A(a2244.get()); - - A a2247 = new A(a2245.get()); - A a2248 = new A(a2246.get()); - - A a2249 = new A(a2247.get()); - A a2250 = new A(a2248.get()); - - A a2251 = new A(a2249.get()); - A a2252 = new A(a2250.get()); - - A a2253 = new A(a2251.get()); - A a2254 = new A(a2252.get()); - - A a2255 = new A(a2253.get()); - A a2256 = new A(a2254.get()); - - A a2257 = new A(a2255.get()); - A a2258 = new A(a2256.get()); - - A a2259 = new A(a2257.get()); - A a2260 = new A(a2258.get()); - - A a2261 = new A(a2259.get()); - A a2262 = new A(a2260.get()); - - A a2263 = new A(a2261.get()); - A a2264 = new A(a2262.get()); - - A a2265 = new A(a2263.get()); - A a2266 = new A(a2264.get()); - - A a2267 = new A(a2265.get()); - A a2268 = new A(a2266.get()); - - A a2269 = new A(a2267.get()); - A a2270 = new A(a2268.get()); - - A a2271 = new A(a2269.get()); - A a2272 = new A(a2270.get()); - - A a2273 = new A(a2271.get()); - A a2274 = new A(a2272.get()); - - A a2275 = new A(a2273.get()); - A a2276 = new A(a2274.get()); - - A a2277 = new A(a2275.get()); - A a2278 = new A(a2276.get()); - - A a2279 = new A(a2277.get()); - A a2280 = new A(a2278.get()); - - A a2281 = new A(a2279.get()); - A a2282 = new A(a2280.get()); - - A a2283 = new A(a2281.get()); - A a2284 = new A(a2282.get()); - - A a2285 = new A(a2283.get()); - A a2286 = new A(a2284.get()); - - A a2287 = new A(a2285.get()); - A a2288 = new A(a2286.get()); - - A a2289 = new A(a2287.get()); - A a2290 = new A(a2288.get()); - - A a2291 = new A(a2289.get()); - A a2292 = new A(a2290.get()); - - A a2293 = new A(a2291.get()); - A a2294 = new A(a2292.get()); - - A a2295 = new A(a2293.get()); - A a2296 = new A(a2294.get()); - - A a2297 = new A(a2295.get()); - A a2298 = new A(a2296.get()); - - A a2299 = new A(a2297.get()); - A a2300 = new A(a2298.get()); - - A a2301 = new A(a2299.get()); - A a2302 = new A(a2300.get()); - - A a2303 = new A(a2301.get()); - A a2304 = new A(a2302.get()); - - A a2305 = new A(a2303.get()); - A a2306 = new A(a2304.get()); - - A a2307 = new A(a2305.get()); - A a2308 = new A(a2306.get()); - - A a2309 = new A(a2307.get()); - A a2310 = new A(a2308.get()); - - A a2311 = new A(a2309.get()); - A a2312 = new A(a2310.get()); - - A a2313 = new A(a2311.get()); - A a2314 = new A(a2312.get()); - - A a2315 = new A(a2313.get()); - A a2316 = new A(a2314.get()); - - A a2317 = new A(a2315.get()); - A a2318 = new A(a2316.get()); - - A a2319 = new A(a2317.get()); - A a2320 = new A(a2318.get()); - - A a2321 = new A(a2319.get()); - A a2322 = new A(a2320.get()); - - A a2323 = new A(a2321.get()); - A a2324 = new A(a2322.get()); - - A a2325 = new A(a2323.get()); - A a2326 = new A(a2324.get()); - - A a2327 = new A(a2325.get()); - A a2328 = new A(a2326.get()); - - A a2329 = new A(a2327.get()); - A a2330 = new A(a2328.get()); - - A a2331 = new A(a2329.get()); - A a2332 = new A(a2330.get()); - - A a2333 = new A(a2331.get()); - A a2334 = new A(a2332.get()); - - A a2335 = new A(a2333.get()); - A a2336 = new A(a2334.get()); - - A a2337 = new A(a2335.get()); - A a2338 = new A(a2336.get()); - - A a2339 = new A(a2337.get()); - A a2340 = new A(a2338.get()); - - A a2341 = new A(a2339.get()); - A a2342 = new A(a2340.get()); - - A a2343 = new A(a2341.get()); - A a2344 = new A(a2342.get()); - - A a2345 = new A(a2343.get()); - A a2346 = new A(a2344.get()); - - A a2347 = new A(a2345.get()); - A a2348 = new A(a2346.get()); - - A a2349 = new A(a2347.get()); - A a2350 = new A(a2348.get()); - - A a2351 = new A(a2349.get()); - A a2352 = new A(a2350.get()); - - A a2353 = new A(a2351.get()); - A a2354 = new A(a2352.get()); - - A a2355 = new A(a2353.get()); - A a2356 = new A(a2354.get()); - - A a2357 = new A(a2355.get()); - A a2358 = new A(a2356.get()); - - A a2359 = new A(a2357.get()); - A a2360 = new A(a2358.get()); - - A a2361 = new A(a2359.get()); - A a2362 = new A(a2360.get()); - - A a2363 = new A(a2361.get()); - A a2364 = new A(a2362.get()); - - A a2365 = new A(a2363.get()); - A a2366 = new A(a2364.get()); - - A a2367 = new A(a2365.get()); - A a2368 = new A(a2366.get()); - - A a2369 = new A(a2367.get()); - A a2370 = new A(a2368.get()); - - A a2371 = new A(a2369.get()); - A a2372 = new A(a2370.get()); - - A a2373 = new A(a2371.get()); - A a2374 = new A(a2372.get()); - - A a2375 = new A(a2373.get()); - A a2376 = new A(a2374.get()); - - A a2377 = new A(a2375.get()); - A a2378 = new A(a2376.get()); - - A a2379 = new A(a2377.get()); - A a2380 = new A(a2378.get()); - - A a2381 = new A(a2379.get()); - A a2382 = new A(a2380.get()); - - A a2383 = new A(a2381.get()); - A a2384 = new A(a2382.get()); - - A a2385 = new A(a2383.get()); - A a2386 = new A(a2384.get()); - - A a2387 = new A(a2385.get()); - A a2388 = new A(a2386.get()); - - A a2389 = new A(a2387.get()); - A a2390 = new A(a2388.get()); - - A a2391 = new A(a2389.get()); - A a2392 = new A(a2390.get()); - - A a2393 = new A(a2391.get()); - A a2394 = new A(a2392.get()); - - A a2395 = new A(a2393.get()); - A a2396 = new A(a2394.get()); - - A a2397 = new A(a2395.get()); - A a2398 = new A(a2396.get()); - - A a2399 = new A(a2397.get()); - A a2400 = new A(a2398.get()); - - A a2401 = new A(a2399.get()); - A a2402 = new A(a2400.get()); - - A a2403 = new A(a2401.get()); - A a2404 = new A(a2402.get()); - - A a2405 = new A(a2403.get()); - A a2406 = new A(a2404.get()); - - A a2407 = new A(a2405.get()); - A a2408 = new A(a2406.get()); - - A a2409 = new A(a2407.get()); - A a2410 = new A(a2408.get()); - - A a2411 = new A(a2409.get()); - A a2412 = new A(a2410.get()); - - A a2413 = new A(a2411.get()); - A a2414 = new A(a2412.get()); - - A a2415 = new A(a2413.get()); - A a2416 = new A(a2414.get()); - - A a2417 = new A(a2415.get()); - A a2418 = new A(a2416.get()); - - A a2419 = new A(a2417.get()); - A a2420 = new A(a2418.get()); - - A a2421 = new A(a2419.get()); - A a2422 = new A(a2420.get()); - - A a2423 = new A(a2421.get()); - A a2424 = new A(a2422.get()); - - A a2425 = new A(a2423.get()); - A a2426 = new A(a2424.get()); - - A a2427 = new A(a2425.get()); - A a2428 = new A(a2426.get()); - - A a2429 = new A(a2427.get()); - A a2430 = new A(a2428.get()); - - A a2431 = new A(a2429.get()); - A a2432 = new A(a2430.get()); - - A a2433 = new A(a2431.get()); - A a2434 = new A(a2432.get()); - - A a2435 = new A(a2433.get()); - A a2436 = new A(a2434.get()); - - A a2437 = new A(a2435.get()); - A a2438 = new A(a2436.get()); - - A a2439 = new A(a2437.get()); - A a2440 = new A(a2438.get()); - - A a2441 = new A(a2439.get()); - A a2442 = new A(a2440.get()); - - A a2443 = new A(a2441.get()); - A a2444 = new A(a2442.get()); - - A a2445 = new A(a2443.get()); - A a2446 = new A(a2444.get()); - - A a2447 = new A(a2445.get()); - A a2448 = new A(a2446.get()); - - A a2449 = new A(a2447.get()); - A a2450 = new A(a2448.get()); - - A a2451 = new A(a2449.get()); - A a2452 = new A(a2450.get()); - - A a2453 = new A(a2451.get()); - A a2454 = new A(a2452.get()); - - A a2455 = new A(a2453.get()); - A a2456 = new A(a2454.get()); - - A a2457 = new A(a2455.get()); - A a2458 = new A(a2456.get()); - - A a2459 = new A(a2457.get()); - A a2460 = new A(a2458.get()); - - A a2461 = new A(a2459.get()); - A a2462 = new A(a2460.get()); - - A a2463 = new A(a2461.get()); - A a2464 = new A(a2462.get()); - - A a2465 = new A(a2463.get()); - A a2466 = new A(a2464.get()); - - A a2467 = new A(a2465.get()); - A a2468 = new A(a2466.get()); - - A a2469 = new A(a2467.get()); - A a2470 = new A(a2468.get()); - - A a2471 = new A(a2469.get()); - A a2472 = new A(a2470.get()); - - A a2473 = new A(a2471.get()); - A a2474 = new A(a2472.get()); - - A a2475 = new A(a2473.get()); - A a2476 = new A(a2474.get()); - - A a2477 = new A(a2475.get()); - A a2478 = new A(a2476.get()); - - A a2479 = new A(a2477.get()); - A a2480 = new A(a2478.get()); - - A a2481 = new A(a2479.get()); - A a2482 = new A(a2480.get()); - - A a2483 = new A(a2481.get()); - A a2484 = new A(a2482.get()); - - A a2485 = new A(a2483.get()); - A a2486 = new A(a2484.get()); - - A a2487 = new A(a2485.get()); - A a2488 = new A(a2486.get()); - - A a2489 = new A(a2487.get()); - A a2490 = new A(a2488.get()); - - A a2491 = new A(a2489.get()); - A a2492 = new A(a2490.get()); - - A a2493 = new A(a2491.get()); - A a2494 = new A(a2492.get()); - - A a2495 = new A(a2493.get()); - A a2496 = new A(a2494.get()); - - A a2497 = new A(a2495.get()); - A a2498 = new A(a2496.get()); - - A a2499 = new A(a2497.get()); - A a2500 = new A(a2498.get()); - - A a2501 = new A(a2499.get()); - A a2502 = new A(a2500.get()); - - A a2503 = new A(a2501.get()); - A a2504 = new A(a2502.get()); - - A a2505 = new A(a2503.get()); - A a2506 = new A(a2504.get()); - - A a2507 = new A(a2505.get()); - A a2508 = new A(a2506.get()); - - A a2509 = new A(a2507.get()); - A a2510 = new A(a2508.get()); - - A a2511 = new A(a2509.get()); - A a2512 = new A(a2510.get()); - - A a2513 = new A(a2511.get()); - A a2514 = new A(a2512.get()); - - A a2515 = new A(a2513.get()); - A a2516 = new A(a2514.get()); - - A a2517 = new A(a2515.get()); - A a2518 = new A(a2516.get()); - - A a2519 = new A(a2517.get()); - A a2520 = new A(a2518.get()); - - A a2521 = new A(a2519.get()); - A a2522 = new A(a2520.get()); - - A a2523 = new A(a2521.get()); - A a2524 = new A(a2522.get()); - - A a2525 = new A(a2523.get()); - A a2526 = new A(a2524.get()); - - A a2527 = new A(a2525.get()); - A a2528 = new A(a2526.get()); - - A a2529 = new A(a2527.get()); - A a2530 = new A(a2528.get()); - - A a2531 = new A(a2529.get()); - A a2532 = new A(a2530.get()); - - A a2533 = new A(a2531.get()); - A a2534 = new A(a2532.get()); - - A a2535 = new A(a2533.get()); - A a2536 = new A(a2534.get()); - - A a2537 = new A(a2535.get()); - A a2538 = new A(a2536.get()); - - A a2539 = new A(a2537.get()); - A a2540 = new A(a2538.get()); - - A a2541 = new A(a2539.get()); - A a2542 = new A(a2540.get()); - - A a2543 = new A(a2541.get()); - A a2544 = new A(a2542.get()); - - A a2545 = new A(a2543.get()); - A a2546 = new A(a2544.get()); - - A a2547 = new A(a2545.get()); - A a2548 = new A(a2546.get()); - - A a2549 = new A(a2547.get()); - A a2550 = new A(a2548.get()); - - A a2551 = new A(a2549.get()); - A a2552 = new A(a2550.get()); - - A a2553 = new A(a2551.get()); - A a2554 = new A(a2552.get()); - - A a2555 = new A(a2553.get()); - A a2556 = new A(a2554.get()); - - A a2557 = new A(a2555.get()); - A a2558 = new A(a2556.get()); - - A a2559 = new A(a2557.get()); - A a2560 = new A(a2558.get()); - - A a2561 = new A(a2559.get()); - A a2562 = new A(a2560.get()); - - A a2563 = new A(a2561.get()); - A a2564 = new A(a2562.get()); - - A a2565 = new A(a2563.get()); - A a2566 = new A(a2564.get()); - - A a2567 = new A(a2565.get()); - A a2568 = new A(a2566.get()); - - A a2569 = new A(a2567.get()); - A a2570 = new A(a2568.get()); - - A a2571 = new A(a2569.get()); - A a2572 = new A(a2570.get()); - - A a2573 = new A(a2571.get()); - A a2574 = new A(a2572.get()); - - A a2575 = new A(a2573.get()); - A a2576 = new A(a2574.get()); - - A a2577 = new A(a2575.get()); - A a2578 = new A(a2576.get()); - - A a2579 = new A(a2577.get()); - A a2580 = new A(a2578.get()); - - A a2581 = new A(a2579.get()); - A a2582 = new A(a2580.get()); - - A a2583 = new A(a2581.get()); - A a2584 = new A(a2582.get()); - - A a2585 = new A(a2583.get()); - A a2586 = new A(a2584.get()); - - A a2587 = new A(a2585.get()); - A a2588 = new A(a2586.get()); - - A a2589 = new A(a2587.get()); - A a2590 = new A(a2588.get()); - - A a2591 = new A(a2589.get()); - A a2592 = new A(a2590.get()); - - A a2593 = new A(a2591.get()); - A a2594 = new A(a2592.get()); - - A a2595 = new A(a2593.get()); - A a2596 = new A(a2594.get()); - - A a2597 = new A(a2595.get()); - A a2598 = new A(a2596.get()); - - A a2599 = new A(a2597.get()); - A a2600 = new A(a2598.get()); - - A a2601 = new A(a2599.get()); - A a2602 = new A(a2600.get()); - - A a2603 = new A(a2601.get()); - A a2604 = new A(a2602.get()); - - A a2605 = new A(a2603.get()); - A a2606 = new A(a2604.get()); - - A a2607 = new A(a2605.get()); - A a2608 = new A(a2606.get()); - - A a2609 = new A(a2607.get()); - A a2610 = new A(a2608.get()); - - A a2611 = new A(a2609.get()); - A a2612 = new A(a2610.get()); - - A a2613 = new A(a2611.get()); - A a2614 = new A(a2612.get()); - - A a2615 = new A(a2613.get()); - A a2616 = new A(a2614.get()); - - A a2617 = new A(a2615.get()); - A a2618 = new A(a2616.get()); - - A a2619 = new A(a2617.get()); - A a2620 = new A(a2618.get()); - - A a2621 = new A(a2619.get()); - A a2622 = new A(a2620.get()); - - A a2623 = new A(a2621.get()); - A a2624 = new A(a2622.get()); - - A a2625 = new A(a2623.get()); - A a2626 = new A(a2624.get()); - - A a2627 = new A(a2625.get()); - A a2628 = new A(a2626.get()); - - A a2629 = new A(a2627.get()); - A a2630 = new A(a2628.get()); - - A a2631 = new A(a2629.get()); - A a2632 = new A(a2630.get()); - - A a2633 = new A(a2631.get()); - A a2634 = new A(a2632.get()); - - A a2635 = new A(a2633.get()); - A a2636 = new A(a2634.get()); - - A a2637 = new A(a2635.get()); - A a2638 = new A(a2636.get()); - - A a2639 = new A(a2637.get()); - A a2640 = new A(a2638.get()); - - A a2641 = new A(a2639.get()); - A a2642 = new A(a2640.get()); - - A a2643 = new A(a2641.get()); - A a2644 = new A(a2642.get()); - - A a2645 = new A(a2643.get()); - A a2646 = new A(a2644.get()); - - A a2647 = new A(a2645.get()); - A a2648 = new A(a2646.get()); - - A a2649 = new A(a2647.get()); - A a2650 = new A(a2648.get()); - - A a2651 = new A(a2649.get()); - A a2652 = new A(a2650.get()); - - A a2653 = new A(a2651.get()); - A a2654 = new A(a2652.get()); - - A a2655 = new A(a2653.get()); - A a2656 = new A(a2654.get()); - - A a2657 = new A(a2655.get()); - A a2658 = new A(a2656.get()); - - A a2659 = new A(a2657.get()); - A a2660 = new A(a2658.get()); - - A a2661 = new A(a2659.get()); - A a2662 = new A(a2660.get()); - - A a2663 = new A(a2661.get()); - A a2664 = new A(a2662.get()); - - A a2665 = new A(a2663.get()); - A a2666 = new A(a2664.get()); - - A a2667 = new A(a2665.get()); - A a2668 = new A(a2666.get()); - - A a2669 = new A(a2667.get()); - A a2670 = new A(a2668.get()); - - A a2671 = new A(a2669.get()); - A a2672 = new A(a2670.get()); - - A a2673 = new A(a2671.get()); - A a2674 = new A(a2672.get()); - - A a2675 = new A(a2673.get()); - A a2676 = new A(a2674.get()); - - A a2677 = new A(a2675.get()); - A a2678 = new A(a2676.get()); - - A a2679 = new A(a2677.get()); - A a2680 = new A(a2678.get()); - - A a2681 = new A(a2679.get()); - A a2682 = new A(a2680.get()); - - A a2683 = new A(a2681.get()); - A a2684 = new A(a2682.get()); - - A a2685 = new A(a2683.get()); - A a2686 = new A(a2684.get()); - - A a2687 = new A(a2685.get()); - A a2688 = new A(a2686.get()); - - A a2689 = new A(a2687.get()); - A a2690 = new A(a2688.get()); - - A a2691 = new A(a2689.get()); - A a2692 = new A(a2690.get()); - - A a2693 = new A(a2691.get()); - A a2694 = new A(a2692.get()); - - A a2695 = new A(a2693.get()); - A a2696 = new A(a2694.get()); - - A a2697 = new A(a2695.get()); - A a2698 = new A(a2696.get()); - - A a2699 = new A(a2697.get()); - A a2700 = new A(a2698.get()); - - A a2701 = new A(a2699.get()); - A a2702 = new A(a2700.get()); - - A a2703 = new A(a2701.get()); - A a2704 = new A(a2702.get()); - - A a2705 = new A(a2703.get()); - A a2706 = new A(a2704.get()); - - A a2707 = new A(a2705.get()); - A a2708 = new A(a2706.get()); - - A a2709 = new A(a2707.get()); - A a2710 = new A(a2708.get()); - - A a2711 = new A(a2709.get()); - A a2712 = new A(a2710.get()); - - A a2713 = new A(a2711.get()); - A a2714 = new A(a2712.get()); - - A a2715 = new A(a2713.get()); - A a2716 = new A(a2714.get()); - - A a2717 = new A(a2715.get()); - A a2718 = new A(a2716.get()); - - A a2719 = new A(a2717.get()); - A a2720 = new A(a2718.get()); - - A a2721 = new A(a2719.get()); - A a2722 = new A(a2720.get()); - - A a2723 = new A(a2721.get()); - A a2724 = new A(a2722.get()); - - A a2725 = new A(a2723.get()); - A a2726 = new A(a2724.get()); - - A a2727 = new A(a2725.get()); - A a2728 = new A(a2726.get()); - - A a2729 = new A(a2727.get()); - A a2730 = new A(a2728.get()); - - A a2731 = new A(a2729.get()); - A a2732 = new A(a2730.get()); - - A a2733 = new A(a2731.get()); - A a2734 = new A(a2732.get()); - - A a2735 = new A(a2733.get()); - A a2736 = new A(a2734.get()); - - A a2737 = new A(a2735.get()); - A a2738 = new A(a2736.get()); - - A a2739 = new A(a2737.get()); - A a2740 = new A(a2738.get()); - - A a2741 = new A(a2739.get()); - A a2742 = new A(a2740.get()); - - A a2743 = new A(a2741.get()); - A a2744 = new A(a2742.get()); - - A a2745 = new A(a2743.get()); - A a2746 = new A(a2744.get()); - - A a2747 = new A(a2745.get()); - A a2748 = new A(a2746.get()); - - A a2749 = new A(a2747.get()); - A a2750 = new A(a2748.get()); - - A a2751 = new A(a2749.get()); - A a2752 = new A(a2750.get()); - - A a2753 = new A(a2751.get()); - A a2754 = new A(a2752.get()); - - A a2755 = new A(a2753.get()); - A a2756 = new A(a2754.get()); - - A a2757 = new A(a2755.get()); - A a2758 = new A(a2756.get()); - - A a2759 = new A(a2757.get()); - A a2760 = new A(a2758.get()); - - A a2761 = new A(a2759.get()); - A a2762 = new A(a2760.get()); - - A a2763 = new A(a2761.get()); - A a2764 = new A(a2762.get()); - - A a2765 = new A(a2763.get()); - A a2766 = new A(a2764.get()); - - A a2767 = new A(a2765.get()); - A a2768 = new A(a2766.get()); - - A a2769 = new A(a2767.get()); - A a2770 = new A(a2768.get()); - - A a2771 = new A(a2769.get()); - A a2772 = new A(a2770.get()); - - A a2773 = new A(a2771.get()); - A a2774 = new A(a2772.get()); - - A a2775 = new A(a2773.get()); - A a2776 = new A(a2774.get()); - - A a2777 = new A(a2775.get()); - A a2778 = new A(a2776.get()); - - A a2779 = new A(a2777.get()); - A a2780 = new A(a2778.get()); - - A a2781 = new A(a2779.get()); - A a2782 = new A(a2780.get()); - - A a2783 = new A(a2781.get()); - A a2784 = new A(a2782.get()); - - A a2785 = new A(a2783.get()); - A a2786 = new A(a2784.get()); - - A a2787 = new A(a2785.get()); - A a2788 = new A(a2786.get()); - - A a2789 = new A(a2787.get()); - A a2790 = new A(a2788.get()); - - A a2791 = new A(a2789.get()); - A a2792 = new A(a2790.get()); - - A a2793 = new A(a2791.get()); - A a2794 = new A(a2792.get()); - - A a2795 = new A(a2793.get()); - A a2796 = new A(a2794.get()); - - A a2797 = new A(a2795.get()); - A a2798 = new A(a2796.get()); - - A a2799 = new A(a2797.get()); - A a2800 = new A(a2798.get()); - - A a2801 = new A(a2799.get()); - A a2802 = new A(a2800.get()); - - A a2803 = new A(a2801.get()); - A a2804 = new A(a2802.get()); - - A a2805 = new A(a2803.get()); - A a2806 = new A(a2804.get()); - - A a2807 = new A(a2805.get()); - A a2808 = new A(a2806.get()); - - A a2809 = new A(a2807.get()); - A a2810 = new A(a2808.get()); - - A a2811 = new A(a2809.get()); - A a2812 = new A(a2810.get()); - - A a2813 = new A(a2811.get()); - A a2814 = new A(a2812.get()); - - A a2815 = new A(a2813.get()); - A a2816 = new A(a2814.get()); - - A a2817 = new A(a2815.get()); - A a2818 = new A(a2816.get()); - - A a2819 = new A(a2817.get()); - A a2820 = new A(a2818.get()); - - A a2821 = new A(a2819.get()); - A a2822 = new A(a2820.get()); - - A a2823 = new A(a2821.get()); - A a2824 = new A(a2822.get()); - - A a2825 = new A(a2823.get()); - A a2826 = new A(a2824.get()); - - A a2827 = new A(a2825.get()); - A a2828 = new A(a2826.get()); - - A a2829 = new A(a2827.get()); - A a2830 = new A(a2828.get()); - - A a2831 = new A(a2829.get()); - A a2832 = new A(a2830.get()); - - A a2833 = new A(a2831.get()); - A a2834 = new A(a2832.get()); - - A a2835 = new A(a2833.get()); - A a2836 = new A(a2834.get()); - - A a2837 = new A(a2835.get()); - A a2838 = new A(a2836.get()); - - A a2839 = new A(a2837.get()); - A a2840 = new A(a2838.get()); - - A a2841 = new A(a2839.get()); - A a2842 = new A(a2840.get()); - - A a2843 = new A(a2841.get()); - A a2844 = new A(a2842.get()); - - A a2845 = new A(a2843.get()); - A a2846 = new A(a2844.get()); - - A a2847 = new A(a2845.get()); - A a2848 = new A(a2846.get()); - - A a2849 = new A(a2847.get()); - A a2850 = new A(a2848.get()); - - A a2851 = new A(a2849.get()); - A a2852 = new A(a2850.get()); - - A a2853 = new A(a2851.get()); - A a2854 = new A(a2852.get()); - - A a2855 = new A(a2853.get()); - A a2856 = new A(a2854.get()); - - A a2857 = new A(a2855.get()); - A a2858 = new A(a2856.get()); - - A a2859 = new A(a2857.get()); - A a2860 = new A(a2858.get()); - - A a2861 = new A(a2859.get()); - A a2862 = new A(a2860.get()); - - A a2863 = new A(a2861.get()); - A a2864 = new A(a2862.get()); - - A a2865 = new A(a2863.get()); - A a2866 = new A(a2864.get()); - - A a2867 = new A(a2865.get()); - A a2868 = new A(a2866.get()); - - A a2869 = new A(a2867.get()); - A a2870 = new A(a2868.get()); - - A a2871 = new A(a2869.get()); - A a2872 = new A(a2870.get()); - - A a2873 = new A(a2871.get()); - A a2874 = new A(a2872.get()); - - A a2875 = new A(a2873.get()); - A a2876 = new A(a2874.get()); - - A a2877 = new A(a2875.get()); - A a2878 = new A(a2876.get()); - - A a2879 = new A(a2877.get()); - A a2880 = new A(a2878.get()); - - A a2881 = new A(a2879.get()); - A a2882 = new A(a2880.get()); - - A a2883 = new A(a2881.get()); - A a2884 = new A(a2882.get()); - - A a2885 = new A(a2883.get()); - A a2886 = new A(a2884.get()); - - A a2887 = new A(a2885.get()); - A a2888 = new A(a2886.get()); - - A a2889 = new A(a2887.get()); - A a2890 = new A(a2888.get()); - - A a2891 = new A(a2889.get()); - A a2892 = new A(a2890.get()); - - A a2893 = new A(a2891.get()); - A a2894 = new A(a2892.get()); - - A a2895 = new A(a2893.get()); - A a2896 = new A(a2894.get()); - - A a2897 = new A(a2895.get()); - A a2898 = new A(a2896.get()); - - A a2899 = new A(a2897.get()); - A a2900 = new A(a2898.get()); - - A a2901 = new A(a2899.get()); - A a2902 = new A(a2900.get()); - - A a2903 = new A(a2901.get()); - A a2904 = new A(a2902.get()); - - A a2905 = new A(a2903.get()); - A a2906 = new A(a2904.get()); - - A a2907 = new A(a2905.get()); - A a2908 = new A(a2906.get()); - - A a2909 = new A(a2907.get()); - A a2910 = new A(a2908.get()); - - A a2911 = new A(a2909.get()); - A a2912 = new A(a2910.get()); - - A a2913 = new A(a2911.get()); - A a2914 = new A(a2912.get()); - - A a2915 = new A(a2913.get()); - A a2916 = new A(a2914.get()); - - A a2917 = new A(a2915.get()); - A a2918 = new A(a2916.get()); - - A a2919 = new A(a2917.get()); - A a2920 = new A(a2918.get()); - - A a2921 = new A(a2919.get()); - A a2922 = new A(a2920.get()); - - A a2923 = new A(a2921.get()); - A a2924 = new A(a2922.get()); - - A a2925 = new A(a2923.get()); - A a2926 = new A(a2924.get()); - - A a2927 = new A(a2925.get()); - A a2928 = new A(a2926.get()); - - A a2929 = new A(a2927.get()); - A a2930 = new A(a2928.get()); - - A a2931 = new A(a2929.get()); - A a2932 = new A(a2930.get()); - - A a2933 = new A(a2931.get()); - A a2934 = new A(a2932.get()); - - A a2935 = new A(a2933.get()); - A a2936 = new A(a2934.get()); - - A a2937 = new A(a2935.get()); - A a2938 = new A(a2936.get()); - - A a2939 = new A(a2937.get()); - A a2940 = new A(a2938.get()); - - A a2941 = new A(a2939.get()); - A a2942 = new A(a2940.get()); - - A a2943 = new A(a2941.get()); - A a2944 = new A(a2942.get()); - - A a2945 = new A(a2943.get()); - A a2946 = new A(a2944.get()); - - A a2947 = new A(a2945.get()); - A a2948 = new A(a2946.get()); - - A a2949 = new A(a2947.get()); - A a2950 = new A(a2948.get()); - - A a2951 = new A(a2949.get()); - A a2952 = new A(a2950.get()); - - A a2953 = new A(a2951.get()); - A a2954 = new A(a2952.get()); - - A a2955 = new A(a2953.get()); - A a2956 = new A(a2954.get()); - - A a2957 = new A(a2955.get()); - A a2958 = new A(a2956.get()); - - A a2959 = new A(a2957.get()); - A a2960 = new A(a2958.get()); - - A a2961 = new A(a2959.get()); - A a2962 = new A(a2960.get()); - - A a2963 = new A(a2961.get()); - A a2964 = new A(a2962.get()); - - A a2965 = new A(a2963.get()); - A a2966 = new A(a2964.get()); - - A a2967 = new A(a2965.get()); - A a2968 = new A(a2966.get()); - - A a2969 = new A(a2967.get()); - A a2970 = new A(a2968.get()); - - A a2971 = new A(a2969.get()); - A a2972 = new A(a2970.get()); - - A a2973 = new A(a2971.get()); - A a2974 = new A(a2972.get()); - - A a2975 = new A(a2973.get()); - A a2976 = new A(a2974.get()); - - A a2977 = new A(a2975.get()); - A a2978 = new A(a2976.get()); - - A a2979 = new A(a2977.get()); - A a2980 = new A(a2978.get()); - - A a2981 = new A(a2979.get()); - A a2982 = new A(a2980.get()); - - A a2983 = new A(a2981.get()); - A a2984 = new A(a2982.get()); - - A a2985 = new A(a2983.get()); - A a2986 = new A(a2984.get()); - - A a2987 = new A(a2985.get()); - A a2988 = new A(a2986.get()); - - A a2989 = new A(a2987.get()); - A a2990 = new A(a2988.get()); - - A a2991 = new A(a2989.get()); - A a2992 = new A(a2990.get()); - - A a2993 = new A(a2991.get()); - A a2994 = new A(a2992.get()); - - A a2995 = new A(a2993.get()); - A a2996 = new A(a2994.get()); - - A a2997 = new A(a2995.get()); - A a2998 = new A(a2996.get()); - - A a2999 = new A(a2997.get()); - A a3000 = new A(a2998.get()); - - A a3001 = new A(a2999.get()); - A a3002 = new A(a3000.get()); - - A a3003 = new A(a3001.get()); - A a3004 = new A(a3002.get()); - - A a3005 = new A(a3003.get()); - A a3006 = new A(a3004.get()); - - A a3007 = new A(a3005.get()); - A a3008 = new A(a3006.get()); - - A a3009 = new A(a3007.get()); - A a3010 = new A(a3008.get()); - - A a3011 = new A(a3009.get()); - A a3012 = new A(a3010.get()); - - A a3013 = new A(a3011.get()); - A a3014 = new A(a3012.get()); - - A a3015 = new A(a3013.get()); - A a3016 = new A(a3014.get()); - - A a3017 = new A(a3015.get()); - A a3018 = new A(a3016.get()); - - A a3019 = new A(a3017.get()); - A a3020 = new A(a3018.get()); - - A a3021 = new A(a3019.get()); - A a3022 = new A(a3020.get()); - - A a3023 = new A(a3021.get()); - A a3024 = new A(a3022.get()); - - A a3025 = new A(a3023.get()); - A a3026 = new A(a3024.get()); - - A a3027 = new A(a3025.get()); - A a3028 = new A(a3026.get()); - - A a3029 = new A(a3027.get()); - A a3030 = new A(a3028.get()); - - A a3031 = new A(a3029.get()); - A a3032 = new A(a3030.get()); - - A a3033 = new A(a3031.get()); - A a3034 = new A(a3032.get()); - - A a3035 = new A(a3033.get()); - A a3036 = new A(a3034.get()); - - A a3037 = new A(a3035.get()); - A a3038 = new A(a3036.get()); - - A a3039 = new A(a3037.get()); - A a3040 = new A(a3038.get()); - - A a3041 = new A(a3039.get()); - A a3042 = new A(a3040.get()); - - A a3043 = new A(a3041.get()); - A a3044 = new A(a3042.get()); - - A a3045 = new A(a3043.get()); - A a3046 = new A(a3044.get()); - - A a3047 = new A(a3045.get()); - A a3048 = new A(a3046.get()); - - A a3049 = new A(a3047.get()); - A a3050 = new A(a3048.get()); - - A a3051 = new A(a3049.get()); - A a3052 = new A(a3050.get()); - - A a3053 = new A(a3051.get()); - A a3054 = new A(a3052.get()); - - A a3055 = new A(a3053.get()); - A a3056 = new A(a3054.get()); - - A a3057 = new A(a3055.get()); - A a3058 = new A(a3056.get()); - - A a3059 = new A(a3057.get()); - A a3060 = new A(a3058.get()); - - A a3061 = new A(a3059.get()); - A a3062 = new A(a3060.get()); - - A a3063 = new A(a3061.get()); - A a3064 = new A(a3062.get()); - - A a3065 = new A(a3063.get()); - A a3066 = new A(a3064.get()); - - A a3067 = new A(a3065.get()); - A a3068 = new A(a3066.get()); - - A a3069 = new A(a3067.get()); - A a3070 = new A(a3068.get()); - - A a3071 = new A(a3069.get()); - A a3072 = new A(a3070.get()); - - A a3073 = new A(a3071.get()); - A a3074 = new A(a3072.get()); - - A a3075 = new A(a3073.get()); - A a3076 = new A(a3074.get()); - - A a3077 = new A(a3075.get()); - A a3078 = new A(a3076.get()); - - A a3079 = new A(a3077.get()); - A a3080 = new A(a3078.get()); - - A a3081 = new A(a3079.get()); - A a3082 = new A(a3080.get()); - - A a3083 = new A(a3081.get()); - A a3084 = new A(a3082.get()); - - A a3085 = new A(a3083.get()); - A a3086 = new A(a3084.get()); - - A a3087 = new A(a3085.get()); - A a3088 = new A(a3086.get()); - - A a3089 = new A(a3087.get()); - A a3090 = new A(a3088.get()); - - A a3091 = new A(a3089.get()); - A a3092 = new A(a3090.get()); - - A a3093 = new A(a3091.get()); - A a3094 = new A(a3092.get()); - - A a3095 = new A(a3093.get()); - A a3096 = new A(a3094.get()); - - A a3097 = new A(a3095.get()); - A a3098 = new A(a3096.get()); - - A a3099 = new A(a3097.get()); - A a3100 = new A(a3098.get()); - - A a3101 = new A(a3099.get()); - A a3102 = new A(a3100.get()); - - A a3103 = new A(a3101.get()); - A a3104 = new A(a3102.get()); - - A a3105 = new A(a3103.get()); - A a3106 = new A(a3104.get()); - - A a3107 = new A(a3105.get()); - A a3108 = new A(a3106.get()); - - A a3109 = new A(a3107.get()); - A a3110 = new A(a3108.get()); - - A a3111 = new A(a3109.get()); - A a3112 = new A(a3110.get()); - - A a3113 = new A(a3111.get()); - A a3114 = new A(a3112.get()); - - A a3115 = new A(a3113.get()); - A a3116 = new A(a3114.get()); - - A a3117 = new A(a3115.get()); - A a3118 = new A(a3116.get()); - - A a3119 = new A(a3117.get()); - A a3120 = new A(a3118.get()); - - A a3121 = new A(a3119.get()); - A a3122 = new A(a3120.get()); - - A a3123 = new A(a3121.get()); - A a3124 = new A(a3122.get()); - - A a3125 = new A(a3123.get()); - A a3126 = new A(a3124.get()); - - A a3127 = new A(a3125.get()); - A a3128 = new A(a3126.get()); - - A a3129 = new A(a3127.get()); - A a3130 = new A(a3128.get()); - - A a3131 = new A(a3129.get()); - A a3132 = new A(a3130.get()); - - A a3133 = new A(a3131.get()); - A a3134 = new A(a3132.get()); - - A a3135 = new A(a3133.get()); - A a3136 = new A(a3134.get()); - - A a3137 = new A(a3135.get()); - A a3138 = new A(a3136.get()); - - A a3139 = new A(a3137.get()); - A a3140 = new A(a3138.get()); - - A a3141 = new A(a3139.get()); - A a3142 = new A(a3140.get()); - - A a3143 = new A(a3141.get()); - A a3144 = new A(a3142.get()); - - A a3145 = new A(a3143.get()); - A a3146 = new A(a3144.get()); - - A a3147 = new A(a3145.get()); - A a3148 = new A(a3146.get()); - - A a3149 = new A(a3147.get()); - A a3150 = new A(a3148.get()); - - A a3151 = new A(a3149.get()); - A a3152 = new A(a3150.get()); - - A a3153 = new A(a3151.get()); - A a3154 = new A(a3152.get()); - - A a3155 = new A(a3153.get()); - A a3156 = new A(a3154.get()); - - A a3157 = new A(a3155.get()); - A a3158 = new A(a3156.get()); - - A a3159 = new A(a3157.get()); - A a3160 = new A(a3158.get()); - - A a3161 = new A(a3159.get()); - A a3162 = new A(a3160.get()); - - A a3163 = new A(a3161.get()); - A a3164 = new A(a3162.get()); - - A a3165 = new A(a3163.get()); - A a3166 = new A(a3164.get()); - - A a3167 = new A(a3165.get()); - A a3168 = new A(a3166.get()); - - A a3169 = new A(a3167.get()); - A a3170 = new A(a3168.get()); - - A a3171 = new A(a3169.get()); - A a3172 = new A(a3170.get()); - - A a3173 = new A(a3171.get()); - A a3174 = new A(a3172.get()); - - A a3175 = new A(a3173.get()); - A a3176 = new A(a3174.get()); - - A a3177 = new A(a3175.get()); - A a3178 = new A(a3176.get()); - - A a3179 = new A(a3177.get()); - A a3180 = new A(a3178.get()); - - A a3181 = new A(a3179.get()); - A a3182 = new A(a3180.get()); - - A a3183 = new A(a3181.get()); - A a3184 = new A(a3182.get()); - - A a3185 = new A(a3183.get()); - A a3186 = new A(a3184.get()); - - A a3187 = new A(a3185.get()); - A a3188 = new A(a3186.get()); - - A a3189 = new A(a3187.get()); - A a3190 = new A(a3188.get()); - - A a3191 = new A(a3189.get()); - A a3192 = new A(a3190.get()); - - A a3193 = new A(a3191.get()); - A a3194 = new A(a3192.get()); - - A a3195 = new A(a3193.get()); - A a3196 = new A(a3194.get()); - - A a3197 = new A(a3195.get()); - A a3198 = new A(a3196.get()); - - A a3199 = new A(a3197.get()); - A a3200 = new A(a3198.get()); - - A a3201 = new A(a3199.get()); - A a3202 = new A(a3200.get()); - - A a3203 = new A(a3201.get()); - A a3204 = new A(a3202.get()); - - A a3205 = new A(a3203.get()); - A a3206 = new A(a3204.get()); - - A a3207 = new A(a3205.get()); - A a3208 = new A(a3206.get()); - - A a3209 = new A(a3207.get()); - A a3210 = new A(a3208.get()); - - A a3211 = new A(a3209.get()); - A a3212 = new A(a3210.get()); - - A a3213 = new A(a3211.get()); - A a3214 = new A(a3212.get()); - - A a3215 = new A(a3213.get()); - A a3216 = new A(a3214.get()); - - A a3217 = new A(a3215.get()); - A a3218 = new A(a3216.get()); - - A a3219 = new A(a3217.get()); - A a3220 = new A(a3218.get()); - - A a3221 = new A(a3219.get()); - A a3222 = new A(a3220.get()); - - A a3223 = new A(a3221.get()); - A a3224 = new A(a3222.get()); - - A a3225 = new A(a3223.get()); - A a3226 = new A(a3224.get()); - - A a3227 = new A(a3225.get()); - A a3228 = new A(a3226.get()); - - A a3229 = new A(a3227.get()); - A a3230 = new A(a3228.get()); - - A a3231 = new A(a3229.get()); - A a3232 = new A(a3230.get()); - - A a3233 = new A(a3231.get()); - A a3234 = new A(a3232.get()); - - A a3235 = new A(a3233.get()); - A a3236 = new A(a3234.get()); - - A a3237 = new A(a3235.get()); - A a3238 = new A(a3236.get()); - - A a3239 = new A(a3237.get()); - A a3240 = new A(a3238.get()); - - A a3241 = new A(a3239.get()); - A a3242 = new A(a3240.get()); - - A a3243 = new A(a3241.get()); - A a3244 = new A(a3242.get()); - - A a3245 = new A(a3243.get()); - A a3246 = new A(a3244.get()); - - A a3247 = new A(a3245.get()); - A a3248 = new A(a3246.get()); - - A a3249 = new A(a3247.get()); - A a3250 = new A(a3248.get()); - - A a3251 = new A(a3249.get()); - A a3252 = new A(a3250.get()); - - A a3253 = new A(a3251.get()); - A a3254 = new A(a3252.get()); - - A a3255 = new A(a3253.get()); - A a3256 = new A(a3254.get()); - - A a3257 = new A(a3255.get()); - A a3258 = new A(a3256.get()); - - A a3259 = new A(a3257.get()); - A a3260 = new A(a3258.get()); - - A a3261 = new A(a3259.get()); - A a3262 = new A(a3260.get()); - - A a3263 = new A(a3261.get()); - A a3264 = new A(a3262.get()); - - A a3265 = new A(a3263.get()); - A a3266 = new A(a3264.get()); - - A a3267 = new A(a3265.get()); - A a3268 = new A(a3266.get()); - - A a3269 = new A(a3267.get()); - A a3270 = new A(a3268.get()); - - A a3271 = new A(a3269.get()); - A a3272 = new A(a3270.get()); - - A a3273 = new A(a3271.get()); - A a3274 = new A(a3272.get()); - - A a3275 = new A(a3273.get()); - A a3276 = new A(a3274.get()); - - A a3277 = new A(a3275.get()); - A a3278 = new A(a3276.get()); - - A a3279 = new A(a3277.get()); - A a3280 = new A(a3278.get()); - - A a3281 = new A(a3279.get()); - A a3282 = new A(a3280.get()); - - A a3283 = new A(a3281.get()); - A a3284 = new A(a3282.get()); - - A a3285 = new A(a3283.get()); - A a3286 = new A(a3284.get()); - - A a3287 = new A(a3285.get()); - A a3288 = new A(a3286.get()); - - A a3289 = new A(a3287.get()); - A a3290 = new A(a3288.get()); - - A a3291 = new A(a3289.get()); - A a3292 = new A(a3290.get()); - - A a3293 = new A(a3291.get()); - A a3294 = new A(a3292.get()); - - A a3295 = new A(a3293.get()); - A a3296 = new A(a3294.get()); - - A a3297 = new A(a3295.get()); - A a3298 = new A(a3296.get()); - - A a3299 = new A(a3297.get()); - A a3300 = new A(a3298.get()); - - A a3301 = new A(a3299.get()); - A a3302 = new A(a3300.get()); - - A a3303 = new A(a3301.get()); - A a3304 = new A(a3302.get()); - - A a3305 = new A(a3303.get()); - A a3306 = new A(a3304.get()); - - A a3307 = new A(a3305.get()); - A a3308 = new A(a3306.get()); - - A a3309 = new A(a3307.get()); - A a3310 = new A(a3308.get()); - - A a3311 = new A(a3309.get()); - A a3312 = new A(a3310.get()); - - A a3313 = new A(a3311.get()); - A a3314 = new A(a3312.get()); - - A a3315 = new A(a3313.get()); - A a3316 = new A(a3314.get()); - - A a3317 = new A(a3315.get()); - A a3318 = new A(a3316.get()); - - A a3319 = new A(a3317.get()); - A a3320 = new A(a3318.get()); - - A a3321 = new A(a3319.get()); - A a3322 = new A(a3320.get()); - - A a3323 = new A(a3321.get()); - A a3324 = new A(a3322.get()); - - A a3325 = new A(a3323.get()); - A a3326 = new A(a3324.get()); - - A a3327 = new A(a3325.get()); - A a3328 = new A(a3326.get()); - - A a3329 = new A(a3327.get()); - A a3330 = new A(a3328.get()); - - A a3331 = new A(a3329.get()); - A a3332 = new A(a3330.get()); - - A a3333 = new A(a3331.get()); - A a3334 = new A(a3332.get()); - - A a3335 = new A(a3333.get()); - A a3336 = new A(a3334.get()); - - A a3337 = new A(a3335.get()); - A a3338 = new A(a3336.get()); - - A a3339 = new A(a3337.get()); - A a3340 = new A(a3338.get()); - - A a3341 = new A(a3339.get()); - A a3342 = new A(a3340.get()); - - A a3343 = new A(a3341.get()); - A a3344 = new A(a3342.get()); - - A a3345 = new A(a3343.get()); - A a3346 = new A(a3344.get()); - - A a3347 = new A(a3345.get()); - A a3348 = new A(a3346.get()); - - A a3349 = new A(a3347.get()); - A a3350 = new A(a3348.get()); - - A a3351 = new A(a3349.get()); - A a3352 = new A(a3350.get()); - - A a3353 = new A(a3351.get()); - A a3354 = new A(a3352.get()); - - A a3355 = new A(a3353.get()); - A a3356 = new A(a3354.get()); - - A a3357 = new A(a3355.get()); - A a3358 = new A(a3356.get()); - - A a3359 = new A(a3357.get()); - A a3360 = new A(a3358.get()); - - A a3361 = new A(a3359.get()); - A a3362 = new A(a3360.get()); - - A a3363 = new A(a3361.get()); - A a3364 = new A(a3362.get()); - - A a3365 = new A(a3363.get()); - A a3366 = new A(a3364.get()); - - A a3367 = new A(a3365.get()); - A a3368 = new A(a3366.get()); - - A a3369 = new A(a3367.get()); - A a3370 = new A(a3368.get()); - - A a3371 = new A(a3369.get()); - A a3372 = new A(a3370.get()); - - A a3373 = new A(a3371.get()); - A a3374 = new A(a3372.get()); - - A a3375 = new A(a3373.get()); - A a3376 = new A(a3374.get()); - - A a3377 = new A(a3375.get()); - A a3378 = new A(a3376.get()); - - A a3379 = new A(a3377.get()); - A a3380 = new A(a3378.get()); - - A a3381 = new A(a3379.get()); - A a3382 = new A(a3380.get()); - - A a3383 = new A(a3381.get()); - A a3384 = new A(a3382.get()); - - A a3385 = new A(a3383.get()); - A a3386 = new A(a3384.get()); - - A a3387 = new A(a3385.get()); - A a3388 = new A(a3386.get()); - - A a3389 = new A(a3387.get()); - A a3390 = new A(a3388.get()); - - A a3391 = new A(a3389.get()); - A a3392 = new A(a3390.get()); - - A a3393 = new A(a3391.get()); - A a3394 = new A(a3392.get()); - - A a3395 = new A(a3393.get()); - A a3396 = new A(a3394.get()); - - A a3397 = new A(a3395.get()); - A a3398 = new A(a3396.get()); - - A a3399 = new A(a3397.get()); - A a3400 = new A(a3398.get()); - - A a3401 = new A(a3399.get()); - A a3402 = new A(a3400.get()); - - A a3403 = new A(a3401.get()); - A a3404 = new A(a3402.get()); - - A a3405 = new A(a3403.get()); - A a3406 = new A(a3404.get()); - - A a3407 = new A(a3405.get()); - A a3408 = new A(a3406.get()); - - A a3409 = new A(a3407.get()); - A a3410 = new A(a3408.get()); - - A a3411 = new A(a3409.get()); - A a3412 = new A(a3410.get()); - - A a3413 = new A(a3411.get()); - A a3414 = new A(a3412.get()); - - A a3415 = new A(a3413.get()); - A a3416 = new A(a3414.get()); - - A a3417 = new A(a3415.get()); - A a3418 = new A(a3416.get()); - - A a3419 = new A(a3417.get()); - A a3420 = new A(a3418.get()); - - A a3421 = new A(a3419.get()); - A a3422 = new A(a3420.get()); - - A a3423 = new A(a3421.get()); - A a3424 = new A(a3422.get()); - - A a3425 = new A(a3423.get()); - A a3426 = new A(a3424.get()); - - A a3427 = new A(a3425.get()); - A a3428 = new A(a3426.get()); - - A a3429 = new A(a3427.get()); - A a3430 = new A(a3428.get()); - - A a3431 = new A(a3429.get()); - A a3432 = new A(a3430.get()); - - A a3433 = new A(a3431.get()); - A a3434 = new A(a3432.get()); - - A a3435 = new A(a3433.get()); - A a3436 = new A(a3434.get()); - - A a3437 = new A(a3435.get()); - A a3438 = new A(a3436.get()); - - A a3439 = new A(a3437.get()); - A a3440 = new A(a3438.get()); - - A a3441 = new A(a3439.get()); - A a3442 = new A(a3440.get()); - - A a3443 = new A(a3441.get()); - A a3444 = new A(a3442.get()); - - A a3445 = new A(a3443.get()); - A a3446 = new A(a3444.get()); - - A a3447 = new A(a3445.get()); - A a3448 = new A(a3446.get()); - - A a3449 = new A(a3447.get()); - A a3450 = new A(a3448.get()); - - A a3451 = new A(a3449.get()); - A a3452 = new A(a3450.get()); - - A a3453 = new A(a3451.get()); - A a3454 = new A(a3452.get()); - - A a3455 = new A(a3453.get()); - A a3456 = new A(a3454.get()); - - A a3457 = new A(a3455.get()); - A a3458 = new A(a3456.get()); - - A a3459 = new A(a3457.get()); - A a3460 = new A(a3458.get()); - - A a3461 = new A(a3459.get()); - A a3462 = new A(a3460.get()); - - A a3463 = new A(a3461.get()); - A a3464 = new A(a3462.get()); - - A a3465 = new A(a3463.get()); - A a3466 = new A(a3464.get()); - - A a3467 = new A(a3465.get()); - A a3468 = new A(a3466.get()); - - A a3469 = new A(a3467.get()); - A a3470 = new A(a3468.get()); - - A a3471 = new A(a3469.get()); - A a3472 = new A(a3470.get()); - - A a3473 = new A(a3471.get()); - A a3474 = new A(a3472.get()); - - A a3475 = new A(a3473.get()); - A a3476 = new A(a3474.get()); - - A a3477 = new A(a3475.get()); - A a3478 = new A(a3476.get()); - - A a3479 = new A(a3477.get()); - A a3480 = new A(a3478.get()); - - A a3481 = new A(a3479.get()); - A a3482 = new A(a3480.get()); - - A a3483 = new A(a3481.get()); - A a3484 = new A(a3482.get()); - - A a3485 = new A(a3483.get()); - A a3486 = new A(a3484.get()); - - A a3487 = new A(a3485.get()); - A a3488 = new A(a3486.get()); - - A a3489 = new A(a3487.get()); - A a3490 = new A(a3488.get()); - - A a3491 = new A(a3489.get()); - A a3492 = new A(a3490.get()); - - A a3493 = new A(a3491.get()); - A a3494 = new A(a3492.get()); - - A a3495 = new A(a3493.get()); - A a3496 = new A(a3494.get()); - - A a3497 = new A(a3495.get()); - A a3498 = new A(a3496.get()); - - A a3499 = new A(a3497.get()); - A a3500 = new A(a3498.get()); - - A a3501 = new A(a3499.get()); - A a3502 = new A(a3500.get()); - - A a3503 = new A(a3501.get()); - A a3504 = new A(a3502.get()); - - A a3505 = new A(a3503.get()); - A a3506 = new A(a3504.get()); - - A a3507 = new A(a3505.get()); - A a3508 = new A(a3506.get()); - - A a3509 = new A(a3507.get()); - A a3510 = new A(a3508.get()); - - A a3511 = new A(a3509.get()); - A a3512 = new A(a3510.get()); - - A a3513 = new A(a3511.get()); - A a3514 = new A(a3512.get()); - - A a3515 = new A(a3513.get()); - A a3516 = new A(a3514.get()); - - A a3517 = new A(a3515.get()); - A a3518 = new A(a3516.get()); - - A a3519 = new A(a3517.get()); - A a3520 = new A(a3518.get()); - - A a3521 = new A(a3519.get()); - A a3522 = new A(a3520.get()); - - A a3523 = new A(a3521.get()); - A a3524 = new A(a3522.get()); - - A a3525 = new A(a3523.get()); - A a3526 = new A(a3524.get()); - - A a3527 = new A(a3525.get()); - A a3528 = new A(a3526.get()); - - A a3529 = new A(a3527.get()); - A a3530 = new A(a3528.get()); - - A a3531 = new A(a3529.get()); - A a3532 = new A(a3530.get()); - - A a3533 = new A(a3531.get()); - A a3534 = new A(a3532.get()); - - A a3535 = new A(a3533.get()); - A a3536 = new A(a3534.get()); - - A a3537 = new A(a3535.get()); - A a3538 = new A(a3536.get()); - - A a3539 = new A(a3537.get()); - A a3540 = new A(a3538.get()); - - A a3541 = new A(a3539.get()); - A a3542 = new A(a3540.get()); - - A a3543 = new A(a3541.get()); - A a3544 = new A(a3542.get()); - - A a3545 = new A(a3543.get()); - A a3546 = new A(a3544.get()); - - A a3547 = new A(a3545.get()); - A a3548 = new A(a3546.get()); - - A a3549 = new A(a3547.get()); - A a3550 = new A(a3548.get()); - - A a3551 = new A(a3549.get()); - A a3552 = new A(a3550.get()); - - A a3553 = new A(a3551.get()); - A a3554 = new A(a3552.get()); - - A a3555 = new A(a3553.get()); - A a3556 = new A(a3554.get()); - - A a3557 = new A(a3555.get()); - A a3558 = new A(a3556.get()); - - A a3559 = new A(a3557.get()); - A a3560 = new A(a3558.get()); - - A a3561 = new A(a3559.get()); - A a3562 = new A(a3560.get()); - - A a3563 = new A(a3561.get()); - A a3564 = new A(a3562.get()); - - A a3565 = new A(a3563.get()); - A a3566 = new A(a3564.get()); - - A a3567 = new A(a3565.get()); - A a3568 = new A(a3566.get()); - - A a3569 = new A(a3567.get()); - A a3570 = new A(a3568.get()); - - A a3571 = new A(a3569.get()); - A a3572 = new A(a3570.get()); - - A a3573 = new A(a3571.get()); - A a3574 = new A(a3572.get()); - - A a3575 = new A(a3573.get()); - A a3576 = new A(a3574.get()); - - A a3577 = new A(a3575.get()); - A a3578 = new A(a3576.get()); - - A a3579 = new A(a3577.get()); - A a3580 = new A(a3578.get()); - - A a3581 = new A(a3579.get()); - A a3582 = new A(a3580.get()); - - A a3583 = new A(a3581.get()); - A a3584 = new A(a3582.get()); - - A a3585 = new A(a3583.get()); - A a3586 = new A(a3584.get()); - - A a3587 = new A(a3585.get()); - A a3588 = new A(a3586.get()); - - A a3589 = new A(a3587.get()); - A a3590 = new A(a3588.get()); - - A a3591 = new A(a3589.get()); - A a3592 = new A(a3590.get()); - - A a3593 = new A(a3591.get()); - A a3594 = new A(a3592.get()); - - A a3595 = new A(a3593.get()); - A a3596 = new A(a3594.get()); - - A a3597 = new A(a3595.get()); - A a3598 = new A(a3596.get()); - - A a3599 = new A(a3597.get()); - A a3600 = new A(a3598.get()); - - A a3601 = new A(a3599.get()); - A a3602 = new A(a3600.get()); - - A a3603 = new A(a3601.get()); - A a3604 = new A(a3602.get()); - - A a3605 = new A(a3603.get()); - A a3606 = new A(a3604.get()); - - A a3607 = new A(a3605.get()); - A a3608 = new A(a3606.get()); - - A a3609 = new A(a3607.get()); - A a3610 = new A(a3608.get()); - - A a3611 = new A(a3609.get()); - A a3612 = new A(a3610.get()); - - A a3613 = new A(a3611.get()); - A a3614 = new A(a3612.get()); - - A a3615 = new A(a3613.get()); - A a3616 = new A(a3614.get()); - - A a3617 = new A(a3615.get()); - A a3618 = new A(a3616.get()); - - A a3619 = new A(a3617.get()); - A a3620 = new A(a3618.get()); - - A a3621 = new A(a3619.get()); - A a3622 = new A(a3620.get()); - - A a3623 = new A(a3621.get()); - A a3624 = new A(a3622.get()); - - A a3625 = new A(a3623.get()); - A a3626 = new A(a3624.get()); - - A a3627 = new A(a3625.get()); - A a3628 = new A(a3626.get()); - - A a3629 = new A(a3627.get()); - A a3630 = new A(a3628.get()); - - A a3631 = new A(a3629.get()); - A a3632 = new A(a3630.get()); - - A a3633 = new A(a3631.get()); - A a3634 = new A(a3632.get()); - - A a3635 = new A(a3633.get()); - A a3636 = new A(a3634.get()); - - A a3637 = new A(a3635.get()); - A a3638 = new A(a3636.get()); - - A a3639 = new A(a3637.get()); - A a3640 = new A(a3638.get()); - - A a3641 = new A(a3639.get()); - A a3642 = new A(a3640.get()); - - A a3643 = new A(a3641.get()); - A a3644 = new A(a3642.get()); - - A a3645 = new A(a3643.get()); - A a3646 = new A(a3644.get()); - - A a3647 = new A(a3645.get()); - A a3648 = new A(a3646.get()); - - A a3649 = new A(a3647.get()); - A a3650 = new A(a3648.get()); - - A a3651 = new A(a3649.get()); - A a3652 = new A(a3650.get()); - - A a3653 = new A(a3651.get()); - A a3654 = new A(a3652.get()); - - A a3655 = new A(a3653.get()); - A a3656 = new A(a3654.get()); - - A a3657 = new A(a3655.get()); - A a3658 = new A(a3656.get()); - - A a3659 = new A(a3657.get()); - A a3660 = new A(a3658.get()); - - A a3661 = new A(a3659.get()); - A a3662 = new A(a3660.get()); - - A a3663 = new A(a3661.get()); - A a3664 = new A(a3662.get()); - - A a3665 = new A(a3663.get()); - A a3666 = new A(a3664.get()); - - A a3667 = new A(a3665.get()); - A a3668 = new A(a3666.get()); - - A a3669 = new A(a3667.get()); - A a3670 = new A(a3668.get()); - - A a3671 = new A(a3669.get()); - A a3672 = new A(a3670.get()); - - A a3673 = new A(a3671.get()); - A a3674 = new A(a3672.get()); - - A a3675 = new A(a3673.get()); - A a3676 = new A(a3674.get()); - - A a3677 = new A(a3675.get()); - A a3678 = new A(a3676.get()); - - A a3679 = new A(a3677.get()); - A a3680 = new A(a3678.get()); - - A a3681 = new A(a3679.get()); - A a3682 = new A(a3680.get()); - - A a3683 = new A(a3681.get()); - A a3684 = new A(a3682.get()); - - A a3685 = new A(a3683.get()); - A a3686 = new A(a3684.get()); - - A a3687 = new A(a3685.get()); - A a3688 = new A(a3686.get()); - - A a3689 = new A(a3687.get()); - A a3690 = new A(a3688.get()); - - A a3691 = new A(a3689.get()); - A a3692 = new A(a3690.get()); - - A a3693 = new A(a3691.get()); - A a3694 = new A(a3692.get()); - - A a3695 = new A(a3693.get()); - A a3696 = new A(a3694.get()); - - return a3696.get(); - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** - * Helper method to obtain a random boolean - */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** - * Helper methot to obtain a random integer - */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11$A.class deleted file mode 100644 index f0fbb4bf27fa..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.class deleted file mode 100644 index ef74e85fa746..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.java deleted file mode 100755 index ff48fdb4c564..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing11.java +++ /dev/null @@ -1,3737 +0,0 @@ -class Aliasing11 { - public static class A { - private boolean x; - - public A(boolean x) { - this.x = x; - } - - public boolean get() { - return (this.x); - } - } - - public static boolean foo(boolean h) { - A a1 = new A(h); - - A a2 = new A(a1.get()); - A a3 = new A(a2.get()); - A a4 = new A(a3.get()); - A a5 = new A(a4.get()); - A a6 = new A(a5.get()); - A a7 = new A(a6.get()); - A a8 = new A(a7.get()); - A a9 = new A(a8.get()); - A a10 = new A(a9.get()); - A a11 = new A(a10.get()); - A a12 = new A(a11.get()); - A a13 = new A(a12.get()); - A a14 = new A(a13.get()); - A a15 = new A(a14.get()); - A a16 = new A(a15.get()); - A a17 = new A(a16.get()); - A a18 = new A(a17.get()); - A a19 = new A(a18.get()); - A a20 = new A(a19.get()); - A a21 = new A(a20.get()); - A a22 = new A(a21.get()); - A a23 = new A(a22.get()); - A a24 = new A(a23.get()); - A a25 = new A(a24.get()); - A a26 = new A(a25.get()); - A a27 = new A(a26.get()); - A a28 = new A(a27.get()); - A a29 = new A(a28.get()); - A a30 = new A(a29.get()); - A a31 = new A(a30.get()); - A a32 = new A(a31.get()); - A a33 = new A(a32.get()); - A a34 = new A(a33.get()); - A a35 = new A(a34.get()); - A a36 = new A(a35.get()); - A a37 = new A(a36.get()); - A a38 = new A(a37.get()); - A a39 = new A(a38.get()); - A a40 = new A(a39.get()); - A a41 = new A(a40.get()); - A a42 = new A(a41.get()); - A a43 = new A(a42.get()); - A a44 = new A(a43.get()); - A a45 = new A(a44.get()); - A a46 = new A(a45.get()); - A a47 = new A(a46.get()); - A a48 = new A(a47.get()); - A a49 = new A(a48.get()); - A a50 = new A(a49.get()); - A a51 = new A(a50.get()); - A a52 = new A(a51.get()); - A a53 = new A(a52.get()); - A a54 = new A(a53.get()); - A a55 = new A(a54.get()); - A a56 = new A(a55.get()); - A a57 = new A(a56.get()); - A a58 = new A(a57.get()); - A a59 = new A(a58.get()); - A a60 = new A(a59.get()); - A a61 = new A(a60.get()); - A a62 = new A(a61.get()); - A a63 = new A(a62.get()); - A a64 = new A(a63.get()); - A a65 = new A(a64.get()); - A a66 = new A(a65.get()); - A a67 = new A(a66.get()); - A a68 = new A(a67.get()); - A a69 = new A(a68.get()); - A a70 = new A(a69.get()); - A a71 = new A(a70.get()); - A a72 = new A(a71.get()); - A a73 = new A(a72.get()); - A a74 = new A(a73.get()); - A a75 = new A(a74.get()); - A a76 = new A(a75.get()); - A a77 = new A(a76.get()); - A a78 = new A(a77.get()); - A a79 = new A(a78.get()); - A a80 = new A(a79.get()); - A a81 = new A(a80.get()); - A a82 = new A(a81.get()); - A a83 = new A(a82.get()); - A a84 = new A(a83.get()); - A a85 = new A(a84.get()); - A a86 = new A(a85.get()); - A a87 = new A(a86.get()); - A a88 = new A(a87.get()); - A a89 = new A(a88.get()); - A a90 = new A(a89.get()); - A a91 = new A(a90.get()); - A a92 = new A(a91.get()); - A a93 = new A(a92.get()); - A a94 = new A(a93.get()); - A a95 = new A(a94.get()); - A a96 = new A(a95.get()); - A a97 = new A(a96.get()); - A a98 = new A(a97.get()); - A a99 = new A(a98.get()); - A a100 = new A(a99.get()); - A a101 = new A(a100.get()); - A a102 = new A(a101.get()); - A a103 = new A(a102.get()); - A a104 = new A(a103.get()); - A a105 = new A(a104.get()); - A a106 = new A(a105.get()); - A a107 = new A(a106.get()); - A a108 = new A(a107.get()); - A a109 = new A(a108.get()); - A a110 = new A(a109.get()); - A a111 = new A(a110.get()); - A a112 = new A(a111.get()); - A a113 = new A(a112.get()); - A a114 = new A(a113.get()); - A a115 = new A(a114.get()); - A a116 = new A(a115.get()); - A a117 = new A(a116.get()); - A a118 = new A(a117.get()); - A a119 = new A(a118.get()); - A a120 = new A(a119.get()); - A a121 = new A(a120.get()); - A a122 = new A(a121.get()); - A a123 = new A(a122.get()); - A a124 = new A(a123.get()); - A a125 = new A(a124.get()); - A a126 = new A(a125.get()); - A a127 = new A(a126.get()); - A a128 = new A(a127.get()); - A a129 = new A(a128.get()); - A a130 = new A(a129.get()); - A a131 = new A(a130.get()); - A a132 = new A(a131.get()); - A a133 = new A(a132.get()); - A a134 = new A(a133.get()); - A a135 = new A(a134.get()); - A a136 = new A(a135.get()); - A a137 = new A(a136.get()); - A a138 = new A(a137.get()); - A a139 = new A(a138.get()); - A a140 = new A(a139.get()); - A a141 = new A(a140.get()); - A a142 = new A(a141.get()); - A a143 = new A(a142.get()); - A a144 = new A(a143.get()); - A a145 = new A(a144.get()); - A a146 = new A(a145.get()); - A a147 = new A(a146.get()); - A a148 = new A(a147.get()); - A a149 = new A(a148.get()); - A a150 = new A(a149.get()); - A a151 = new A(a150.get()); - A a152 = new A(a151.get()); - A a153 = new A(a152.get()); - A a154 = new A(a153.get()); - A a155 = new A(a154.get()); - A a156 = new A(a155.get()); - A a157 = new A(a156.get()); - A a158 = new A(a157.get()); - A a159 = new A(a158.get()); - A a160 = new A(a159.get()); - A a161 = new A(a160.get()); - A a162 = new A(a161.get()); - A a163 = new A(a162.get()); - A a164 = new A(a163.get()); - A a165 = new A(a164.get()); - A a166 = new A(a165.get()); - A a167 = new A(a166.get()); - A a168 = new A(a167.get()); - A a169 = new A(a168.get()); - A a170 = new A(a169.get()); - A a171 = new A(a170.get()); - A a172 = new A(a171.get()); - A a173 = new A(a172.get()); - A a174 = new A(a173.get()); - A a175 = new A(a174.get()); - A a176 = new A(a175.get()); - A a177 = new A(a176.get()); - A a178 = new A(a177.get()); - A a179 = new A(a178.get()); - A a180 = new A(a179.get()); - A a181 = new A(a180.get()); - A a182 = new A(a181.get()); - A a183 = new A(a182.get()); - A a184 = new A(a183.get()); - A a185 = new A(a184.get()); - A a186 = new A(a185.get()); - A a187 = new A(a186.get()); - A a188 = new A(a187.get()); - A a189 = new A(a188.get()); - A a190 = new A(a189.get()); - A a191 = new A(a190.get()); - A a192 = new A(a191.get()); - A a193 = new A(a192.get()); - A a194 = new A(a193.get()); - A a195 = new A(a194.get()); - A a196 = new A(a195.get()); - A a197 = new A(a196.get()); - A a198 = new A(a197.get()); - A a199 = new A(a198.get()); - A a200 = new A(a199.get()); - A a201 = new A(a200.get()); - A a202 = new A(a201.get()); - A a203 = new A(a202.get()); - A a204 = new A(a203.get()); - A a205 = new A(a204.get()); - A a206 = new A(a205.get()); - A a207 = new A(a206.get()); - A a208 = new A(a207.get()); - A a209 = new A(a208.get()); - A a210 = new A(a209.get()); - A a211 = new A(a210.get()); - A a212 = new A(a211.get()); - A a213 = new A(a212.get()); - A a214 = new A(a213.get()); - A a215 = new A(a214.get()); - A a216 = new A(a215.get()); - A a217 = new A(a216.get()); - A a218 = new A(a217.get()); - A a219 = new A(a218.get()); - A a220 = new A(a219.get()); - A a221 = new A(a220.get()); - A a222 = new A(a221.get()); - A a223 = new A(a222.get()); - A a224 = new A(a223.get()); - A a225 = new A(a224.get()); - A a226 = new A(a225.get()); - A a227 = new A(a226.get()); - A a228 = new A(a227.get()); - A a229 = new A(a228.get()); - A a230 = new A(a229.get()); - A a231 = new A(a230.get()); - A a232 = new A(a231.get()); - A a233 = new A(a232.get()); - A a234 = new A(a233.get()); - A a235 = new A(a234.get()); - A a236 = new A(a235.get()); - A a237 = new A(a236.get()); - A a238 = new A(a237.get()); - A a239 = new A(a238.get()); - A a240 = new A(a239.get()); - A a241 = new A(a240.get()); - A a242 = new A(a241.get()); - A a243 = new A(a242.get()); - A a244 = new A(a243.get()); - A a245 = new A(a244.get()); - A a246 = new A(a245.get()); - A a247 = new A(a246.get()); - A a248 = new A(a247.get()); - A a249 = new A(a248.get()); - A a250 = new A(a249.get()); - A a251 = new A(a250.get()); - A a252 = new A(a251.get()); - A a253 = new A(a252.get()); - A a254 = new A(a253.get()); - A a255 = new A(a254.get()); - A a256 = new A(a255.get()); - A a257 = new A(a256.get()); - A a258 = new A(a257.get()); - A a259 = new A(a258.get()); - A a260 = new A(a259.get()); - A a261 = new A(a260.get()); - A a262 = new A(a261.get()); - A a263 = new A(a262.get()); - A a264 = new A(a263.get()); - A a265 = new A(a264.get()); - A a266 = new A(a265.get()); - A a267 = new A(a266.get()); - A a268 = new A(a267.get()); - A a269 = new A(a268.get()); - A a270 = new A(a269.get()); - A a271 = new A(a270.get()); - A a272 = new A(a271.get()); - A a273 = new A(a272.get()); - A a274 = new A(a273.get()); - A a275 = new A(a274.get()); - A a276 = new A(a275.get()); - A a277 = new A(a276.get()); - A a278 = new A(a277.get()); - A a279 = new A(a278.get()); - A a280 = new A(a279.get()); - A a281 = new A(a280.get()); - A a282 = new A(a281.get()); - A a283 = new A(a282.get()); - A a284 = new A(a283.get()); - A a285 = new A(a284.get()); - A a286 = new A(a285.get()); - A a287 = new A(a286.get()); - A a288 = new A(a287.get()); - A a289 = new A(a288.get()); - A a290 = new A(a289.get()); - A a291 = new A(a290.get()); - A a292 = new A(a291.get()); - A a293 = new A(a292.get()); - A a294 = new A(a293.get()); - A a295 = new A(a294.get()); - A a296 = new A(a295.get()); - A a297 = new A(a296.get()); - A a298 = new A(a297.get()); - A a299 = new A(a298.get()); - A a300 = new A(a299.get()); - A a301 = new A(a300.get()); - A a302 = new A(a301.get()); - A a303 = new A(a302.get()); - A a304 = new A(a303.get()); - A a305 = new A(a304.get()); - A a306 = new A(a305.get()); - A a307 = new A(a306.get()); - A a308 = new A(a307.get()); - A a309 = new A(a308.get()); - A a310 = new A(a309.get()); - A a311 = new A(a310.get()); - A a312 = new A(a311.get()); - A a313 = new A(a312.get()); - A a314 = new A(a313.get()); - A a315 = new A(a314.get()); - A a316 = new A(a315.get()); - A a317 = new A(a316.get()); - A a318 = new A(a317.get()); - A a319 = new A(a318.get()); - A a320 = new A(a319.get()); - A a321 = new A(a320.get()); - A a322 = new A(a321.get()); - A a323 = new A(a322.get()); - A a324 = new A(a323.get()); - A a325 = new A(a324.get()); - A a326 = new A(a325.get()); - A a327 = new A(a326.get()); - A a328 = new A(a327.get()); - A a329 = new A(a328.get()); - A a330 = new A(a329.get()); - A a331 = new A(a330.get()); - A a332 = new A(a331.get()); - A a333 = new A(a332.get()); - A a334 = new A(a333.get()); - A a335 = new A(a334.get()); - A a336 = new A(a335.get()); - A a337 = new A(a336.get()); - A a338 = new A(a337.get()); - A a339 = new A(a338.get()); - A a340 = new A(a339.get()); - A a341 = new A(a340.get()); - A a342 = new A(a341.get()); - A a343 = new A(a342.get()); - A a344 = new A(a343.get()); - A a345 = new A(a344.get()); - A a346 = new A(a345.get()); - A a347 = new A(a346.get()); - A a348 = new A(a347.get()); - A a349 = new A(a348.get()); - A a350 = new A(a349.get()); - A a351 = new A(a350.get()); - A a352 = new A(a351.get()); - A a353 = new A(a352.get()); - A a354 = new A(a353.get()); - A a355 = new A(a354.get()); - A a356 = new A(a355.get()); - A a357 = new A(a356.get()); - A a358 = new A(a357.get()); - A a359 = new A(a358.get()); - A a360 = new A(a359.get()); - A a361 = new A(a360.get()); - A a362 = new A(a361.get()); - A a363 = new A(a362.get()); - A a364 = new A(a363.get()); - A a365 = new A(a364.get()); - A a366 = new A(a365.get()); - A a367 = new A(a366.get()); - A a368 = new A(a367.get()); - A a369 = new A(a368.get()); - A a370 = new A(a369.get()); - A a371 = new A(a370.get()); - A a372 = new A(a371.get()); - A a373 = new A(a372.get()); - A a374 = new A(a373.get()); - A a375 = new A(a374.get()); - A a376 = new A(a375.get()); - A a377 = new A(a376.get()); - A a378 = new A(a377.get()); - A a379 = new A(a378.get()); - A a380 = new A(a379.get()); - A a381 = new A(a380.get()); - A a382 = new A(a381.get()); - A a383 = new A(a382.get()); - A a384 = new A(a383.get()); - A a385 = new A(a384.get()); - A a386 = new A(a385.get()); - A a387 = new A(a386.get()); - A a388 = new A(a387.get()); - A a389 = new A(a388.get()); - A a390 = new A(a389.get()); - A a391 = new A(a390.get()); - A a392 = new A(a391.get()); - A a393 = new A(a392.get()); - A a394 = new A(a393.get()); - A a395 = new A(a394.get()); - A a396 = new A(a395.get()); - A a397 = new A(a396.get()); - A a398 = new A(a397.get()); - A a399 = new A(a398.get()); - A a400 = new A(a399.get()); - A a401 = new A(a400.get()); - A a402 = new A(a401.get()); - A a403 = new A(a402.get()); - A a404 = new A(a403.get()); - A a405 = new A(a404.get()); - A a406 = new A(a405.get()); - A a407 = new A(a406.get()); - A a408 = new A(a407.get()); - A a409 = new A(a408.get()); - A a410 = new A(a409.get()); - A a411 = new A(a410.get()); - A a412 = new A(a411.get()); - A a413 = new A(a412.get()); - A a414 = new A(a413.get()); - A a415 = new A(a414.get()); - A a416 = new A(a415.get()); - A a417 = new A(a416.get()); - A a418 = new A(a417.get()); - A a419 = new A(a418.get()); - A a420 = new A(a419.get()); - A a421 = new A(a420.get()); - A a422 = new A(a421.get()); - A a423 = new A(a422.get()); - A a424 = new A(a423.get()); - A a425 = new A(a424.get()); - A a426 = new A(a425.get()); - A a427 = new A(a426.get()); - A a428 = new A(a427.get()); - A a429 = new A(a428.get()); - A a430 = new A(a429.get()); - A a431 = new A(a430.get()); - A a432 = new A(a431.get()); - A a433 = new A(a432.get()); - A a434 = new A(a433.get()); - A a435 = new A(a434.get()); - A a436 = new A(a435.get()); - A a437 = new A(a436.get()); - A a438 = new A(a437.get()); - A a439 = new A(a438.get()); - A a440 = new A(a439.get()); - A a441 = new A(a440.get()); - A a442 = new A(a441.get()); - A a443 = new A(a442.get()); - A a444 = new A(a443.get()); - A a445 = new A(a444.get()); - A a446 = new A(a445.get()); - A a447 = new A(a446.get()); - A a448 = new A(a447.get()); - A a449 = new A(a448.get()); - A a450 = new A(a449.get()); - A a451 = new A(a450.get()); - A a452 = new A(a451.get()); - A a453 = new A(a452.get()); - A a454 = new A(a453.get()); - A a455 = new A(a454.get()); - A a456 = new A(a455.get()); - A a457 = new A(a456.get()); - A a458 = new A(a457.get()); - A a459 = new A(a458.get()); - A a460 = new A(a459.get()); - A a461 = new A(a460.get()); - A a462 = new A(a461.get()); - A a463 = new A(a462.get()); - A a464 = new A(a463.get()); - A a465 = new A(a464.get()); - A a466 = new A(a465.get()); - A a467 = new A(a466.get()); - A a468 = new A(a467.get()); - A a469 = new A(a468.get()); - A a470 = new A(a469.get()); - A a471 = new A(a470.get()); - A a472 = new A(a471.get()); - A a473 = new A(a472.get()); - A a474 = new A(a473.get()); - A a475 = new A(a474.get()); - A a476 = new A(a475.get()); - A a477 = new A(a476.get()); - A a478 = new A(a477.get()); - A a479 = new A(a478.get()); - A a480 = new A(a479.get()); - A a481 = new A(a480.get()); - A a482 = new A(a481.get()); - A a483 = new A(a482.get()); - A a484 = new A(a483.get()); - A a485 = new A(a484.get()); - A a486 = new A(a485.get()); - A a487 = new A(a486.get()); - A a488 = new A(a487.get()); - A a489 = new A(a488.get()); - A a490 = new A(a489.get()); - A a491 = new A(a490.get()); - A a492 = new A(a491.get()); - A a493 = new A(a492.get()); - A a494 = new A(a493.get()); - A a495 = new A(a494.get()); - A a496 = new A(a495.get()); - A a497 = new A(a496.get()); - A a498 = new A(a497.get()); - A a499 = new A(a498.get()); - A a500 = new A(a499.get()); - A a501 = new A(a500.get()); - A a502 = new A(a501.get()); - A a503 = new A(a502.get()); - A a504 = new A(a503.get()); - A a505 = new A(a504.get()); - A a506 = new A(a505.get()); - A a507 = new A(a506.get()); - A a508 = new A(a507.get()); - A a509 = new A(a508.get()); - A a510 = new A(a509.get()); - A a511 = new A(a510.get()); - A a512 = new A(a511.get()); - A a513 = new A(a512.get()); - A a514 = new A(a513.get()); - A a515 = new A(a514.get()); - A a516 = new A(a515.get()); - A a517 = new A(a516.get()); - A a518 = new A(a517.get()); - A a519 = new A(a518.get()); - A a520 = new A(a519.get()); - A a521 = new A(a520.get()); - A a522 = new A(a521.get()); - A a523 = new A(a522.get()); - A a524 = new A(a523.get()); - A a525 = new A(a524.get()); - A a526 = new A(a525.get()); - A a527 = new A(a526.get()); - A a528 = new A(a527.get()); - A a529 = new A(a528.get()); - A a530 = new A(a529.get()); - A a531 = new A(a530.get()); - A a532 = new A(a531.get()); - A a533 = new A(a532.get()); - A a534 = new A(a533.get()); - A a535 = new A(a534.get()); - A a536 = new A(a535.get()); - A a537 = new A(a536.get()); - A a538 = new A(a537.get()); - A a539 = new A(a538.get()); - A a540 = new A(a539.get()); - A a541 = new A(a540.get()); - A a542 = new A(a541.get()); - A a543 = new A(a542.get()); - A a544 = new A(a543.get()); - A a545 = new A(a544.get()); - A a546 = new A(a545.get()); - A a547 = new A(a546.get()); - A a548 = new A(a547.get()); - A a549 = new A(a548.get()); - A a550 = new A(a549.get()); - A a551 = new A(a550.get()); - A a552 = new A(a551.get()); - A a553 = new A(a552.get()); - A a554 = new A(a553.get()); - A a555 = new A(a554.get()); - A a556 = new A(a555.get()); - A a557 = new A(a556.get()); - A a558 = new A(a557.get()); - A a559 = new A(a558.get()); - A a560 = new A(a559.get()); - A a561 = new A(a560.get()); - A a562 = new A(a561.get()); - A a563 = new A(a562.get()); - A a564 = new A(a563.get()); - A a565 = new A(a564.get()); - A a566 = new A(a565.get()); - A a567 = new A(a566.get()); - A a568 = new A(a567.get()); - A a569 = new A(a568.get()); - A a570 = new A(a569.get()); - A a571 = new A(a570.get()); - A a572 = new A(a571.get()); - A a573 = new A(a572.get()); - A a574 = new A(a573.get()); - A a575 = new A(a574.get()); - A a576 = new A(a575.get()); - A a577 = new A(a576.get()); - A a578 = new A(a577.get()); - A a579 = new A(a578.get()); - A a580 = new A(a579.get()); - A a581 = new A(a580.get()); - A a582 = new A(a581.get()); - A a583 = new A(a582.get()); - A a584 = new A(a583.get()); - A a585 = new A(a584.get()); - A a586 = new A(a585.get()); - A a587 = new A(a586.get()); - A a588 = new A(a587.get()); - A a589 = new A(a588.get()); - A a590 = new A(a589.get()); - A a591 = new A(a590.get()); - A a592 = new A(a591.get()); - A a593 = new A(a592.get()); - A a594 = new A(a593.get()); - A a595 = new A(a594.get()); - A a596 = new A(a595.get()); - A a597 = new A(a596.get()); - A a598 = new A(a597.get()); - A a599 = new A(a598.get()); - A a600 = new A(a599.get()); - A a601 = new A(a600.get()); - A a602 = new A(a601.get()); - A a603 = new A(a602.get()); - A a604 = new A(a603.get()); - A a605 = new A(a604.get()); - A a606 = new A(a605.get()); - A a607 = new A(a606.get()); - A a608 = new A(a607.get()); - A a609 = new A(a608.get()); - A a610 = new A(a609.get()); - A a611 = new A(a610.get()); - A a612 = new A(a611.get()); - A a613 = new A(a612.get()); - A a614 = new A(a613.get()); - A a615 = new A(a614.get()); - A a616 = new A(a615.get()); - A a617 = new A(a616.get()); - A a618 = new A(a617.get()); - A a619 = new A(a618.get()); - A a620 = new A(a619.get()); - A a621 = new A(a620.get()); - A a622 = new A(a621.get()); - A a623 = new A(a622.get()); - A a624 = new A(a623.get()); - A a625 = new A(a624.get()); - A a626 = new A(a625.get()); - A a627 = new A(a626.get()); - A a628 = new A(a627.get()); - A a629 = new A(a628.get()); - A a630 = new A(a629.get()); - A a631 = new A(a630.get()); - A a632 = new A(a631.get()); - A a633 = new A(a632.get()); - A a634 = new A(a633.get()); - A a635 = new A(a634.get()); - A a636 = new A(a635.get()); - A a637 = new A(a636.get()); - A a638 = new A(a637.get()); - A a639 = new A(a638.get()); - A a640 = new A(a639.get()); - A a641 = new A(a640.get()); - A a642 = new A(a641.get()); - A a643 = new A(a642.get()); - A a644 = new A(a643.get()); - A a645 = new A(a644.get()); - A a646 = new A(a645.get()); - A a647 = new A(a646.get()); - A a648 = new A(a647.get()); - A a649 = new A(a648.get()); - A a650 = new A(a649.get()); - A a651 = new A(a650.get()); - A a652 = new A(a651.get()); - A a653 = new A(a652.get()); - A a654 = new A(a653.get()); - A a655 = new A(a654.get()); - A a656 = new A(a655.get()); - A a657 = new A(a656.get()); - A a658 = new A(a657.get()); - A a659 = new A(a658.get()); - A a660 = new A(a659.get()); - A a661 = new A(a660.get()); - A a662 = new A(a661.get()); - A a663 = new A(a662.get()); - A a664 = new A(a663.get()); - A a665 = new A(a664.get()); - A a666 = new A(a665.get()); - A a667 = new A(a666.get()); - A a668 = new A(a667.get()); - A a669 = new A(a668.get()); - A a670 = new A(a669.get()); - A a671 = new A(a670.get()); - A a672 = new A(a671.get()); - A a673 = new A(a672.get()); - A a674 = new A(a673.get()); - A a675 = new A(a674.get()); - A a676 = new A(a675.get()); - A a677 = new A(a676.get()); - A a678 = new A(a677.get()); - A a679 = new A(a678.get()); - A a680 = new A(a679.get()); - A a681 = new A(a680.get()); - A a682 = new A(a681.get()); - A a683 = new A(a682.get()); - A a684 = new A(a683.get()); - A a685 = new A(a684.get()); - A a686 = new A(a685.get()); - A a687 = new A(a686.get()); - A a688 = new A(a687.get()); - A a689 = new A(a688.get()); - A a690 = new A(a689.get()); - A a691 = new A(a690.get()); - A a692 = new A(a691.get()); - A a693 = new A(a692.get()); - A a694 = new A(a693.get()); - A a695 = new A(a694.get()); - A a696 = new A(a695.get()); - A a697 = new A(a696.get()); - A a698 = new A(a697.get()); - A a699 = new A(a698.get()); - A a700 = new A(a699.get()); - A a701 = new A(a700.get()); - A a702 = new A(a701.get()); - A a703 = new A(a702.get()); - A a704 = new A(a703.get()); - A a705 = new A(a704.get()); - A a706 = new A(a705.get()); - A a707 = new A(a706.get()); - A a708 = new A(a707.get()); - A a709 = new A(a708.get()); - A a710 = new A(a709.get()); - A a711 = new A(a710.get()); - A a712 = new A(a711.get()); - A a713 = new A(a712.get()); - A a714 = new A(a713.get()); - A a715 = new A(a714.get()); - A a716 = new A(a715.get()); - A a717 = new A(a716.get()); - A a718 = new A(a717.get()); - A a719 = new A(a718.get()); - A a720 = new A(a719.get()); - A a721 = new A(a720.get()); - A a722 = new A(a721.get()); - A a723 = new A(a722.get()); - A a724 = new A(a723.get()); - A a725 = new A(a724.get()); - A a726 = new A(a725.get()); - A a727 = new A(a726.get()); - A a728 = new A(a727.get()); - A a729 = new A(a728.get()); - A a730 = new A(a729.get()); - A a731 = new A(a730.get()); - A a732 = new A(a731.get()); - A a733 = new A(a732.get()); - A a734 = new A(a733.get()); - A a735 = new A(a734.get()); - A a736 = new A(a735.get()); - A a737 = new A(a736.get()); - A a738 = new A(a737.get()); - A a739 = new A(a738.get()); - A a740 = new A(a739.get()); - A a741 = new A(a740.get()); - A a742 = new A(a741.get()); - A a743 = new A(a742.get()); - A a744 = new A(a743.get()); - A a745 = new A(a744.get()); - A a746 = new A(a745.get()); - A a747 = new A(a746.get()); - A a748 = new A(a747.get()); - A a749 = new A(a748.get()); - A a750 = new A(a749.get()); - A a751 = new A(a750.get()); - A a752 = new A(a751.get()); - A a753 = new A(a752.get()); - A a754 = new A(a753.get()); - A a755 = new A(a754.get()); - A a756 = new A(a755.get()); - A a757 = new A(a756.get()); - A a758 = new A(a757.get()); - A a759 = new A(a758.get()); - A a760 = new A(a759.get()); - A a761 = new A(a760.get()); - A a762 = new A(a761.get()); - A a763 = new A(a762.get()); - A a764 = new A(a763.get()); - A a765 = new A(a764.get()); - A a766 = new A(a765.get()); - A a767 = new A(a766.get()); - A a768 = new A(a767.get()); - A a769 = new A(a768.get()); - A a770 = new A(a769.get()); - A a771 = new A(a770.get()); - A a772 = new A(a771.get()); - A a773 = new A(a772.get()); - A a774 = new A(a773.get()); - A a775 = new A(a774.get()); - A a776 = new A(a775.get()); - A a777 = new A(a776.get()); - A a778 = new A(a777.get()); - A a779 = new A(a778.get()); - A a780 = new A(a779.get()); - A a781 = new A(a780.get()); - A a782 = new A(a781.get()); - A a783 = new A(a782.get()); - A a784 = new A(a783.get()); - A a785 = new A(a784.get()); - A a786 = new A(a785.get()); - A a787 = new A(a786.get()); - A a788 = new A(a787.get()); - A a789 = new A(a788.get()); - A a790 = new A(a789.get()); - A a791 = new A(a790.get()); - A a792 = new A(a791.get()); - A a793 = new A(a792.get()); - A a794 = new A(a793.get()); - A a795 = new A(a794.get()); - A a796 = new A(a795.get()); - A a797 = new A(a796.get()); - A a798 = new A(a797.get()); - A a799 = new A(a798.get()); - A a800 = new A(a799.get()); - A a801 = new A(a800.get()); - A a802 = new A(a801.get()); - A a803 = new A(a802.get()); - A a804 = new A(a803.get()); - A a805 = new A(a804.get()); - A a806 = new A(a805.get()); - A a807 = new A(a806.get()); - A a808 = new A(a807.get()); - A a809 = new A(a808.get()); - A a810 = new A(a809.get()); - A a811 = new A(a810.get()); - A a812 = new A(a811.get()); - A a813 = new A(a812.get()); - A a814 = new A(a813.get()); - A a815 = new A(a814.get()); - A a816 = new A(a815.get()); - A a817 = new A(a816.get()); - A a818 = new A(a817.get()); - A a819 = new A(a818.get()); - A a820 = new A(a819.get()); - A a821 = new A(a820.get()); - A a822 = new A(a821.get()); - A a823 = new A(a822.get()); - A a824 = new A(a823.get()); - A a825 = new A(a824.get()); - A a826 = new A(a825.get()); - A a827 = new A(a826.get()); - A a828 = new A(a827.get()); - A a829 = new A(a828.get()); - A a830 = new A(a829.get()); - A a831 = new A(a830.get()); - A a832 = new A(a831.get()); - A a833 = new A(a832.get()); - A a834 = new A(a833.get()); - A a835 = new A(a834.get()); - A a836 = new A(a835.get()); - A a837 = new A(a836.get()); - A a838 = new A(a837.get()); - A a839 = new A(a838.get()); - A a840 = new A(a839.get()); - A a841 = new A(a840.get()); - A a842 = new A(a841.get()); - A a843 = new A(a842.get()); - A a844 = new A(a843.get()); - A a845 = new A(a844.get()); - A a846 = new A(a845.get()); - A a847 = new A(a846.get()); - A a848 = new A(a847.get()); - A a849 = new A(a848.get()); - A a850 = new A(a849.get()); - A a851 = new A(a850.get()); - A a852 = new A(a851.get()); - A a853 = new A(a852.get()); - A a854 = new A(a853.get()); - A a855 = new A(a854.get()); - A a856 = new A(a855.get()); - A a857 = new A(a856.get()); - A a858 = new A(a857.get()); - A a859 = new A(a858.get()); - A a860 = new A(a859.get()); - A a861 = new A(a860.get()); - A a862 = new A(a861.get()); - A a863 = new A(a862.get()); - A a864 = new A(a863.get()); - A a865 = new A(a864.get()); - A a866 = new A(a865.get()); - A a867 = new A(a866.get()); - A a868 = new A(a867.get()); - A a869 = new A(a868.get()); - A a870 = new A(a869.get()); - A a871 = new A(a870.get()); - A a872 = new A(a871.get()); - A a873 = new A(a872.get()); - A a874 = new A(a873.get()); - A a875 = new A(a874.get()); - A a876 = new A(a875.get()); - A a877 = new A(a876.get()); - A a878 = new A(a877.get()); - A a879 = new A(a878.get()); - A a880 = new A(a879.get()); - A a881 = new A(a880.get()); - A a882 = new A(a881.get()); - A a883 = new A(a882.get()); - A a884 = new A(a883.get()); - A a885 = new A(a884.get()); - A a886 = new A(a885.get()); - A a887 = new A(a886.get()); - A a888 = new A(a887.get()); - A a889 = new A(a888.get()); - A a890 = new A(a889.get()); - A a891 = new A(a890.get()); - A a892 = new A(a891.get()); - A a893 = new A(a892.get()); - A a894 = new A(a893.get()); - A a895 = new A(a894.get()); - A a896 = new A(a895.get()); - A a897 = new A(a896.get()); - A a898 = new A(a897.get()); - A a899 = new A(a898.get()); - A a900 = new A(a899.get()); - A a901 = new A(a900.get()); - A a902 = new A(a901.get()); - A a903 = new A(a902.get()); - A a904 = new A(a903.get()); - A a905 = new A(a904.get()); - A a906 = new A(a905.get()); - A a907 = new A(a906.get()); - A a908 = new A(a907.get()); - A a909 = new A(a908.get()); - A a910 = new A(a909.get()); - A a911 = new A(a910.get()); - A a912 = new A(a911.get()); - A a913 = new A(a912.get()); - A a914 = new A(a913.get()); - A a915 = new A(a914.get()); - A a916 = new A(a915.get()); - A a917 = new A(a916.get()); - A a918 = new A(a917.get()); - A a919 = new A(a918.get()); - A a920 = new A(a919.get()); - A a921 = new A(a920.get()); - A a922 = new A(a921.get()); - A a923 = new A(a922.get()); - A a924 = new A(a923.get()); - A a925 = new A(a924.get()); - A a926 = new A(a925.get()); - A a927 = new A(a926.get()); - A a928 = new A(a927.get()); - A a929 = new A(a928.get()); - A a930 = new A(a929.get()); - A a931 = new A(a930.get()); - A a932 = new A(a931.get()); - A a933 = new A(a932.get()); - A a934 = new A(a933.get()); - A a935 = new A(a934.get()); - A a936 = new A(a935.get()); - A a937 = new A(a936.get()); - A a938 = new A(a937.get()); - A a939 = new A(a938.get()); - A a940 = new A(a939.get()); - A a941 = new A(a940.get()); - A a942 = new A(a941.get()); - A a943 = new A(a942.get()); - A a944 = new A(a943.get()); - A a945 = new A(a944.get()); - A a946 = new A(a945.get()); - A a947 = new A(a946.get()); - A a948 = new A(a947.get()); - A a949 = new A(a948.get()); - A a950 = new A(a949.get()); - A a951 = new A(a950.get()); - A a952 = new A(a951.get()); - A a953 = new A(a952.get()); - A a954 = new A(a953.get()); - A a955 = new A(a954.get()); - A a956 = new A(a955.get()); - A a957 = new A(a956.get()); - A a958 = new A(a957.get()); - A a959 = new A(a958.get()); - A a960 = new A(a959.get()); - A a961 = new A(a960.get()); - A a962 = new A(a961.get()); - A a963 = new A(a962.get()); - A a964 = new A(a963.get()); - A a965 = new A(a964.get()); - A a966 = new A(a965.get()); - A a967 = new A(a966.get()); - A a968 = new A(a967.get()); - A a969 = new A(a968.get()); - A a970 = new A(a969.get()); - A a971 = new A(a970.get()); - A a972 = new A(a971.get()); - A a973 = new A(a972.get()); - A a974 = new A(a973.get()); - A a975 = new A(a974.get()); - A a976 = new A(a975.get()); - A a977 = new A(a976.get()); - A a978 = new A(a977.get()); - A a979 = new A(a978.get()); - A a980 = new A(a979.get()); - A a981 = new A(a980.get()); - A a982 = new A(a981.get()); - A a983 = new A(a982.get()); - A a984 = new A(a983.get()); - A a985 = new A(a984.get()); - A a986 = new A(a985.get()); - A a987 = new A(a986.get()); - A a988 = new A(a987.get()); - A a989 = new A(a988.get()); - A a990 = new A(a989.get()); - A a991 = new A(a990.get()); - A a992 = new A(a991.get()); - A a993 = new A(a992.get()); - A a994 = new A(a993.get()); - A a995 = new A(a994.get()); - A a996 = new A(a995.get()); - A a997 = new A(a996.get()); - A a998 = new A(a997.get()); - A a999 = new A(a998.get()); - A a1000 = new A(a999.get()); - A a1001 = new A(a1000.get()); - A a1002 = new A(a1001.get()); - A a1003 = new A(a1002.get()); - A a1004 = new A(a1003.get()); - A a1005 = new A(a1004.get()); - A a1006 = new A(a1005.get()); - A a1007 = new A(a1006.get()); - A a1008 = new A(a1007.get()); - A a1009 = new A(a1008.get()); - A a1010 = new A(a1009.get()); - A a1011 = new A(a1010.get()); - A a1012 = new A(a1011.get()); - A a1013 = new A(a1012.get()); - A a1014 = new A(a1013.get()); - A a1015 = new A(a1014.get()); - A a1016 = new A(a1015.get()); - A a1017 = new A(a1016.get()); - A a1018 = new A(a1017.get()); - A a1019 = new A(a1018.get()); - A a1020 = new A(a1019.get()); - A a1021 = new A(a1020.get()); - A a1022 = new A(a1021.get()); - A a1023 = new A(a1022.get()); - A a1024 = new A(a1023.get()); - A a1025 = new A(a1024.get()); - A a1026 = new A(a1025.get()); - A a1027 = new A(a1026.get()); - A a1028 = new A(a1027.get()); - A a1029 = new A(a1028.get()); - A a1030 = new A(a1029.get()); - A a1031 = new A(a1030.get()); - A a1032 = new A(a1031.get()); - A a1033 = new A(a1032.get()); - A a1034 = new A(a1033.get()); - A a1035 = new A(a1034.get()); - A a1036 = new A(a1035.get()); - A a1037 = new A(a1036.get()); - A a1038 = new A(a1037.get()); - A a1039 = new A(a1038.get()); - A a1040 = new A(a1039.get()); - A a1041 = new A(a1040.get()); - A a1042 = new A(a1041.get()); - A a1043 = new A(a1042.get()); - A a1044 = new A(a1043.get()); - A a1045 = new A(a1044.get()); - A a1046 = new A(a1045.get()); - A a1047 = new A(a1046.get()); - A a1048 = new A(a1047.get()); - A a1049 = new A(a1048.get()); - A a1050 = new A(a1049.get()); - A a1051 = new A(a1050.get()); - A a1052 = new A(a1051.get()); - A a1053 = new A(a1052.get()); - A a1054 = new A(a1053.get()); - A a1055 = new A(a1054.get()); - A a1056 = new A(a1055.get()); - A a1057 = new A(a1056.get()); - A a1058 = new A(a1057.get()); - A a1059 = new A(a1058.get()); - A a1060 = new A(a1059.get()); - A a1061 = new A(a1060.get()); - A a1062 = new A(a1061.get()); - A a1063 = new A(a1062.get()); - A a1064 = new A(a1063.get()); - A a1065 = new A(a1064.get()); - A a1066 = new A(a1065.get()); - A a1067 = new A(a1066.get()); - A a1068 = new A(a1067.get()); - A a1069 = new A(a1068.get()); - A a1070 = new A(a1069.get()); - A a1071 = new A(a1070.get()); - A a1072 = new A(a1071.get()); - A a1073 = new A(a1072.get()); - A a1074 = new A(a1073.get()); - A a1075 = new A(a1074.get()); - A a1076 = new A(a1075.get()); - A a1077 = new A(a1076.get()); - A a1078 = new A(a1077.get()); - A a1079 = new A(a1078.get()); - A a1080 = new A(a1079.get()); - A a1081 = new A(a1080.get()); - A a1082 = new A(a1081.get()); - A a1083 = new A(a1082.get()); - A a1084 = new A(a1083.get()); - A a1085 = new A(a1084.get()); - A a1086 = new A(a1085.get()); - A a1087 = new A(a1086.get()); - A a1088 = new A(a1087.get()); - A a1089 = new A(a1088.get()); - A a1090 = new A(a1089.get()); - A a1091 = new A(a1090.get()); - A a1092 = new A(a1091.get()); - A a1093 = new A(a1092.get()); - A a1094 = new A(a1093.get()); - A a1095 = new A(a1094.get()); - A a1096 = new A(a1095.get()); - A a1097 = new A(a1096.get()); - A a1098 = new A(a1097.get()); - A a1099 = new A(a1098.get()); - A a1100 = new A(a1099.get()); - A a1101 = new A(a1100.get()); - A a1102 = new A(a1101.get()); - A a1103 = new A(a1102.get()); - A a1104 = new A(a1103.get()); - A a1105 = new A(a1104.get()); - A a1106 = new A(a1105.get()); - A a1107 = new A(a1106.get()); - A a1108 = new A(a1107.get()); - A a1109 = new A(a1108.get()); - A a1110 = new A(a1109.get()); - A a1111 = new A(a1110.get()); - A a1112 = new A(a1111.get()); - A a1113 = new A(a1112.get()); - A a1114 = new A(a1113.get()); - A a1115 = new A(a1114.get()); - A a1116 = new A(a1115.get()); - A a1117 = new A(a1116.get()); - A a1118 = new A(a1117.get()); - A a1119 = new A(a1118.get()); - A a1120 = new A(a1119.get()); - A a1121 = new A(a1120.get()); - A a1122 = new A(a1121.get()); - A a1123 = new A(a1122.get()); - A a1124 = new A(a1123.get()); - A a1125 = new A(a1124.get()); - A a1126 = new A(a1125.get()); - A a1127 = new A(a1126.get()); - A a1128 = new A(a1127.get()); - A a1129 = new A(a1128.get()); - A a1130 = new A(a1129.get()); - A a1131 = new A(a1130.get()); - A a1132 = new A(a1131.get()); - A a1133 = new A(a1132.get()); - A a1134 = new A(a1133.get()); - A a1135 = new A(a1134.get()); - A a1136 = new A(a1135.get()); - A a1137 = new A(a1136.get()); - A a1138 = new A(a1137.get()); - A a1139 = new A(a1138.get()); - A a1140 = new A(a1139.get()); - A a1141 = new A(a1140.get()); - A a1142 = new A(a1141.get()); - A a1143 = new A(a1142.get()); - A a1144 = new A(a1143.get()); - A a1145 = new A(a1144.get()); - A a1146 = new A(a1145.get()); - A a1147 = new A(a1146.get()); - A a1148 = new A(a1147.get()); - A a1149 = new A(a1148.get()); - A a1150 = new A(a1149.get()); - A a1151 = new A(a1150.get()); - A a1152 = new A(a1151.get()); - A a1153 = new A(a1152.get()); - A a1154 = new A(a1153.get()); - A a1155 = new A(a1154.get()); - A a1156 = new A(a1155.get()); - A a1157 = new A(a1156.get()); - A a1158 = new A(a1157.get()); - A a1159 = new A(a1158.get()); - A a1160 = new A(a1159.get()); - A a1161 = new A(a1160.get()); - A a1162 = new A(a1161.get()); - A a1163 = new A(a1162.get()); - A a1164 = new A(a1163.get()); - A a1165 = new A(a1164.get()); - A a1166 = new A(a1165.get()); - A a1167 = new A(a1166.get()); - A a1168 = new A(a1167.get()); - A a1169 = new A(a1168.get()); - A a1170 = new A(a1169.get()); - A a1171 = new A(a1170.get()); - A a1172 = new A(a1171.get()); - A a1173 = new A(a1172.get()); - A a1174 = new A(a1173.get()); - A a1175 = new A(a1174.get()); - A a1176 = new A(a1175.get()); - A a1177 = new A(a1176.get()); - A a1178 = new A(a1177.get()); - A a1179 = new A(a1178.get()); - A a1180 = new A(a1179.get()); - A a1181 = new A(a1180.get()); - A a1182 = new A(a1181.get()); - A a1183 = new A(a1182.get()); - A a1184 = new A(a1183.get()); - A a1185 = new A(a1184.get()); - A a1186 = new A(a1185.get()); - A a1187 = new A(a1186.get()); - A a1188 = new A(a1187.get()); - A a1189 = new A(a1188.get()); - A a1190 = new A(a1189.get()); - A a1191 = new A(a1190.get()); - A a1192 = new A(a1191.get()); - A a1193 = new A(a1192.get()); - A a1194 = new A(a1193.get()); - A a1195 = new A(a1194.get()); - A a1196 = new A(a1195.get()); - A a1197 = new A(a1196.get()); - A a1198 = new A(a1197.get()); - A a1199 = new A(a1198.get()); - A a1200 = new A(a1199.get()); - A a1201 = new A(a1200.get()); - A a1202 = new A(a1201.get()); - A a1203 = new A(a1202.get()); - A a1204 = new A(a1203.get()); - A a1205 = new A(a1204.get()); - A a1206 = new A(a1205.get()); - A a1207 = new A(a1206.get()); - A a1208 = new A(a1207.get()); - A a1209 = new A(a1208.get()); - A a1210 = new A(a1209.get()); - A a1211 = new A(a1210.get()); - A a1212 = new A(a1211.get()); - A a1213 = new A(a1212.get()); - A a1214 = new A(a1213.get()); - A a1215 = new A(a1214.get()); - A a1216 = new A(a1215.get()); - A a1217 = new A(a1216.get()); - A a1218 = new A(a1217.get()); - A a1219 = new A(a1218.get()); - A a1220 = new A(a1219.get()); - A a1221 = new A(a1220.get()); - A a1222 = new A(a1221.get()); - A a1223 = new A(a1222.get()); - A a1224 = new A(a1223.get()); - A a1225 = new A(a1224.get()); - A a1226 = new A(a1225.get()); - A a1227 = new A(a1226.get()); - A a1228 = new A(a1227.get()); - A a1229 = new A(a1228.get()); - A a1230 = new A(a1229.get()); - A a1231 = new A(a1230.get()); - A a1232 = new A(a1231.get()); - A a1233 = new A(a1232.get()); - A a1234 = new A(a1233.get()); - A a1235 = new A(a1234.get()); - A a1236 = new A(a1235.get()); - A a1237 = new A(a1236.get()); - A a1238 = new A(a1237.get()); - A a1239 = new A(a1238.get()); - A a1240 = new A(a1239.get()); - A a1241 = new A(a1240.get()); - A a1242 = new A(a1241.get()); - A a1243 = new A(a1242.get()); - A a1244 = new A(a1243.get()); - A a1245 = new A(a1244.get()); - A a1246 = new A(a1245.get()); - A a1247 = new A(a1246.get()); - A a1248 = new A(a1247.get()); - A a1249 = new A(a1248.get()); - A a1250 = new A(a1249.get()); - A a1251 = new A(a1250.get()); - A a1252 = new A(a1251.get()); - A a1253 = new A(a1252.get()); - A a1254 = new A(a1253.get()); - A a1255 = new A(a1254.get()); - A a1256 = new A(a1255.get()); - A a1257 = new A(a1256.get()); - A a1258 = new A(a1257.get()); - A a1259 = new A(a1258.get()); - A a1260 = new A(a1259.get()); - A a1261 = new A(a1260.get()); - A a1262 = new A(a1261.get()); - A a1263 = new A(a1262.get()); - A a1264 = new A(a1263.get()); - A a1265 = new A(a1264.get()); - A a1266 = new A(a1265.get()); - A a1267 = new A(a1266.get()); - A a1268 = new A(a1267.get()); - A a1269 = new A(a1268.get()); - A a1270 = new A(a1269.get()); - A a1271 = new A(a1270.get()); - A a1272 = new A(a1271.get()); - A a1273 = new A(a1272.get()); - A a1274 = new A(a1273.get()); - A a1275 = new A(a1274.get()); - A a1276 = new A(a1275.get()); - A a1277 = new A(a1276.get()); - A a1278 = new A(a1277.get()); - A a1279 = new A(a1278.get()); - A a1280 = new A(a1279.get()); - A a1281 = new A(a1280.get()); - A a1282 = new A(a1281.get()); - A a1283 = new A(a1282.get()); - A a1284 = new A(a1283.get()); - A a1285 = new A(a1284.get()); - A a1286 = new A(a1285.get()); - A a1287 = new A(a1286.get()); - A a1288 = new A(a1287.get()); - A a1289 = new A(a1288.get()); - A a1290 = new A(a1289.get()); - A a1291 = new A(a1290.get()); - A a1292 = new A(a1291.get()); - A a1293 = new A(a1292.get()); - A a1294 = new A(a1293.get()); - A a1295 = new A(a1294.get()); - A a1296 = new A(a1295.get()); - A a1297 = new A(a1296.get()); - A a1298 = new A(a1297.get()); - A a1299 = new A(a1298.get()); - A a1300 = new A(a1299.get()); - A a1301 = new A(a1300.get()); - A a1302 = new A(a1301.get()); - A a1303 = new A(a1302.get()); - A a1304 = new A(a1303.get()); - A a1305 = new A(a1304.get()); - A a1306 = new A(a1305.get()); - A a1307 = new A(a1306.get()); - A a1308 = new A(a1307.get()); - A a1309 = new A(a1308.get()); - A a1310 = new A(a1309.get()); - A a1311 = new A(a1310.get()); - A a1312 = new A(a1311.get()); - A a1313 = new A(a1312.get()); - A a1314 = new A(a1313.get()); - A a1315 = new A(a1314.get()); - A a1316 = new A(a1315.get()); - A a1317 = new A(a1316.get()); - A a1318 = new A(a1317.get()); - A a1319 = new A(a1318.get()); - A a1320 = new A(a1319.get()); - A a1321 = new A(a1320.get()); - A a1322 = new A(a1321.get()); - A a1323 = new A(a1322.get()); - A a1324 = new A(a1323.get()); - A a1325 = new A(a1324.get()); - A a1326 = new A(a1325.get()); - A a1327 = new A(a1326.get()); - A a1328 = new A(a1327.get()); - A a1329 = new A(a1328.get()); - A a1330 = new A(a1329.get()); - A a1331 = new A(a1330.get()); - A a1332 = new A(a1331.get()); - A a1333 = new A(a1332.get()); - A a1334 = new A(a1333.get()); - A a1335 = new A(a1334.get()); - A a1336 = new A(a1335.get()); - A a1337 = new A(a1336.get()); - A a1338 = new A(a1337.get()); - A a1339 = new A(a1338.get()); - A a1340 = new A(a1339.get()); - A a1341 = new A(a1340.get()); - A a1342 = new A(a1341.get()); - A a1343 = new A(a1342.get()); - A a1344 = new A(a1343.get()); - A a1345 = new A(a1344.get()); - A a1346 = new A(a1345.get()); - A a1347 = new A(a1346.get()); - A a1348 = new A(a1347.get()); - A a1349 = new A(a1348.get()); - A a1350 = new A(a1349.get()); - A a1351 = new A(a1350.get()); - A a1352 = new A(a1351.get()); - A a1353 = new A(a1352.get()); - A a1354 = new A(a1353.get()); - A a1355 = new A(a1354.get()); - A a1356 = new A(a1355.get()); - A a1357 = new A(a1356.get()); - A a1358 = new A(a1357.get()); - A a1359 = new A(a1358.get()); - A a1360 = new A(a1359.get()); - A a1361 = new A(a1360.get()); - A a1362 = new A(a1361.get()); - A a1363 = new A(a1362.get()); - A a1364 = new A(a1363.get()); - A a1365 = new A(a1364.get()); - A a1366 = new A(a1365.get()); - A a1367 = new A(a1366.get()); - A a1368 = new A(a1367.get()); - A a1369 = new A(a1368.get()); - A a1370 = new A(a1369.get()); - A a1371 = new A(a1370.get()); - A a1372 = new A(a1371.get()); - A a1373 = new A(a1372.get()); - A a1374 = new A(a1373.get()); - A a1375 = new A(a1374.get()); - A a1376 = new A(a1375.get()); - A a1377 = new A(a1376.get()); - A a1378 = new A(a1377.get()); - A a1379 = new A(a1378.get()); - A a1380 = new A(a1379.get()); - A a1381 = new A(a1380.get()); - A a1382 = new A(a1381.get()); - A a1383 = new A(a1382.get()); - A a1384 = new A(a1383.get()); - A a1385 = new A(a1384.get()); - A a1386 = new A(a1385.get()); - A a1387 = new A(a1386.get()); - A a1388 = new A(a1387.get()); - A a1389 = new A(a1388.get()); - A a1390 = new A(a1389.get()); - A a1391 = new A(a1390.get()); - A a1392 = new A(a1391.get()); - A a1393 = new A(a1392.get()); - A a1394 = new A(a1393.get()); - A a1395 = new A(a1394.get()); - A a1396 = new A(a1395.get()); - A a1397 = new A(a1396.get()); - A a1398 = new A(a1397.get()); - A a1399 = new A(a1398.get()); - A a1400 = new A(a1399.get()); - A a1401 = new A(a1400.get()); - A a1402 = new A(a1401.get()); - A a1403 = new A(a1402.get()); - A a1404 = new A(a1403.get()); - A a1405 = new A(a1404.get()); - A a1406 = new A(a1405.get()); - A a1407 = new A(a1406.get()); - A a1408 = new A(a1407.get()); - A a1409 = new A(a1408.get()); - A a1410 = new A(a1409.get()); - A a1411 = new A(a1410.get()); - A a1412 = new A(a1411.get()); - A a1413 = new A(a1412.get()); - A a1414 = new A(a1413.get()); - A a1415 = new A(a1414.get()); - A a1416 = new A(a1415.get()); - A a1417 = new A(a1416.get()); - A a1418 = new A(a1417.get()); - A a1419 = new A(a1418.get()); - A a1420 = new A(a1419.get()); - A a1421 = new A(a1420.get()); - A a1422 = new A(a1421.get()); - A a1423 = new A(a1422.get()); - A a1424 = new A(a1423.get()); - A a1425 = new A(a1424.get()); - A a1426 = new A(a1425.get()); - A a1427 = new A(a1426.get()); - A a1428 = new A(a1427.get()); - A a1429 = new A(a1428.get()); - A a1430 = new A(a1429.get()); - A a1431 = new A(a1430.get()); - A a1432 = new A(a1431.get()); - A a1433 = new A(a1432.get()); - A a1434 = new A(a1433.get()); - A a1435 = new A(a1434.get()); - A a1436 = new A(a1435.get()); - A a1437 = new A(a1436.get()); - A a1438 = new A(a1437.get()); - A a1439 = new A(a1438.get()); - A a1440 = new A(a1439.get()); - A a1441 = new A(a1440.get()); - A a1442 = new A(a1441.get()); - A a1443 = new A(a1442.get()); - A a1444 = new A(a1443.get()); - A a1445 = new A(a1444.get()); - A a1446 = new A(a1445.get()); - A a1447 = new A(a1446.get()); - A a1448 = new A(a1447.get()); - A a1449 = new A(a1448.get()); - A a1450 = new A(a1449.get()); - A a1451 = new A(a1450.get()); - A a1452 = new A(a1451.get()); - A a1453 = new A(a1452.get()); - A a1454 = new A(a1453.get()); - A a1455 = new A(a1454.get()); - A a1456 = new A(a1455.get()); - A a1457 = new A(a1456.get()); - A a1458 = new A(a1457.get()); - A a1459 = new A(a1458.get()); - A a1460 = new A(a1459.get()); - A a1461 = new A(a1460.get()); - A a1462 = new A(a1461.get()); - A a1463 = new A(a1462.get()); - A a1464 = new A(a1463.get()); - A a1465 = new A(a1464.get()); - A a1466 = new A(a1465.get()); - A a1467 = new A(a1466.get()); - A a1468 = new A(a1467.get()); - A a1469 = new A(a1468.get()); - A a1470 = new A(a1469.get()); - A a1471 = new A(a1470.get()); - A a1472 = new A(a1471.get()); - A a1473 = new A(a1472.get()); - A a1474 = new A(a1473.get()); - A a1475 = new A(a1474.get()); - A a1476 = new A(a1475.get()); - A a1477 = new A(a1476.get()); - A a1478 = new A(a1477.get()); - A a1479 = new A(a1478.get()); - A a1480 = new A(a1479.get()); - A a1481 = new A(a1480.get()); - A a1482 = new A(a1481.get()); - A a1483 = new A(a1482.get()); - A a1484 = new A(a1483.get()); - A a1485 = new A(a1484.get()); - A a1486 = new A(a1485.get()); - A a1487 = new A(a1486.get()); - A a1488 = new A(a1487.get()); - A a1489 = new A(a1488.get()); - A a1490 = new A(a1489.get()); - A a1491 = new A(a1490.get()); - A a1492 = new A(a1491.get()); - A a1493 = new A(a1492.get()); - A a1494 = new A(a1493.get()); - A a1495 = new A(a1494.get()); - A a1496 = new A(a1495.get()); - A a1497 = new A(a1496.get()); - A a1498 = new A(a1497.get()); - A a1499 = new A(a1498.get()); - A a1500 = new A(a1499.get()); - A a1501 = new A(a1500.get()); - A a1502 = new A(a1501.get()); - A a1503 = new A(a1502.get()); - A a1504 = new A(a1503.get()); - A a1505 = new A(a1504.get()); - A a1506 = new A(a1505.get()); - A a1507 = new A(a1506.get()); - A a1508 = new A(a1507.get()); - A a1509 = new A(a1508.get()); - A a1510 = new A(a1509.get()); - A a1511 = new A(a1510.get()); - A a1512 = new A(a1511.get()); - A a1513 = new A(a1512.get()); - A a1514 = new A(a1513.get()); - A a1515 = new A(a1514.get()); - A a1516 = new A(a1515.get()); - A a1517 = new A(a1516.get()); - A a1518 = new A(a1517.get()); - A a1519 = new A(a1518.get()); - A a1520 = new A(a1519.get()); - A a1521 = new A(a1520.get()); - A a1522 = new A(a1521.get()); - A a1523 = new A(a1522.get()); - A a1524 = new A(a1523.get()); - A a1525 = new A(a1524.get()); - A a1526 = new A(a1525.get()); - A a1527 = new A(a1526.get()); - A a1528 = new A(a1527.get()); - A a1529 = new A(a1528.get()); - A a1530 = new A(a1529.get()); - A a1531 = new A(a1530.get()); - A a1532 = new A(a1531.get()); - A a1533 = new A(a1532.get()); - A a1534 = new A(a1533.get()); - A a1535 = new A(a1534.get()); - A a1536 = new A(a1535.get()); - A a1537 = new A(a1536.get()); - A a1538 = new A(a1537.get()); - A a1539 = new A(a1538.get()); - A a1540 = new A(a1539.get()); - A a1541 = new A(a1540.get()); - A a1542 = new A(a1541.get()); - A a1543 = new A(a1542.get()); - A a1544 = new A(a1543.get()); - A a1545 = new A(a1544.get()); - A a1546 = new A(a1545.get()); - A a1547 = new A(a1546.get()); - A a1548 = new A(a1547.get()); - A a1549 = new A(a1548.get()); - A a1550 = new A(a1549.get()); - A a1551 = new A(a1550.get()); - A a1552 = new A(a1551.get()); - A a1553 = new A(a1552.get()); - A a1554 = new A(a1553.get()); - A a1555 = new A(a1554.get()); - A a1556 = new A(a1555.get()); - A a1557 = new A(a1556.get()); - A a1558 = new A(a1557.get()); - A a1559 = new A(a1558.get()); - A a1560 = new A(a1559.get()); - A a1561 = new A(a1560.get()); - A a1562 = new A(a1561.get()); - A a1563 = new A(a1562.get()); - A a1564 = new A(a1563.get()); - A a1565 = new A(a1564.get()); - A a1566 = new A(a1565.get()); - A a1567 = new A(a1566.get()); - A a1568 = new A(a1567.get()); - A a1569 = new A(a1568.get()); - A a1570 = new A(a1569.get()); - A a1571 = new A(a1570.get()); - A a1572 = new A(a1571.get()); - A a1573 = new A(a1572.get()); - A a1574 = new A(a1573.get()); - A a1575 = new A(a1574.get()); - A a1576 = new A(a1575.get()); - A a1577 = new A(a1576.get()); - A a1578 = new A(a1577.get()); - A a1579 = new A(a1578.get()); - A a1580 = new A(a1579.get()); - A a1581 = new A(a1580.get()); - A a1582 = new A(a1581.get()); - A a1583 = new A(a1582.get()); - A a1584 = new A(a1583.get()); - A a1585 = new A(a1584.get()); - A a1586 = new A(a1585.get()); - A a1587 = new A(a1586.get()); - A a1588 = new A(a1587.get()); - A a1589 = new A(a1588.get()); - A a1590 = new A(a1589.get()); - A a1591 = new A(a1590.get()); - A a1592 = new A(a1591.get()); - A a1593 = new A(a1592.get()); - A a1594 = new A(a1593.get()); - A a1595 = new A(a1594.get()); - A a1596 = new A(a1595.get()); - A a1597 = new A(a1596.get()); - A a1598 = new A(a1597.get()); - A a1599 = new A(a1598.get()); - A a1600 = new A(a1599.get()); - A a1601 = new A(a1600.get()); - A a1602 = new A(a1601.get()); - A a1603 = new A(a1602.get()); - A a1604 = new A(a1603.get()); - A a1605 = new A(a1604.get()); - A a1606 = new A(a1605.get()); - A a1607 = new A(a1606.get()); - A a1608 = new A(a1607.get()); - A a1609 = new A(a1608.get()); - A a1610 = new A(a1609.get()); - A a1611 = new A(a1610.get()); - A a1612 = new A(a1611.get()); - A a1613 = new A(a1612.get()); - A a1614 = new A(a1613.get()); - A a1615 = new A(a1614.get()); - A a1616 = new A(a1615.get()); - A a1617 = new A(a1616.get()); - A a1618 = new A(a1617.get()); - A a1619 = new A(a1618.get()); - A a1620 = new A(a1619.get()); - A a1621 = new A(a1620.get()); - A a1622 = new A(a1621.get()); - A a1623 = new A(a1622.get()); - A a1624 = new A(a1623.get()); - A a1625 = new A(a1624.get()); - A a1626 = new A(a1625.get()); - A a1627 = new A(a1626.get()); - A a1628 = new A(a1627.get()); - A a1629 = new A(a1628.get()); - A a1630 = new A(a1629.get()); - A a1631 = new A(a1630.get()); - A a1632 = new A(a1631.get()); - A a1633 = new A(a1632.get()); - A a1634 = new A(a1633.get()); - A a1635 = new A(a1634.get()); - A a1636 = new A(a1635.get()); - A a1637 = new A(a1636.get()); - A a1638 = new A(a1637.get()); - A a1639 = new A(a1638.get()); - A a1640 = new A(a1639.get()); - A a1641 = new A(a1640.get()); - A a1642 = new A(a1641.get()); - A a1643 = new A(a1642.get()); - A a1644 = new A(a1643.get()); - A a1645 = new A(a1644.get()); - A a1646 = new A(a1645.get()); - A a1647 = new A(a1646.get()); - A a1648 = new A(a1647.get()); - A a1649 = new A(a1648.get()); - A a1650 = new A(a1649.get()); - A a1651 = new A(a1650.get()); - A a1652 = new A(a1651.get()); - A a1653 = new A(a1652.get()); - A a1654 = new A(a1653.get()); - A a1655 = new A(a1654.get()); - A a1656 = new A(a1655.get()); - A a1657 = new A(a1656.get()); - A a1658 = new A(a1657.get()); - A a1659 = new A(a1658.get()); - A a1660 = new A(a1659.get()); - A a1661 = new A(a1660.get()); - A a1662 = new A(a1661.get()); - A a1663 = new A(a1662.get()); - A a1664 = new A(a1663.get()); - A a1665 = new A(a1664.get()); - A a1666 = new A(a1665.get()); - A a1667 = new A(a1666.get()); - A a1668 = new A(a1667.get()); - A a1669 = new A(a1668.get()); - A a1670 = new A(a1669.get()); - A a1671 = new A(a1670.get()); - A a1672 = new A(a1671.get()); - A a1673 = new A(a1672.get()); - A a1674 = new A(a1673.get()); - A a1675 = new A(a1674.get()); - A a1676 = new A(a1675.get()); - A a1677 = new A(a1676.get()); - A a1678 = new A(a1677.get()); - A a1679 = new A(a1678.get()); - A a1680 = new A(a1679.get()); - A a1681 = new A(a1680.get()); - A a1682 = new A(a1681.get()); - A a1683 = new A(a1682.get()); - A a1684 = new A(a1683.get()); - A a1685 = new A(a1684.get()); - A a1686 = new A(a1685.get()); - A a1687 = new A(a1686.get()); - A a1688 = new A(a1687.get()); - A a1689 = new A(a1688.get()); - A a1690 = new A(a1689.get()); - A a1691 = new A(a1690.get()); - A a1692 = new A(a1691.get()); - A a1693 = new A(a1692.get()); - A a1694 = new A(a1693.get()); - A a1695 = new A(a1694.get()); - A a1696 = new A(a1695.get()); - A a1697 = new A(a1696.get()); - A a1698 = new A(a1697.get()); - A a1699 = new A(a1698.get()); - A a1700 = new A(a1699.get()); - A a1701 = new A(a1700.get()); - A a1702 = new A(a1701.get()); - A a1703 = new A(a1702.get()); - A a1704 = new A(a1703.get()); - A a1705 = new A(a1704.get()); - A a1706 = new A(a1705.get()); - A a1707 = new A(a1706.get()); - A a1708 = new A(a1707.get()); - A a1709 = new A(a1708.get()); - A a1710 = new A(a1709.get()); - A a1711 = new A(a1710.get()); - A a1712 = new A(a1711.get()); - A a1713 = new A(a1712.get()); - A a1714 = new A(a1713.get()); - A a1715 = new A(a1714.get()); - A a1716 = new A(a1715.get()); - A a1717 = new A(a1716.get()); - A a1718 = new A(a1717.get()); - A a1719 = new A(a1718.get()); - A a1720 = new A(a1719.get()); - A a1721 = new A(a1720.get()); - A a1722 = new A(a1721.get()); - A a1723 = new A(a1722.get()); - A a1724 = new A(a1723.get()); - A a1725 = new A(a1724.get()); - A a1726 = new A(a1725.get()); - A a1727 = new A(a1726.get()); - A a1728 = new A(a1727.get()); - A a1729 = new A(a1728.get()); - A a1730 = new A(a1729.get()); - A a1731 = new A(a1730.get()); - A a1732 = new A(a1731.get()); - A a1733 = new A(a1732.get()); - A a1734 = new A(a1733.get()); - A a1735 = new A(a1734.get()); - A a1736 = new A(a1735.get()); - A a1737 = new A(a1736.get()); - A a1738 = new A(a1737.get()); - A a1739 = new A(a1738.get()); - A a1740 = new A(a1739.get()); - A a1741 = new A(a1740.get()); - A a1742 = new A(a1741.get()); - A a1743 = new A(a1742.get()); - A a1744 = new A(a1743.get()); - A a1745 = new A(a1744.get()); - A a1746 = new A(a1745.get()); - A a1747 = new A(a1746.get()); - A a1748 = new A(a1747.get()); - A a1749 = new A(a1748.get()); - A a1750 = new A(a1749.get()); - A a1751 = new A(a1750.get()); - A a1752 = new A(a1751.get()); - A a1753 = new A(a1752.get()); - A a1754 = new A(a1753.get()); - A a1755 = new A(a1754.get()); - A a1756 = new A(a1755.get()); - A a1757 = new A(a1756.get()); - A a1758 = new A(a1757.get()); - A a1759 = new A(a1758.get()); - A a1760 = new A(a1759.get()); - A a1761 = new A(a1760.get()); - A a1762 = new A(a1761.get()); - A a1763 = new A(a1762.get()); - A a1764 = new A(a1763.get()); - A a1765 = new A(a1764.get()); - A a1766 = new A(a1765.get()); - A a1767 = new A(a1766.get()); - A a1768 = new A(a1767.get()); - A a1769 = new A(a1768.get()); - A a1770 = new A(a1769.get()); - A a1771 = new A(a1770.get()); - A a1772 = new A(a1771.get()); - A a1773 = new A(a1772.get()); - A a1774 = new A(a1773.get()); - A a1775 = new A(a1774.get()); - A a1776 = new A(a1775.get()); - A a1777 = new A(a1776.get()); - A a1778 = new A(a1777.get()); - A a1779 = new A(a1778.get()); - A a1780 = new A(a1779.get()); - A a1781 = new A(a1780.get()); - A a1782 = new A(a1781.get()); - A a1783 = new A(a1782.get()); - A a1784 = new A(a1783.get()); - A a1785 = new A(a1784.get()); - A a1786 = new A(a1785.get()); - A a1787 = new A(a1786.get()); - A a1788 = new A(a1787.get()); - A a1789 = new A(a1788.get()); - A a1790 = new A(a1789.get()); - A a1791 = new A(a1790.get()); - A a1792 = new A(a1791.get()); - A a1793 = new A(a1792.get()); - A a1794 = new A(a1793.get()); - A a1795 = new A(a1794.get()); - A a1796 = new A(a1795.get()); - A a1797 = new A(a1796.get()); - A a1798 = new A(a1797.get()); - A a1799 = new A(a1798.get()); - A a1800 = new A(a1799.get()); - A a1801 = new A(a1800.get()); - A a1802 = new A(a1801.get()); - A a1803 = new A(a1802.get()); - A a1804 = new A(a1803.get()); - A a1805 = new A(a1804.get()); - A a1806 = new A(a1805.get()); - A a1807 = new A(a1806.get()); - A a1808 = new A(a1807.get()); - A a1809 = new A(a1808.get()); - A a1810 = new A(a1809.get()); - A a1811 = new A(a1810.get()); - A a1812 = new A(a1811.get()); - A a1813 = new A(a1812.get()); - A a1814 = new A(a1813.get()); - A a1815 = new A(a1814.get()); - A a1816 = new A(a1815.get()); - A a1817 = new A(a1816.get()); - A a1818 = new A(a1817.get()); - A a1819 = new A(a1818.get()); - A a1820 = new A(a1819.get()); - A a1821 = new A(a1820.get()); - A a1822 = new A(a1821.get()); - A a1823 = new A(a1822.get()); - A a1824 = new A(a1823.get()); - A a1825 = new A(a1824.get()); - A a1826 = new A(a1825.get()); - A a1827 = new A(a1826.get()); - A a1828 = new A(a1827.get()); - A a1829 = new A(a1828.get()); - A a1830 = new A(a1829.get()); - A a1831 = new A(a1830.get()); - A a1832 = new A(a1831.get()); - A a1833 = new A(a1832.get()); - A a1834 = new A(a1833.get()); - A a1835 = new A(a1834.get()); - A a1836 = new A(a1835.get()); - A a1837 = new A(a1836.get()); - A a1838 = new A(a1837.get()); - A a1839 = new A(a1838.get()); - A a1840 = new A(a1839.get()); - A a1841 = new A(a1840.get()); - A a1842 = new A(a1841.get()); - A a1843 = new A(a1842.get()); - A a1844 = new A(a1843.get()); - A a1845 = new A(a1844.get()); - A a1846 = new A(a1845.get()); - A a1847 = new A(a1846.get()); - A a1848 = new A(a1847.get()); - A a1849 = new A(a1848.get()); - A a1850 = new A(a1849.get()); - A a1851 = new A(a1850.get()); - A a1852 = new A(a1851.get()); - A a1853 = new A(a1852.get()); - A a1854 = new A(a1853.get()); - A a1855 = new A(a1854.get()); - A a1856 = new A(a1855.get()); - A a1857 = new A(a1856.get()); - A a1858 = new A(a1857.get()); - A a1859 = new A(a1858.get()); - A a1860 = new A(a1859.get()); - A a1861 = new A(a1860.get()); - A a1862 = new A(a1861.get()); - A a1863 = new A(a1862.get()); - A a1864 = new A(a1863.get()); - A a1865 = new A(a1864.get()); - A a1866 = new A(a1865.get()); - A a1867 = new A(a1866.get()); - A a1868 = new A(a1867.get()); - A a1869 = new A(a1868.get()); - A a1870 = new A(a1869.get()); - A a1871 = new A(a1870.get()); - A a1872 = new A(a1871.get()); - A a1873 = new A(a1872.get()); - A a1874 = new A(a1873.get()); - A a1875 = new A(a1874.get()); - A a1876 = new A(a1875.get()); - A a1877 = new A(a1876.get()); - A a1878 = new A(a1877.get()); - A a1879 = new A(a1878.get()); - A a1880 = new A(a1879.get()); - A a1881 = new A(a1880.get()); - A a1882 = new A(a1881.get()); - A a1883 = new A(a1882.get()); - A a1884 = new A(a1883.get()); - A a1885 = new A(a1884.get()); - A a1886 = new A(a1885.get()); - A a1887 = new A(a1886.get()); - A a1888 = new A(a1887.get()); - A a1889 = new A(a1888.get()); - A a1890 = new A(a1889.get()); - A a1891 = new A(a1890.get()); - A a1892 = new A(a1891.get()); - A a1893 = new A(a1892.get()); - A a1894 = new A(a1893.get()); - A a1895 = new A(a1894.get()); - A a1896 = new A(a1895.get()); - A a1897 = new A(a1896.get()); - A a1898 = new A(a1897.get()); - A a1899 = new A(a1898.get()); - A a1900 = new A(a1899.get()); - A a1901 = new A(a1900.get()); - A a1902 = new A(a1901.get()); - A a1903 = new A(a1902.get()); - A a1904 = new A(a1903.get()); - A a1905 = new A(a1904.get()); - A a1906 = new A(a1905.get()); - A a1907 = new A(a1906.get()); - A a1908 = new A(a1907.get()); - A a1909 = new A(a1908.get()); - A a1910 = new A(a1909.get()); - A a1911 = new A(a1910.get()); - A a1912 = new A(a1911.get()); - A a1913 = new A(a1912.get()); - A a1914 = new A(a1913.get()); - A a1915 = new A(a1914.get()); - A a1916 = new A(a1915.get()); - A a1917 = new A(a1916.get()); - A a1918 = new A(a1917.get()); - A a1919 = new A(a1918.get()); - A a1920 = new A(a1919.get()); - A a1921 = new A(a1920.get()); - A a1922 = new A(a1921.get()); - A a1923 = new A(a1922.get()); - A a1924 = new A(a1923.get()); - A a1925 = new A(a1924.get()); - A a1926 = new A(a1925.get()); - A a1927 = new A(a1926.get()); - A a1928 = new A(a1927.get()); - A a1929 = new A(a1928.get()); - A a1930 = new A(a1929.get()); - A a1931 = new A(a1930.get()); - A a1932 = new A(a1931.get()); - A a1933 = new A(a1932.get()); - A a1934 = new A(a1933.get()); - A a1935 = new A(a1934.get()); - A a1936 = new A(a1935.get()); - A a1937 = new A(a1936.get()); - A a1938 = new A(a1937.get()); - A a1939 = new A(a1938.get()); - A a1940 = new A(a1939.get()); - A a1941 = new A(a1940.get()); - A a1942 = new A(a1941.get()); - A a1943 = new A(a1942.get()); - A a1944 = new A(a1943.get()); - A a1945 = new A(a1944.get()); - A a1946 = new A(a1945.get()); - A a1947 = new A(a1946.get()); - A a1948 = new A(a1947.get()); - A a1949 = new A(a1948.get()); - A a1950 = new A(a1949.get()); - A a1951 = new A(a1950.get()); - A a1952 = new A(a1951.get()); - A a1953 = new A(a1952.get()); - A a1954 = new A(a1953.get()); - A a1955 = new A(a1954.get()); - A a1956 = new A(a1955.get()); - A a1957 = new A(a1956.get()); - A a1958 = new A(a1957.get()); - A a1959 = new A(a1958.get()); - A a1960 = new A(a1959.get()); - A a1961 = new A(a1960.get()); - A a1962 = new A(a1961.get()); - A a1963 = new A(a1962.get()); - A a1964 = new A(a1963.get()); - A a1965 = new A(a1964.get()); - A a1966 = new A(a1965.get()); - A a1967 = new A(a1966.get()); - A a1968 = new A(a1967.get()); - A a1969 = new A(a1968.get()); - A a1970 = new A(a1969.get()); - A a1971 = new A(a1970.get()); - A a1972 = new A(a1971.get()); - A a1973 = new A(a1972.get()); - A a1974 = new A(a1973.get()); - A a1975 = new A(a1974.get()); - A a1976 = new A(a1975.get()); - A a1977 = new A(a1976.get()); - A a1978 = new A(a1977.get()); - A a1979 = new A(a1978.get()); - A a1980 = new A(a1979.get()); - A a1981 = new A(a1980.get()); - A a1982 = new A(a1981.get()); - A a1983 = new A(a1982.get()); - A a1984 = new A(a1983.get()); - A a1985 = new A(a1984.get()); - A a1986 = new A(a1985.get()); - A a1987 = new A(a1986.get()); - A a1988 = new A(a1987.get()); - A a1989 = new A(a1988.get()); - A a1990 = new A(a1989.get()); - A a1991 = new A(a1990.get()); - A a1992 = new A(a1991.get()); - A a1993 = new A(a1992.get()); - A a1994 = new A(a1993.get()); - A a1995 = new A(a1994.get()); - A a1996 = new A(a1995.get()); - A a1997 = new A(a1996.get()); - A a1998 = new A(a1997.get()); - A a1999 = new A(a1998.get()); - A a2000 = new A(a1999.get()); - A a2001 = new A(a2000.get()); - A a2002 = new A(a2001.get()); - A a2003 = new A(a2002.get()); - A a2004 = new A(a2003.get()); - A a2005 = new A(a2004.get()); - A a2006 = new A(a2005.get()); - A a2007 = new A(a2006.get()); - A a2008 = new A(a2007.get()); - A a2009 = new A(a2008.get()); - A a2010 = new A(a2009.get()); - A a2011 = new A(a2010.get()); - A a2012 = new A(a2011.get()); - A a2013 = new A(a2012.get()); - A a2014 = new A(a2013.get()); - A a2015 = new A(a2014.get()); - A a2016 = new A(a2015.get()); - A a2017 = new A(a2016.get()); - A a2018 = new A(a2017.get()); - A a2019 = new A(a2018.get()); - A a2020 = new A(a2019.get()); - A a2021 = new A(a2020.get()); - A a2022 = new A(a2021.get()); - A a2023 = new A(a2022.get()); - A a2024 = new A(a2023.get()); - A a2025 = new A(a2024.get()); - A a2026 = new A(a2025.get()); - A a2027 = new A(a2026.get()); - A a2028 = new A(a2027.get()); - A a2029 = new A(a2028.get()); - A a2030 = new A(a2029.get()); - A a2031 = new A(a2030.get()); - A a2032 = new A(a2031.get()); - A a2033 = new A(a2032.get()); - A a2034 = new A(a2033.get()); - A a2035 = new A(a2034.get()); - A a2036 = new A(a2035.get()); - A a2037 = new A(a2036.get()); - A a2038 = new A(a2037.get()); - A a2039 = new A(a2038.get()); - A a2040 = new A(a2039.get()); - A a2041 = new A(a2040.get()); - A a2042 = new A(a2041.get()); - A a2043 = new A(a2042.get()); - A a2044 = new A(a2043.get()); - A a2045 = new A(a2044.get()); - A a2046 = new A(a2045.get()); - A a2047 = new A(a2046.get()); - A a2048 = new A(a2047.get()); - A a2049 = new A(a2048.get()); - A a2050 = new A(a2049.get()); - A a2051 = new A(a2050.get()); - A a2052 = new A(a2051.get()); - A a2053 = new A(a2052.get()); - A a2054 = new A(a2053.get()); - A a2055 = new A(a2054.get()); - A a2056 = new A(a2055.get()); - A a2057 = new A(a2056.get()); - A a2058 = new A(a2057.get()); - A a2059 = new A(a2058.get()); - A a2060 = new A(a2059.get()); - A a2061 = new A(a2060.get()); - A a2062 = new A(a2061.get()); - A a2063 = new A(a2062.get()); - A a2064 = new A(a2063.get()); - A a2065 = new A(a2064.get()); - A a2066 = new A(a2065.get()); - A a2067 = new A(a2066.get()); - A a2068 = new A(a2067.get()); - A a2069 = new A(a2068.get()); - A a2070 = new A(a2069.get()); - A a2071 = new A(a2070.get()); - A a2072 = new A(a2071.get()); - A a2073 = new A(a2072.get()); - A a2074 = new A(a2073.get()); - A a2075 = new A(a2074.get()); - A a2076 = new A(a2075.get()); - A a2077 = new A(a2076.get()); - A a2078 = new A(a2077.get()); - A a2079 = new A(a2078.get()); - A a2080 = new A(a2079.get()); - A a2081 = new A(a2080.get()); - A a2082 = new A(a2081.get()); - A a2083 = new A(a2082.get()); - A a2084 = new A(a2083.get()); - A a2085 = new A(a2084.get()); - A a2086 = new A(a2085.get()); - A a2087 = new A(a2086.get()); - A a2088 = new A(a2087.get()); - A a2089 = new A(a2088.get()); - A a2090 = new A(a2089.get()); - A a2091 = new A(a2090.get()); - A a2092 = new A(a2091.get()); - A a2093 = new A(a2092.get()); - A a2094 = new A(a2093.get()); - A a2095 = new A(a2094.get()); - A a2096 = new A(a2095.get()); - A a2097 = new A(a2096.get()); - A a2098 = new A(a2097.get()); - A a2099 = new A(a2098.get()); - A a2100 = new A(a2099.get()); - A a2101 = new A(a2100.get()); - A a2102 = new A(a2101.get()); - A a2103 = new A(a2102.get()); - A a2104 = new A(a2103.get()); - A a2105 = new A(a2104.get()); - A a2106 = new A(a2105.get()); - A a2107 = new A(a2106.get()); - A a2108 = new A(a2107.get()); - A a2109 = new A(a2108.get()); - A a2110 = new A(a2109.get()); - A a2111 = new A(a2110.get()); - A a2112 = new A(a2111.get()); - A a2113 = new A(a2112.get()); - A a2114 = new A(a2113.get()); - A a2115 = new A(a2114.get()); - A a2116 = new A(a2115.get()); - A a2117 = new A(a2116.get()); - A a2118 = new A(a2117.get()); - A a2119 = new A(a2118.get()); - A a2120 = new A(a2119.get()); - A a2121 = new A(a2120.get()); - A a2122 = new A(a2121.get()); - A a2123 = new A(a2122.get()); - A a2124 = new A(a2123.get()); - A a2125 = new A(a2124.get()); - A a2126 = new A(a2125.get()); - A a2127 = new A(a2126.get()); - A a2128 = new A(a2127.get()); - A a2129 = new A(a2128.get()); - A a2130 = new A(a2129.get()); - A a2131 = new A(a2130.get()); - A a2132 = new A(a2131.get()); - A a2133 = new A(a2132.get()); - A a2134 = new A(a2133.get()); - A a2135 = new A(a2134.get()); - A a2136 = new A(a2135.get()); - A a2137 = new A(a2136.get()); - A a2138 = new A(a2137.get()); - A a2139 = new A(a2138.get()); - A a2140 = new A(a2139.get()); - A a2141 = new A(a2140.get()); - A a2142 = new A(a2141.get()); - A a2143 = new A(a2142.get()); - A a2144 = new A(a2143.get()); - A a2145 = new A(a2144.get()); - A a2146 = new A(a2145.get()); - A a2147 = new A(a2146.get()); - A a2148 = new A(a2147.get()); - A a2149 = new A(a2148.get()); - A a2150 = new A(a2149.get()); - A a2151 = new A(a2150.get()); - A a2152 = new A(a2151.get()); - A a2153 = new A(a2152.get()); - A a2154 = new A(a2153.get()); - A a2155 = new A(a2154.get()); - A a2156 = new A(a2155.get()); - A a2157 = new A(a2156.get()); - A a2158 = new A(a2157.get()); - A a2159 = new A(a2158.get()); - A a2160 = new A(a2159.get()); - A a2161 = new A(a2160.get()); - A a2162 = new A(a2161.get()); - A a2163 = new A(a2162.get()); - A a2164 = new A(a2163.get()); - A a2165 = new A(a2164.get()); - A a2166 = new A(a2165.get()); - A a2167 = new A(a2166.get()); - A a2168 = new A(a2167.get()); - A a2169 = new A(a2168.get()); - A a2170 = new A(a2169.get()); - A a2171 = new A(a2170.get()); - A a2172 = new A(a2171.get()); - A a2173 = new A(a2172.get()); - A a2174 = new A(a2173.get()); - A a2175 = new A(a2174.get()); - A a2176 = new A(a2175.get()); - A a2177 = new A(a2176.get()); - A a2178 = new A(a2177.get()); - A a2179 = new A(a2178.get()); - A a2180 = new A(a2179.get()); - A a2181 = new A(a2180.get()); - A a2182 = new A(a2181.get()); - A a2183 = new A(a2182.get()); - A a2184 = new A(a2183.get()); - A a2185 = new A(a2184.get()); - A a2186 = new A(a2185.get()); - A a2187 = new A(a2186.get()); - A a2188 = new A(a2187.get()); - A a2189 = new A(a2188.get()); - A a2190 = new A(a2189.get()); - A a2191 = new A(a2190.get()); - A a2192 = new A(a2191.get()); - A a2193 = new A(a2192.get()); - A a2194 = new A(a2193.get()); - A a2195 = new A(a2194.get()); - A a2196 = new A(a2195.get()); - A a2197 = new A(a2196.get()); - A a2198 = new A(a2197.get()); - A a2199 = new A(a2198.get()); - A a2200 = new A(a2199.get()); - A a2201 = new A(a2200.get()); - A a2202 = new A(a2201.get()); - A a2203 = new A(a2202.get()); - A a2204 = new A(a2203.get()); - A a2205 = new A(a2204.get()); - A a2206 = new A(a2205.get()); - A a2207 = new A(a2206.get()); - A a2208 = new A(a2207.get()); - A a2209 = new A(a2208.get()); - A a2210 = new A(a2209.get()); - A a2211 = new A(a2210.get()); - A a2212 = new A(a2211.get()); - A a2213 = new A(a2212.get()); - A a2214 = new A(a2213.get()); - A a2215 = new A(a2214.get()); - A a2216 = new A(a2215.get()); - A a2217 = new A(a2216.get()); - A a2218 = new A(a2217.get()); - A a2219 = new A(a2218.get()); - A a2220 = new A(a2219.get()); - A a2221 = new A(a2220.get()); - A a2222 = new A(a2221.get()); - A a2223 = new A(a2222.get()); - A a2224 = new A(a2223.get()); - A a2225 = new A(a2224.get()); - A a2226 = new A(a2225.get()); - A a2227 = new A(a2226.get()); - A a2228 = new A(a2227.get()); - A a2229 = new A(a2228.get()); - A a2230 = new A(a2229.get()); - A a2231 = new A(a2230.get()); - A a2232 = new A(a2231.get()); - A a2233 = new A(a2232.get()); - A a2234 = new A(a2233.get()); - A a2235 = new A(a2234.get()); - A a2236 = new A(a2235.get()); - A a2237 = new A(a2236.get()); - A a2238 = new A(a2237.get()); - A a2239 = new A(a2238.get()); - A a2240 = new A(a2239.get()); - A a2241 = new A(a2240.get()); - A a2242 = new A(a2241.get()); - A a2243 = new A(a2242.get()); - A a2244 = new A(a2243.get()); - A a2245 = new A(a2244.get()); - A a2246 = new A(a2245.get()); - A a2247 = new A(a2246.get()); - A a2248 = new A(a2247.get()); - A a2249 = new A(a2248.get()); - A a2250 = new A(a2249.get()); - A a2251 = new A(a2250.get()); - A a2252 = new A(a2251.get()); - A a2253 = new A(a2252.get()); - A a2254 = new A(a2253.get()); - A a2255 = new A(a2254.get()); - A a2256 = new A(a2255.get()); - A a2257 = new A(a2256.get()); - A a2258 = new A(a2257.get()); - A a2259 = new A(a2258.get()); - A a2260 = new A(a2259.get()); - A a2261 = new A(a2260.get()); - A a2262 = new A(a2261.get()); - A a2263 = new A(a2262.get()); - A a2264 = new A(a2263.get()); - A a2265 = new A(a2264.get()); - A a2266 = new A(a2265.get()); - A a2267 = new A(a2266.get()); - A a2268 = new A(a2267.get()); - A a2269 = new A(a2268.get()); - A a2270 = new A(a2269.get()); - A a2271 = new A(a2270.get()); - A a2272 = new A(a2271.get()); - A a2273 = new A(a2272.get()); - A a2274 = new A(a2273.get()); - A a2275 = new A(a2274.get()); - A a2276 = new A(a2275.get()); - A a2277 = new A(a2276.get()); - A a2278 = new A(a2277.get()); - A a2279 = new A(a2278.get()); - A a2280 = new A(a2279.get()); - A a2281 = new A(a2280.get()); - A a2282 = new A(a2281.get()); - A a2283 = new A(a2282.get()); - A a2284 = new A(a2283.get()); - A a2285 = new A(a2284.get()); - A a2286 = new A(a2285.get()); - A a2287 = new A(a2286.get()); - A a2288 = new A(a2287.get()); - A a2289 = new A(a2288.get()); - A a2290 = new A(a2289.get()); - A a2291 = new A(a2290.get()); - A a2292 = new A(a2291.get()); - A a2293 = new A(a2292.get()); - A a2294 = new A(a2293.get()); - A a2295 = new A(a2294.get()); - A a2296 = new A(a2295.get()); - A a2297 = new A(a2296.get()); - A a2298 = new A(a2297.get()); - A a2299 = new A(a2298.get()); - A a2300 = new A(a2299.get()); - A a2301 = new A(a2300.get()); - A a2302 = new A(a2301.get()); - A a2303 = new A(a2302.get()); - A a2304 = new A(a2303.get()); - A a2305 = new A(a2304.get()); - A a2306 = new A(a2305.get()); - A a2307 = new A(a2306.get()); - A a2308 = new A(a2307.get()); - A a2309 = new A(a2308.get()); - A a2310 = new A(a2309.get()); - A a2311 = new A(a2310.get()); - A a2312 = new A(a2311.get()); - A a2313 = new A(a2312.get()); - A a2314 = new A(a2313.get()); - A a2315 = new A(a2314.get()); - A a2316 = new A(a2315.get()); - A a2317 = new A(a2316.get()); - A a2318 = new A(a2317.get()); - A a2319 = new A(a2318.get()); - A a2320 = new A(a2319.get()); - A a2321 = new A(a2320.get()); - A a2322 = new A(a2321.get()); - A a2323 = new A(a2322.get()); - A a2324 = new A(a2323.get()); - A a2325 = new A(a2324.get()); - A a2326 = new A(a2325.get()); - A a2327 = new A(a2326.get()); - A a2328 = new A(a2327.get()); - A a2329 = new A(a2328.get()); - A a2330 = new A(a2329.get()); - A a2331 = new A(a2330.get()); - A a2332 = new A(a2331.get()); - A a2333 = new A(a2332.get()); - A a2334 = new A(a2333.get()); - A a2335 = new A(a2334.get()); - A a2336 = new A(a2335.get()); - A a2337 = new A(a2336.get()); - A a2338 = new A(a2337.get()); - A a2339 = new A(a2338.get()); - A a2340 = new A(a2339.get()); - A a2341 = new A(a2340.get()); - A a2342 = new A(a2341.get()); - A a2343 = new A(a2342.get()); - A a2344 = new A(a2343.get()); - A a2345 = new A(a2344.get()); - A a2346 = new A(a2345.get()); - A a2347 = new A(a2346.get()); - A a2348 = new A(a2347.get()); - A a2349 = new A(a2348.get()); - A a2350 = new A(a2349.get()); - A a2351 = new A(a2350.get()); - A a2352 = new A(a2351.get()); - A a2353 = new A(a2352.get()); - A a2354 = new A(a2353.get()); - A a2355 = new A(a2354.get()); - A a2356 = new A(a2355.get()); - A a2357 = new A(a2356.get()); - A a2358 = new A(a2357.get()); - A a2359 = new A(a2358.get()); - A a2360 = new A(a2359.get()); - A a2361 = new A(a2360.get()); - A a2362 = new A(a2361.get()); - A a2363 = new A(a2362.get()); - A a2364 = new A(a2363.get()); - A a2365 = new A(a2364.get()); - A a2366 = new A(a2365.get()); - A a2367 = new A(a2366.get()); - A a2368 = new A(a2367.get()); - A a2369 = new A(a2368.get()); - A a2370 = new A(a2369.get()); - A a2371 = new A(a2370.get()); - A a2372 = new A(a2371.get()); - A a2373 = new A(a2372.get()); - A a2374 = new A(a2373.get()); - A a2375 = new A(a2374.get()); - A a2376 = new A(a2375.get()); - A a2377 = new A(a2376.get()); - A a2378 = new A(a2377.get()); - A a2379 = new A(a2378.get()); - A a2380 = new A(a2379.get()); - A a2381 = new A(a2380.get()); - A a2382 = new A(a2381.get()); - A a2383 = new A(a2382.get()); - A a2384 = new A(a2383.get()); - A a2385 = new A(a2384.get()); - A a2386 = new A(a2385.get()); - A a2387 = new A(a2386.get()); - A a2388 = new A(a2387.get()); - A a2389 = new A(a2388.get()); - A a2390 = new A(a2389.get()); - A a2391 = new A(a2390.get()); - A a2392 = new A(a2391.get()); - A a2393 = new A(a2392.get()); - A a2394 = new A(a2393.get()); - A a2395 = new A(a2394.get()); - A a2396 = new A(a2395.get()); - A a2397 = new A(a2396.get()); - A a2398 = new A(a2397.get()); - A a2399 = new A(a2398.get()); - A a2400 = new A(a2399.get()); - A a2401 = new A(a2400.get()); - A a2402 = new A(a2401.get()); - A a2403 = new A(a2402.get()); - A a2404 = new A(a2403.get()); - A a2405 = new A(a2404.get()); - A a2406 = new A(a2405.get()); - A a2407 = new A(a2406.get()); - A a2408 = new A(a2407.get()); - A a2409 = new A(a2408.get()); - A a2410 = new A(a2409.get()); - A a2411 = new A(a2410.get()); - A a2412 = new A(a2411.get()); - A a2413 = new A(a2412.get()); - A a2414 = new A(a2413.get()); - A a2415 = new A(a2414.get()); - A a2416 = new A(a2415.get()); - A a2417 = new A(a2416.get()); - A a2418 = new A(a2417.get()); - A a2419 = new A(a2418.get()); - A a2420 = new A(a2419.get()); - A a2421 = new A(a2420.get()); - A a2422 = new A(a2421.get()); - A a2423 = new A(a2422.get()); - A a2424 = new A(a2423.get()); - A a2425 = new A(a2424.get()); - A a2426 = new A(a2425.get()); - A a2427 = new A(a2426.get()); - A a2428 = new A(a2427.get()); - A a2429 = new A(a2428.get()); - A a2430 = new A(a2429.get()); - A a2431 = new A(a2430.get()); - A a2432 = new A(a2431.get()); - A a2433 = new A(a2432.get()); - A a2434 = new A(a2433.get()); - A a2435 = new A(a2434.get()); - A a2436 = new A(a2435.get()); - A a2437 = new A(a2436.get()); - A a2438 = new A(a2437.get()); - A a2439 = new A(a2438.get()); - A a2440 = new A(a2439.get()); - A a2441 = new A(a2440.get()); - A a2442 = new A(a2441.get()); - A a2443 = new A(a2442.get()); - A a2444 = new A(a2443.get()); - A a2445 = new A(a2444.get()); - A a2446 = new A(a2445.get()); - A a2447 = new A(a2446.get()); - A a2448 = new A(a2447.get()); - A a2449 = new A(a2448.get()); - A a2450 = new A(a2449.get()); - A a2451 = new A(a2450.get()); - A a2452 = new A(a2451.get()); - A a2453 = new A(a2452.get()); - A a2454 = new A(a2453.get()); - A a2455 = new A(a2454.get()); - A a2456 = new A(a2455.get()); - A a2457 = new A(a2456.get()); - A a2458 = new A(a2457.get()); - A a2459 = new A(a2458.get()); - A a2460 = new A(a2459.get()); - A a2461 = new A(a2460.get()); - A a2462 = new A(a2461.get()); - A a2463 = new A(a2462.get()); - A a2464 = new A(a2463.get()); - A a2465 = new A(a2464.get()); - A a2466 = new A(a2465.get()); - A a2467 = new A(a2466.get()); - A a2468 = new A(a2467.get()); - A a2469 = new A(a2468.get()); - A a2470 = new A(a2469.get()); - A a2471 = new A(a2470.get()); - A a2472 = new A(a2471.get()); - A a2473 = new A(a2472.get()); - A a2474 = new A(a2473.get()); - A a2475 = new A(a2474.get()); - A a2476 = new A(a2475.get()); - A a2477 = new A(a2476.get()); - A a2478 = new A(a2477.get()); - A a2479 = new A(a2478.get()); - A a2480 = new A(a2479.get()); - A a2481 = new A(a2480.get()); - A a2482 = new A(a2481.get()); - A a2483 = new A(a2482.get()); - A a2484 = new A(a2483.get()); - A a2485 = new A(a2484.get()); - A a2486 = new A(a2485.get()); - A a2487 = new A(a2486.get()); - A a2488 = new A(a2487.get()); - A a2489 = new A(a2488.get()); - A a2490 = new A(a2489.get()); - A a2491 = new A(a2490.get()); - A a2492 = new A(a2491.get()); - A a2493 = new A(a2492.get()); - A a2494 = new A(a2493.get()); - A a2495 = new A(a2494.get()); - A a2496 = new A(a2495.get()); - A a2497 = new A(a2496.get()); - A a2498 = new A(a2497.get()); - A a2499 = new A(a2498.get()); - A a2500 = new A(a2499.get()); - A a2501 = new A(a2500.get()); - A a2502 = new A(a2501.get()); - A a2503 = new A(a2502.get()); - A a2504 = new A(a2503.get()); - A a2505 = new A(a2504.get()); - A a2506 = new A(a2505.get()); - A a2507 = new A(a2506.get()); - A a2508 = new A(a2507.get()); - A a2509 = new A(a2508.get()); - A a2510 = new A(a2509.get()); - A a2511 = new A(a2510.get()); - A a2512 = new A(a2511.get()); - A a2513 = new A(a2512.get()); - A a2514 = new A(a2513.get()); - A a2515 = new A(a2514.get()); - A a2516 = new A(a2515.get()); - A a2517 = new A(a2516.get()); - A a2518 = new A(a2517.get()); - A a2519 = new A(a2518.get()); - A a2520 = new A(a2519.get()); - A a2521 = new A(a2520.get()); - A a2522 = new A(a2521.get()); - A a2523 = new A(a2522.get()); - A a2524 = new A(a2523.get()); - A a2525 = new A(a2524.get()); - A a2526 = new A(a2525.get()); - A a2527 = new A(a2526.get()); - A a2528 = new A(a2527.get()); - A a2529 = new A(a2528.get()); - A a2530 = new A(a2529.get()); - A a2531 = new A(a2530.get()); - A a2532 = new A(a2531.get()); - A a2533 = new A(a2532.get()); - A a2534 = new A(a2533.get()); - A a2535 = new A(a2534.get()); - A a2536 = new A(a2535.get()); - A a2537 = new A(a2536.get()); - A a2538 = new A(a2537.get()); - A a2539 = new A(a2538.get()); - A a2540 = new A(a2539.get()); - A a2541 = new A(a2540.get()); - A a2542 = new A(a2541.get()); - A a2543 = new A(a2542.get()); - A a2544 = new A(a2543.get()); - A a2545 = new A(a2544.get()); - A a2546 = new A(a2545.get()); - A a2547 = new A(a2546.get()); - A a2548 = new A(a2547.get()); - A a2549 = new A(a2548.get()); - A a2550 = new A(a2549.get()); - A a2551 = new A(a2550.get()); - A a2552 = new A(a2551.get()); - A a2553 = new A(a2552.get()); - A a2554 = new A(a2553.get()); - A a2555 = new A(a2554.get()); - A a2556 = new A(a2555.get()); - A a2557 = new A(a2556.get()); - A a2558 = new A(a2557.get()); - A a2559 = new A(a2558.get()); - A a2560 = new A(a2559.get()); - A a2561 = new A(a2560.get()); - A a2562 = new A(a2561.get()); - A a2563 = new A(a2562.get()); - A a2564 = new A(a2563.get()); - A a2565 = new A(a2564.get()); - A a2566 = new A(a2565.get()); - A a2567 = new A(a2566.get()); - A a2568 = new A(a2567.get()); - A a2569 = new A(a2568.get()); - A a2570 = new A(a2569.get()); - A a2571 = new A(a2570.get()); - A a2572 = new A(a2571.get()); - A a2573 = new A(a2572.get()); - A a2574 = new A(a2573.get()); - A a2575 = new A(a2574.get()); - A a2576 = new A(a2575.get()); - A a2577 = new A(a2576.get()); - A a2578 = new A(a2577.get()); - A a2579 = new A(a2578.get()); - A a2580 = new A(a2579.get()); - A a2581 = new A(a2580.get()); - A a2582 = new A(a2581.get()); - A a2583 = new A(a2582.get()); - A a2584 = new A(a2583.get()); - A a2585 = new A(a2584.get()); - A a2586 = new A(a2585.get()); - A a2587 = new A(a2586.get()); - A a2588 = new A(a2587.get()); - A a2589 = new A(a2588.get()); - A a2590 = new A(a2589.get()); - A a2591 = new A(a2590.get()); - A a2592 = new A(a2591.get()); - A a2593 = new A(a2592.get()); - A a2594 = new A(a2593.get()); - A a2595 = new A(a2594.get()); - A a2596 = new A(a2595.get()); - A a2597 = new A(a2596.get()); - A a2598 = new A(a2597.get()); - A a2599 = new A(a2598.get()); - A a2600 = new A(a2599.get()); - A a2601 = new A(a2600.get()); - A a2602 = new A(a2601.get()); - A a2603 = new A(a2602.get()); - A a2604 = new A(a2603.get()); - A a2605 = new A(a2604.get()); - A a2606 = new A(a2605.get()); - A a2607 = new A(a2606.get()); - A a2608 = new A(a2607.get()); - A a2609 = new A(a2608.get()); - A a2610 = new A(a2609.get()); - A a2611 = new A(a2610.get()); - A a2612 = new A(a2611.get()); - A a2613 = new A(a2612.get()); - A a2614 = new A(a2613.get()); - A a2615 = new A(a2614.get()); - A a2616 = new A(a2615.get()); - A a2617 = new A(a2616.get()); - A a2618 = new A(a2617.get()); - A a2619 = new A(a2618.get()); - A a2620 = new A(a2619.get()); - A a2621 = new A(a2620.get()); - A a2622 = new A(a2621.get()); - A a2623 = new A(a2622.get()); - A a2624 = new A(a2623.get()); - A a2625 = new A(a2624.get()); - A a2626 = new A(a2625.get()); - A a2627 = new A(a2626.get()); - A a2628 = new A(a2627.get()); - A a2629 = new A(a2628.get()); - A a2630 = new A(a2629.get()); - A a2631 = new A(a2630.get()); - A a2632 = new A(a2631.get()); - A a2633 = new A(a2632.get()); - A a2634 = new A(a2633.get()); - A a2635 = new A(a2634.get()); - A a2636 = new A(a2635.get()); - A a2637 = new A(a2636.get()); - A a2638 = new A(a2637.get()); - A a2639 = new A(a2638.get()); - A a2640 = new A(a2639.get()); - A a2641 = new A(a2640.get()); - A a2642 = new A(a2641.get()); - A a2643 = new A(a2642.get()); - A a2644 = new A(a2643.get()); - A a2645 = new A(a2644.get()); - A a2646 = new A(a2645.get()); - A a2647 = new A(a2646.get()); - A a2648 = new A(a2647.get()); - A a2649 = new A(a2648.get()); - A a2650 = new A(a2649.get()); - A a2651 = new A(a2650.get()); - A a2652 = new A(a2651.get()); - A a2653 = new A(a2652.get()); - A a2654 = new A(a2653.get()); - A a2655 = new A(a2654.get()); - A a2656 = new A(a2655.get()); - A a2657 = new A(a2656.get()); - A a2658 = new A(a2657.get()); - A a2659 = new A(a2658.get()); - A a2660 = new A(a2659.get()); - A a2661 = new A(a2660.get()); - A a2662 = new A(a2661.get()); - A a2663 = new A(a2662.get()); - A a2664 = new A(a2663.get()); - A a2665 = new A(a2664.get()); - A a2666 = new A(a2665.get()); - A a2667 = new A(a2666.get()); - A a2668 = new A(a2667.get()); - A a2669 = new A(a2668.get()); - A a2670 = new A(a2669.get()); - A a2671 = new A(a2670.get()); - A a2672 = new A(a2671.get()); - A a2673 = new A(a2672.get()); - A a2674 = new A(a2673.get()); - A a2675 = new A(a2674.get()); - A a2676 = new A(a2675.get()); - A a2677 = new A(a2676.get()); - A a2678 = new A(a2677.get()); - A a2679 = new A(a2678.get()); - A a2680 = new A(a2679.get()); - A a2681 = new A(a2680.get()); - A a2682 = new A(a2681.get()); - A a2683 = new A(a2682.get()); - A a2684 = new A(a2683.get()); - A a2685 = new A(a2684.get()); - A a2686 = new A(a2685.get()); - A a2687 = new A(a2686.get()); - A a2688 = new A(a2687.get()); - A a2689 = new A(a2688.get()); - A a2690 = new A(a2689.get()); - A a2691 = new A(a2690.get()); - A a2692 = new A(a2691.get()); - A a2693 = new A(a2692.get()); - A a2694 = new A(a2693.get()); - A a2695 = new A(a2694.get()); - A a2696 = new A(a2695.get()); - A a2697 = new A(a2696.get()); - A a2698 = new A(a2697.get()); - A a2699 = new A(a2698.get()); - A a2700 = new A(a2699.get()); - A a2701 = new A(a2700.get()); - A a2702 = new A(a2701.get()); - A a2703 = new A(a2702.get()); - A a2704 = new A(a2703.get()); - A a2705 = new A(a2704.get()); - A a2706 = new A(a2705.get()); - A a2707 = new A(a2706.get()); - A a2708 = new A(a2707.get()); - A a2709 = new A(a2708.get()); - A a2710 = new A(a2709.get()); - A a2711 = new A(a2710.get()); - A a2712 = new A(a2711.get()); - A a2713 = new A(a2712.get()); - A a2714 = new A(a2713.get()); - A a2715 = new A(a2714.get()); - A a2716 = new A(a2715.get()); - A a2717 = new A(a2716.get()); - A a2718 = new A(a2717.get()); - A a2719 = new A(a2718.get()); - A a2720 = new A(a2719.get()); - A a2721 = new A(a2720.get()); - A a2722 = new A(a2721.get()); - A a2723 = new A(a2722.get()); - A a2724 = new A(a2723.get()); - A a2725 = new A(a2724.get()); - A a2726 = new A(a2725.get()); - A a2727 = new A(a2726.get()); - A a2728 = new A(a2727.get()); - A a2729 = new A(a2728.get()); - A a2730 = new A(a2729.get()); - A a2731 = new A(a2730.get()); - A a2732 = new A(a2731.get()); - A a2733 = new A(a2732.get()); - A a2734 = new A(a2733.get()); - A a2735 = new A(a2734.get()); - A a2736 = new A(a2735.get()); - A a2737 = new A(a2736.get()); - A a2738 = new A(a2737.get()); - A a2739 = new A(a2738.get()); - A a2740 = new A(a2739.get()); - A a2741 = new A(a2740.get()); - A a2742 = new A(a2741.get()); - A a2743 = new A(a2742.get()); - A a2744 = new A(a2743.get()); - A a2745 = new A(a2744.get()); - A a2746 = new A(a2745.get()); - A a2747 = new A(a2746.get()); - A a2748 = new A(a2747.get()); - A a2749 = new A(a2748.get()); - A a2750 = new A(a2749.get()); - A a2751 = new A(a2750.get()); - A a2752 = new A(a2751.get()); - A a2753 = new A(a2752.get()); - A a2754 = new A(a2753.get()); - A a2755 = new A(a2754.get()); - A a2756 = new A(a2755.get()); - A a2757 = new A(a2756.get()); - A a2758 = new A(a2757.get()); - A a2759 = new A(a2758.get()); - A a2760 = new A(a2759.get()); - A a2761 = new A(a2760.get()); - A a2762 = new A(a2761.get()); - A a2763 = new A(a2762.get()); - A a2764 = new A(a2763.get()); - A a2765 = new A(a2764.get()); - A a2766 = new A(a2765.get()); - A a2767 = new A(a2766.get()); - A a2768 = new A(a2767.get()); - A a2769 = new A(a2768.get()); - A a2770 = new A(a2769.get()); - A a2771 = new A(a2770.get()); - A a2772 = new A(a2771.get()); - A a2773 = new A(a2772.get()); - A a2774 = new A(a2773.get()); - A a2775 = new A(a2774.get()); - A a2776 = new A(a2775.get()); - A a2777 = new A(a2776.get()); - A a2778 = new A(a2777.get()); - A a2779 = new A(a2778.get()); - A a2780 = new A(a2779.get()); - A a2781 = new A(a2780.get()); - A a2782 = new A(a2781.get()); - A a2783 = new A(a2782.get()); - A a2784 = new A(a2783.get()); - A a2785 = new A(a2784.get()); - A a2786 = new A(a2785.get()); - A a2787 = new A(a2786.get()); - A a2788 = new A(a2787.get()); - A a2789 = new A(a2788.get()); - A a2790 = new A(a2789.get()); - A a2791 = new A(a2790.get()); - A a2792 = new A(a2791.get()); - A a2793 = new A(a2792.get()); - A a2794 = new A(a2793.get()); - A a2795 = new A(a2794.get()); - A a2796 = new A(a2795.get()); - A a2797 = new A(a2796.get()); - A a2798 = new A(a2797.get()); - A a2799 = new A(a2798.get()); - A a2800 = new A(a2799.get()); - A a2801 = new A(a2800.get()); - A a2802 = new A(a2801.get()); - A a2803 = new A(a2802.get()); - A a2804 = new A(a2803.get()); - A a2805 = new A(a2804.get()); - A a2806 = new A(a2805.get()); - A a2807 = new A(a2806.get()); - A a2808 = new A(a2807.get()); - A a2809 = new A(a2808.get()); - A a2810 = new A(a2809.get()); - A a2811 = new A(a2810.get()); - A a2812 = new A(a2811.get()); - A a2813 = new A(a2812.get()); - A a2814 = new A(a2813.get()); - A a2815 = new A(a2814.get()); - A a2816 = new A(a2815.get()); - A a2817 = new A(a2816.get()); - A a2818 = new A(a2817.get()); - A a2819 = new A(a2818.get()); - A a2820 = new A(a2819.get()); - A a2821 = new A(a2820.get()); - A a2822 = new A(a2821.get()); - A a2823 = new A(a2822.get()); - A a2824 = new A(a2823.get()); - A a2825 = new A(a2824.get()); - A a2826 = new A(a2825.get()); - A a2827 = new A(a2826.get()); - A a2828 = new A(a2827.get()); - A a2829 = new A(a2828.get()); - A a2830 = new A(a2829.get()); - A a2831 = new A(a2830.get()); - A a2832 = new A(a2831.get()); - A a2833 = new A(a2832.get()); - A a2834 = new A(a2833.get()); - A a2835 = new A(a2834.get()); - A a2836 = new A(a2835.get()); - A a2837 = new A(a2836.get()); - A a2838 = new A(a2837.get()); - A a2839 = new A(a2838.get()); - A a2840 = new A(a2839.get()); - A a2841 = new A(a2840.get()); - A a2842 = new A(a2841.get()); - A a2843 = new A(a2842.get()); - A a2844 = new A(a2843.get()); - A a2845 = new A(a2844.get()); - A a2846 = new A(a2845.get()); - A a2847 = new A(a2846.get()); - A a2848 = new A(a2847.get()); - A a2849 = new A(a2848.get()); - A a2850 = new A(a2849.get()); - A a2851 = new A(a2850.get()); - A a2852 = new A(a2851.get()); - A a2853 = new A(a2852.get()); - A a2854 = new A(a2853.get()); - A a2855 = new A(a2854.get()); - A a2856 = new A(a2855.get()); - A a2857 = new A(a2856.get()); - A a2858 = new A(a2857.get()); - A a2859 = new A(a2858.get()); - A a2860 = new A(a2859.get()); - A a2861 = new A(a2860.get()); - A a2862 = new A(a2861.get()); - A a2863 = new A(a2862.get()); - A a2864 = new A(a2863.get()); - A a2865 = new A(a2864.get()); - A a2866 = new A(a2865.get()); - A a2867 = new A(a2866.get()); - A a2868 = new A(a2867.get()); - A a2869 = new A(a2868.get()); - A a2870 = new A(a2869.get()); - A a2871 = new A(a2870.get()); - A a2872 = new A(a2871.get()); - A a2873 = new A(a2872.get()); - A a2874 = new A(a2873.get()); - A a2875 = new A(a2874.get()); - A a2876 = new A(a2875.get()); - A a2877 = new A(a2876.get()); - A a2878 = new A(a2877.get()); - A a2879 = new A(a2878.get()); - A a2880 = new A(a2879.get()); - A a2881 = new A(a2880.get()); - A a2882 = new A(a2881.get()); - A a2883 = new A(a2882.get()); - A a2884 = new A(a2883.get()); - A a2885 = new A(a2884.get()); - A a2886 = new A(a2885.get()); - A a2887 = new A(a2886.get()); - A a2888 = new A(a2887.get()); - A a2889 = new A(a2888.get()); - A a2890 = new A(a2889.get()); - A a2891 = new A(a2890.get()); - A a2892 = new A(a2891.get()); - A a2893 = new A(a2892.get()); - A a2894 = new A(a2893.get()); - A a2895 = new A(a2894.get()); - A a2896 = new A(a2895.get()); - A a2897 = new A(a2896.get()); - A a2898 = new A(a2897.get()); - A a2899 = new A(a2898.get()); - A a2900 = new A(a2899.get()); - A a2901 = new A(a2900.get()); - A a2902 = new A(a2901.get()); - A a2903 = new A(a2902.get()); - A a2904 = new A(a2903.get()); - A a2905 = new A(a2904.get()); - A a2906 = new A(a2905.get()); - A a2907 = new A(a2906.get()); - A a2908 = new A(a2907.get()); - A a2909 = new A(a2908.get()); - A a2910 = new A(a2909.get()); - A a2911 = new A(a2910.get()); - A a2912 = new A(a2911.get()); - A a2913 = new A(a2912.get()); - A a2914 = new A(a2913.get()); - A a2915 = new A(a2914.get()); - A a2916 = new A(a2915.get()); - A a2917 = new A(a2916.get()); - A a2918 = new A(a2917.get()); - A a2919 = new A(a2918.get()); - A a2920 = new A(a2919.get()); - A a2921 = new A(a2920.get()); - A a2922 = new A(a2921.get()); - A a2923 = new A(a2922.get()); - A a2924 = new A(a2923.get()); - A a2925 = new A(a2924.get()); - A a2926 = new A(a2925.get()); - A a2927 = new A(a2926.get()); - A a2928 = new A(a2927.get()); - A a2929 = new A(a2928.get()); - A a2930 = new A(a2929.get()); - A a2931 = new A(a2930.get()); - A a2932 = new A(a2931.get()); - A a2933 = new A(a2932.get()); - A a2934 = new A(a2933.get()); - A a2935 = new A(a2934.get()); - A a2936 = new A(a2935.get()); - A a2937 = new A(a2936.get()); - A a2938 = new A(a2937.get()); - A a2939 = new A(a2938.get()); - A a2940 = new A(a2939.get()); - A a2941 = new A(a2940.get()); - A a2942 = new A(a2941.get()); - A a2943 = new A(a2942.get()); - A a2944 = new A(a2943.get()); - A a2945 = new A(a2944.get()); - A a2946 = new A(a2945.get()); - A a2947 = new A(a2946.get()); - A a2948 = new A(a2947.get()); - A a2949 = new A(a2948.get()); - A a2950 = new A(a2949.get()); - A a2951 = new A(a2950.get()); - A a2952 = new A(a2951.get()); - A a2953 = new A(a2952.get()); - A a2954 = new A(a2953.get()); - A a2955 = new A(a2954.get()); - A a2956 = new A(a2955.get()); - A a2957 = new A(a2956.get()); - A a2958 = new A(a2957.get()); - A a2959 = new A(a2958.get()); - A a2960 = new A(a2959.get()); - A a2961 = new A(a2960.get()); - A a2962 = new A(a2961.get()); - A a2963 = new A(a2962.get()); - A a2964 = new A(a2963.get()); - A a2965 = new A(a2964.get()); - A a2966 = new A(a2965.get()); - A a2967 = new A(a2966.get()); - A a2968 = new A(a2967.get()); - A a2969 = new A(a2968.get()); - A a2970 = new A(a2969.get()); - A a2971 = new A(a2970.get()); - A a2972 = new A(a2971.get()); - A a2973 = new A(a2972.get()); - A a2974 = new A(a2973.get()); - A a2975 = new A(a2974.get()); - A a2976 = new A(a2975.get()); - A a2977 = new A(a2976.get()); - A a2978 = new A(a2977.get()); - A a2979 = new A(a2978.get()); - A a2980 = new A(a2979.get()); - A a2981 = new A(a2980.get()); - A a2982 = new A(a2981.get()); - A a2983 = new A(a2982.get()); - A a2984 = new A(a2983.get()); - A a2985 = new A(a2984.get()); - A a2986 = new A(a2985.get()); - A a2987 = new A(a2986.get()); - A a2988 = new A(a2987.get()); - A a2989 = new A(a2988.get()); - A a2990 = new A(a2989.get()); - A a2991 = new A(a2990.get()); - A a2992 = new A(a2991.get()); - A a2993 = new A(a2992.get()); - A a2994 = new A(a2993.get()); - A a2995 = new A(a2994.get()); - A a2996 = new A(a2995.get()); - A a2997 = new A(a2996.get()); - A a2998 = new A(a2997.get()); - A a2999 = new A(a2998.get()); - A a3000 = new A(a2999.get()); - A a3001 = new A(a3000.get()); - A a3002 = new A(a3001.get()); - A a3003 = new A(a3002.get()); - A a3004 = new A(a3003.get()); - A a3005 = new A(a3004.get()); - A a3006 = new A(a3005.get()); - A a3007 = new A(a3006.get()); - A a3008 = new A(a3007.get()); - A a3009 = new A(a3008.get()); - A a3010 = new A(a3009.get()); - A a3011 = new A(a3010.get()); - A a3012 = new A(a3011.get()); - A a3013 = new A(a3012.get()); - A a3014 = new A(a3013.get()); - A a3015 = new A(a3014.get()); - A a3016 = new A(a3015.get()); - A a3017 = new A(a3016.get()); - A a3018 = new A(a3017.get()); - A a3019 = new A(a3018.get()); - A a3020 = new A(a3019.get()); - A a3021 = new A(a3020.get()); - A a3022 = new A(a3021.get()); - A a3023 = new A(a3022.get()); - A a3024 = new A(a3023.get()); - A a3025 = new A(a3024.get()); - A a3026 = new A(a3025.get()); - A a3027 = new A(a3026.get()); - A a3028 = new A(a3027.get()); - A a3029 = new A(a3028.get()); - A a3030 = new A(a3029.get()); - A a3031 = new A(a3030.get()); - A a3032 = new A(a3031.get()); - A a3033 = new A(a3032.get()); - A a3034 = new A(a3033.get()); - A a3035 = new A(a3034.get()); - A a3036 = new A(a3035.get()); - A a3037 = new A(a3036.get()); - A a3038 = new A(a3037.get()); - A a3039 = new A(a3038.get()); - A a3040 = new A(a3039.get()); - A a3041 = new A(a3040.get()); - A a3042 = new A(a3041.get()); - A a3043 = new A(a3042.get()); - A a3044 = new A(a3043.get()); - A a3045 = new A(a3044.get()); - A a3046 = new A(a3045.get()); - A a3047 = new A(a3046.get()); - A a3048 = new A(a3047.get()); - A a3049 = new A(a3048.get()); - A a3050 = new A(a3049.get()); - A a3051 = new A(a3050.get()); - A a3052 = new A(a3051.get()); - A a3053 = new A(a3052.get()); - A a3054 = new A(a3053.get()); - A a3055 = new A(a3054.get()); - A a3056 = new A(a3055.get()); - A a3057 = new A(a3056.get()); - A a3058 = new A(a3057.get()); - A a3059 = new A(a3058.get()); - A a3060 = new A(a3059.get()); - A a3061 = new A(a3060.get()); - A a3062 = new A(a3061.get()); - A a3063 = new A(a3062.get()); - A a3064 = new A(a3063.get()); - A a3065 = new A(a3064.get()); - A a3066 = new A(a3065.get()); - A a3067 = new A(a3066.get()); - A a3068 = new A(a3067.get()); - A a3069 = new A(a3068.get()); - A a3070 = new A(a3069.get()); - A a3071 = new A(a3070.get()); - A a3072 = new A(a3071.get()); - A a3073 = new A(a3072.get()); - A a3074 = new A(a3073.get()); - A a3075 = new A(a3074.get()); - A a3076 = new A(a3075.get()); - A a3077 = new A(a3076.get()); - A a3078 = new A(a3077.get()); - A a3079 = new A(a3078.get()); - A a3080 = new A(a3079.get()); - A a3081 = new A(a3080.get()); - A a3082 = new A(a3081.get()); - A a3083 = new A(a3082.get()); - A a3084 = new A(a3083.get()); - A a3085 = new A(a3084.get()); - A a3086 = new A(a3085.get()); - A a3087 = new A(a3086.get()); - A a3088 = new A(a3087.get()); - A a3089 = new A(a3088.get()); - A a3090 = new A(a3089.get()); - A a3091 = new A(a3090.get()); - A a3092 = new A(a3091.get()); - A a3093 = new A(a3092.get()); - A a3094 = new A(a3093.get()); - A a3095 = new A(a3094.get()); - A a3096 = new A(a3095.get()); - A a3097 = new A(a3096.get()); - A a3098 = new A(a3097.get()); - A a3099 = new A(a3098.get()); - A a3100 = new A(a3099.get()); - A a3101 = new A(a3100.get()); - A a3102 = new A(a3101.get()); - A a3103 = new A(a3102.get()); - A a3104 = new A(a3103.get()); - A a3105 = new A(a3104.get()); - A a3106 = new A(a3105.get()); - A a3107 = new A(a3106.get()); - A a3108 = new A(a3107.get()); - A a3109 = new A(a3108.get()); - A a3110 = new A(a3109.get()); - A a3111 = new A(a3110.get()); - A a3112 = new A(a3111.get()); - A a3113 = new A(a3112.get()); - A a3114 = new A(a3113.get()); - A a3115 = new A(a3114.get()); - A a3116 = new A(a3115.get()); - A a3117 = new A(a3116.get()); - A a3118 = new A(a3117.get()); - A a3119 = new A(a3118.get()); - A a3120 = new A(a3119.get()); - A a3121 = new A(a3120.get()); - A a3122 = new A(a3121.get()); - A a3123 = new A(a3122.get()); - A a3124 = new A(a3123.get()); - A a3125 = new A(a3124.get()); - A a3126 = new A(a3125.get()); - A a3127 = new A(a3126.get()); - A a3128 = new A(a3127.get()); - A a3129 = new A(a3128.get()); - A a3130 = new A(a3129.get()); - A a3131 = new A(a3130.get()); - A a3132 = new A(a3131.get()); - A a3133 = new A(a3132.get()); - A a3134 = new A(a3133.get()); - A a3135 = new A(a3134.get()); - A a3136 = new A(a3135.get()); - A a3137 = new A(a3136.get()); - A a3138 = new A(a3137.get()); - A a3139 = new A(a3138.get()); - A a3140 = new A(a3139.get()); - A a3141 = new A(a3140.get()); - A a3142 = new A(a3141.get()); - A a3143 = new A(a3142.get()); - A a3144 = new A(a3143.get()); - A a3145 = new A(a3144.get()); - A a3146 = new A(a3145.get()); - A a3147 = new A(a3146.get()); - A a3148 = new A(a3147.get()); - A a3149 = new A(a3148.get()); - A a3150 = new A(a3149.get()); - A a3151 = new A(a3150.get()); - A a3152 = new A(a3151.get()); - A a3153 = new A(a3152.get()); - A a3154 = new A(a3153.get()); - A a3155 = new A(a3154.get()); - A a3156 = new A(a3155.get()); - A a3157 = new A(a3156.get()); - A a3158 = new A(a3157.get()); - A a3159 = new A(a3158.get()); - A a3160 = new A(a3159.get()); - A a3161 = new A(a3160.get()); - A a3162 = new A(a3161.get()); - A a3163 = new A(a3162.get()); - A a3164 = new A(a3163.get()); - A a3165 = new A(a3164.get()); - A a3166 = new A(a3165.get()); - A a3167 = new A(a3166.get()); - A a3168 = new A(a3167.get()); - A a3169 = new A(a3168.get()); - A a3170 = new A(a3169.get()); - A a3171 = new A(a3170.get()); - A a3172 = new A(a3171.get()); - A a3173 = new A(a3172.get()); - A a3174 = new A(a3173.get()); - A a3175 = new A(a3174.get()); - A a3176 = new A(a3175.get()); - A a3177 = new A(a3176.get()); - A a3178 = new A(a3177.get()); - A a3179 = new A(a3178.get()); - A a3180 = new A(a3179.get()); - A a3181 = new A(a3180.get()); - A a3182 = new A(a3181.get()); - A a3183 = new A(a3182.get()); - A a3184 = new A(a3183.get()); - A a3185 = new A(a3184.get()); - A a3186 = new A(a3185.get()); - A a3187 = new A(a3186.get()); - A a3188 = new A(a3187.get()); - A a3189 = new A(a3188.get()); - A a3190 = new A(a3189.get()); - A a3191 = new A(a3190.get()); - A a3192 = new A(a3191.get()); - A a3193 = new A(a3192.get()); - A a3194 = new A(a3193.get()); - A a3195 = new A(a3194.get()); - A a3196 = new A(a3195.get()); - A a3197 = new A(a3196.get()); - A a3198 = new A(a3197.get()); - A a3199 = new A(a3198.get()); - A a3200 = new A(a3199.get()); - A a3201 = new A(a3200.get()); - A a3202 = new A(a3201.get()); - A a3203 = new A(a3202.get()); - A a3204 = new A(a3203.get()); - A a3205 = new A(a3204.get()); - A a3206 = new A(a3205.get()); - A a3207 = new A(a3206.get()); - A a3208 = new A(a3207.get()); - A a3209 = new A(a3208.get()); - A a3210 = new A(a3209.get()); - A a3211 = new A(a3210.get()); - A a3212 = new A(a3211.get()); - A a3213 = new A(a3212.get()); - A a3214 = new A(a3213.get()); - A a3215 = new A(a3214.get()); - A a3216 = new A(a3215.get()); - A a3217 = new A(a3216.get()); - A a3218 = new A(a3217.get()); - A a3219 = new A(a3218.get()); - A a3220 = new A(a3219.get()); - A a3221 = new A(a3220.get()); - A a3222 = new A(a3221.get()); - A a3223 = new A(a3222.get()); - A a3224 = new A(a3223.get()); - A a3225 = new A(a3224.get()); - A a3226 = new A(a3225.get()); - A a3227 = new A(a3226.get()); - A a3228 = new A(a3227.get()); - A a3229 = new A(a3228.get()); - A a3230 = new A(a3229.get()); - A a3231 = new A(a3230.get()); - A a3232 = new A(a3231.get()); - A a3233 = new A(a3232.get()); - A a3234 = new A(a3233.get()); - A a3235 = new A(a3234.get()); - A a3236 = new A(a3235.get()); - A a3237 = new A(a3236.get()); - A a3238 = new A(a3237.get()); - A a3239 = new A(a3238.get()); - A a3240 = new A(a3239.get()); - A a3241 = new A(a3240.get()); - A a3242 = new A(a3241.get()); - A a3243 = new A(a3242.get()); - A a3244 = new A(a3243.get()); - A a3245 = new A(a3244.get()); - A a3246 = new A(a3245.get()); - A a3247 = new A(a3246.get()); - A a3248 = new A(a3247.get()); - A a3249 = new A(a3248.get()); - A a3250 = new A(a3249.get()); - A a3251 = new A(a3250.get()); - A a3252 = new A(a3251.get()); - A a3253 = new A(a3252.get()); - A a3254 = new A(a3253.get()); - A a3255 = new A(a3254.get()); - A a3256 = new A(a3255.get()); - A a3257 = new A(a3256.get()); - A a3258 = new A(a3257.get()); - A a3259 = new A(a3258.get()); - A a3260 = new A(a3259.get()); - A a3261 = new A(a3260.get()); - A a3262 = new A(a3261.get()); - A a3263 = new A(a3262.get()); - A a3264 = new A(a3263.get()); - A a3265 = new A(a3264.get()); - A a3266 = new A(a3265.get()); - A a3267 = new A(a3266.get()); - A a3268 = new A(a3267.get()); - A a3269 = new A(a3268.get()); - A a3270 = new A(a3269.get()); - A a3271 = new A(a3270.get()); - A a3272 = new A(a3271.get()); - A a3273 = new A(a3272.get()); - A a3274 = new A(a3273.get()); - A a3275 = new A(a3274.get()); - A a3276 = new A(a3275.get()); - A a3277 = new A(a3276.get()); - A a3278 = new A(a3277.get()); - A a3279 = new A(a3278.get()); - A a3280 = new A(a3279.get()); - A a3281 = new A(a3280.get()); - A a3282 = new A(a3281.get()); - A a3283 = new A(a3282.get()); - A a3284 = new A(a3283.get()); - A a3285 = new A(a3284.get()); - A a3286 = new A(a3285.get()); - A a3287 = new A(a3286.get()); - A a3288 = new A(a3287.get()); - A a3289 = new A(a3288.get()); - A a3290 = new A(a3289.get()); - A a3291 = new A(a3290.get()); - A a3292 = new A(a3291.get()); - A a3293 = new A(a3292.get()); - A a3294 = new A(a3293.get()); - A a3295 = new A(a3294.get()); - A a3296 = new A(a3295.get()); - A a3297 = new A(a3296.get()); - A a3298 = new A(a3297.get()); - A a3299 = new A(a3298.get()); - A a3300 = new A(a3299.get()); - A a3301 = new A(a3300.get()); - A a3302 = new A(a3301.get()); - A a3303 = new A(a3302.get()); - A a3304 = new A(a3303.get()); - A a3305 = new A(a3304.get()); - A a3306 = new A(a3305.get()); - A a3307 = new A(a3306.get()); - A a3308 = new A(a3307.get()); - A a3309 = new A(a3308.get()); - A a3310 = new A(a3309.get()); - A a3311 = new A(a3310.get()); - A a3312 = new A(a3311.get()); - A a3313 = new A(a3312.get()); - A a3314 = new A(a3313.get()); - A a3315 = new A(a3314.get()); - A a3316 = new A(a3315.get()); - A a3317 = new A(a3316.get()); - A a3318 = new A(a3317.get()); - A a3319 = new A(a3318.get()); - A a3320 = new A(a3319.get()); - A a3321 = new A(a3320.get()); - A a3322 = new A(a3321.get()); - A a3323 = new A(a3322.get()); - A a3324 = new A(a3323.get()); - A a3325 = new A(a3324.get()); - A a3326 = new A(a3325.get()); - A a3327 = new A(a3326.get()); - A a3328 = new A(a3327.get()); - A a3329 = new A(a3328.get()); - A a3330 = new A(a3329.get()); - A a3331 = new A(a3330.get()); - A a3332 = new A(a3331.get()); - A a3333 = new A(a3332.get()); - A a3334 = new A(a3333.get()); - A a3335 = new A(a3334.get()); - A a3336 = new A(a3335.get()); - A a3337 = new A(a3336.get()); - A a3338 = new A(a3337.get()); - A a3339 = new A(a3338.get()); - A a3340 = new A(a3339.get()); - A a3341 = new A(a3340.get()); - A a3342 = new A(a3341.get()); - A a3343 = new A(a3342.get()); - A a3344 = new A(a3343.get()); - A a3345 = new A(a3344.get()); - A a3346 = new A(a3345.get()); - A a3347 = new A(a3346.get()); - A a3348 = new A(a3347.get()); - A a3349 = new A(a3348.get()); - A a3350 = new A(a3349.get()); - A a3351 = new A(a3350.get()); - A a3352 = new A(a3351.get()); - A a3353 = new A(a3352.get()); - A a3354 = new A(a3353.get()); - A a3355 = new A(a3354.get()); - A a3356 = new A(a3355.get()); - A a3357 = new A(a3356.get()); - A a3358 = new A(a3357.get()); - A a3359 = new A(a3358.get()); - A a3360 = new A(a3359.get()); - A a3361 = new A(a3360.get()); - A a3362 = new A(a3361.get()); - A a3363 = new A(a3362.get()); - A a3364 = new A(a3363.get()); - A a3365 = new A(a3364.get()); - A a3366 = new A(a3365.get()); - A a3367 = new A(a3366.get()); - A a3368 = new A(a3367.get()); - A a3369 = new A(a3368.get()); - A a3370 = new A(a3369.get()); - A a3371 = new A(a3370.get()); - A a3372 = new A(a3371.get()); - A a3373 = new A(a3372.get()); - A a3374 = new A(a3373.get()); - A a3375 = new A(a3374.get()); - A a3376 = new A(a3375.get()); - A a3377 = new A(a3376.get()); - A a3378 = new A(a3377.get()); - A a3379 = new A(a3378.get()); - A a3380 = new A(a3379.get()); - A a3381 = new A(a3380.get()); - A a3382 = new A(a3381.get()); - A a3383 = new A(a3382.get()); - A a3384 = new A(a3383.get()); - A a3385 = new A(a3384.get()); - A a3386 = new A(a3385.get()); - A a3387 = new A(a3386.get()); - A a3388 = new A(a3387.get()); - A a3389 = new A(a3388.get()); - A a3390 = new A(a3389.get()); - A a3391 = new A(a3390.get()); - A a3392 = new A(a3391.get()); - A a3393 = new A(a3392.get()); - A a3394 = new A(a3393.get()); - A a3395 = new A(a3394.get()); - A a3396 = new A(a3395.get()); - A a3397 = new A(a3396.get()); - A a3398 = new A(a3397.get()); - A a3399 = new A(a3398.get()); - A a3400 = new A(a3399.get()); - A a3401 = new A(a3400.get()); - A a3402 = new A(a3401.get()); - A a3403 = new A(a3402.get()); - A a3404 = new A(a3403.get()); - A a3405 = new A(a3404.get()); - A a3406 = new A(a3405.get()); - A a3407 = new A(a3406.get()); - A a3408 = new A(a3407.get()); - A a3409 = new A(a3408.get()); - A a3410 = new A(a3409.get()); - A a3411 = new A(a3410.get()); - A a3412 = new A(a3411.get()); - A a3413 = new A(a3412.get()); - A a3414 = new A(a3413.get()); - A a3415 = new A(a3414.get()); - A a3416 = new A(a3415.get()); - A a3417 = new A(a3416.get()); - A a3418 = new A(a3417.get()); - A a3419 = new A(a3418.get()); - A a3420 = new A(a3419.get()); - A a3421 = new A(a3420.get()); - A a3422 = new A(a3421.get()); - A a3423 = new A(a3422.get()); - A a3424 = new A(a3423.get()); - A a3425 = new A(a3424.get()); - A a3426 = new A(a3425.get()); - A a3427 = new A(a3426.get()); - A a3428 = new A(a3427.get()); - A a3429 = new A(a3428.get()); - A a3430 = new A(a3429.get()); - A a3431 = new A(a3430.get()); - A a3432 = new A(a3431.get()); - A a3433 = new A(a3432.get()); - A a3434 = new A(a3433.get()); - A a3435 = new A(a3434.get()); - A a3436 = new A(a3435.get()); - A a3437 = new A(a3436.get()); - A a3438 = new A(a3437.get()); - A a3439 = new A(a3438.get()); - A a3440 = new A(a3439.get()); - A a3441 = new A(a3440.get()); - A a3442 = new A(a3441.get()); - A a3443 = new A(a3442.get()); - A a3444 = new A(a3443.get()); - A a3445 = new A(a3444.get()); - A a3446 = new A(a3445.get()); - A a3447 = new A(a3446.get()); - A a3448 = new A(a3447.get()); - A a3449 = new A(a3448.get()); - A a3450 = new A(a3449.get()); - A a3451 = new A(a3450.get()); - A a3452 = new A(a3451.get()); - A a3453 = new A(a3452.get()); - A a3454 = new A(a3453.get()); - A a3455 = new A(a3454.get()); - A a3456 = new A(a3455.get()); - A a3457 = new A(a3456.get()); - A a3458 = new A(a3457.get()); - A a3459 = new A(a3458.get()); - A a3460 = new A(a3459.get()); - A a3461 = new A(a3460.get()); - A a3462 = new A(a3461.get()); - A a3463 = new A(a3462.get()); - A a3464 = new A(a3463.get()); - A a3465 = new A(a3464.get()); - A a3466 = new A(a3465.get()); - A a3467 = new A(a3466.get()); - A a3468 = new A(a3467.get()); - A a3469 = new A(a3468.get()); - A a3470 = new A(a3469.get()); - A a3471 = new A(a3470.get()); - A a3472 = new A(a3471.get()); - A a3473 = new A(a3472.get()); - A a3474 = new A(a3473.get()); - A a3475 = new A(a3474.get()); - A a3476 = new A(a3475.get()); - A a3477 = new A(a3476.get()); - A a3478 = new A(a3477.get()); - A a3479 = new A(a3478.get()); - A a3480 = new A(a3479.get()); - A a3481 = new A(a3480.get()); - A a3482 = new A(a3481.get()); - A a3483 = new A(a3482.get()); - A a3484 = new A(a3483.get()); - A a3485 = new A(a3484.get()); - A a3486 = new A(a3485.get()); - A a3487 = new A(a3486.get()); - A a3488 = new A(a3487.get()); - A a3489 = new A(a3488.get()); - A a3490 = new A(a3489.get()); - A a3491 = new A(a3490.get()); - A a3492 = new A(a3491.get()); - A a3493 = new A(a3492.get()); - A a3494 = new A(a3493.get()); - A a3495 = new A(a3494.get()); - A a3496 = new A(a3495.get()); - A a3497 = new A(a3496.get()); - A a3498 = new A(a3497.get()); - A a3499 = new A(a3498.get()); - A a3500 = new A(a3499.get()); - A a3501 = new A(a3500.get()); - A a3502 = new A(a3501.get()); - A a3503 = new A(a3502.get()); - A a3504 = new A(a3503.get()); - A a3505 = new A(a3504.get()); - A a3506 = new A(a3505.get()); - A a3507 = new A(a3506.get()); - A a3508 = new A(a3507.get()); - A a3509 = new A(a3508.get()); - A a3510 = new A(a3509.get()); - A a3511 = new A(a3510.get()); - A a3512 = new A(a3511.get()); - A a3513 = new A(a3512.get()); - A a3514 = new A(a3513.get()); - A a3515 = new A(a3514.get()); - A a3516 = new A(a3515.get()); - A a3517 = new A(a3516.get()); - A a3518 = new A(a3517.get()); - A a3519 = new A(a3518.get()); - A a3520 = new A(a3519.get()); - A a3521 = new A(a3520.get()); - A a3522 = new A(a3521.get()); - A a3523 = new A(a3522.get()); - A a3524 = new A(a3523.get()); - A a3525 = new A(a3524.get()); - A a3526 = new A(a3525.get()); - A a3527 = new A(a3526.get()); - A a3528 = new A(a3527.get()); - A a3529 = new A(a3528.get()); - A a3530 = new A(a3529.get()); - A a3531 = new A(a3530.get()); - A a3532 = new A(a3531.get()); - A a3533 = new A(a3532.get()); - A a3534 = new A(a3533.get()); - A a3535 = new A(a3534.get()); - A a3536 = new A(a3535.get()); - A a3537 = new A(a3536.get()); - A a3538 = new A(a3537.get()); - A a3539 = new A(a3538.get()); - A a3540 = new A(a3539.get()); - A a3541 = new A(a3540.get()); - A a3542 = new A(a3541.get()); - A a3543 = new A(a3542.get()); - A a3544 = new A(a3543.get()); - A a3545 = new A(a3544.get()); - A a3546 = new A(a3545.get()); - A a3547 = new A(a3546.get()); - A a3548 = new A(a3547.get()); - A a3549 = new A(a3548.get()); - A a3550 = new A(a3549.get()); - A a3551 = new A(a3550.get()); - A a3552 = new A(a3551.get()); - A a3553 = new A(a3552.get()); - A a3554 = new A(a3553.get()); - A a3555 = new A(a3554.get()); - A a3556 = new A(a3555.get()); - A a3557 = new A(a3556.get()); - A a3558 = new A(a3557.get()); - A a3559 = new A(a3558.get()); - A a3560 = new A(a3559.get()); - A a3561 = new A(a3560.get()); - A a3562 = new A(a3561.get()); - A a3563 = new A(a3562.get()); - A a3564 = new A(a3563.get()); - A a3565 = new A(a3564.get()); - A a3566 = new A(a3565.get()); - A a3567 = new A(a3566.get()); - A a3568 = new A(a3567.get()); - A a3569 = new A(a3568.get()); - A a3570 = new A(a3569.get()); - A a3571 = new A(a3570.get()); - A a3572 = new A(a3571.get()); - A a3573 = new A(a3572.get()); - A a3574 = new A(a3573.get()); - A a3575 = new A(a3574.get()); - A a3576 = new A(a3575.get()); - A a3577 = new A(a3576.get()); - A a3578 = new A(a3577.get()); - A a3579 = new A(a3578.get()); - A a3580 = new A(a3579.get()); - A a3581 = new A(a3580.get()); - A a3582 = new A(a3581.get()); - A a3583 = new A(a3582.get()); - A a3584 = new A(a3583.get()); - A a3585 = new A(a3584.get()); - A a3586 = new A(a3585.get()); - A a3587 = new A(a3586.get()); - A a3588 = new A(a3587.get()); - A a3589 = new A(a3588.get()); - A a3590 = new A(a3589.get()); - A a3591 = new A(a3590.get()); - A a3592 = new A(a3591.get()); - A a3593 = new A(a3592.get()); - A a3594 = new A(a3593.get()); - A a3595 = new A(a3594.get()); - A a3596 = new A(a3595.get()); - A a3597 = new A(a3596.get()); - A a3598 = new A(a3597.get()); - A a3599 = new A(a3598.get()); - A a3600 = new A(a3599.get()); - A a3601 = new A(a3600.get()); - A a3602 = new A(a3601.get()); - A a3603 = new A(a3602.get()); - A a3604 = new A(a3603.get()); - A a3605 = new A(a3604.get()); - A a3606 = new A(a3605.get()); - A a3607 = new A(a3606.get()); - A a3608 = new A(a3607.get()); - A a3609 = new A(a3608.get()); - A a3610 = new A(a3609.get()); - A a3611 = new A(a3610.get()); - A a3612 = new A(a3611.get()); - A a3613 = new A(a3612.get()); - A a3614 = new A(a3613.get()); - A a3615 = new A(a3614.get()); - A a3616 = new A(a3615.get()); - A a3617 = new A(a3616.get()); - A a3618 = new A(a3617.get()); - A a3619 = new A(a3618.get()); - A a3620 = new A(a3619.get()); - A a3621 = new A(a3620.get()); - A a3622 = new A(a3621.get()); - A a3623 = new A(a3622.get()); - A a3624 = new A(a3623.get()); - A a3625 = new A(a3624.get()); - A a3626 = new A(a3625.get()); - A a3627 = new A(a3626.get()); - A a3628 = new A(a3627.get()); - A a3629 = new A(a3628.get()); - A a3630 = new A(a3629.get()); - A a3631 = new A(a3630.get()); - A a3632 = new A(a3631.get()); - A a3633 = new A(a3632.get()); - A a3634 = new A(a3633.get()); - A a3635 = new A(a3634.get()); - A a3636 = new A(a3635.get()); - A a3637 = new A(a3636.get()); - A a3638 = new A(a3637.get()); - A a3639 = new A(a3638.get()); - A a3640 = new A(a3639.get()); - A a3641 = new A(a3640.get()); - A a3642 = new A(a3641.get()); - A a3643 = new A(a3642.get()); - A a3644 = new A(a3643.get()); - A a3645 = new A(a3644.get()); - A a3646 = new A(a3645.get()); - A a3647 = new A(a3646.get()); - A a3648 = new A(a3647.get()); - A a3649 = new A(a3648.get()); - A a3650 = new A(a3649.get()); - A a3651 = new A(a3650.get()); - A a3652 = new A(a3651.get()); - A a3653 = new A(a3652.get()); - A a3654 = new A(a3653.get()); - A a3655 = new A(a3654.get()); - A a3656 = new A(a3655.get()); - A a3657 = new A(a3656.get()); - A a3658 = new A(a3657.get()); - A a3659 = new A(a3658.get()); - A a3660 = new A(a3659.get()); - A a3661 = new A(a3660.get()); - A a3662 = new A(a3661.get()); - A a3663 = new A(a3662.get()); - A a3664 = new A(a3663.get()); - A a3665 = new A(a3664.get()); - A a3666 = new A(a3665.get()); - A a3667 = new A(a3666.get()); - A a3668 = new A(a3667.get()); - A a3669 = new A(a3668.get()); - A a3670 = new A(a3669.get()); - A a3671 = new A(a3670.get()); - A a3672 = new A(a3671.get()); - A a3673 = new A(a3672.get()); - A a3674 = new A(a3673.get()); - A a3675 = new A(a3674.get()); - A a3676 = new A(a3675.get()); - A a3677 = new A(a3676.get()); - A a3678 = new A(a3677.get()); - A a3679 = new A(a3678.get()); - A a3680 = new A(a3679.get()); - A a3681 = new A(a3680.get()); - A a3682 = new A(a3681.get()); - A a3683 = new A(a3682.get()); - A a3684 = new A(a3683.get()); - A a3685 = new A(a3684.get()); - A a3686 = new A(a3685.get()); - A a3687 = new A(a3686.get()); - A a3688 = new A(a3687.get()); - A a3689 = new A(a3688.get()); - A a3690 = new A(a3689.get()); - A a3691 = new A(a3690.get()); - A a3692 = new A(a3691.get()); - A a3693 = new A(a3692.get()); - A a3694 = new A(a3693.get()); - A a3695 = new A(a3694.get()); - A a3696 = new A(a3695.get()); - A a3697 = new A(a3696.get()); - - return a3697.get(); - } - - - public static void main(String[] args) { - foo(randBool()); - } - - /** - * Helper method to obtain a random boolean - */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** - * Helper methot to obtain a random integer - */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} - diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2$A.class deleted file mode 100644 index a11482ea1059..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.class deleted file mode 100644 index ff53a42bd8e3..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.java deleted file mode 100644 index 492a776a9f5c..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing2.java +++ /dev/null @@ -1,25 +0,0 @@ -class Aliasing2 { - - static class A { - int val; - - A(int val) { - this.val = val; - } - } - - static private int secret = 42; - - public static void main(String[] args) { - A a = new A(1); - A b = a; - - if (secret == 42) { - a.val = 2; - } else { - a.val = 2; - } - - System.out.println(b.val); - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3$A.class deleted file mode 100644 index 93cb7e162711..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.class deleted file mode 100644 index ddf89fda1699..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.java deleted file mode 100644 index e99b3d98efd0..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing3.java +++ /dev/null @@ -1,29 +0,0 @@ -class Aliasing3 { - - static class A { - int val; - - A(int val) { - this.val = val; - } - - void update(int val) { - this.val = val; - } - } - - static int secret = 42; - - public static void main(String[] args) { - A a = new A(1); - A b = a; - A c = b; - - doUpdate(a, secret); - System.out.println(c.val); - } - - static void doUpdate(A a, int val) { - a.update(val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4$A.class deleted file mode 100644 index 2abc5cc83ec7..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.class deleted file mode 100644 index 803fef946bae..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.java deleted file mode 100644 index cf0c0122ea75..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing4.java +++ /dev/null @@ -1,29 +0,0 @@ -class Aliasing4 { - - static class A { - int val; - - A(int val) { - this.val = val; - } - - void update(int val) { - this.val = val; - } - } - - static int secret = 42; - - public static void main(String[] args) { - A a = new A(1); - A b = new A(1); - A c = b; - - doUpdate(a, secret); - System.out.println(c.val); - } - - static void doUpdate(A a, int val) { - a.update(val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$A.class deleted file mode 100644 index 235d6b170ade..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$B.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$B.class deleted file mode 100644 index bc3546ba9356..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5$B.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.class deleted file mode 100644 index eefcfe0d98f4..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.java deleted file mode 100644 index 8df3b4fdaa7f..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing5.java +++ /dev/null @@ -1,29 +0,0 @@ -class Aliasing5 { - - static class A { - B b; - - A(B b) { - this.b = b; - } - } - - static class B { - int val; - - B(int val) { - this.val = val; - } - } - - static int secret = 42; - - public static void main(String[] args) { - B b = new B(1); - A a = new A(b); - - b.val = secret; - - System.out.println(a.b.val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$A.class deleted file mode 100644 index 386856f55fcc..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$B.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$B.class deleted file mode 100644 index b0bef186427c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6$B.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.class deleted file mode 100644 index 1795323a7b8f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.java deleted file mode 100644 index 42e19a4a7a92..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing6.java +++ /dev/null @@ -1,30 +0,0 @@ -class Aliasing6 { - - static class A { - B b; - - A(B b) { - this.b = b; - } - } - - static class B { - int val; - - B(int val) { - this.val = val; - } - } - - static int secret = 42; - - public static void main(String[] args) { - B b = new B(1); - A a = new A(b); - - b.val = secret; - a.b = new B(1); - - System.out.println(a.b.val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7$A.class deleted file mode 100644 index 03a404bfaa9e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.class deleted file mode 100644 index c803db39d3b0..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.java deleted file mode 100644 index ca1217cf7906..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing7.java +++ /dev/null @@ -1,26 +0,0 @@ -class Aliasing7 { - - static class A { - int i; - } - - static void set(A v1, A v2, int h) { - v1.i = h; - } - - static int getNumber() { - return 42; - } - - static int test(int i) { - A v1 = new A(); - A v2 = new A(); - v2 = v1; - set(v1, v2, i); - return v2.i; - } - - public static void main(String args[]) throws Exception { - test(getNumber()); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8$A.class deleted file mode 100644 index f5ace9682b14..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.class deleted file mode 100644 index 57bf52706417..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.java deleted file mode 100644 index 301235100f21..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing8.java +++ /dev/null @@ -1,25 +0,0 @@ -class Aliasing8 { - - static class A { - int i; - } - - static void set(A v1, A v2, int h) { - v1.i = h; - } - - static int getNumber() { - return 42; - } - - static int test(int i) { - A v1 = new A(); - A v2 = new A(); - set(v1, v2, i); - return v2.i; - } - - public static void main(String args[]) throws Exception { - test(getNumber()); - } -} diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9$A.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9$A.class deleted file mode 100644 index 9cd2225dda2c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.class b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.class deleted file mode 100644 index fd4a798b33b5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.java b/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.java deleted file mode 100644 index 0e1d7beddccf..000000000000 --- a/benchmarks/src/test/resources/ifspec/aliasing/Aliasing9.java +++ /dev/null @@ -1,24 +0,0 @@ -class Aliasing9 { - - static class A { - int val; - - A(int val) { - this.val = val; - } - } - - static int secret = 42; - - public static void main(String[] arg) { - A a = new A(secret); - A b = new A(5); - A c = b; - - b = a; - - a.val = 2; - - System.out.println(c.val); - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays1.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays1.class deleted file mode 100644 index b5bd87445596..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays1.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays1.java deleted file mode 100644 index 46f8e0d94d14..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays1.java +++ /dev/null @@ -1,34 +0,0 @@ -import java.util.Random; - -class Arrays1 { - public static int f(int h, int l, int[] a) { - for (int i = 0; i < h; i++) { - l += a[i]; - } - return l; - } - - public static void main(String args[]) { - int h = randInt(); - int l = randInt(); - int[] arr = randIntArray(h); - f(h, l, arr); - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } - - /** - * Helper method to obtain an array of random - * integers with the given length - **/ - static int[] randIntArray(int length) { - int[] ret = new int[length]; - for (int i = 0; i < length; i++) { - ret[i] = randInt(); - } - return ret; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays10$Video.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays10$Video.class deleted file mode 100644 index 87b58dccaed9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays10$Video.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays10$VideoSet.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays10$VideoSet.class deleted file mode 100644 index fd5712eb52cd..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays10$VideoSet.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays10.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays10.class deleted file mode 100644 index f50ad726a358..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays10.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays10.java deleted file mode 100644 index 1f1a2f48392b..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays10.java +++ /dev/null @@ -1,42 +0,0 @@ -class Arrays10 { - public int low; - private int high; - - private static int h; - private static int l; - - private int[] transaction; - - public static void main(String[] args) { - - Arrays10 w = new Arrays10(); - w.seePreview(l); - w.seePrime(l); - } - - private VideoSet[] vids; - - public Video seePreview(int i) { - if (vids != null && 0 <= i && i < vids.length) { - return vids[i].vFree; - } else { - return null; - } - } - - public Video seePrime(int i) { - if (vids != null && 0 <= i && i < vids.length) { - return vids[i].vPrime; - } else { - return null; - } - } - - public static class VideoSet { - public Video vFree; - public Video vPrime; - } - - public static class Video { - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays2.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays2.class deleted file mode 100644 index 6a6d2ab7bf8e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays2.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays2.java deleted file mode 100644 index cad96236fa83..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays2.java +++ /dev/null @@ -1,17 +0,0 @@ -class Arrays2 { - - static int secret = 42; - - public static void main(String[] args) { - int[] arr = new int[secret]; - - for (int i = 0; i < Integer.MAX_VALUE; i++) { - try { - int j = arr[i]; - } catch (Exception e) { - System.out.println(i); - System.exit(0); - } - } - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays3.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays3.class deleted file mode 100644 index 773e9bc7ddad..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays3.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays3.java deleted file mode 100644 index 8a74a46b8e9f..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays3.java +++ /dev/null @@ -1,16 +0,0 @@ -class Arrays3 { - - static int secret = 42; - - public static void main(String[] args) { - int[] arr = new int[secret]; - - for (int i = 0; i < Integer.MAX_VALUE; i++) { - try { - int j = arr[i]; - } catch (Exception e) { - System.exit(0); - } - } - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays4.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays4.class deleted file mode 100644 index b77e7f59b753..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays4.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays4.java deleted file mode 100644 index cd8211405cc4..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays4.java +++ /dev/null @@ -1,7 +0,0 @@ -class Arrays4 { - public static int foo(int h) { - int[] a = new int[2]; - a[0] = h; - return a[1]; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays5.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays5.class deleted file mode 100644 index 7f7bcf365d71..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays5.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays5.java deleted file mode 100644 index cf6a76c3c841..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays5.java +++ /dev/null @@ -1,16 +0,0 @@ -class Arrays5 { - - static private int secret = 42; - - public static void main(String[] args) { - - int[] arr = new int[5]; - arr[0] = secret; - - if (arr[0] == 42) { - System.out.println("Found"); - } - - } - -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays6.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays6.class deleted file mode 100644 index e54bdc47e83a..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays6.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays6.java deleted file mode 100644 index cc15c2da4c49..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays6.java +++ /dev/null @@ -1,18 +0,0 @@ -class Arrays6 { - - static private int secret = 42; - - public static void main(String[] args) { - - int[] arr = new int[5]; - arr[0] = secret; - - if (arr[0] == 42) { - System.out.println("checked"); - } else { - System.out.println("checked"); - } - - } - -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays7.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays7.class deleted file mode 100644 index c82254012cba..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays7.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays7.java deleted file mode 100644 index 6a3ff64c463c..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays7.java +++ /dev/null @@ -1,10 +0,0 @@ -class Arrays7 { - - static int secret=42; - - public static void main(String[] args) { - int[] a = new int[secret]; - a = new int[5]; - System.out.println(a.length); - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays8.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays8.class deleted file mode 100644 index 103b518e2bdd..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays8.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays8.java deleted file mode 100644 index e77ab62fc2e5..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays8.java +++ /dev/null @@ -1,19 +0,0 @@ -class Arrays8 { - - public static void main(String[] args) { - int value = 5; - Arrays8.arraySizeLeak(value); - } - - /** - * Returns the number that was given, by passing - * it trough an array size. - * - * @param h secret value - * @return value given - */ - public static int arraySizeLeak(int h) { - int[] array = new int[h]; - return array.length; - } -} diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays9.class b/benchmarks/src/test/resources/ifspec/arrays/Arrays9.class deleted file mode 100644 index 2cee5095e846..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/arrays/Arrays9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/arrays/Arrays9.java b/benchmarks/src/test/resources/ifspec/arrays/Arrays9.java deleted file mode 100644 index f030245836da..000000000000 --- a/benchmarks/src/test/resources/ifspec/arrays/Arrays9.java +++ /dev/null @@ -1,26 +0,0 @@ -class Arrays9 { - public int low; - private int high; - - private static int h; - private static int l; - - private int[] transaction; - - public static void main(String[] args) { - Arrays9 w = new Arrays9(); - w.buyProduct(l, h); - } - - /* - * Customer buys the product and wants to pay with the given credit card number. - * Afterwards, the store returns the bought product - */ - public int buyProduct(int prod, int cc) { - this.transaction = new int[2]; - this.transaction[0] = prod; - this.transaction[1] = cc; - - return this.transaction[0]; - } -} diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting1.class b/benchmarks/src/test/resources/ifspec/casting/Casting1.class deleted file mode 100644 index 41e71cb904af..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/casting/Casting1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting1.java b/benchmarks/src/test/resources/ifspec/casting/Casting1.java deleted file mode 100644 index 9ebc4b0ce4ec..000000000000 --- a/benchmarks/src/test/resources/ifspec/casting/Casting1.java +++ /dev/null @@ -1,31 +0,0 @@ -class Casting1 { - - public static int getRandomInt() { - return 42; - } - - public static int doIt(int h) { - // Assign the high variable h to the most significant half of the long variable - // x - long x = h * 256 * 256 * 256 * 256; // 4bytes to the left - - // Fill the least-significant part of x with random garbage - x += (getRandomInt()); - - // Assign x to the low variable l - // Here is where the "magic" happens - // The casting form long to int drops the four most significant bytes, which - // contain the secret - int l = (int) x; - - return l; - } - - public static void main(String[] args) { - // Assign first input parameter to the high variable - int h = getRandomInt(); - - // Do very important math - doIt(h); - } -} diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting2$A.class b/benchmarks/src/test/resources/ifspec/casting/Casting2$A.class deleted file mode 100644 index a8d0a3c4d53b..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/casting/Casting2$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting2$B.class b/benchmarks/src/test/resources/ifspec/casting/Casting2$B.class deleted file mode 100644 index 3948c135921f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/casting/Casting2$B.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting2$C.class b/benchmarks/src/test/resources/ifspec/casting/Casting2$C.class deleted file mode 100644 index 1b76faca2df0..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/casting/Casting2$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting2.class b/benchmarks/src/test/resources/ifspec/casting/Casting2.class deleted file mode 100644 index 2e56e2c73580..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/casting/Casting2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/casting/Casting2.java b/benchmarks/src/test/resources/ifspec/casting/Casting2.java deleted file mode 100644 index eebc6a96e017..000000000000 --- a/benchmarks/src/test/resources/ifspec/casting/Casting2.java +++ /dev/null @@ -1,38 +0,0 @@ -class Casting2 { - static boolean secret = true; - - public static void main(String[] args) { - test(); - } - - public static boolean test() { - Casting2$A obj; - - if (secret) { - obj = new Casting2$B(); - } else { - obj = new Casting2$C(); - } - - boolean reconstructed = true; - - try { - Casting2$A test = ((Casting2$B) obj); - } catch (Exception e) { - reconstructed = false; - } finally { - return reconstructed; - } - } - - -} - -class Casting2$A { -} - -class Casting2$B extends Casting2$A { -} - -class Casting2$C extends Casting2$A { -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1$A.class deleted file mode 100644 index 3dafdfee1a0d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.class deleted file mode 100644 index 1f41b16f551f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.java deleted file mode 100644 index 3b72c0e2e31c..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer1.java +++ /dev/null @@ -1,21 +0,0 @@ -class ClassInitializer1 { - - private static String secret = "secret"; - private static String[] vals = { "a", "b", "c" }; - - static class A { - static { - vals[0] = secret; - } - - void leak() { - System.out.println(vals[0]); - } - } - - public static void main(String[] args) { - A a = new A(); - a.leak(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2$A.class deleted file mode 100644 index 5f848f104dfd..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.class deleted file mode 100644 index b5344e506bc5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.java deleted file mode 100644 index 5dc93f27ca11..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer2.java +++ /dev/null @@ -1,21 +0,0 @@ -class ClassInitializer2 { - - private static String secret = "secret"; - private static String[] vals = { "a", "b", "c" }; - - static class A { - static { - vals[1] = secret; - } - - void leak() { - System.out.println(vals[0]); - } - } - - public static void main(String[] args) { - A a = new A(); - a.leak(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3$A.class deleted file mode 100644 index afa90457ec10..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.class deleted file mode 100644 index 8d506065a04d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.java deleted file mode 100644 index a3f2c5698a0f..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer3.java +++ /dev/null @@ -1,20 +0,0 @@ -class ClassInitializer3 { - - private static String secret = "secret"; - - static class A { - static { - System.out.println(secret); - } - - int add(int a, int b) { - return a + b; - } - } - - public static void main(String[] args) { - A a = new A(); - a.add(1, 2); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4$A.class deleted file mode 100644 index 0a38c843b9f5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.class deleted file mode 100644 index 3f9d2af6696c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.java deleted file mode 100644 index 40cb73360e3c..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer4.java +++ /dev/null @@ -1,23 +0,0 @@ -class ClassInitializer4 { - - private static String secret = "secret"; - - static class A { - static String stored; - - static { - stored = secret; - System.out.println("initialized"); - } - - int add(int a, int b) { - return a + b; - } - } - - public static void main(String[] args) { - A a = new A(); - a.add(1, 2); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.class deleted file mode 100644 index 74ed9e6beacb..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.java deleted file mode 100644 index 2b74ba32c692..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer5.java +++ /dev/null @@ -1,16 +0,0 @@ -class ClassInitializer5 { - - static String l = "Foo"; - static String h = "Top Secret"; - - static String x = "Foo"; - static { - x = h; - } - - public static void main(String[] args) { - l = x; - System.out.println(l); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$A.class deleted file mode 100644 index adb42bc978e4..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$B.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$B.class deleted file mode 100644 index 086c6140372d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6$B.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.class deleted file mode 100644 index 391136a75e3e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.java deleted file mode 100644 index ff36c1c0d11a..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer6.java +++ /dev/null @@ -1,34 +0,0 @@ -class ClassInitializer6 { - - static String l = "Foo"; - static String h = "Top Secret"; - static String x = "Foo"; - - static class A { - static int f = 17; - static { - l = x; - System.out.println("Ainit"); - } - } - - static class B { - static { - x = h; - System.out.println("Binit"); - } - } - - static void f(Object a, Object b) { - } - - public static void main(String[] args) { - f(A.f, new B()); - /* - * int x = A.f; - * new B(); - */ - System.out.println(l); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7$A.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7$A.class deleted file mode 100644 index d77d480f9292..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.class b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.class deleted file mode 100644 index 17e81126681a..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.java b/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.java deleted file mode 100644 index 01f98deae6a4..000000000000 --- a/benchmarks/src/test/resources/ifspec/classinitializer/ClassInitializer7.java +++ /dev/null @@ -1,14 +0,0 @@ -class ClassInitializer7 { - - private static String secret = "secret"; - - static class A { - static { - System.out.println(secret); - } - } - - public static void main(String[] args) { - System.out.println("nothing here."); - } -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.class deleted file mode 100644 index ef8a3e6d9534..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.java deleted file mode 100644 index f3cfeb12d63d..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions1.java +++ /dev/null @@ -1,22 +0,0 @@ -import java.lang.ArithmeticException; - -class Exceptions1 { - public static int divide(int l, int h) { - int z = 0; - try { - z = l / h; - } catch (ArithmeticException e) { - System.out.println(h + " is not defined"); - } - return z; - } - - public static void main(String[] args) { - divide(randInt(), randInt()); - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2$T.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2$T.class deleted file mode 100644 index b819675ab12f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2$T.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.class deleted file mode 100644 index 66013c3f49d8..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.java deleted file mode 100644 index de97156b32c6..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions2.java +++ /dev/null @@ -1,32 +0,0 @@ -class Exceptions2 { - - private static class T extends Exception { - } - - /** Main test method parameter is the secret, return value is public */ - static boolean foo(boolean h) { - try { - if (h) { - throw new T(); - } - } catch (T t) { - return true; - } - return false; - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3$T.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3$T.class deleted file mode 100644 index 9f6d6ee117cc..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3$T.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.class deleted file mode 100644 index d43c4a8fda69..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.java deleted file mode 100644 index e9d6306718e0..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions3.java +++ /dev/null @@ -1,34 +0,0 @@ -class Exceptions3 { - - private static class T extends Exception { - } - - /** Main test method parameter is the secret, return value is public */ - static boolean foo(boolean h) { - boolean x = false; - try { - if (h) { - throw new T(); - } - } catch (T t) { - // Nothing happening here - } - x = true; - return x; - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return true; - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4$T.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4$T.class deleted file mode 100644 index 81cb6fdd889e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4$T.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.class deleted file mode 100644 index 1f5ed7e4339b..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.java deleted file mode 100644 index ac1fc027dd8c..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions4.java +++ /dev/null @@ -1,35 +0,0 @@ -class Exceptions4 { - - private static class T extends Exception { - } - - /** Main test method parameter is the secret, return value is public */ - static boolean foo(boolean h) { - boolean x = false; - try { - if (h) { - throw new T(); - } else { - throw new T(); - } - } catch (T t) { - x = true; - } - return x; - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return true; - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.class deleted file mode 100644 index c23038beda1e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.java deleted file mode 100644 index 84c01c5240ee..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions5.java +++ /dev/null @@ -1,40 +0,0 @@ -import java.util.Scanner; - -class Exceptions5 { - public Exceptions5() { - Scanner sc = new Scanner(System.in); - System.out.println("Please enter two private integers a and b."); - System.out.println("We will return a/b in integer precision"); - System.out.print("Enter one private integer: "); - int i1 = sc.nextInt(); - System.out.print("Enter an other private interger: "); - int i2 = sc.nextInt(); - int r = i1 / i2; - String result = i1 + " / " + i2 + " = " + r; - System.out.println(" " + result); - System.out.println("Your query was saved in our secure database," - + " such that we can use it for marketing issues."); - System.out.println("We guarantee that your query will not be saved publicly on the disk."); - this.writeToDB(result); - sc.close(); - } - - private void writeToDB(String entry) { - // saves the new entry to a secure DB for logging of user inputs - System.out.println("writeToDB:" + entry); - } - - public static void writeToDisk(String err) { - // saves the error into a public log file, such that technicians can solve the - // problem. - System.out.println("writeToDisk:" + err); - } - - public static void main(String... args) { - try { - new Exceptions5(); - } catch (Exception e) { - writeToDisk(e.toString()); - } - } -} diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.class b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.class deleted file mode 100644 index d25be80d70f7..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.java b/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.java deleted file mode 100644 index cf020e1c3485..000000000000 --- a/benchmarks/src/test/resources/ifspec/exceptions/Exceptions6.java +++ /dev/null @@ -1,22 +0,0 @@ -class Exceptions6 { - static int g(int a) throws Exception { - if (a < 0) - throw new Exception(); - return 1; - } - - static int f(int a) { - int x; - try { - x = g(a); - x++; - } catch (Exception e) { - x = 0; - } - return x; - } - - public static void main(String args[]) throws Exception { - f(42); - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.class deleted file mode 100644 index 47e324c076d9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.java deleted file mode 100644 index 381652098ecb..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional1.java +++ /dev/null @@ -1,15 +0,0 @@ -class HighConditional1 { - public static void main(String args[]) { - int h = 5; - int l = 1; - f(h, l); - } - - public static int f(int h, int l) { - while (h > 0) { - h--; - l++; - } - return l; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.class deleted file mode 100644 index 4677356b85b1..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.java deleted file mode 100644 index 2630c430cd8d..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional10.java +++ /dev/null @@ -1,24 +0,0 @@ -class HighConditional10 { - - public static void main(String args[]) { - computeSecretly(12); - } - - // compare the secret input to 0, set the return value to some - // intermediate value, but set the return value to 5 eventually - private static int computeSecretly(int h) { - int a = 42; - - if (h > 0) { - a = 5; - } else { - a = 3; - } - - if (h <= 0) { - a = 5; - } - - return a; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$A.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$A.class deleted file mode 100644 index dabd368b535c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$B.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$B.class deleted file mode 100644 index e48d92f83b27..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$B.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$C.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$C.class deleted file mode 100644 index 761318b93012..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.class deleted file mode 100644 index 0535d372866c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.java deleted file mode 100644 index ba3e293b67de..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional11.java +++ /dev/null @@ -1,29 +0,0 @@ -class HighConditional11$A { -} - -class HighConditional11$B extends HighConditional11$A { -} - -class HighConditional11$C extends HighConditional11$A { -} - -class HighConditional11 { - static boolean secret = false; - - public static void main(String[] args) { - test(); - } - - public static boolean test() { - HighConditional11$A obj; - - if (secret) { - obj = new HighConditional11$B(); - } else { - obj = new HighConditional11$C(); - } - - boolean reconstructed = obj instanceof HighConditional11$B; - return reconstructed; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$Video.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$Video.class deleted file mode 100644 index b9f17124af7e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$Video.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$VideoSet.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$VideoSet.class deleted file mode 100644 index 71b7e3a0e8d5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore$HighConditional12$VideoSet.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore.class deleted file mode 100644 index de312e730259..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12$Webstore.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12.java deleted file mode 100644 index 6e7f82149233..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional12.java +++ /dev/null @@ -1,52 +0,0 @@ -class HighConditional12$Webstore { - public int low; - private int high; - - private static int h; - private static int l; - - private int[] transaction; - - public static void main(String[] args) { - - HighConditional12$Webstore w = new HighConditional12$Webstore(); - w.reinit(true); - } - - private HighConditional12$VideoSet[] vids; - - public HighConditional12$Video seePreview(int i) { - if (vids != null && 0 <= i && i < vids.length) { - return vids[i].vFree; - } else { - return null; - } - } - - public HighConditional12$Video seePrime(int i) { - if (vids != null && 0 <= i && i < vids.length) { - return vids[i].vPrime; - } else { - return null; - } - } - - public void reinit(boolean h) { - if (h) { - if (vids != null && vids.length > 0 && vids[0] != null) { - HighConditional12$VideoSet v = new HighConditional12$VideoSet(); - v.vFree = vids[0].vFree; - v.vPrime = vids[0].vPrime; - vids[0] = v; - } - } - } - - public static class HighConditional12$VideoSet { - public HighConditional12$Video vFree; - public HighConditional12$Video vPrime; - } - - public static class HighConditional12$Video { - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.class deleted file mode 100644 index 99abf0af7e9a..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.java deleted file mode 100644 index abf92516b60c..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional2.java +++ /dev/null @@ -1,14 +0,0 @@ -class HighConditional2 { - public static void main(String args[]) { - int h = 5; - int l = 1; - f(h, l); - } - - public static int f(int h, int l) { - while (h > 0) { - h--; - } - return l; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.class deleted file mode 100644 index 4b18b6f8f493..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.java deleted file mode 100644 index c2cc0e1ee082..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional3.java +++ /dev/null @@ -1,27 +0,0 @@ -class HighConditional3 { - - public static void main(String[] args) { - HighConditional3 ifl = new HighConditional3(); - ifl.secure_ifl(17); - } - - public int secure_ifl(int high) { - int x = 0; - int y = 0; - int low = 23; - // @ loop_invariant 0 <= y && y <= 10; - // @ determines low, y, (y < 10 ? x : 0) \by \itself; - // @ assignable low; - // @ decreases 10 - y; - while (y < 10) { - low = x; - if (y == 5) { - x = high; - y = 9; - } - x++; - y++; - } - return low; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.class deleted file mode 100644 index e4f4bcf5f982..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.java deleted file mode 100644 index c80ef06a4a4c..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional4.java +++ /dev/null @@ -1,26 +0,0 @@ -class HighConditional4 { - public int low; - private int high; - - public static void main(String[] args) { - HighConditional4 ifl = new HighConditional4(); - ifl.insecure_ifl(); - } - - public void insecure_ifl() { - int x = 0; - int y = 0; - while (y < 10) { - print(x); - if (y == 5) { - x = high; - } - x++; - y++; - } - } - - public void print(int x) { - low = x; - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Account.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Account.class deleted file mode 100644 index 42ed9e4122c7..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Account.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$AccountOwner.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$AccountOwner.class deleted file mode 100644 index 1eadff811e67..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$AccountOwner.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Beneficiary.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Beneficiary.class deleted file mode 100644 index a4b76a3869ca..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Beneficiary.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$ErrorLog.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$ErrorLog.class deleted file mode 100644 index 9a9a4b48e498..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$ErrorLog.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Main.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Main.class deleted file mode 100644 index 082b87265727..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$Main.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$TransactionLog.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$TransactionLog.class deleted file mode 100644 index ad0e42f305f9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5$TransactionLog.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5.java deleted file mode 100644 index e282dbce5491..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional5.java +++ /dev/null @@ -1,92 +0,0 @@ -class HighConditional5$Account { - - double balance; - - HighConditional5$ErrorLog errorLog = new HighConditional5$ErrorLog(); - - HighConditional5$TransactionLog transactionLog = new HighConditional5$TransactionLog(); - - public void deposit(double amount) { - if (amount > 0) { - this.balance += amount; - this.logTransaction(true); - } else { - this.logError("Cannot deposit a non-positive amount."); - } - } - - public boolean withdraw(double amount) { - if (amount > 0) { - double newAmount = this.balance - amount; - if (newAmount > 0) { - this.balance = newAmount; - this.logTransaction(false); - return true; - } else { - this.logError("Account has insufficient funds to withdraw " + amount); - return false; - } - } - this.logError("Cannot withdraw a non-positive amount."); - return false; - } - - private void logTransaction(boolean isDeposit) { - String transaction = isDeposit ? "Deposit" : "Withdrawal"; - this.transactionLog.logTransaction(transaction + " completed, new balance: " + this.balance); - } - - public void logError(String message) { - this.errorLog.logError(message); - } - -} - -class HighConditional5$AccountOwner { - private HighConditional5$Account account; - - public HighConditional5$AccountOwner(HighConditional5$Account account) { - this.account = account; - } - - public void payBeneficiary(HighConditional5$Beneficiary b, double amount) { - boolean transactionPossible = this.account.withdraw(amount); - if (transactionPossible) { - b.receive(amount); - } - } - -} - -class HighConditional5$Beneficiary { - - private double received; - - public void receive(double amount) { - this.received += amount; - } -} - -class HighConditional5$ErrorLog { - - public void logError(String message) { - System.out.println(message); - } -} - -class HighConditional5$Main { - public static void main(String[] args) { - HighConditional5$Account account = new HighConditional5$Account(); - account.deposit(100); - HighConditional5$AccountOwner owner = new HighConditional5$AccountOwner(account); - HighConditional5$Beneficiary beneficiary = new HighConditional5$Beneficiary(); - owner.payBeneficiary(beneficiary, 50); - } -} - -class HighConditional5$TransactionLog { - - public void logTransaction(String message) { - } - -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Account.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Account.class deleted file mode 100644 index 4fedbc19d9b9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Account.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$AccountOwner.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$AccountOwner.class deleted file mode 100644 index 3c73b6e7ee8f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$AccountOwner.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Beneficiary.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Beneficiary.class deleted file mode 100644 index e8462b175385..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Beneficiary.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$ErrorLog.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$ErrorLog.class deleted file mode 100644 index 1f740ec57d82..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$ErrorLog.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Main.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Main.class deleted file mode 100644 index c5212522732d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$Main.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$TransactionLog.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$TransactionLog.class deleted file mode 100644 index 9fe9597e8314..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6$TransactionLog.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6.java deleted file mode 100644 index ba78953a0cdd..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional6.java +++ /dev/null @@ -1,91 +0,0 @@ -class HighConditional6$Account { - - double balance; - - HighConditional6$ErrorLog errorLog = new HighConditional6$ErrorLog(); - - HighConditional6$TransactionLog transactionLog = new HighConditional6$TransactionLog(); - - public void deposit(double amount) { - if (amount > 0) { - this.balance += amount; - this.logTransaction(true); - } else { - this.logError("Cannot deposit a non-positive amount."); - } - } - - public boolean withdraw(double amount) { - if (amount > 0) { - double newAmount = this.balance - amount; - if (newAmount > 0) { - this.balance = newAmount; - this.logTransaction(false); - return true; - } else { - return false; - } - } - this.logError("Cannot withdraw a non-positive amount."); - return false; - } - - private void logTransaction(boolean isDeposit) { - String transaction = isDeposit ? "Deposit" : "Withdrawal"; - this.transactionLog.logTransaction(transaction + " completed, new balance: " + this.balance); - } - - public void logError(String message) { - this.errorLog.logError(message); - } - -} - -class HighConditional6$AccountOwner { - private HighConditional6$Account account; - - public HighConditional6$AccountOwner(HighConditional6$Account account) { - this.account = account; - } - - public void payBeneficiary(HighConditional6$Beneficiary b, double amount) { - boolean transactionPossible = this.account.withdraw(amount); - if (transactionPossible) { - b.receive(amount); - } - } - -} - -class HighConditional6$Beneficiary { - - private double received; - - public void receive(double amount) { - this.received += amount; - } -} - -class HighConditional6$ErrorLog { - - public void logError(String message) { - System.out.println(message); - } -} - -class HighConditional6$Main { - public static void main(String[] args) { - HighConditional6$Account account = new HighConditional6$Account(); - account.deposit(100); - HighConditional6$AccountOwner owner = new HighConditional6$AccountOwner(account); - HighConditional6$Beneficiary beneficiary = new HighConditional6$Beneficiary(); - owner.payBeneficiary(beneficiary, 150); - } -} - -class HighConditional6$TransactionLog { - - public void logTransaction(String message) { - } - -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$Main.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$Main.class deleted file mode 100644 index 4d3428757541..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$Main.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$PasswordManager.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$PasswordManager.class deleted file mode 100644 index d157fb3c6f8f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7$PasswordManager.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7.java deleted file mode 100644 index 301cd46c7a96..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional7.java +++ /dev/null @@ -1,45 +0,0 @@ -import java.io.BufferedReader; -import java.io.InputStreamReader; - -class HighConditional7$Main { - // just here to have an entry point for the program - public static void main(String[] args) throws Exception { - String exitKeyword = "exit"; - boolean exit = false; - - HighConditional7$PasswordManager pm = new HighConditional7$PasswordManager(); - - System.out.println("To exit, type: " + exitKeyword); - - while (!exit) { - System.out.println("Enter password:"); - BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - String input = br.readLine(); - exit |= input.equals(exitKeyword); - pm.tryLogin(input); - - System.out.println("Run completed, run again"); - } - } -} - -class HighConditional7$PasswordManager { - private String password = "supersecret"; - private int invalidTries = 0; - private int maximumTries = 10; - private boolean loggedIn = false; - - public void tryLogin(String tryedPassword) { - if (this.invalidTries < this.maximumTries) { - if (this.password.equals(tryedPassword)) { - this.loggedIn = true; - this.invalidTries = 0; - } else { - this.loggedIn = false; - this.invalidTries++; - } - } else { - System.out.println("No more password tries allowed"); - } - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$Main.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$Main.class deleted file mode 100644 index dc5b6e8ff4e9..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$Main.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$PasswordManager.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$PasswordManager.class deleted file mode 100644 index d4dd39fcd1f0..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8$PasswordManager.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8.java deleted file mode 100644 index 31d7fc4f4187..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional8.java +++ /dev/null @@ -1,43 +0,0 @@ -import java.io.BufferedReader; -import java.io.InputStreamReader; - -class HighConditional8$Main { - // just here to have an entry point for the program - public static void main(String[] args) throws Exception { - String exitKeyword = "exit"; - boolean exit = false; - - HighConditional8$PasswordManager pm = new HighConditional8$PasswordManager(); - - System.out.println("To exit, type: " + exitKeyword); - - while (!exit) { - System.out.println("Enter password:"); - BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - String input = br.readLine(); - exit |= input.equals(exitKeyword); - pm.tryLogin(input); - - System.out.println("Run completed, run again"); - } - } -} - -class HighConditional8$PasswordManager { - private String password = "supersecret"; - private int invalidTries = 0; - private int maximumTries = 10; - private boolean loggedIn = false; - - public void tryLogin(String tryedPassword) { - if (this.invalidTries < this.maximumTries) { - if (this.password.equals(tryedPassword)) { - this.loggedIn = true; - } else { - this.loggedIn = false; - this.invalidTries++; - } - } - System.out.println("Login Attempt Completed"); - } -} diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.class b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.class deleted file mode 100644 index 5036a193ed0c..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.java b/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.java deleted file mode 100644 index 9c7b882b7a01..000000000000 --- a/benchmarks/src/test/resources/ifspec/highconditional/HighConditional9.java +++ /dev/null @@ -1,20 +0,0 @@ -class HighConditional9 { - private static boolean secret = true; - - public static void main(String[] args) { - test(); - } - - public static int test() { - int value; - - if (secret) { - value = 1; - } else { - value = 1; - } - - return value; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library1.class b/benchmarks/src/test/resources/ifspec/library/Library1.class deleted file mode 100644 index cb3bdee114a1..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library1.java b/benchmarks/src/test/resources/ifspec/library/Library1.java deleted file mode 100644 index 9eccf82122a7..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library1.java +++ /dev/null @@ -1,27 +0,0 @@ -import java.util.ArrayList; - -class Library1 { - - public static void main(String[] args) { - int value = 5; - System.out.println("Running simpleListSize"); - System.out.println("Secret value: " + value); - System.out.println("Returned value: " + Library1.listSizeLeak(value)); - } - - public static int listSizeLeak(int h) { - ArrayList list = new ArrayList(); - - int r = 0; - - for (int i = 0; i < h; i++) { - list.add(42); - } - - if (list.size() < 10) { - r = 1; - } - - return r; - } -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library2.class b/benchmarks/src/test/resources/ifspec/library/Library2.class deleted file mode 100644 index 9f616b05a80e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library2.java b/benchmarks/src/test/resources/ifspec/library/Library2.java deleted file mode 100644 index 861c50c71700..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library2.java +++ /dev/null @@ -1,29 +0,0 @@ -import java.util.ArrayList; - -class Library2 { - - public static void main(String[] args) { - int value = 5; - System.out.println("Running simpleListSize"); - System.out.println("Secret value: " + value); - System.out.println("Returned value: " + Library2.listSizeLeak(value)); - } - - public static int listSizeLeak(int h) { - ArrayList list = new ArrayList(); - - int r = 0; - - for (int i = 0; i < h; i++) { - list.add(42); - } - - if (list.size() < 10) { - r = 1; - } - - r = 0; - - return r; - } -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library3.class b/benchmarks/src/test/resources/ifspec/library/Library3.class deleted file mode 100644 index d5e2f76adda7..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library3.java b/benchmarks/src/test/resources/ifspec/library/Library3.java deleted file mode 100644 index c517e1c8ff3d..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library3.java +++ /dev/null @@ -1,43 +0,0 @@ -import java.util.*; -import java.io.*; -import java.lang.*; - -class Library3 { - static int countAlphanumeric(String passwd) { - int count = 0; - for (int i = 0; i < passwd.length(); i++) - if (Character.isDigit(passwd.charAt(i)) || Character.isLetter(passwd.charAt(i))) - count++; - - return count; - } - - static int countCaps(String passwd) { - int count = 0; - for (int i = 0; i < passwd.length(); i++) - if (passwd.charAt(i) >= 'A' && passwd.charAt(i) <= 'Z') - count++; - return count; - } - - static int passwordstrength(String passwd) { - int strength = 0; - - if (countAlphanumeric(passwd) < 3) - strength = 1; - - if (countCaps(passwd) < 3) - strength = 2; - else - strength = 3; - - return strength; - } - - public static void main(String args[]) { - Scanner input = new Scanner(System.in); - String passwd = input.nextLine(); - int strength = passwordstrength(passwd); - System.out.println(strength); - } -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library4.class b/benchmarks/src/test/resources/ifspec/library/Library4.class deleted file mode 100644 index 1823fae84dc8..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library4.java b/benchmarks/src/test/resources/ifspec/library/Library4.java deleted file mode 100644 index 3b1059071f97..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library4.java +++ /dev/null @@ -1,28 +0,0 @@ -import java.util.ArrayList; - -class Library4 { - - public static void main(String[] args) { - int value = 5; - System.out.println("Running simpleListSize"); - System.out.println("Secret value: " + value); - System.out.println("Returned value: " + Library4.listSizeLeak(value)); - } - - /** - * Returns the number that was given, by passing - * adding elements to a list and returning its size. - * - * @param h secret value - * @return value given - */ - public static int listSizeLeak(int h) { - ArrayList list = new ArrayList(); - - for (int i = 0; i < h; i++) { - list.add(42); - } - - return list.size(); - } -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library5.class b/benchmarks/src/test/resources/ifspec/library/Library5.class deleted file mode 100644 index f4848829c714..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library5.java b/benchmarks/src/test/resources/ifspec/library/Library5.java deleted file mode 100644 index 4cec170eaa28..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library5.java +++ /dev/null @@ -1,30 +0,0 @@ -import java.util.ArrayList; - -class Library5 { - public static void main(String[] args) { - int value = 5; - System.out.println("Running simpleListToArraySize"); - System.out.println("Secret value: " + value); - System.out.println("Returned value: " + Library5.listArraySizeLeak(value)); - } - - /** - * Returns the number that was given, by passing - * adding elements to a list, converting to an array - * and returning its size. - * - * @param h secret value - * @return value given - */ - public static int listArraySizeLeak(int h) { - ArrayList list = new ArrayList(); - - for (int i = 0; i < h; i++) { - list.add(42); - } - - Object[] array = list.toArray(); - - return array.length; - } -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library6.class b/benchmarks/src/test/resources/ifspec/library/Library6.class deleted file mode 100644 index f19d7a094565..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library6.java b/benchmarks/src/test/resources/ifspec/library/Library6.java deleted file mode 100644 index cf35cd4481b0..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library6.java +++ /dev/null @@ -1,36 +0,0 @@ -class Library6 { - private static String a = "in"; - private static String b = "secure"; - private static String c = "i"; - private static String d = "nse"; - private static String e = "cure"; - - public static boolean foo(boolean h) { - // Write h to the jvm string pool - if (h) - (a + b).intern(); - - // Read back the value of h from the string pool - String s = (c + d + e); - return (s.intern() != s); - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** - * Helper method to obtain a random boolean - */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** - * Helper method to obtain a random integer - */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/library/Library7.class b/benchmarks/src/test/resources/ifspec/library/Library7.class deleted file mode 100644 index 23a7d3d4a585..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/library/Library7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/library/Library7.java b/benchmarks/src/test/resources/ifspec/library/Library7.java deleted file mode 100644 index afff098709b2..000000000000 --- a/benchmarks/src/test/resources/ifspec/library/Library7.java +++ /dev/null @@ -1,16 +0,0 @@ -class Library7 { - public static void main(String[] args) { - int value = 5; - noLeak(value); - } - - static long inThePast = 1456223086265L; // 23 Feb. 2016 11:24 - - public static int noLeak(int h) { - long curr = System.currentTimeMillis(); - if (curr < inThePast) { - return h; - } - return 0; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple1.class b/benchmarks/src/test/resources/ifspec/simple/Simple1.class deleted file mode 100644 index 784a7dabad98..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple1.java b/benchmarks/src/test/resources/ifspec/simple/Simple1.java deleted file mode 100644 index ed10e2941fb3..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple1.java +++ /dev/null @@ -1,7 +0,0 @@ -class Simple1 { - public static boolean leakyMethod(boolean high) { - boolean ret; - ret = (high && true); - return ret; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple10.class b/benchmarks/src/test/resources/ifspec/simple/Simple10.class deleted file mode 100644 index 89443d97d817..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple10.java b/benchmarks/src/test/resources/ifspec/simple/Simple10.java deleted file mode 100644 index b7f52af73182..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple10.java +++ /dev/null @@ -1,29 +0,0 @@ -class Simple10 { - public int low; - private int high; - - public static void main(String[] args) { - Simple10 ifm = new Simple10(); - ifm.insecure_if_high_n1(42); - } - - int insecure_if_high_n1(int high) { - int low; - if (high > 0) { - low = n5(high); - } else { - low = 7; - } - low = n1(high); - return low; - } - - int n1(int x) { - return 27; - } - - int n5(int x) { - return 15; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple11$A.class b/benchmarks/src/test/resources/ifspec/simple/Simple11$A.class deleted file mode 100644 index a1222ccca622..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple11$A.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple11.class b/benchmarks/src/test/resources/ifspec/simple/Simple11.class deleted file mode 100644 index 3d74eb45ce0e..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple11.java b/benchmarks/src/test/resources/ifspec/simple/Simple11.java deleted file mode 100644 index aab8aca362ab..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple11.java +++ /dev/null @@ -1,33 +0,0 @@ -class Simple11$A { - private int i; - - public Simple11$A(int i) { - this.i = i; - } - - public int doPrint() { - return out(this.i); - } - - public static int out(int i){ - return i; - } -} - -class Simple11 { - - public static int high = 0; - public static int low = 1; - - public static void main(String[] args) { - test(high, low); - } - - public static int test(int h, int l) { - Simple11$A a1 = new Simple11$A(l); - Simple11$A a2 = new Simple11$A(h); - - return a1.doPrint(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple12.class b/benchmarks/src/test/resources/ifspec/simple/Simple12.class deleted file mode 100644 index a44109047823..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple12.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple12.java b/benchmarks/src/test/resources/ifspec/simple/Simple12.java deleted file mode 100644 index 57a8b2afd904..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple12.java +++ /dev/null @@ -1,26 +0,0 @@ -import java.util.*; -import java.lang.*; -import java.io.*; -import java.math.BigInteger; - -class Simple12 { - public static BigInteger compute(BigInteger h, BigInteger l) { - /* x^6 + 3*x^4 + 3*x^2 + 1 ?= 0 */ - if ((h.pow(6).add(h.pow(4).multiply(BigInteger.valueOf(3))).add(h.pow(2).multiply(BigInteger.valueOf(3))) - .add(BigInteger.valueOf(1))).compareTo(BigInteger.valueOf(0)) == 0) { - return h; - } else { - return l; - } - } - - public static void main(String[] args) throws java.lang.Exception { - Random r = new Random(System.currentTimeMillis()); - BigInteger h = new BigInteger(32, r); - BigInteger l = new BigInteger(32, r); - System.out.println(h.toString()); - System.out.println(l.toString()); - BigInteger c = compute(h, l); - System.out.println(c.toString()); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple13$Review.class b/benchmarks/src/test/resources/ifspec/simple/Simple13$Review.class deleted file mode 100644 index 2414e0e67673..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple13$Review.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple13.class b/benchmarks/src/test/resources/ifspec/simple/Simple13.class deleted file mode 100644 index 240e8628c2f1..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple13.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple13.java b/benchmarks/src/test/resources/ifspec/simple/Simple13.java deleted file mode 100644 index 6aec171d6601..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple13.java +++ /dev/null @@ -1,55 +0,0 @@ -import java.util.List; -import java.util.LinkedList; -import java.util.Collections; - -class Simple13 { - private class Review implements Comparable { - int reviewer_id; - int score; - String content; - - public int compareTo(Review r) { - if (this.reviewer_id != r.reviewer_id) { - return (this.reviewer_id < r.reviewer_id) ? -1 : 1; - } else if (this.score != r.score) { - return (this.score < r.score) ? -1 : 1; - } else { - return this.content.compareTo(r.content); - } - } - } - - private List reviews; - - Simple13() { - reviews = new LinkedList(); - } - - public void addReview(int reviewer_id, int score, String content) { - Review r = new Review(); - r.reviewer_id = reviewer_id; - r.score = score; - r.content = content; - reviews.add(r); - } - - public void sendNotifications() { - Collections.sort(reviews); - for (Review r : reviews) { - System.out.println("---"); - System.out.println("Score: " + r.score); - System.out.println("Review: " + r.content); - System.out.println("---"); - } - } - - public static void main(String args[]) { - Simple13 rp = new Simple13(); - - rp.addReview(42, 1, "Little novelty."); - rp.addReview(5, 3, "Borderline paper."); - rp.addReview(7, 4, "Significant contribution."); - - rp.sendNotifications(); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple14$Review.class b/benchmarks/src/test/resources/ifspec/simple/Simple14$Review.class deleted file mode 100644 index bab5179758f8..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple14$Review.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple14.class b/benchmarks/src/test/resources/ifspec/simple/Simple14.class deleted file mode 100644 index d9d47dd36056..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple14.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple14.java b/benchmarks/src/test/resources/ifspec/simple/Simple14.java deleted file mode 100644 index 5088b004994c..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple14.java +++ /dev/null @@ -1,55 +0,0 @@ -import java.util.List; -import java.util.LinkedList; -import java.util.Collections; - -class Simple14 { - private class Review implements Comparable { - int reviewer_id; - int score; - String content; - - public int compareTo(Review r) { - if (this.reviewer_id != r.reviewer_id) { - return (this.reviewer_id < r.reviewer_id) ? -1 : 1; - } else if (this.score != r.score) { - return (this.score < r.score) ? -1 : 1; - } else { - return this.content.compareTo(r.content); - } - } - } - - private List reviews; - - Simple14() { - reviews = new LinkedList(); - } - - public void addReview(int reviewer_id, int score, String content) { - Review r = new Review(); - r.reviewer_id = reviewer_id; - r.score = score; - r.content = content; - reviews.add(r); - } - - public void sendNotifications() { - Collections.sort(reviews); - for (Review r : reviews) { - System.out.println("---"); - System.out.println("Score: " + r.score); - System.out.println("Review: " + r.content); - System.out.println("---"); - } - } - - public static void main(String args[]) { - Simple14 rp = new Simple14(); - - rp.addReview(42, 1, "Little novelty."); - rp.addReview(5, 3, "Borderline paper."); - rp.addReview(7, 4, "Significant contribution."); - - rp.sendNotifications(); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple15.class b/benchmarks/src/test/resources/ifspec/simple/Simple15.class deleted file mode 100644 index b8545d472ded..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple15.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple15.java b/benchmarks/src/test/resources/ifspec/simple/Simple15.java deleted file mode 100644 index 9597267eaa2e..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple15.java +++ /dev/null @@ -1,18 +0,0 @@ -import java.util.Random; - -class Simple15 { - private static int secret = 42; - - public static void main(String[] args) { - int output = secret; - - Random random = new Random(); - if (random.nextBoolean()) { - output += random.nextInt(Integer.MAX_VALUE - secret); - } else { - output -= random.nextInt(-(Integer.MIN_VALUE + secret)); - } - - System.out.println(Integer.toString(output)); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple16.class b/benchmarks/src/test/resources/ifspec/simple/Simple16.class deleted file mode 100644 index 1f67abe27388..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple16.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple16.java b/benchmarks/src/test/resources/ifspec/simple/Simple16.java deleted file mode 100644 index cbab2e5c07e4..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple16.java +++ /dev/null @@ -1,14 +0,0 @@ -import java.util.Random; - -class Simple16 { - private static int secret = 42; - - public static void main(String[] args) { - int output = secret; - - Random random = new Random(); - output += random.nextInt(Integer.MAX_VALUE) - secret; - - System.out.println(Integer.toString(output)); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple17.class b/benchmarks/src/test/resources/ifspec/simple/Simple17.class deleted file mode 100644 index 244e534b775f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple17.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple17.java b/benchmarks/src/test/resources/ifspec/simple/Simple17.java deleted file mode 100644 index a64b7375bfb5..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple17.java +++ /dev/null @@ -1,26 +0,0 @@ -class Simple17 { - - int h, l; - - int lsink, hsink; - - public void f() { - if (l == 1) - set((long) h); - else - set(h); - } - - public void set(long a) { - lsink = (int) a; - } - - public void set(int a) { - hsink = a; - } - - public static void main(String[] args) { - Simple17 sd = new Simple17(); - sd.f(); - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple18$Address.class b/benchmarks/src/test/resources/ifspec/simple/Simple18$Address.class deleted file mode 100644 index e1ce6f87e39f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple18$Address.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple18$DAddress.class b/benchmarks/src/test/resources/ifspec/simple/Simple18$DAddress.class deleted file mode 100644 index 31fc1da25c6d..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple18$DAddress.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple18.class b/benchmarks/src/test/resources/ifspec/simple/Simple18.class deleted file mode 100644 index c24669f9c8a1..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple18.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple18.java b/benchmarks/src/test/resources/ifspec/simple/Simple18.java deleted file mode 100644 index 558fd45b0de0..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple18.java +++ /dev/null @@ -1,51 +0,0 @@ -class Simple18 { - public int low; - private int high; - - private static int h; - private static int l; - - private int[] transaction; - - public static void main(String[] args) { - - Simple18 w = new Simple18(); - w.setBillingAdr(l, l); - w.setDeliveryAdr(h, h); - w.getBillAdr(); - w.getDeliverAdr(); - } - - private Address bill; - private DAddress delivery; - - public void setBillingAdr(int name, int street) { - bill = new Address(); - bill.name = name; - bill.street = street; - } - - public void setDeliveryAdr(int name, int street) { - delivery = new DAddress(); - delivery.name = name; - delivery.street = street; - } - - public int getBillAdr() { - return this.bill.street; - } - - public int getDeliverAdr() { - return this.delivery.street; - } - - public static class Address { - public int name; - public int street; - } - - public static class DAddress extends Address { - public int name; - public int street; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple2.class b/benchmarks/src/test/resources/ifspec/simple/Simple2.class deleted file mode 100644 index eb08b3712699..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple2.java b/benchmarks/src/test/resources/ifspec/simple/Simple2.java deleted file mode 100644 index 931646f34873..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple2.java +++ /dev/null @@ -1,7 +0,0 @@ -class Simple2 { - public static boolean leakyMethod(boolean high) { - boolean ret; - ret = (high || true) || (high || false); - return ret; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple3.class b/benchmarks/src/test/resources/ifspec/simple/Simple3.class deleted file mode 100644 index 3d30cf7e4048..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple3.java b/benchmarks/src/test/resources/ifspec/simple/Simple3.java deleted file mode 100644 index 550d81aa3ad6..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple3.java +++ /dev/null @@ -1,27 +0,0 @@ -class Simple3 { - - static int foo(int h) { - int y = id(h); - int x = 0; - return id(x); - } - - static int id(int x) { - return x; - } - - public static void main(String[] args) { - foo(randInt()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return true; - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple4.class b/benchmarks/src/test/resources/ifspec/simple/Simple4.class deleted file mode 100644 index d866f276eff5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple4.java b/benchmarks/src/test/resources/ifspec/simple/Simple4.java deleted file mode 100755 index e956cd15e60a..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple4.java +++ /dev/null @@ -1,40021 +0,0 @@ - -class Simple4 { - public static boolean foo(boolean h) { - return deep1(h); - } - - public static boolean deep1(boolean x) { - return deep2(x); - } - - public static boolean deep2(boolean x) { - return deep3(x); - } - - public static boolean deep3(boolean x) { - return deep4(x); - } - - public static boolean deep4(boolean x) { - return deep5(x); - } - - public static boolean deep5(boolean x) { - return deep6(x); - } - - public static boolean deep6(boolean x) { - return deep7(x); - } - - public static boolean deep7(boolean x) { - return deep8(x); - } - - public static boolean deep8(boolean x) { - return deep9(x); - } - - public static boolean deep9(boolean x) { - return deep10(x); - } - - public static boolean deep10(boolean x) { - return deep11(x); - } - - public static boolean deep11(boolean x) { - return deep12(x); - } - - public static boolean deep12(boolean x) { - return deep13(x); - } - - public static boolean deep13(boolean x) { - return deep14(x); - } - - public static boolean deep14(boolean x) { - return deep15(x); - } - - public static boolean deep15(boolean x) { - return deep16(x); - } - - public static boolean deep16(boolean x) { - return deep17(x); - } - - public static boolean deep17(boolean x) { - return deep18(x); - } - - public static boolean deep18(boolean x) { - return deep19(x); - } - - public static boolean deep19(boolean x) { - return deep20(x); - } - - public static boolean deep20(boolean x) { - return deep21(x); - } - - public static boolean deep21(boolean x) { - return deep22(x); - } - - public static boolean deep22(boolean x) { - return deep23(x); - } - - public static boolean deep23(boolean x) { - return deep24(x); - } - - public static boolean deep24(boolean x) { - return deep25(x); - } - - public static boolean deep25(boolean x) { - return deep26(x); - } - - public static boolean deep26(boolean x) { - return deep27(x); - } - - public static boolean deep27(boolean x) { - return deep28(x); - } - - public static boolean deep28(boolean x) { - return deep29(x); - } - - public static boolean deep29(boolean x) { - return deep30(x); - } - - public static boolean deep30(boolean x) { - return deep31(x); - } - - public static boolean deep31(boolean x) { - return deep32(x); - } - - public static boolean deep32(boolean x) { - return deep33(x); - } - - public static boolean deep33(boolean x) { - return deep34(x); - } - - public static boolean deep34(boolean x) { - return deep35(x); - } - - public static boolean deep35(boolean x) { - return deep36(x); - } - - public static boolean deep36(boolean x) { - return deep37(x); - } - - public static boolean deep37(boolean x) { - return deep38(x); - } - - public static boolean deep38(boolean x) { - return deep39(x); - } - - public static boolean deep39(boolean x) { - return deep40(x); - } - - public static boolean deep40(boolean x) { - return deep41(x); - } - - public static boolean deep41(boolean x) { - return deep42(x); - } - - public static boolean deep42(boolean x) { - return deep43(x); - } - - public static boolean deep43(boolean x) { - return deep44(x); - } - - public static boolean deep44(boolean x) { - return deep45(x); - } - - public static boolean deep45(boolean x) { - return deep46(x); - } - - public static boolean deep46(boolean x) { - return deep47(x); - } - - public static boolean deep47(boolean x) { - return deep48(x); - } - - public static boolean deep48(boolean x) { - return deep49(x); - } - - public static boolean deep49(boolean x) { - return deep50(x); - } - - public static boolean deep50(boolean x) { - return deep51(x); - } - - public static boolean deep51(boolean x) { - return deep52(x); - } - - public static boolean deep52(boolean x) { - return deep53(x); - } - - public static boolean deep53(boolean x) { - return deep54(x); - } - - public static boolean deep54(boolean x) { - return deep55(x); - } - - public static boolean deep55(boolean x) { - return deep56(x); - } - - public static boolean deep56(boolean x) { - return deep57(x); - } - - public static boolean deep57(boolean x) { - return deep58(x); - } - - public static boolean deep58(boolean x) { - return deep59(x); - } - - public static boolean deep59(boolean x) { - return deep60(x); - } - - public static boolean deep60(boolean x) { - return deep61(x); - } - - public static boolean deep61(boolean x) { - return deep62(x); - } - - public static boolean deep62(boolean x) { - return deep63(x); - } - - public static boolean deep63(boolean x) { - return deep64(x); - } - - public static boolean deep64(boolean x) { - return deep65(x); - } - - public static boolean deep65(boolean x) { - return deep66(x); - } - - public static boolean deep66(boolean x) { - return deep67(x); - } - - public static boolean deep67(boolean x) { - return deep68(x); - } - - public static boolean deep68(boolean x) { - return deep69(x); - } - - public static boolean deep69(boolean x) { - return deep70(x); - } - - public static boolean deep70(boolean x) { - return deep71(x); - } - - public static boolean deep71(boolean x) { - return deep72(x); - } - - public static boolean deep72(boolean x) { - return deep73(x); - } - - public static boolean deep73(boolean x) { - return deep74(x); - } - - public static boolean deep74(boolean x) { - return deep75(x); - } - - public static boolean deep75(boolean x) { - return deep76(x); - } - - public static boolean deep76(boolean x) { - return deep77(x); - } - - public static boolean deep77(boolean x) { - return deep78(x); - } - - public static boolean deep78(boolean x) { - return deep79(x); - } - - public static boolean deep79(boolean x) { - return deep80(x); - } - - public static boolean deep80(boolean x) { - return deep81(x); - } - - public static boolean deep81(boolean x) { - return deep82(x); - } - - public static boolean deep82(boolean x) { - return deep83(x); - } - - public static boolean deep83(boolean x) { - return deep84(x); - } - - public static boolean deep84(boolean x) { - return deep85(x); - } - - public static boolean deep85(boolean x) { - return deep86(x); - } - - public static boolean deep86(boolean x) { - return deep87(x); - } - - public static boolean deep87(boolean x) { - return deep88(x); - } - - public static boolean deep88(boolean x) { - return deep89(x); - } - - public static boolean deep89(boolean x) { - return deep90(x); - } - - public static boolean deep90(boolean x) { - return deep91(x); - } - - public static boolean deep91(boolean x) { - return deep92(x); - } - - public static boolean deep92(boolean x) { - return deep93(x); - } - - public static boolean deep93(boolean x) { - return deep94(x); - } - - public static boolean deep94(boolean x) { - return deep95(x); - } - - public static boolean deep95(boolean x) { - return deep96(x); - } - - public static boolean deep96(boolean x) { - return deep97(x); - } - - public static boolean deep97(boolean x) { - return deep98(x); - } - - public static boolean deep98(boolean x) { - return deep99(x); - } - - public static boolean deep99(boolean x) { - return deep100(x); - } - - public static boolean deep100(boolean x) { - return deep101(x); - } - - public static boolean deep101(boolean x) { - return deep102(x); - } - - public static boolean deep102(boolean x) { - return deep103(x); - } - - public static boolean deep103(boolean x) { - return deep104(x); - } - - public static boolean deep104(boolean x) { - return deep105(x); - } - - public static boolean deep105(boolean x) { - return deep106(x); - } - - public static boolean deep106(boolean x) { - return deep107(x); - } - - public static boolean deep107(boolean x) { - return deep108(x); - } - - public static boolean deep108(boolean x) { - return deep109(x); - } - - public static boolean deep109(boolean x) { - return deep110(x); - } - - public static boolean deep110(boolean x) { - return deep111(x); - } - - public static boolean deep111(boolean x) { - return deep112(x); - } - - public static boolean deep112(boolean x) { - return deep113(x); - } - - public static boolean deep113(boolean x) { - return deep114(x); - } - - public static boolean deep114(boolean x) { - return deep115(x); - } - - public static boolean deep115(boolean x) { - return deep116(x); - } - - public static boolean deep116(boolean x) { - return deep117(x); - } - - public static boolean deep117(boolean x) { - return deep118(x); - } - - public static boolean deep118(boolean x) { - return deep119(x); - } - - public static boolean deep119(boolean x) { - return deep120(x); - } - - public static boolean deep120(boolean x) { - return deep121(x); - } - - public static boolean deep121(boolean x) { - return deep122(x); - } - - public static boolean deep122(boolean x) { - return deep123(x); - } - - public static boolean deep123(boolean x) { - return deep124(x); - } - - public static boolean deep124(boolean x) { - return deep125(x); - } - - public static boolean deep125(boolean x) { - return deep126(x); - } - - public static boolean deep126(boolean x) { - return deep127(x); - } - - public static boolean deep127(boolean x) { - return deep128(x); - } - - public static boolean deep128(boolean x) { - return deep129(x); - } - - public static boolean deep129(boolean x) { - return deep130(x); - } - - public static boolean deep130(boolean x) { - return deep131(x); - } - - public static boolean deep131(boolean x) { - return deep132(x); - } - - public static boolean deep132(boolean x) { - return deep133(x); - } - - public static boolean deep133(boolean x) { - return deep134(x); - } - - public static boolean deep134(boolean x) { - return deep135(x); - } - - public static boolean deep135(boolean x) { - return deep136(x); - } - - public static boolean deep136(boolean x) { - return deep137(x); - } - - public static boolean deep137(boolean x) { - return deep138(x); - } - - public static boolean deep138(boolean x) { - return deep139(x); - } - - public static boolean deep139(boolean x) { - return deep140(x); - } - - public static boolean deep140(boolean x) { - return deep141(x); - } - - public static boolean deep141(boolean x) { - return deep142(x); - } - - public static boolean deep142(boolean x) { - return deep143(x); - } - - public static boolean deep143(boolean x) { - return deep144(x); - } - - public static boolean deep144(boolean x) { - return deep145(x); - } - - public static boolean deep145(boolean x) { - return deep146(x); - } - - public static boolean deep146(boolean x) { - return deep147(x); - } - - public static boolean deep147(boolean x) { - return deep148(x); - } - - public static boolean deep148(boolean x) { - return deep149(x); - } - - public static boolean deep149(boolean x) { - return deep150(x); - } - - public static boolean deep150(boolean x) { - return deep151(x); - } - - public static boolean deep151(boolean x) { - return deep152(x); - } - - public static boolean deep152(boolean x) { - return deep153(x); - } - - public static boolean deep153(boolean x) { - return deep154(x); - } - - public static boolean deep154(boolean x) { - return deep155(x); - } - - public static boolean deep155(boolean x) { - return deep156(x); - } - - public static boolean deep156(boolean x) { - return deep157(x); - } - - public static boolean deep157(boolean x) { - return deep158(x); - } - - public static boolean deep158(boolean x) { - return deep159(x); - } - - public static boolean deep159(boolean x) { - return deep160(x); - } - - public static boolean deep160(boolean x) { - return deep161(x); - } - - public static boolean deep161(boolean x) { - return deep162(x); - } - - public static boolean deep162(boolean x) { - return deep163(x); - } - - public static boolean deep163(boolean x) { - return deep164(x); - } - - public static boolean deep164(boolean x) { - return deep165(x); - } - - public static boolean deep165(boolean x) { - return deep166(x); - } - - public static boolean deep166(boolean x) { - return deep167(x); - } - - public static boolean deep167(boolean x) { - return deep168(x); - } - - public static boolean deep168(boolean x) { - return deep169(x); - } - - public static boolean deep169(boolean x) { - return deep170(x); - } - - public static boolean deep170(boolean x) { - return deep171(x); - } - - public static boolean deep171(boolean x) { - return deep172(x); - } - - public static boolean deep172(boolean x) { - return deep173(x); - } - - public static boolean deep173(boolean x) { - return deep174(x); - } - - public static boolean deep174(boolean x) { - return deep175(x); - } - - public static boolean deep175(boolean x) { - return deep176(x); - } - - public static boolean deep176(boolean x) { - return deep177(x); - } - - public static boolean deep177(boolean x) { - return deep178(x); - } - - public static boolean deep178(boolean x) { - return deep179(x); - } - - public static boolean deep179(boolean x) { - return deep180(x); - } - - public static boolean deep180(boolean x) { - return deep181(x); - } - - public static boolean deep181(boolean x) { - return deep182(x); - } - - public static boolean deep182(boolean x) { - return deep183(x); - } - - public static boolean deep183(boolean x) { - return deep184(x); - } - - public static boolean deep184(boolean x) { - return deep185(x); - } - - public static boolean deep185(boolean x) { - return deep186(x); - } - - public static boolean deep186(boolean x) { - return deep187(x); - } - - public static boolean deep187(boolean x) { - return deep188(x); - } - - public static boolean deep188(boolean x) { - return deep189(x); - } - - public static boolean deep189(boolean x) { - return deep190(x); - } - - public static boolean deep190(boolean x) { - return deep191(x); - } - - public static boolean deep191(boolean x) { - return deep192(x); - } - - public static boolean deep192(boolean x) { - return deep193(x); - } - - public static boolean deep193(boolean x) { - return deep194(x); - } - - public static boolean deep194(boolean x) { - return deep195(x); - } - - public static boolean deep195(boolean x) { - return deep196(x); - } - - public static boolean deep196(boolean x) { - return deep197(x); - } - - public static boolean deep197(boolean x) { - return deep198(x); - } - - public static boolean deep198(boolean x) { - return deep199(x); - } - - public static boolean deep199(boolean x) { - return deep200(x); - } - - public static boolean deep200(boolean x) { - return deep201(x); - } - - public static boolean deep201(boolean x) { - return deep202(x); - } - - public static boolean deep202(boolean x) { - return deep203(x); - } - - public static boolean deep203(boolean x) { - return deep204(x); - } - - public static boolean deep204(boolean x) { - return deep205(x); - } - - public static boolean deep205(boolean x) { - return deep206(x); - } - - public static boolean deep206(boolean x) { - return deep207(x); - } - - public static boolean deep207(boolean x) { - return deep208(x); - } - - public static boolean deep208(boolean x) { - return deep209(x); - } - - public static boolean deep209(boolean x) { - return deep210(x); - } - - public static boolean deep210(boolean x) { - return deep211(x); - } - - public static boolean deep211(boolean x) { - return deep212(x); - } - - public static boolean deep212(boolean x) { - return deep213(x); - } - - public static boolean deep213(boolean x) { - return deep214(x); - } - - public static boolean deep214(boolean x) { - return deep215(x); - } - - public static boolean deep215(boolean x) { - return deep216(x); - } - - public static boolean deep216(boolean x) { - return deep217(x); - } - - public static boolean deep217(boolean x) { - return deep218(x); - } - - public static boolean deep218(boolean x) { - return deep219(x); - } - - public static boolean deep219(boolean x) { - return deep220(x); - } - - public static boolean deep220(boolean x) { - return deep221(x); - } - - public static boolean deep221(boolean x) { - return deep222(x); - } - - public static boolean deep222(boolean x) { - return deep223(x); - } - - public static boolean deep223(boolean x) { - return deep224(x); - } - - public static boolean deep224(boolean x) { - return deep225(x); - } - - public static boolean deep225(boolean x) { - return deep226(x); - } - - public static boolean deep226(boolean x) { - return deep227(x); - } - - public static boolean deep227(boolean x) { - return deep228(x); - } - - public static boolean deep228(boolean x) { - return deep229(x); - } - - public static boolean deep229(boolean x) { - return deep230(x); - } - - public static boolean deep230(boolean x) { - return deep231(x); - } - - public static boolean deep231(boolean x) { - return deep232(x); - } - - public static boolean deep232(boolean x) { - return deep233(x); - } - - public static boolean deep233(boolean x) { - return deep234(x); - } - - public static boolean deep234(boolean x) { - return deep235(x); - } - - public static boolean deep235(boolean x) { - return deep236(x); - } - - public static boolean deep236(boolean x) { - return deep237(x); - } - - public static boolean deep237(boolean x) { - return deep238(x); - } - - public static boolean deep238(boolean x) { - return deep239(x); - } - - public static boolean deep239(boolean x) { - return deep240(x); - } - - public static boolean deep240(boolean x) { - return deep241(x); - } - - public static boolean deep241(boolean x) { - return deep242(x); - } - - public static boolean deep242(boolean x) { - return deep243(x); - } - - public static boolean deep243(boolean x) { - return deep244(x); - } - - public static boolean deep244(boolean x) { - return deep245(x); - } - - public static boolean deep245(boolean x) { - return deep246(x); - } - - public static boolean deep246(boolean x) { - return deep247(x); - } - - public static boolean deep247(boolean x) { - return deep248(x); - } - - public static boolean deep248(boolean x) { - return deep249(x); - } - - public static boolean deep249(boolean x) { - return deep250(x); - } - - public static boolean deep250(boolean x) { - return deep251(x); - } - - public static boolean deep251(boolean x) { - return deep252(x); - } - - public static boolean deep252(boolean x) { - return deep253(x); - } - - public static boolean deep253(boolean x) { - return deep254(x); - } - - public static boolean deep254(boolean x) { - return deep255(x); - } - - public static boolean deep255(boolean x) { - return deep256(x); - } - - public static boolean deep256(boolean x) { - return deep257(x); - } - - public static boolean deep257(boolean x) { - return deep258(x); - } - - public static boolean deep258(boolean x) { - return deep259(x); - } - - public static boolean deep259(boolean x) { - return deep260(x); - } - - public static boolean deep260(boolean x) { - return deep261(x); - } - - public static boolean deep261(boolean x) { - return deep262(x); - } - - public static boolean deep262(boolean x) { - return deep263(x); - } - - public static boolean deep263(boolean x) { - return deep264(x); - } - - public static boolean deep264(boolean x) { - return deep265(x); - } - - public static boolean deep265(boolean x) { - return deep266(x); - } - - public static boolean deep266(boolean x) { - return deep267(x); - } - - public static boolean deep267(boolean x) { - return deep268(x); - } - - public static boolean deep268(boolean x) { - return deep269(x); - } - - public static boolean deep269(boolean x) { - return deep270(x); - } - - public static boolean deep270(boolean x) { - return deep271(x); - } - - public static boolean deep271(boolean x) { - return deep272(x); - } - - public static boolean deep272(boolean x) { - return deep273(x); - } - - public static boolean deep273(boolean x) { - return deep274(x); - } - - public static boolean deep274(boolean x) { - return deep275(x); - } - - public static boolean deep275(boolean x) { - return deep276(x); - } - - public static boolean deep276(boolean x) { - return deep277(x); - } - - public static boolean deep277(boolean x) { - return deep278(x); - } - - public static boolean deep278(boolean x) { - return deep279(x); - } - - public static boolean deep279(boolean x) { - return deep280(x); - } - - public static boolean deep280(boolean x) { - return deep281(x); - } - - public static boolean deep281(boolean x) { - return deep282(x); - } - - public static boolean deep282(boolean x) { - return deep283(x); - } - - public static boolean deep283(boolean x) { - return deep284(x); - } - - public static boolean deep284(boolean x) { - return deep285(x); - } - - public static boolean deep285(boolean x) { - return deep286(x); - } - - public static boolean deep286(boolean x) { - return deep287(x); - } - - public static boolean deep287(boolean x) { - return deep288(x); - } - - public static boolean deep288(boolean x) { - return deep289(x); - } - - public static boolean deep289(boolean x) { - return deep290(x); - } - - public static boolean deep290(boolean x) { - return deep291(x); - } - - public static boolean deep291(boolean x) { - return deep292(x); - } - - public static boolean deep292(boolean x) { - return deep293(x); - } - - public static boolean deep293(boolean x) { - return deep294(x); - } - - public static boolean deep294(boolean x) { - return deep295(x); - } - - public static boolean deep295(boolean x) { - return deep296(x); - } - - public static boolean deep296(boolean x) { - return deep297(x); - } - - public static boolean deep297(boolean x) { - return deep298(x); - } - - public static boolean deep298(boolean x) { - return deep299(x); - } - - public static boolean deep299(boolean x) { - return deep300(x); - } - - public static boolean deep300(boolean x) { - return deep301(x); - } - - public static boolean deep301(boolean x) { - return deep302(x); - } - - public static boolean deep302(boolean x) { - return deep303(x); - } - - public static boolean deep303(boolean x) { - return deep304(x); - } - - public static boolean deep304(boolean x) { - return deep305(x); - } - - public static boolean deep305(boolean x) { - return deep306(x); - } - - public static boolean deep306(boolean x) { - return deep307(x); - } - - public static boolean deep307(boolean x) { - return deep308(x); - } - - public static boolean deep308(boolean x) { - return deep309(x); - } - - public static boolean deep309(boolean x) { - return deep310(x); - } - - public static boolean deep310(boolean x) { - return deep311(x); - } - - public static boolean deep311(boolean x) { - return deep312(x); - } - - public static boolean deep312(boolean x) { - return deep313(x); - } - - public static boolean deep313(boolean x) { - return deep314(x); - } - - public static boolean deep314(boolean x) { - return deep315(x); - } - - public static boolean deep315(boolean x) { - return deep316(x); - } - - public static boolean deep316(boolean x) { - return deep317(x); - } - - public static boolean deep317(boolean x) { - return deep318(x); - } - - public static boolean deep318(boolean x) { - return deep319(x); - } - - public static boolean deep319(boolean x) { - return deep320(x); - } - - public static boolean deep320(boolean x) { - return deep321(x); - } - - public static boolean deep321(boolean x) { - return deep322(x); - } - - public static boolean deep322(boolean x) { - return deep323(x); - } - - public static boolean deep323(boolean x) { - return deep324(x); - } - - public static boolean deep324(boolean x) { - return deep325(x); - } - - public static boolean deep325(boolean x) { - return deep326(x); - } - - public static boolean deep326(boolean x) { - return deep327(x); - } - - public static boolean deep327(boolean x) { - return deep328(x); - } - - public static boolean deep328(boolean x) { - return deep329(x); - } - - public static boolean deep329(boolean x) { - return deep330(x); - } - - public static boolean deep330(boolean x) { - return deep331(x); - } - - public static boolean deep331(boolean x) { - return deep332(x); - } - - public static boolean deep332(boolean x) { - return deep333(x); - } - - public static boolean deep333(boolean x) { - return deep334(x); - } - - public static boolean deep334(boolean x) { - return deep335(x); - } - - public static boolean deep335(boolean x) { - return deep336(x); - } - - public static boolean deep336(boolean x) { - return deep337(x); - } - - public static boolean deep337(boolean x) { - return deep338(x); - } - - public static boolean deep338(boolean x) { - return deep339(x); - } - - public static boolean deep339(boolean x) { - return deep340(x); - } - - public static boolean deep340(boolean x) { - return deep341(x); - } - - public static boolean deep341(boolean x) { - return deep342(x); - } - - public static boolean deep342(boolean x) { - return deep343(x); - } - - public static boolean deep343(boolean x) { - return deep344(x); - } - - public static boolean deep344(boolean x) { - return deep345(x); - } - - public static boolean deep345(boolean x) { - return deep346(x); - } - - public static boolean deep346(boolean x) { - return deep347(x); - } - - public static boolean deep347(boolean x) { - return deep348(x); - } - - public static boolean deep348(boolean x) { - return deep349(x); - } - - public static boolean deep349(boolean x) { - return deep350(x); - } - - public static boolean deep350(boolean x) { - return deep351(x); - } - - public static boolean deep351(boolean x) { - return deep352(x); - } - - public static boolean deep352(boolean x) { - return deep353(x); - } - - public static boolean deep353(boolean x) { - return deep354(x); - } - - public static boolean deep354(boolean x) { - return deep355(x); - } - - public static boolean deep355(boolean x) { - return deep356(x); - } - - public static boolean deep356(boolean x) { - return deep357(x); - } - - public static boolean deep357(boolean x) { - return deep358(x); - } - - public static boolean deep358(boolean x) { - return deep359(x); - } - - public static boolean deep359(boolean x) { - return deep360(x); - } - - public static boolean deep360(boolean x) { - return deep361(x); - } - - public static boolean deep361(boolean x) { - return deep362(x); - } - - public static boolean deep362(boolean x) { - return deep363(x); - } - - public static boolean deep363(boolean x) { - return deep364(x); - } - - public static boolean deep364(boolean x) { - return deep365(x); - } - - public static boolean deep365(boolean x) { - return deep366(x); - } - - public static boolean deep366(boolean x) { - return deep367(x); - } - - public static boolean deep367(boolean x) { - return deep368(x); - } - - public static boolean deep368(boolean x) { - return deep369(x); - } - - public static boolean deep369(boolean x) { - return deep370(x); - } - - public static boolean deep370(boolean x) { - return deep371(x); - } - - public static boolean deep371(boolean x) { - return deep372(x); - } - - public static boolean deep372(boolean x) { - return deep373(x); - } - - public static boolean deep373(boolean x) { - return deep374(x); - } - - public static boolean deep374(boolean x) { - return deep375(x); - } - - public static boolean deep375(boolean x) { - return deep376(x); - } - - public static boolean deep376(boolean x) { - return deep377(x); - } - - public static boolean deep377(boolean x) { - return deep378(x); - } - - public static boolean deep378(boolean x) { - return deep379(x); - } - - public static boolean deep379(boolean x) { - return deep380(x); - } - - public static boolean deep380(boolean x) { - return deep381(x); - } - - public static boolean deep381(boolean x) { - return deep382(x); - } - - public static boolean deep382(boolean x) { - return deep383(x); - } - - public static boolean deep383(boolean x) { - return deep384(x); - } - - public static boolean deep384(boolean x) { - return deep385(x); - } - - public static boolean deep385(boolean x) { - return deep386(x); - } - - public static boolean deep386(boolean x) { - return deep387(x); - } - - public static boolean deep387(boolean x) { - return deep388(x); - } - - public static boolean deep388(boolean x) { - return deep389(x); - } - - public static boolean deep389(boolean x) { - return deep390(x); - } - - public static boolean deep390(boolean x) { - return deep391(x); - } - - public static boolean deep391(boolean x) { - return deep392(x); - } - - public static boolean deep392(boolean x) { - return deep393(x); - } - - public static boolean deep393(boolean x) { - return deep394(x); - } - - public static boolean deep394(boolean x) { - return deep395(x); - } - - public static boolean deep395(boolean x) { - return deep396(x); - } - - public static boolean deep396(boolean x) { - return deep397(x); - } - - public static boolean deep397(boolean x) { - return deep398(x); - } - - public static boolean deep398(boolean x) { - return deep399(x); - } - - public static boolean deep399(boolean x) { - return deep400(x); - } - - public static boolean deep400(boolean x) { - return deep401(x); - } - - public static boolean deep401(boolean x) { - return deep402(x); - } - - public static boolean deep402(boolean x) { - return deep403(x); - } - - public static boolean deep403(boolean x) { - return deep404(x); - } - - public static boolean deep404(boolean x) { - return deep405(x); - } - - public static boolean deep405(boolean x) { - return deep406(x); - } - - public static boolean deep406(boolean x) { - return deep407(x); - } - - public static boolean deep407(boolean x) { - return deep408(x); - } - - public static boolean deep408(boolean x) { - return deep409(x); - } - - public static boolean deep409(boolean x) { - return deep410(x); - } - - public static boolean deep410(boolean x) { - return deep411(x); - } - - public static boolean deep411(boolean x) { - return deep412(x); - } - - public static boolean deep412(boolean x) { - return deep413(x); - } - - public static boolean deep413(boolean x) { - return deep414(x); - } - - public static boolean deep414(boolean x) { - return deep415(x); - } - - public static boolean deep415(boolean x) { - return deep416(x); - } - - public static boolean deep416(boolean x) { - return deep417(x); - } - - public static boolean deep417(boolean x) { - return deep418(x); - } - - public static boolean deep418(boolean x) { - return deep419(x); - } - - public static boolean deep419(boolean x) { - return deep420(x); - } - - public static boolean deep420(boolean x) { - return deep421(x); - } - - public static boolean deep421(boolean x) { - return deep422(x); - } - - public static boolean deep422(boolean x) { - return deep423(x); - } - - public static boolean deep423(boolean x) { - return deep424(x); - } - - public static boolean deep424(boolean x) { - return deep425(x); - } - - public static boolean deep425(boolean x) { - return deep426(x); - } - - public static boolean deep426(boolean x) { - return deep427(x); - } - - public static boolean deep427(boolean x) { - return deep428(x); - } - - public static boolean deep428(boolean x) { - return deep429(x); - } - - public static boolean deep429(boolean x) { - return deep430(x); - } - - public static boolean deep430(boolean x) { - return deep431(x); - } - - public static boolean deep431(boolean x) { - return deep432(x); - } - - public static boolean deep432(boolean x) { - return deep433(x); - } - - public static boolean deep433(boolean x) { - return deep434(x); - } - - public static boolean deep434(boolean x) { - return deep435(x); - } - - public static boolean deep435(boolean x) { - return deep436(x); - } - - public static boolean deep436(boolean x) { - return deep437(x); - } - - public static boolean deep437(boolean x) { - return deep438(x); - } - - public static boolean deep438(boolean x) { - return deep439(x); - } - - public static boolean deep439(boolean x) { - return deep440(x); - } - - public static boolean deep440(boolean x) { - return deep441(x); - } - - public static boolean deep441(boolean x) { - return deep442(x); - } - - public static boolean deep442(boolean x) { - return deep443(x); - } - - public static boolean deep443(boolean x) { - return deep444(x); - } - - public static boolean deep444(boolean x) { - return deep445(x); - } - - public static boolean deep445(boolean x) { - return deep446(x); - } - - public static boolean deep446(boolean x) { - return deep447(x); - } - - public static boolean deep447(boolean x) { - return deep448(x); - } - - public static boolean deep448(boolean x) { - return deep449(x); - } - - public static boolean deep449(boolean x) { - return deep450(x); - } - - public static boolean deep450(boolean x) { - return deep451(x); - } - - public static boolean deep451(boolean x) { - return deep452(x); - } - - public static boolean deep452(boolean x) { - return deep453(x); - } - - public static boolean deep453(boolean x) { - return deep454(x); - } - - public static boolean deep454(boolean x) { - return deep455(x); - } - - public static boolean deep455(boolean x) { - return deep456(x); - } - - public static boolean deep456(boolean x) { - return deep457(x); - } - - public static boolean deep457(boolean x) { - return deep458(x); - } - - public static boolean deep458(boolean x) { - return deep459(x); - } - - public static boolean deep459(boolean x) { - return deep460(x); - } - - public static boolean deep460(boolean x) { - return deep461(x); - } - - public static boolean deep461(boolean x) { - return deep462(x); - } - - public static boolean deep462(boolean x) { - return deep463(x); - } - - public static boolean deep463(boolean x) { - return deep464(x); - } - - public static boolean deep464(boolean x) { - return deep465(x); - } - - public static boolean deep465(boolean x) { - return deep466(x); - } - - public static boolean deep466(boolean x) { - return deep467(x); - } - - public static boolean deep467(boolean x) { - return deep468(x); - } - - public static boolean deep468(boolean x) { - return deep469(x); - } - - public static boolean deep469(boolean x) { - return deep470(x); - } - - public static boolean deep470(boolean x) { - return deep471(x); - } - - public static boolean deep471(boolean x) { - return deep472(x); - } - - public static boolean deep472(boolean x) { - return deep473(x); - } - - public static boolean deep473(boolean x) { - return deep474(x); - } - - public static boolean deep474(boolean x) { - return deep475(x); - } - - public static boolean deep475(boolean x) { - return deep476(x); - } - - public static boolean deep476(boolean x) { - return deep477(x); - } - - public static boolean deep477(boolean x) { - return deep478(x); - } - - public static boolean deep478(boolean x) { - return deep479(x); - } - - public static boolean deep479(boolean x) { - return deep480(x); - } - - public static boolean deep480(boolean x) { - return deep481(x); - } - - public static boolean deep481(boolean x) { - return deep482(x); - } - - public static boolean deep482(boolean x) { - return deep483(x); - } - - public static boolean deep483(boolean x) { - return deep484(x); - } - - public static boolean deep484(boolean x) { - return deep485(x); - } - - public static boolean deep485(boolean x) { - return deep486(x); - } - - public static boolean deep486(boolean x) { - return deep487(x); - } - - public static boolean deep487(boolean x) { - return deep488(x); - } - - public static boolean deep488(boolean x) { - return deep489(x); - } - - public static boolean deep489(boolean x) { - return deep490(x); - } - - public static boolean deep490(boolean x) { - return deep491(x); - } - - public static boolean deep491(boolean x) { - return deep492(x); - } - - public static boolean deep492(boolean x) { - return deep493(x); - } - - public static boolean deep493(boolean x) { - return deep494(x); - } - - public static boolean deep494(boolean x) { - return deep495(x); - } - - public static boolean deep495(boolean x) { - return deep496(x); - } - - public static boolean deep496(boolean x) { - return deep497(x); - } - - public static boolean deep497(boolean x) { - return deep498(x); - } - - public static boolean deep498(boolean x) { - return deep499(x); - } - - public static boolean deep499(boolean x) { - return deep500(x); - } - - public static boolean deep500(boolean x) { - return deep501(x); - } - - public static boolean deep501(boolean x) { - return deep502(x); - } - - public static boolean deep502(boolean x) { - return deep503(x); - } - - public static boolean deep503(boolean x) { - return deep504(x); - } - - public static boolean deep504(boolean x) { - return deep505(x); - } - - public static boolean deep505(boolean x) { - return deep506(x); - } - - public static boolean deep506(boolean x) { - return deep507(x); - } - - public static boolean deep507(boolean x) { - return deep508(x); - } - - public static boolean deep508(boolean x) { - return deep509(x); - } - - public static boolean deep509(boolean x) { - return deep510(x); - } - - public static boolean deep510(boolean x) { - return deep511(x); - } - - public static boolean deep511(boolean x) { - return deep512(x); - } - - public static boolean deep512(boolean x) { - return deep513(x); - } - - public static boolean deep513(boolean x) { - return deep514(x); - } - - public static boolean deep514(boolean x) { - return deep515(x); - } - - public static boolean deep515(boolean x) { - return deep516(x); - } - - public static boolean deep516(boolean x) { - return deep517(x); - } - - public static boolean deep517(boolean x) { - return deep518(x); - } - - public static boolean deep518(boolean x) { - return deep519(x); - } - - public static boolean deep519(boolean x) { - return deep520(x); - } - - public static boolean deep520(boolean x) { - return deep521(x); - } - - public static boolean deep521(boolean x) { - return deep522(x); - } - - public static boolean deep522(boolean x) { - return deep523(x); - } - - public static boolean deep523(boolean x) { - return deep524(x); - } - - public static boolean deep524(boolean x) { - return deep525(x); - } - - public static boolean deep525(boolean x) { - return deep526(x); - } - - public static boolean deep526(boolean x) { - return deep527(x); - } - - public static boolean deep527(boolean x) { - return deep528(x); - } - - public static boolean deep528(boolean x) { - return deep529(x); - } - - public static boolean deep529(boolean x) { - return deep530(x); - } - - public static boolean deep530(boolean x) { - return deep531(x); - } - - public static boolean deep531(boolean x) { - return deep532(x); - } - - public static boolean deep532(boolean x) { - return deep533(x); - } - - public static boolean deep533(boolean x) { - return deep534(x); - } - - public static boolean deep534(boolean x) { - return deep535(x); - } - - public static boolean deep535(boolean x) { - return deep536(x); - } - - public static boolean deep536(boolean x) { - return deep537(x); - } - - public static boolean deep537(boolean x) { - return deep538(x); - } - - public static boolean deep538(boolean x) { - return deep539(x); - } - - public static boolean deep539(boolean x) { - return deep540(x); - } - - public static boolean deep540(boolean x) { - return deep541(x); - } - - public static boolean deep541(boolean x) { - return deep542(x); - } - - public static boolean deep542(boolean x) { - return deep543(x); - } - - public static boolean deep543(boolean x) { - return deep544(x); - } - - public static boolean deep544(boolean x) { - return deep545(x); - } - - public static boolean deep545(boolean x) { - return deep546(x); - } - - public static boolean deep546(boolean x) { - return deep547(x); - } - - public static boolean deep547(boolean x) { - return deep548(x); - } - - public static boolean deep548(boolean x) { - return deep549(x); - } - - public static boolean deep549(boolean x) { - return deep550(x); - } - - public static boolean deep550(boolean x) { - return deep551(x); - } - - public static boolean deep551(boolean x) { - return deep552(x); - } - - public static boolean deep552(boolean x) { - return deep553(x); - } - - public static boolean deep553(boolean x) { - return deep554(x); - } - - public static boolean deep554(boolean x) { - return deep555(x); - } - - public static boolean deep555(boolean x) { - return deep556(x); - } - - public static boolean deep556(boolean x) { - return deep557(x); - } - - public static boolean deep557(boolean x) { - return deep558(x); - } - - public static boolean deep558(boolean x) { - return deep559(x); - } - - public static boolean deep559(boolean x) { - return deep560(x); - } - - public static boolean deep560(boolean x) { - return deep561(x); - } - - public static boolean deep561(boolean x) { - return deep562(x); - } - - public static boolean deep562(boolean x) { - return deep563(x); - } - - public static boolean deep563(boolean x) { - return deep564(x); - } - - public static boolean deep564(boolean x) { - return deep565(x); - } - - public static boolean deep565(boolean x) { - return deep566(x); - } - - public static boolean deep566(boolean x) { - return deep567(x); - } - - public static boolean deep567(boolean x) { - return deep568(x); - } - - public static boolean deep568(boolean x) { - return deep569(x); - } - - public static boolean deep569(boolean x) { - return deep570(x); - } - - public static boolean deep570(boolean x) { - return deep571(x); - } - - public static boolean deep571(boolean x) { - return deep572(x); - } - - public static boolean deep572(boolean x) { - return deep573(x); - } - - public static boolean deep573(boolean x) { - return deep574(x); - } - - public static boolean deep574(boolean x) { - return deep575(x); - } - - public static boolean deep575(boolean x) { - return deep576(x); - } - - public static boolean deep576(boolean x) { - return deep577(x); - } - - public static boolean deep577(boolean x) { - return deep578(x); - } - - public static boolean deep578(boolean x) { - return deep579(x); - } - - public static boolean deep579(boolean x) { - return deep580(x); - } - - public static boolean deep580(boolean x) { - return deep581(x); - } - - public static boolean deep581(boolean x) { - return deep582(x); - } - - public static boolean deep582(boolean x) { - return deep583(x); - } - - public static boolean deep583(boolean x) { - return deep584(x); - } - - public static boolean deep584(boolean x) { - return deep585(x); - } - - public static boolean deep585(boolean x) { - return deep586(x); - } - - public static boolean deep586(boolean x) { - return deep587(x); - } - - public static boolean deep587(boolean x) { - return deep588(x); - } - - public static boolean deep588(boolean x) { - return deep589(x); - } - - public static boolean deep589(boolean x) { - return deep590(x); - } - - public static boolean deep590(boolean x) { - return deep591(x); - } - - public static boolean deep591(boolean x) { - return deep592(x); - } - - public static boolean deep592(boolean x) { - return deep593(x); - } - - public static boolean deep593(boolean x) { - return deep594(x); - } - - public static boolean deep594(boolean x) { - return deep595(x); - } - - public static boolean deep595(boolean x) { - return deep596(x); - } - - public static boolean deep596(boolean x) { - return deep597(x); - } - - public static boolean deep597(boolean x) { - return deep598(x); - } - - public static boolean deep598(boolean x) { - return deep599(x); - } - - public static boolean deep599(boolean x) { - return deep600(x); - } - - public static boolean deep600(boolean x) { - return deep601(x); - } - - public static boolean deep601(boolean x) { - return deep602(x); - } - - public static boolean deep602(boolean x) { - return deep603(x); - } - - public static boolean deep603(boolean x) { - return deep604(x); - } - - public static boolean deep604(boolean x) { - return deep605(x); - } - - public static boolean deep605(boolean x) { - return deep606(x); - } - - public static boolean deep606(boolean x) { - return deep607(x); - } - - public static boolean deep607(boolean x) { - return deep608(x); - } - - public static boolean deep608(boolean x) { - return deep609(x); - } - - public static boolean deep609(boolean x) { - return deep610(x); - } - - public static boolean deep610(boolean x) { - return deep611(x); - } - - public static boolean deep611(boolean x) { - return deep612(x); - } - - public static boolean deep612(boolean x) { - return deep613(x); - } - - public static boolean deep613(boolean x) { - return deep614(x); - } - - public static boolean deep614(boolean x) { - return deep615(x); - } - - public static boolean deep615(boolean x) { - return deep616(x); - } - - public static boolean deep616(boolean x) { - return deep617(x); - } - - public static boolean deep617(boolean x) { - return deep618(x); - } - - public static boolean deep618(boolean x) { - return deep619(x); - } - - public static boolean deep619(boolean x) { - return deep620(x); - } - - public static boolean deep620(boolean x) { - return deep621(x); - } - - public static boolean deep621(boolean x) { - return deep622(x); - } - - public static boolean deep622(boolean x) { - return deep623(x); - } - - public static boolean deep623(boolean x) { - return deep624(x); - } - - public static boolean deep624(boolean x) { - return deep625(x); - } - - public static boolean deep625(boolean x) { - return deep626(x); - } - - public static boolean deep626(boolean x) { - return deep627(x); - } - - public static boolean deep627(boolean x) { - return deep628(x); - } - - public static boolean deep628(boolean x) { - return deep629(x); - } - - public static boolean deep629(boolean x) { - return deep630(x); - } - - public static boolean deep630(boolean x) { - return deep631(x); - } - - public static boolean deep631(boolean x) { - return deep632(x); - } - - public static boolean deep632(boolean x) { - return deep633(x); - } - - public static boolean deep633(boolean x) { - return deep634(x); - } - - public static boolean deep634(boolean x) { - return deep635(x); - } - - public static boolean deep635(boolean x) { - return deep636(x); - } - - public static boolean deep636(boolean x) { - return deep637(x); - } - - public static boolean deep637(boolean x) { - return deep638(x); - } - - public static boolean deep638(boolean x) { - return deep639(x); - } - - public static boolean deep639(boolean x) { - return deep640(x); - } - - public static boolean deep640(boolean x) { - return deep641(x); - } - - public static boolean deep641(boolean x) { - return deep642(x); - } - - public static boolean deep642(boolean x) { - return deep643(x); - } - - public static boolean deep643(boolean x) { - return deep644(x); - } - - public static boolean deep644(boolean x) { - return deep645(x); - } - - public static boolean deep645(boolean x) { - return deep646(x); - } - - public static boolean deep646(boolean x) { - return deep647(x); - } - - public static boolean deep647(boolean x) { - return deep648(x); - } - - public static boolean deep648(boolean x) { - return deep649(x); - } - - public static boolean deep649(boolean x) { - return deep650(x); - } - - public static boolean deep650(boolean x) { - return deep651(x); - } - - public static boolean deep651(boolean x) { - return deep652(x); - } - - public static boolean deep652(boolean x) { - return deep653(x); - } - - public static boolean deep653(boolean x) { - return deep654(x); - } - - public static boolean deep654(boolean x) { - return deep655(x); - } - - public static boolean deep655(boolean x) { - return deep656(x); - } - - public static boolean deep656(boolean x) { - return deep657(x); - } - - public static boolean deep657(boolean x) { - return deep658(x); - } - - public static boolean deep658(boolean x) { - return deep659(x); - } - - public static boolean deep659(boolean x) { - return deep660(x); - } - - public static boolean deep660(boolean x) { - return deep661(x); - } - - public static boolean deep661(boolean x) { - return deep662(x); - } - - public static boolean deep662(boolean x) { - return deep663(x); - } - - public static boolean deep663(boolean x) { - return deep664(x); - } - - public static boolean deep664(boolean x) { - return deep665(x); - } - - public static boolean deep665(boolean x) { - return deep666(x); - } - - public static boolean deep666(boolean x) { - return deep667(x); - } - - public static boolean deep667(boolean x) { - return deep668(x); - } - - public static boolean deep668(boolean x) { - return deep669(x); - } - - public static boolean deep669(boolean x) { - return deep670(x); - } - - public static boolean deep670(boolean x) { - return deep671(x); - } - - public static boolean deep671(boolean x) { - return deep672(x); - } - - public static boolean deep672(boolean x) { - return deep673(x); - } - - public static boolean deep673(boolean x) { - return deep674(x); - } - - public static boolean deep674(boolean x) { - return deep675(x); - } - - public static boolean deep675(boolean x) { - return deep676(x); - } - - public static boolean deep676(boolean x) { - return deep677(x); - } - - public static boolean deep677(boolean x) { - return deep678(x); - } - - public static boolean deep678(boolean x) { - return deep679(x); - } - - public static boolean deep679(boolean x) { - return deep680(x); - } - - public static boolean deep680(boolean x) { - return deep681(x); - } - - public static boolean deep681(boolean x) { - return deep682(x); - } - - public static boolean deep682(boolean x) { - return deep683(x); - } - - public static boolean deep683(boolean x) { - return deep684(x); - } - - public static boolean deep684(boolean x) { - return deep685(x); - } - - public static boolean deep685(boolean x) { - return deep686(x); - } - - public static boolean deep686(boolean x) { - return deep687(x); - } - - public static boolean deep687(boolean x) { - return deep688(x); - } - - public static boolean deep688(boolean x) { - return deep689(x); - } - - public static boolean deep689(boolean x) { - return deep690(x); - } - - public static boolean deep690(boolean x) { - return deep691(x); - } - - public static boolean deep691(boolean x) { - return deep692(x); - } - - public static boolean deep692(boolean x) { - return deep693(x); - } - - public static boolean deep693(boolean x) { - return deep694(x); - } - - public static boolean deep694(boolean x) { - return deep695(x); - } - - public static boolean deep695(boolean x) { - return deep696(x); - } - - public static boolean deep696(boolean x) { - return deep697(x); - } - - public static boolean deep697(boolean x) { - return deep698(x); - } - - public static boolean deep698(boolean x) { - return deep699(x); - } - - public static boolean deep699(boolean x) { - return deep700(x); - } - - public static boolean deep700(boolean x) { - return deep701(x); - } - - public static boolean deep701(boolean x) { - return deep702(x); - } - - public static boolean deep702(boolean x) { - return deep703(x); - } - - public static boolean deep703(boolean x) { - return deep704(x); - } - - public static boolean deep704(boolean x) { - return deep705(x); - } - - public static boolean deep705(boolean x) { - return deep706(x); - } - - public static boolean deep706(boolean x) { - return deep707(x); - } - - public static boolean deep707(boolean x) { - return deep708(x); - } - - public static boolean deep708(boolean x) { - return deep709(x); - } - - public static boolean deep709(boolean x) { - return deep710(x); - } - - public static boolean deep710(boolean x) { - return deep711(x); - } - - public static boolean deep711(boolean x) { - return deep712(x); - } - - public static boolean deep712(boolean x) { - return deep713(x); - } - - public static boolean deep713(boolean x) { - return deep714(x); - } - - public static boolean deep714(boolean x) { - return deep715(x); - } - - public static boolean deep715(boolean x) { - return deep716(x); - } - - public static boolean deep716(boolean x) { - return deep717(x); - } - - public static boolean deep717(boolean x) { - return deep718(x); - } - - public static boolean deep718(boolean x) { - return deep719(x); - } - - public static boolean deep719(boolean x) { - return deep720(x); - } - - public static boolean deep720(boolean x) { - return deep721(x); - } - - public static boolean deep721(boolean x) { - return deep722(x); - } - - public static boolean deep722(boolean x) { - return deep723(x); - } - - public static boolean deep723(boolean x) { - return deep724(x); - } - - public static boolean deep724(boolean x) { - return deep725(x); - } - - public static boolean deep725(boolean x) { - return deep726(x); - } - - public static boolean deep726(boolean x) { - return deep727(x); - } - - public static boolean deep727(boolean x) { - return deep728(x); - } - - public static boolean deep728(boolean x) { - return deep729(x); - } - - public static boolean deep729(boolean x) { - return deep730(x); - } - - public static boolean deep730(boolean x) { - return deep731(x); - } - - public static boolean deep731(boolean x) { - return deep732(x); - } - - public static boolean deep732(boolean x) { - return deep733(x); - } - - public static boolean deep733(boolean x) { - return deep734(x); - } - - public static boolean deep734(boolean x) { - return deep735(x); - } - - public static boolean deep735(boolean x) { - return deep736(x); - } - - public static boolean deep736(boolean x) { - return deep737(x); - } - - public static boolean deep737(boolean x) { - return deep738(x); - } - - public static boolean deep738(boolean x) { - return deep739(x); - } - - public static boolean deep739(boolean x) { - return deep740(x); - } - - public static boolean deep740(boolean x) { - return deep741(x); - } - - public static boolean deep741(boolean x) { - return deep742(x); - } - - public static boolean deep742(boolean x) { - return deep743(x); - } - - public static boolean deep743(boolean x) { - return deep744(x); - } - - public static boolean deep744(boolean x) { - return deep745(x); - } - - public static boolean deep745(boolean x) { - return deep746(x); - } - - public static boolean deep746(boolean x) { - return deep747(x); - } - - public static boolean deep747(boolean x) { - return deep748(x); - } - - public static boolean deep748(boolean x) { - return deep749(x); - } - - public static boolean deep749(boolean x) { - return deep750(x); - } - - public static boolean deep750(boolean x) { - return deep751(x); - } - - public static boolean deep751(boolean x) { - return deep752(x); - } - - public static boolean deep752(boolean x) { - return deep753(x); - } - - public static boolean deep753(boolean x) { - return deep754(x); - } - - public static boolean deep754(boolean x) { - return deep755(x); - } - - public static boolean deep755(boolean x) { - return deep756(x); - } - - public static boolean deep756(boolean x) { - return deep757(x); - } - - public static boolean deep757(boolean x) { - return deep758(x); - } - - public static boolean deep758(boolean x) { - return deep759(x); - } - - public static boolean deep759(boolean x) { - return deep760(x); - } - - public static boolean deep760(boolean x) { - return deep761(x); - } - - public static boolean deep761(boolean x) { - return deep762(x); - } - - public static boolean deep762(boolean x) { - return deep763(x); - } - - public static boolean deep763(boolean x) { - return deep764(x); - } - - public static boolean deep764(boolean x) { - return deep765(x); - } - - public static boolean deep765(boolean x) { - return deep766(x); - } - - public static boolean deep766(boolean x) { - return deep767(x); - } - - public static boolean deep767(boolean x) { - return deep768(x); - } - - public static boolean deep768(boolean x) { - return deep769(x); - } - - public static boolean deep769(boolean x) { - return deep770(x); - } - - public static boolean deep770(boolean x) { - return deep771(x); - } - - public static boolean deep771(boolean x) { - return deep772(x); - } - - public static boolean deep772(boolean x) { - return deep773(x); - } - - public static boolean deep773(boolean x) { - return deep774(x); - } - - public static boolean deep774(boolean x) { - return deep775(x); - } - - public static boolean deep775(boolean x) { - return deep776(x); - } - - public static boolean deep776(boolean x) { - return deep777(x); - } - - public static boolean deep777(boolean x) { - return deep778(x); - } - - public static boolean deep778(boolean x) { - return deep779(x); - } - - public static boolean deep779(boolean x) { - return deep780(x); - } - - public static boolean deep780(boolean x) { - return deep781(x); - } - - public static boolean deep781(boolean x) { - return deep782(x); - } - - public static boolean deep782(boolean x) { - return deep783(x); - } - - public static boolean deep783(boolean x) { - return deep784(x); - } - - public static boolean deep784(boolean x) { - return deep785(x); - } - - public static boolean deep785(boolean x) { - return deep786(x); - } - - public static boolean deep786(boolean x) { - return deep787(x); - } - - public static boolean deep787(boolean x) { - return deep788(x); - } - - public static boolean deep788(boolean x) { - return deep789(x); - } - - public static boolean deep789(boolean x) { - return deep790(x); - } - - public static boolean deep790(boolean x) { - return deep791(x); - } - - public static boolean deep791(boolean x) { - return deep792(x); - } - - public static boolean deep792(boolean x) { - return deep793(x); - } - - public static boolean deep793(boolean x) { - return deep794(x); - } - - public static boolean deep794(boolean x) { - return deep795(x); - } - - public static boolean deep795(boolean x) { - return deep796(x); - } - - public static boolean deep796(boolean x) { - return deep797(x); - } - - public static boolean deep797(boolean x) { - return deep798(x); - } - - public static boolean deep798(boolean x) { - return deep799(x); - } - - public static boolean deep799(boolean x) { - return deep800(x); - } - - public static boolean deep800(boolean x) { - return deep801(x); - } - - public static boolean deep801(boolean x) { - return deep802(x); - } - - public static boolean deep802(boolean x) { - return deep803(x); - } - - public static boolean deep803(boolean x) { - return deep804(x); - } - - public static boolean deep804(boolean x) { - return deep805(x); - } - - public static boolean deep805(boolean x) { - return deep806(x); - } - - public static boolean deep806(boolean x) { - return deep807(x); - } - - public static boolean deep807(boolean x) { - return deep808(x); - } - - public static boolean deep808(boolean x) { - return deep809(x); - } - - public static boolean deep809(boolean x) { - return deep810(x); - } - - public static boolean deep810(boolean x) { - return deep811(x); - } - - public static boolean deep811(boolean x) { - return deep812(x); - } - - public static boolean deep812(boolean x) { - return deep813(x); - } - - public static boolean deep813(boolean x) { - return deep814(x); - } - - public static boolean deep814(boolean x) { - return deep815(x); - } - - public static boolean deep815(boolean x) { - return deep816(x); - } - - public static boolean deep816(boolean x) { - return deep817(x); - } - - public static boolean deep817(boolean x) { - return deep818(x); - } - - public static boolean deep818(boolean x) { - return deep819(x); - } - - public static boolean deep819(boolean x) { - return deep820(x); - } - - public static boolean deep820(boolean x) { - return deep821(x); - } - - public static boolean deep821(boolean x) { - return deep822(x); - } - - public static boolean deep822(boolean x) { - return deep823(x); - } - - public static boolean deep823(boolean x) { - return deep824(x); - } - - public static boolean deep824(boolean x) { - return deep825(x); - } - - public static boolean deep825(boolean x) { - return deep826(x); - } - - public static boolean deep826(boolean x) { - return deep827(x); - } - - public static boolean deep827(boolean x) { - return deep828(x); - } - - public static boolean deep828(boolean x) { - return deep829(x); - } - - public static boolean deep829(boolean x) { - return deep830(x); - } - - public static boolean deep830(boolean x) { - return deep831(x); - } - - public static boolean deep831(boolean x) { - return deep832(x); - } - - public static boolean deep832(boolean x) { - return deep833(x); - } - - public static boolean deep833(boolean x) { - return deep834(x); - } - - public static boolean deep834(boolean x) { - return deep835(x); - } - - public static boolean deep835(boolean x) { - return deep836(x); - } - - public static boolean deep836(boolean x) { - return deep837(x); - } - - public static boolean deep837(boolean x) { - return deep838(x); - } - - public static boolean deep838(boolean x) { - return deep839(x); - } - - public static boolean deep839(boolean x) { - return deep840(x); - } - - public static boolean deep840(boolean x) { - return deep841(x); - } - - public static boolean deep841(boolean x) { - return deep842(x); - } - - public static boolean deep842(boolean x) { - return deep843(x); - } - - public static boolean deep843(boolean x) { - return deep844(x); - } - - public static boolean deep844(boolean x) { - return deep845(x); - } - - public static boolean deep845(boolean x) { - return deep846(x); - } - - public static boolean deep846(boolean x) { - return deep847(x); - } - - public static boolean deep847(boolean x) { - return deep848(x); - } - - public static boolean deep848(boolean x) { - return deep849(x); - } - - public static boolean deep849(boolean x) { - return deep850(x); - } - - public static boolean deep850(boolean x) { - return deep851(x); - } - - public static boolean deep851(boolean x) { - return deep852(x); - } - - public static boolean deep852(boolean x) { - return deep853(x); - } - - public static boolean deep853(boolean x) { - return deep854(x); - } - - public static boolean deep854(boolean x) { - return deep855(x); - } - - public static boolean deep855(boolean x) { - return deep856(x); - } - - public static boolean deep856(boolean x) { - return deep857(x); - } - - public static boolean deep857(boolean x) { - return deep858(x); - } - - public static boolean deep858(boolean x) { - return deep859(x); - } - - public static boolean deep859(boolean x) { - return deep860(x); - } - - public static boolean deep860(boolean x) { - return deep861(x); - } - - public static boolean deep861(boolean x) { - return deep862(x); - } - - public static boolean deep862(boolean x) { - return deep863(x); - } - - public static boolean deep863(boolean x) { - return deep864(x); - } - - public static boolean deep864(boolean x) { - return deep865(x); - } - - public static boolean deep865(boolean x) { - return deep866(x); - } - - public static boolean deep866(boolean x) { - return deep867(x); - } - - public static boolean deep867(boolean x) { - return deep868(x); - } - - public static boolean deep868(boolean x) { - return deep869(x); - } - - public static boolean deep869(boolean x) { - return deep870(x); - } - - public static boolean deep870(boolean x) { - return deep871(x); - } - - public static boolean deep871(boolean x) { - return deep872(x); - } - - public static boolean deep872(boolean x) { - return deep873(x); - } - - public static boolean deep873(boolean x) { - return deep874(x); - } - - public static boolean deep874(boolean x) { - return deep875(x); - } - - public static boolean deep875(boolean x) { - return deep876(x); - } - - public static boolean deep876(boolean x) { - return deep877(x); - } - - public static boolean deep877(boolean x) { - return deep878(x); - } - - public static boolean deep878(boolean x) { - return deep879(x); - } - - public static boolean deep879(boolean x) { - return deep880(x); - } - - public static boolean deep880(boolean x) { - return deep881(x); - } - - public static boolean deep881(boolean x) { - return deep882(x); - } - - public static boolean deep882(boolean x) { - return deep883(x); - } - - public static boolean deep883(boolean x) { - return deep884(x); - } - - public static boolean deep884(boolean x) { - return deep885(x); - } - - public static boolean deep885(boolean x) { - return deep886(x); - } - - public static boolean deep886(boolean x) { - return deep887(x); - } - - public static boolean deep887(boolean x) { - return deep888(x); - } - - public static boolean deep888(boolean x) { - return deep889(x); - } - - public static boolean deep889(boolean x) { - return deep890(x); - } - - public static boolean deep890(boolean x) { - return deep891(x); - } - - public static boolean deep891(boolean x) { - return deep892(x); - } - - public static boolean deep892(boolean x) { - return deep893(x); - } - - public static boolean deep893(boolean x) { - return deep894(x); - } - - public static boolean deep894(boolean x) { - return deep895(x); - } - - public static boolean deep895(boolean x) { - return deep896(x); - } - - public static boolean deep896(boolean x) { - return deep897(x); - } - - public static boolean deep897(boolean x) { - return deep898(x); - } - - public static boolean deep898(boolean x) { - return deep899(x); - } - - public static boolean deep899(boolean x) { - return deep900(x); - } - - public static boolean deep900(boolean x) { - return deep901(x); - } - - public static boolean deep901(boolean x) { - return deep902(x); - } - - public static boolean deep902(boolean x) { - return deep903(x); - } - - public static boolean deep903(boolean x) { - return deep904(x); - } - - public static boolean deep904(boolean x) { - return deep905(x); - } - - public static boolean deep905(boolean x) { - return deep906(x); - } - - public static boolean deep906(boolean x) { - return deep907(x); - } - - public static boolean deep907(boolean x) { - return deep908(x); - } - - public static boolean deep908(boolean x) { - return deep909(x); - } - - public static boolean deep909(boolean x) { - return deep910(x); - } - - public static boolean deep910(boolean x) { - return deep911(x); - } - - public static boolean deep911(boolean x) { - return deep912(x); - } - - public static boolean deep912(boolean x) { - return deep913(x); - } - - public static boolean deep913(boolean x) { - return deep914(x); - } - - public static boolean deep914(boolean x) { - return deep915(x); - } - - public static boolean deep915(boolean x) { - return deep916(x); - } - - public static boolean deep916(boolean x) { - return deep917(x); - } - - public static boolean deep917(boolean x) { - return deep918(x); - } - - public static boolean deep918(boolean x) { - return deep919(x); - } - - public static boolean deep919(boolean x) { - return deep920(x); - } - - public static boolean deep920(boolean x) { - return deep921(x); - } - - public static boolean deep921(boolean x) { - return deep922(x); - } - - public static boolean deep922(boolean x) { - return deep923(x); - } - - public static boolean deep923(boolean x) { - return deep924(x); - } - - public static boolean deep924(boolean x) { - return deep925(x); - } - - public static boolean deep925(boolean x) { - return deep926(x); - } - - public static boolean deep926(boolean x) { - return deep927(x); - } - - public static boolean deep927(boolean x) { - return deep928(x); - } - - public static boolean deep928(boolean x) { - return deep929(x); - } - - public static boolean deep929(boolean x) { - return deep930(x); - } - - public static boolean deep930(boolean x) { - return deep931(x); - } - - public static boolean deep931(boolean x) { - return deep932(x); - } - - public static boolean deep932(boolean x) { - return deep933(x); - } - - public static boolean deep933(boolean x) { - return deep934(x); - } - - public static boolean deep934(boolean x) { - return deep935(x); - } - - public static boolean deep935(boolean x) { - return deep936(x); - } - - public static boolean deep936(boolean x) { - return deep937(x); - } - - public static boolean deep937(boolean x) { - return deep938(x); - } - - public static boolean deep938(boolean x) { - return deep939(x); - } - - public static boolean deep939(boolean x) { - return deep940(x); - } - - public static boolean deep940(boolean x) { - return deep941(x); - } - - public static boolean deep941(boolean x) { - return deep942(x); - } - - public static boolean deep942(boolean x) { - return deep943(x); - } - - public static boolean deep943(boolean x) { - return deep944(x); - } - - public static boolean deep944(boolean x) { - return deep945(x); - } - - public static boolean deep945(boolean x) { - return deep946(x); - } - - public static boolean deep946(boolean x) { - return deep947(x); - } - - public static boolean deep947(boolean x) { - return deep948(x); - } - - public static boolean deep948(boolean x) { - return deep949(x); - } - - public static boolean deep949(boolean x) { - return deep950(x); - } - - public static boolean deep950(boolean x) { - return deep951(x); - } - - public static boolean deep951(boolean x) { - return deep952(x); - } - - public static boolean deep952(boolean x) { - return deep953(x); - } - - public static boolean deep953(boolean x) { - return deep954(x); - } - - public static boolean deep954(boolean x) { - return deep955(x); - } - - public static boolean deep955(boolean x) { - return deep956(x); - } - - public static boolean deep956(boolean x) { - return deep957(x); - } - - public static boolean deep957(boolean x) { - return deep958(x); - } - - public static boolean deep958(boolean x) { - return deep959(x); - } - - public static boolean deep959(boolean x) { - return deep960(x); - } - - public static boolean deep960(boolean x) { - return deep961(x); - } - - public static boolean deep961(boolean x) { - return deep962(x); - } - - public static boolean deep962(boolean x) { - return deep963(x); - } - - public static boolean deep963(boolean x) { - return deep964(x); - } - - public static boolean deep964(boolean x) { - return deep965(x); - } - - public static boolean deep965(boolean x) { - return deep966(x); - } - - public static boolean deep966(boolean x) { - return deep967(x); - } - - public static boolean deep967(boolean x) { - return deep968(x); - } - - public static boolean deep968(boolean x) { - return deep969(x); - } - - public static boolean deep969(boolean x) { - return deep970(x); - } - - public static boolean deep970(boolean x) { - return deep971(x); - } - - public static boolean deep971(boolean x) { - return deep972(x); - } - - public static boolean deep972(boolean x) { - return deep973(x); - } - - public static boolean deep973(boolean x) { - return deep974(x); - } - - public static boolean deep974(boolean x) { - return deep975(x); - } - - public static boolean deep975(boolean x) { - return deep976(x); - } - - public static boolean deep976(boolean x) { - return deep977(x); - } - - public static boolean deep977(boolean x) { - return deep978(x); - } - - public static boolean deep978(boolean x) { - return deep979(x); - } - - public static boolean deep979(boolean x) { - return deep980(x); - } - - public static boolean deep980(boolean x) { - return deep981(x); - } - - public static boolean deep981(boolean x) { - return deep982(x); - } - - public static boolean deep982(boolean x) { - return deep983(x); - } - - public static boolean deep983(boolean x) { - return deep984(x); - } - - public static boolean deep984(boolean x) { - return deep985(x); - } - - public static boolean deep985(boolean x) { - return deep986(x); - } - - public static boolean deep986(boolean x) { - return deep987(x); - } - - public static boolean deep987(boolean x) { - return deep988(x); - } - - public static boolean deep988(boolean x) { - return deep989(x); - } - - public static boolean deep989(boolean x) { - return deep990(x); - } - - public static boolean deep990(boolean x) { - return deep991(x); - } - - public static boolean deep991(boolean x) { - return deep992(x); - } - - public static boolean deep992(boolean x) { - return deep993(x); - } - - public static boolean deep993(boolean x) { - return deep994(x); - } - - public static boolean deep994(boolean x) { - return deep995(x); - } - - public static boolean deep995(boolean x) { - return deep996(x); - } - - public static boolean deep996(boolean x) { - return deep997(x); - } - - public static boolean deep997(boolean x) { - return deep998(x); - } - - public static boolean deep998(boolean x) { - return deep999(x); - } - - public static boolean deep999(boolean x) { - return deep1000(x); - } - - public static boolean deep1000(boolean x) { - return deep1001(x); - } - - public static boolean deep1001(boolean x) { - return deep1002(x); - } - - public static boolean deep1002(boolean x) { - return deep1003(x); - } - - public static boolean deep1003(boolean x) { - return deep1004(x); - } - - public static boolean deep1004(boolean x) { - return deep1005(x); - } - - public static boolean deep1005(boolean x) { - return deep1006(x); - } - - public static boolean deep1006(boolean x) { - return deep1007(x); - } - - public static boolean deep1007(boolean x) { - return deep1008(x); - } - - public static boolean deep1008(boolean x) { - return deep1009(x); - } - - public static boolean deep1009(boolean x) { - return deep1010(x); - } - - public static boolean deep1010(boolean x) { - return deep1011(x); - } - - public static boolean deep1011(boolean x) { - return deep1012(x); - } - - public static boolean deep1012(boolean x) { - return deep1013(x); - } - - public static boolean deep1013(boolean x) { - return deep1014(x); - } - - public static boolean deep1014(boolean x) { - return deep1015(x); - } - - public static boolean deep1015(boolean x) { - return deep1016(x); - } - - public static boolean deep1016(boolean x) { - return deep1017(x); - } - - public static boolean deep1017(boolean x) { - return deep1018(x); - } - - public static boolean deep1018(boolean x) { - return deep1019(x); - } - - public static boolean deep1019(boolean x) { - return deep1020(x); - } - - public static boolean deep1020(boolean x) { - return deep1021(x); - } - - public static boolean deep1021(boolean x) { - return deep1022(x); - } - - public static boolean deep1022(boolean x) { - return deep1023(x); - } - - public static boolean deep1023(boolean x) { - return deep1024(x); - } - - public static boolean deep1024(boolean x) { - return deep1025(x); - } - - public static boolean deep1025(boolean x) { - return deep1026(x); - } - - public static boolean deep1026(boolean x) { - return deep1027(x); - } - - public static boolean deep1027(boolean x) { - return deep1028(x); - } - - public static boolean deep1028(boolean x) { - return deep1029(x); - } - - public static boolean deep1029(boolean x) { - return deep1030(x); - } - - public static boolean deep1030(boolean x) { - return deep1031(x); - } - - public static boolean deep1031(boolean x) { - return deep1032(x); - } - - public static boolean deep1032(boolean x) { - return deep1033(x); - } - - public static boolean deep1033(boolean x) { - return deep1034(x); - } - - public static boolean deep1034(boolean x) { - return deep1035(x); - } - - public static boolean deep1035(boolean x) { - return deep1036(x); - } - - public static boolean deep1036(boolean x) { - return deep1037(x); - } - - public static boolean deep1037(boolean x) { - return deep1038(x); - } - - public static boolean deep1038(boolean x) { - return deep1039(x); - } - - public static boolean deep1039(boolean x) { - return deep1040(x); - } - - public static boolean deep1040(boolean x) { - return deep1041(x); - } - - public static boolean deep1041(boolean x) { - return deep1042(x); - } - - public static boolean deep1042(boolean x) { - return deep1043(x); - } - - public static boolean deep1043(boolean x) { - return deep1044(x); - } - - public static boolean deep1044(boolean x) { - return deep1045(x); - } - - public static boolean deep1045(boolean x) { - return deep1046(x); - } - - public static boolean deep1046(boolean x) { - return deep1047(x); - } - - public static boolean deep1047(boolean x) { - return deep1048(x); - } - - public static boolean deep1048(boolean x) { - return deep1049(x); - } - - public static boolean deep1049(boolean x) { - return deep1050(x); - } - - public static boolean deep1050(boolean x) { - return deep1051(x); - } - - public static boolean deep1051(boolean x) { - return deep1052(x); - } - - public static boolean deep1052(boolean x) { - return deep1053(x); - } - - public static boolean deep1053(boolean x) { - return deep1054(x); - } - - public static boolean deep1054(boolean x) { - return deep1055(x); - } - - public static boolean deep1055(boolean x) { - return deep1056(x); - } - - public static boolean deep1056(boolean x) { - return deep1057(x); - } - - public static boolean deep1057(boolean x) { - return deep1058(x); - } - - public static boolean deep1058(boolean x) { - return deep1059(x); - } - - public static boolean deep1059(boolean x) { - return deep1060(x); - } - - public static boolean deep1060(boolean x) { - return deep1061(x); - } - - public static boolean deep1061(boolean x) { - return deep1062(x); - } - - public static boolean deep1062(boolean x) { - return deep1063(x); - } - - public static boolean deep1063(boolean x) { - return deep1064(x); - } - - public static boolean deep1064(boolean x) { - return deep1065(x); - } - - public static boolean deep1065(boolean x) { - return deep1066(x); - } - - public static boolean deep1066(boolean x) { - return deep1067(x); - } - - public static boolean deep1067(boolean x) { - return deep1068(x); - } - - public static boolean deep1068(boolean x) { - return deep1069(x); - } - - public static boolean deep1069(boolean x) { - return deep1070(x); - } - - public static boolean deep1070(boolean x) { - return deep1071(x); - } - - public static boolean deep1071(boolean x) { - return deep1072(x); - } - - public static boolean deep1072(boolean x) { - return deep1073(x); - } - - public static boolean deep1073(boolean x) { - return deep1074(x); - } - - public static boolean deep1074(boolean x) { - return deep1075(x); - } - - public static boolean deep1075(boolean x) { - return deep1076(x); - } - - public static boolean deep1076(boolean x) { - return deep1077(x); - } - - public static boolean deep1077(boolean x) { - return deep1078(x); - } - - public static boolean deep1078(boolean x) { - return deep1079(x); - } - - public static boolean deep1079(boolean x) { - return deep1080(x); - } - - public static boolean deep1080(boolean x) { - return deep1081(x); - } - - public static boolean deep1081(boolean x) { - return deep1082(x); - } - - public static boolean deep1082(boolean x) { - return deep1083(x); - } - - public static boolean deep1083(boolean x) { - return deep1084(x); - } - - public static boolean deep1084(boolean x) { - return deep1085(x); - } - - public static boolean deep1085(boolean x) { - return deep1086(x); - } - - public static boolean deep1086(boolean x) { - return deep1087(x); - } - - public static boolean deep1087(boolean x) { - return deep1088(x); - } - - public static boolean deep1088(boolean x) { - return deep1089(x); - } - - public static boolean deep1089(boolean x) { - return deep1090(x); - } - - public static boolean deep1090(boolean x) { - return deep1091(x); - } - - public static boolean deep1091(boolean x) { - return deep1092(x); - } - - public static boolean deep1092(boolean x) { - return deep1093(x); - } - - public static boolean deep1093(boolean x) { - return deep1094(x); - } - - public static boolean deep1094(boolean x) { - return deep1095(x); - } - - public static boolean deep1095(boolean x) { - return deep1096(x); - } - - public static boolean deep1096(boolean x) { - return deep1097(x); - } - - public static boolean deep1097(boolean x) { - return deep1098(x); - } - - public static boolean deep1098(boolean x) { - return deep1099(x); - } - - public static boolean deep1099(boolean x) { - return deep1100(x); - } - - public static boolean deep1100(boolean x) { - return deep1101(x); - } - - public static boolean deep1101(boolean x) { - return deep1102(x); - } - - public static boolean deep1102(boolean x) { - return deep1103(x); - } - - public static boolean deep1103(boolean x) { - return deep1104(x); - } - - public static boolean deep1104(boolean x) { - return deep1105(x); - } - - public static boolean deep1105(boolean x) { - return deep1106(x); - } - - public static boolean deep1106(boolean x) { - return deep1107(x); - } - - public static boolean deep1107(boolean x) { - return deep1108(x); - } - - public static boolean deep1108(boolean x) { - return deep1109(x); - } - - public static boolean deep1109(boolean x) { - return deep1110(x); - } - - public static boolean deep1110(boolean x) { - return deep1111(x); - } - - public static boolean deep1111(boolean x) { - return deep1112(x); - } - - public static boolean deep1112(boolean x) { - return deep1113(x); - } - - public static boolean deep1113(boolean x) { - return deep1114(x); - } - - public static boolean deep1114(boolean x) { - return deep1115(x); - } - - public static boolean deep1115(boolean x) { - return deep1116(x); - } - - public static boolean deep1116(boolean x) { - return deep1117(x); - } - - public static boolean deep1117(boolean x) { - return deep1118(x); - } - - public static boolean deep1118(boolean x) { - return deep1119(x); - } - - public static boolean deep1119(boolean x) { - return deep1120(x); - } - - public static boolean deep1120(boolean x) { - return deep1121(x); - } - - public static boolean deep1121(boolean x) { - return deep1122(x); - } - - public static boolean deep1122(boolean x) { - return deep1123(x); - } - - public static boolean deep1123(boolean x) { - return deep1124(x); - } - - public static boolean deep1124(boolean x) { - return deep1125(x); - } - - public static boolean deep1125(boolean x) { - return deep1126(x); - } - - public static boolean deep1126(boolean x) { - return deep1127(x); - } - - public static boolean deep1127(boolean x) { - return deep1128(x); - } - - public static boolean deep1128(boolean x) { - return deep1129(x); - } - - public static boolean deep1129(boolean x) { - return deep1130(x); - } - - public static boolean deep1130(boolean x) { - return deep1131(x); - } - - public static boolean deep1131(boolean x) { - return deep1132(x); - } - - public static boolean deep1132(boolean x) { - return deep1133(x); - } - - public static boolean deep1133(boolean x) { - return deep1134(x); - } - - public static boolean deep1134(boolean x) { - return deep1135(x); - } - - public static boolean deep1135(boolean x) { - return deep1136(x); - } - - public static boolean deep1136(boolean x) { - return deep1137(x); - } - - public static boolean deep1137(boolean x) { - return deep1138(x); - } - - public static boolean deep1138(boolean x) { - return deep1139(x); - } - - public static boolean deep1139(boolean x) { - return deep1140(x); - } - - public static boolean deep1140(boolean x) { - return deep1141(x); - } - - public static boolean deep1141(boolean x) { - return deep1142(x); - } - - public static boolean deep1142(boolean x) { - return deep1143(x); - } - - public static boolean deep1143(boolean x) { - return deep1144(x); - } - - public static boolean deep1144(boolean x) { - return deep1145(x); - } - - public static boolean deep1145(boolean x) { - return deep1146(x); - } - - public static boolean deep1146(boolean x) { - return deep1147(x); - } - - public static boolean deep1147(boolean x) { - return deep1148(x); - } - - public static boolean deep1148(boolean x) { - return deep1149(x); - } - - public static boolean deep1149(boolean x) { - return deep1150(x); - } - - public static boolean deep1150(boolean x) { - return deep1151(x); - } - - public static boolean deep1151(boolean x) { - return deep1152(x); - } - - public static boolean deep1152(boolean x) { - return deep1153(x); - } - - public static boolean deep1153(boolean x) { - return deep1154(x); - } - - public static boolean deep1154(boolean x) { - return deep1155(x); - } - - public static boolean deep1155(boolean x) { - return deep1156(x); - } - - public static boolean deep1156(boolean x) { - return deep1157(x); - } - - public static boolean deep1157(boolean x) { - return deep1158(x); - } - - public static boolean deep1158(boolean x) { - return deep1159(x); - } - - public static boolean deep1159(boolean x) { - return deep1160(x); - } - - public static boolean deep1160(boolean x) { - return deep1161(x); - } - - public static boolean deep1161(boolean x) { - return deep1162(x); - } - - public static boolean deep1162(boolean x) { - return deep1163(x); - } - - public static boolean deep1163(boolean x) { - return deep1164(x); - } - - public static boolean deep1164(boolean x) { - return deep1165(x); - } - - public static boolean deep1165(boolean x) { - return deep1166(x); - } - - public static boolean deep1166(boolean x) { - return deep1167(x); - } - - public static boolean deep1167(boolean x) { - return deep1168(x); - } - - public static boolean deep1168(boolean x) { - return deep1169(x); - } - - public static boolean deep1169(boolean x) { - return deep1170(x); - } - - public static boolean deep1170(boolean x) { - return deep1171(x); - } - - public static boolean deep1171(boolean x) { - return deep1172(x); - } - - public static boolean deep1172(boolean x) { - return deep1173(x); - } - - public static boolean deep1173(boolean x) { - return deep1174(x); - } - - public static boolean deep1174(boolean x) { - return deep1175(x); - } - - public static boolean deep1175(boolean x) { - return deep1176(x); - } - - public static boolean deep1176(boolean x) { - return deep1177(x); - } - - public static boolean deep1177(boolean x) { - return deep1178(x); - } - - public static boolean deep1178(boolean x) { - return deep1179(x); - } - - public static boolean deep1179(boolean x) { - return deep1180(x); - } - - public static boolean deep1180(boolean x) { - return deep1181(x); - } - - public static boolean deep1181(boolean x) { - return deep1182(x); - } - - public static boolean deep1182(boolean x) { - return deep1183(x); - } - - public static boolean deep1183(boolean x) { - return deep1184(x); - } - - public static boolean deep1184(boolean x) { - return deep1185(x); - } - - public static boolean deep1185(boolean x) { - return deep1186(x); - } - - public static boolean deep1186(boolean x) { - return deep1187(x); - } - - public static boolean deep1187(boolean x) { - return deep1188(x); - } - - public static boolean deep1188(boolean x) { - return deep1189(x); - } - - public static boolean deep1189(boolean x) { - return deep1190(x); - } - - public static boolean deep1190(boolean x) { - return deep1191(x); - } - - public static boolean deep1191(boolean x) { - return deep1192(x); - } - - public static boolean deep1192(boolean x) { - return deep1193(x); - } - - public static boolean deep1193(boolean x) { - return deep1194(x); - } - - public static boolean deep1194(boolean x) { - return deep1195(x); - } - - public static boolean deep1195(boolean x) { - return deep1196(x); - } - - public static boolean deep1196(boolean x) { - return deep1197(x); - } - - public static boolean deep1197(boolean x) { - return deep1198(x); - } - - public static boolean deep1198(boolean x) { - return deep1199(x); - } - - public static boolean deep1199(boolean x) { - return deep1200(x); - } - - public static boolean deep1200(boolean x) { - return deep1201(x); - } - - public static boolean deep1201(boolean x) { - return deep1202(x); - } - - public static boolean deep1202(boolean x) { - return deep1203(x); - } - - public static boolean deep1203(boolean x) { - return deep1204(x); - } - - public static boolean deep1204(boolean x) { - return deep1205(x); - } - - public static boolean deep1205(boolean x) { - return deep1206(x); - } - - public static boolean deep1206(boolean x) { - return deep1207(x); - } - - public static boolean deep1207(boolean x) { - return deep1208(x); - } - - public static boolean deep1208(boolean x) { - return deep1209(x); - } - - public static boolean deep1209(boolean x) { - return deep1210(x); - } - - public static boolean deep1210(boolean x) { - return deep1211(x); - } - - public static boolean deep1211(boolean x) { - return deep1212(x); - } - - public static boolean deep1212(boolean x) { - return deep1213(x); - } - - public static boolean deep1213(boolean x) { - return deep1214(x); - } - - public static boolean deep1214(boolean x) { - return deep1215(x); - } - - public static boolean deep1215(boolean x) { - return deep1216(x); - } - - public static boolean deep1216(boolean x) { - return deep1217(x); - } - - public static boolean deep1217(boolean x) { - return deep1218(x); - } - - public static boolean deep1218(boolean x) { - return deep1219(x); - } - - public static boolean deep1219(boolean x) { - return deep1220(x); - } - - public static boolean deep1220(boolean x) { - return deep1221(x); - } - - public static boolean deep1221(boolean x) { - return deep1222(x); - } - - public static boolean deep1222(boolean x) { - return deep1223(x); - } - - public static boolean deep1223(boolean x) { - return deep1224(x); - } - - public static boolean deep1224(boolean x) { - return deep1225(x); - } - - public static boolean deep1225(boolean x) { - return deep1226(x); - } - - public static boolean deep1226(boolean x) { - return deep1227(x); - } - - public static boolean deep1227(boolean x) { - return deep1228(x); - } - - public static boolean deep1228(boolean x) { - return deep1229(x); - } - - public static boolean deep1229(boolean x) { - return deep1230(x); - } - - public static boolean deep1230(boolean x) { - return deep1231(x); - } - - public static boolean deep1231(boolean x) { - return deep1232(x); - } - - public static boolean deep1232(boolean x) { - return deep1233(x); - } - - public static boolean deep1233(boolean x) { - return deep1234(x); - } - - public static boolean deep1234(boolean x) { - return deep1235(x); - } - - public static boolean deep1235(boolean x) { - return deep1236(x); - } - - public static boolean deep1236(boolean x) { - return deep1237(x); - } - - public static boolean deep1237(boolean x) { - return deep1238(x); - } - - public static boolean deep1238(boolean x) { - return deep1239(x); - } - - public static boolean deep1239(boolean x) { - return deep1240(x); - } - - public static boolean deep1240(boolean x) { - return deep1241(x); - } - - public static boolean deep1241(boolean x) { - return deep1242(x); - } - - public static boolean deep1242(boolean x) { - return deep1243(x); - } - - public static boolean deep1243(boolean x) { - return deep1244(x); - } - - public static boolean deep1244(boolean x) { - return deep1245(x); - } - - public static boolean deep1245(boolean x) { - return deep1246(x); - } - - public static boolean deep1246(boolean x) { - return deep1247(x); - } - - public static boolean deep1247(boolean x) { - return deep1248(x); - } - - public static boolean deep1248(boolean x) { - return deep1249(x); - } - - public static boolean deep1249(boolean x) { - return deep1250(x); - } - - public static boolean deep1250(boolean x) { - return deep1251(x); - } - - public static boolean deep1251(boolean x) { - return deep1252(x); - } - - public static boolean deep1252(boolean x) { - return deep1253(x); - } - - public static boolean deep1253(boolean x) { - return deep1254(x); - } - - public static boolean deep1254(boolean x) { - return deep1255(x); - } - - public static boolean deep1255(boolean x) { - return deep1256(x); - } - - public static boolean deep1256(boolean x) { - return deep1257(x); - } - - public static boolean deep1257(boolean x) { - return deep1258(x); - } - - public static boolean deep1258(boolean x) { - return deep1259(x); - } - - public static boolean deep1259(boolean x) { - return deep1260(x); - } - - public static boolean deep1260(boolean x) { - return deep1261(x); - } - - public static boolean deep1261(boolean x) { - return deep1262(x); - } - - public static boolean deep1262(boolean x) { - return deep1263(x); - } - - public static boolean deep1263(boolean x) { - return deep1264(x); - } - - public static boolean deep1264(boolean x) { - return deep1265(x); - } - - public static boolean deep1265(boolean x) { - return deep1266(x); - } - - public static boolean deep1266(boolean x) { - return deep1267(x); - } - - public static boolean deep1267(boolean x) { - return deep1268(x); - } - - public static boolean deep1268(boolean x) { - return deep1269(x); - } - - public static boolean deep1269(boolean x) { - return deep1270(x); - } - - public static boolean deep1270(boolean x) { - return deep1271(x); - } - - public static boolean deep1271(boolean x) { - return deep1272(x); - } - - public static boolean deep1272(boolean x) { - return deep1273(x); - } - - public static boolean deep1273(boolean x) { - return deep1274(x); - } - - public static boolean deep1274(boolean x) { - return deep1275(x); - } - - public static boolean deep1275(boolean x) { - return deep1276(x); - } - - public static boolean deep1276(boolean x) { - return deep1277(x); - } - - public static boolean deep1277(boolean x) { - return deep1278(x); - } - - public static boolean deep1278(boolean x) { - return deep1279(x); - } - - public static boolean deep1279(boolean x) { - return deep1280(x); - } - - public static boolean deep1280(boolean x) { - return deep1281(x); - } - - public static boolean deep1281(boolean x) { - return deep1282(x); - } - - public static boolean deep1282(boolean x) { - return deep1283(x); - } - - public static boolean deep1283(boolean x) { - return deep1284(x); - } - - public static boolean deep1284(boolean x) { - return deep1285(x); - } - - public static boolean deep1285(boolean x) { - return deep1286(x); - } - - public static boolean deep1286(boolean x) { - return deep1287(x); - } - - public static boolean deep1287(boolean x) { - return deep1288(x); - } - - public static boolean deep1288(boolean x) { - return deep1289(x); - } - - public static boolean deep1289(boolean x) { - return deep1290(x); - } - - public static boolean deep1290(boolean x) { - return deep1291(x); - } - - public static boolean deep1291(boolean x) { - return deep1292(x); - } - - public static boolean deep1292(boolean x) { - return deep1293(x); - } - - public static boolean deep1293(boolean x) { - return deep1294(x); - } - - public static boolean deep1294(boolean x) { - return deep1295(x); - } - - public static boolean deep1295(boolean x) { - return deep1296(x); - } - - public static boolean deep1296(boolean x) { - return deep1297(x); - } - - public static boolean deep1297(boolean x) { - return deep1298(x); - } - - public static boolean deep1298(boolean x) { - return deep1299(x); - } - - public static boolean deep1299(boolean x) { - return deep1300(x); - } - - public static boolean deep1300(boolean x) { - return deep1301(x); - } - - public static boolean deep1301(boolean x) { - return deep1302(x); - } - - public static boolean deep1302(boolean x) { - return deep1303(x); - } - - public static boolean deep1303(boolean x) { - return deep1304(x); - } - - public static boolean deep1304(boolean x) { - return deep1305(x); - } - - public static boolean deep1305(boolean x) { - return deep1306(x); - } - - public static boolean deep1306(boolean x) { - return deep1307(x); - } - - public static boolean deep1307(boolean x) { - return deep1308(x); - } - - public static boolean deep1308(boolean x) { - return deep1309(x); - } - - public static boolean deep1309(boolean x) { - return deep1310(x); - } - - public static boolean deep1310(boolean x) { - return deep1311(x); - } - - public static boolean deep1311(boolean x) { - return deep1312(x); - } - - public static boolean deep1312(boolean x) { - return deep1313(x); - } - - public static boolean deep1313(boolean x) { - return deep1314(x); - } - - public static boolean deep1314(boolean x) { - return deep1315(x); - } - - public static boolean deep1315(boolean x) { - return deep1316(x); - } - - public static boolean deep1316(boolean x) { - return deep1317(x); - } - - public static boolean deep1317(boolean x) { - return deep1318(x); - } - - public static boolean deep1318(boolean x) { - return deep1319(x); - } - - public static boolean deep1319(boolean x) { - return deep1320(x); - } - - public static boolean deep1320(boolean x) { - return deep1321(x); - } - - public static boolean deep1321(boolean x) { - return deep1322(x); - } - - public static boolean deep1322(boolean x) { - return deep1323(x); - } - - public static boolean deep1323(boolean x) { - return deep1324(x); - } - - public static boolean deep1324(boolean x) { - return deep1325(x); - } - - public static boolean deep1325(boolean x) { - return deep1326(x); - } - - public static boolean deep1326(boolean x) { - return deep1327(x); - } - - public static boolean deep1327(boolean x) { - return deep1328(x); - } - - public static boolean deep1328(boolean x) { - return deep1329(x); - } - - public static boolean deep1329(boolean x) { - return deep1330(x); - } - - public static boolean deep1330(boolean x) { - return deep1331(x); - } - - public static boolean deep1331(boolean x) { - return deep1332(x); - } - - public static boolean deep1332(boolean x) { - return deep1333(x); - } - - public static boolean deep1333(boolean x) { - return deep1334(x); - } - - public static boolean deep1334(boolean x) { - return deep1335(x); - } - - public static boolean deep1335(boolean x) { - return deep1336(x); - } - - public static boolean deep1336(boolean x) { - return deep1337(x); - } - - public static boolean deep1337(boolean x) { - return deep1338(x); - } - - public static boolean deep1338(boolean x) { - return deep1339(x); - } - - public static boolean deep1339(boolean x) { - return deep1340(x); - } - - public static boolean deep1340(boolean x) { - return deep1341(x); - } - - public static boolean deep1341(boolean x) { - return deep1342(x); - } - - public static boolean deep1342(boolean x) { - return deep1343(x); - } - - public static boolean deep1343(boolean x) { - return deep1344(x); - } - - public static boolean deep1344(boolean x) { - return deep1345(x); - } - - public static boolean deep1345(boolean x) { - return deep1346(x); - } - - public static boolean deep1346(boolean x) { - return deep1347(x); - } - - public static boolean deep1347(boolean x) { - return deep1348(x); - } - - public static boolean deep1348(boolean x) { - return deep1349(x); - } - - public static boolean deep1349(boolean x) { - return deep1350(x); - } - - public static boolean deep1350(boolean x) { - return deep1351(x); - } - - public static boolean deep1351(boolean x) { - return deep1352(x); - } - - public static boolean deep1352(boolean x) { - return deep1353(x); - } - - public static boolean deep1353(boolean x) { - return deep1354(x); - } - - public static boolean deep1354(boolean x) { - return deep1355(x); - } - - public static boolean deep1355(boolean x) { - return deep1356(x); - } - - public static boolean deep1356(boolean x) { - return deep1357(x); - } - - public static boolean deep1357(boolean x) { - return deep1358(x); - } - - public static boolean deep1358(boolean x) { - return deep1359(x); - } - - public static boolean deep1359(boolean x) { - return deep1360(x); - } - - public static boolean deep1360(boolean x) { - return deep1361(x); - } - - public static boolean deep1361(boolean x) { - return deep1362(x); - } - - public static boolean deep1362(boolean x) { - return deep1363(x); - } - - public static boolean deep1363(boolean x) { - return deep1364(x); - } - - public static boolean deep1364(boolean x) { - return deep1365(x); - } - - public static boolean deep1365(boolean x) { - return deep1366(x); - } - - public static boolean deep1366(boolean x) { - return deep1367(x); - } - - public static boolean deep1367(boolean x) { - return deep1368(x); - } - - public static boolean deep1368(boolean x) { - return deep1369(x); - } - - public static boolean deep1369(boolean x) { - return deep1370(x); - } - - public static boolean deep1370(boolean x) { - return deep1371(x); - } - - public static boolean deep1371(boolean x) { - return deep1372(x); - } - - public static boolean deep1372(boolean x) { - return deep1373(x); - } - - public static boolean deep1373(boolean x) { - return deep1374(x); - } - - public static boolean deep1374(boolean x) { - return deep1375(x); - } - - public static boolean deep1375(boolean x) { - return deep1376(x); - } - - public static boolean deep1376(boolean x) { - return deep1377(x); - } - - public static boolean deep1377(boolean x) { - return deep1378(x); - } - - public static boolean deep1378(boolean x) { - return deep1379(x); - } - - public static boolean deep1379(boolean x) { - return deep1380(x); - } - - public static boolean deep1380(boolean x) { - return deep1381(x); - } - - public static boolean deep1381(boolean x) { - return deep1382(x); - } - - public static boolean deep1382(boolean x) { - return deep1383(x); - } - - public static boolean deep1383(boolean x) { - return deep1384(x); - } - - public static boolean deep1384(boolean x) { - return deep1385(x); - } - - public static boolean deep1385(boolean x) { - return deep1386(x); - } - - public static boolean deep1386(boolean x) { - return deep1387(x); - } - - public static boolean deep1387(boolean x) { - return deep1388(x); - } - - public static boolean deep1388(boolean x) { - return deep1389(x); - } - - public static boolean deep1389(boolean x) { - return deep1390(x); - } - - public static boolean deep1390(boolean x) { - return deep1391(x); - } - - public static boolean deep1391(boolean x) { - return deep1392(x); - } - - public static boolean deep1392(boolean x) { - return deep1393(x); - } - - public static boolean deep1393(boolean x) { - return deep1394(x); - } - - public static boolean deep1394(boolean x) { - return deep1395(x); - } - - public static boolean deep1395(boolean x) { - return deep1396(x); - } - - public static boolean deep1396(boolean x) { - return deep1397(x); - } - - public static boolean deep1397(boolean x) { - return deep1398(x); - } - - public static boolean deep1398(boolean x) { - return deep1399(x); - } - - public static boolean deep1399(boolean x) { - return deep1400(x); - } - - public static boolean deep1400(boolean x) { - return deep1401(x); - } - - public static boolean deep1401(boolean x) { - return deep1402(x); - } - - public static boolean deep1402(boolean x) { - return deep1403(x); - } - - public static boolean deep1403(boolean x) { - return deep1404(x); - } - - public static boolean deep1404(boolean x) { - return deep1405(x); - } - - public static boolean deep1405(boolean x) { - return deep1406(x); - } - - public static boolean deep1406(boolean x) { - return deep1407(x); - } - - public static boolean deep1407(boolean x) { - return deep1408(x); - } - - public static boolean deep1408(boolean x) { - return deep1409(x); - } - - public static boolean deep1409(boolean x) { - return deep1410(x); - } - - public static boolean deep1410(boolean x) { - return deep1411(x); - } - - public static boolean deep1411(boolean x) { - return deep1412(x); - } - - public static boolean deep1412(boolean x) { - return deep1413(x); - } - - public static boolean deep1413(boolean x) { - return deep1414(x); - } - - public static boolean deep1414(boolean x) { - return deep1415(x); - } - - public static boolean deep1415(boolean x) { - return deep1416(x); - } - - public static boolean deep1416(boolean x) { - return deep1417(x); - } - - public static boolean deep1417(boolean x) { - return deep1418(x); - } - - public static boolean deep1418(boolean x) { - return deep1419(x); - } - - public static boolean deep1419(boolean x) { - return deep1420(x); - } - - public static boolean deep1420(boolean x) { - return deep1421(x); - } - - public static boolean deep1421(boolean x) { - return deep1422(x); - } - - public static boolean deep1422(boolean x) { - return deep1423(x); - } - - public static boolean deep1423(boolean x) { - return deep1424(x); - } - - public static boolean deep1424(boolean x) { - return deep1425(x); - } - - public static boolean deep1425(boolean x) { - return deep1426(x); - } - - public static boolean deep1426(boolean x) { - return deep1427(x); - } - - public static boolean deep1427(boolean x) { - return deep1428(x); - } - - public static boolean deep1428(boolean x) { - return deep1429(x); - } - - public static boolean deep1429(boolean x) { - return deep1430(x); - } - - public static boolean deep1430(boolean x) { - return deep1431(x); - } - - public static boolean deep1431(boolean x) { - return deep1432(x); - } - - public static boolean deep1432(boolean x) { - return deep1433(x); - } - - public static boolean deep1433(boolean x) { - return deep1434(x); - } - - public static boolean deep1434(boolean x) { - return deep1435(x); - } - - public static boolean deep1435(boolean x) { - return deep1436(x); - } - - public static boolean deep1436(boolean x) { - return deep1437(x); - } - - public static boolean deep1437(boolean x) { - return deep1438(x); - } - - public static boolean deep1438(boolean x) { - return deep1439(x); - } - - public static boolean deep1439(boolean x) { - return deep1440(x); - } - - public static boolean deep1440(boolean x) { - return deep1441(x); - } - - public static boolean deep1441(boolean x) { - return deep1442(x); - } - - public static boolean deep1442(boolean x) { - return deep1443(x); - } - - public static boolean deep1443(boolean x) { - return deep1444(x); - } - - public static boolean deep1444(boolean x) { - return deep1445(x); - } - - public static boolean deep1445(boolean x) { - return deep1446(x); - } - - public static boolean deep1446(boolean x) { - return deep1447(x); - } - - public static boolean deep1447(boolean x) { - return deep1448(x); - } - - public static boolean deep1448(boolean x) { - return deep1449(x); - } - - public static boolean deep1449(boolean x) { - return deep1450(x); - } - - public static boolean deep1450(boolean x) { - return deep1451(x); - } - - public static boolean deep1451(boolean x) { - return deep1452(x); - } - - public static boolean deep1452(boolean x) { - return deep1453(x); - } - - public static boolean deep1453(boolean x) { - return deep1454(x); - } - - public static boolean deep1454(boolean x) { - return deep1455(x); - } - - public static boolean deep1455(boolean x) { - return deep1456(x); - } - - public static boolean deep1456(boolean x) { - return deep1457(x); - } - - public static boolean deep1457(boolean x) { - return deep1458(x); - } - - public static boolean deep1458(boolean x) { - return deep1459(x); - } - - public static boolean deep1459(boolean x) { - return deep1460(x); - } - - public static boolean deep1460(boolean x) { - return deep1461(x); - } - - public static boolean deep1461(boolean x) { - return deep1462(x); - } - - public static boolean deep1462(boolean x) { - return deep1463(x); - } - - public static boolean deep1463(boolean x) { - return deep1464(x); - } - - public static boolean deep1464(boolean x) { - return deep1465(x); - } - - public static boolean deep1465(boolean x) { - return deep1466(x); - } - - public static boolean deep1466(boolean x) { - return deep1467(x); - } - - public static boolean deep1467(boolean x) { - return deep1468(x); - } - - public static boolean deep1468(boolean x) { - return deep1469(x); - } - - public static boolean deep1469(boolean x) { - return deep1470(x); - } - - public static boolean deep1470(boolean x) { - return deep1471(x); - } - - public static boolean deep1471(boolean x) { - return deep1472(x); - } - - public static boolean deep1472(boolean x) { - return deep1473(x); - } - - public static boolean deep1473(boolean x) { - return deep1474(x); - } - - public static boolean deep1474(boolean x) { - return deep1475(x); - } - - public static boolean deep1475(boolean x) { - return deep1476(x); - } - - public static boolean deep1476(boolean x) { - return deep1477(x); - } - - public static boolean deep1477(boolean x) { - return deep1478(x); - } - - public static boolean deep1478(boolean x) { - return deep1479(x); - } - - public static boolean deep1479(boolean x) { - return deep1480(x); - } - - public static boolean deep1480(boolean x) { - return deep1481(x); - } - - public static boolean deep1481(boolean x) { - return deep1482(x); - } - - public static boolean deep1482(boolean x) { - return deep1483(x); - } - - public static boolean deep1483(boolean x) { - return deep1484(x); - } - - public static boolean deep1484(boolean x) { - return deep1485(x); - } - - public static boolean deep1485(boolean x) { - return deep1486(x); - } - - public static boolean deep1486(boolean x) { - return deep1487(x); - } - - public static boolean deep1487(boolean x) { - return deep1488(x); - } - - public static boolean deep1488(boolean x) { - return deep1489(x); - } - - public static boolean deep1489(boolean x) { - return deep1490(x); - } - - public static boolean deep1490(boolean x) { - return deep1491(x); - } - - public static boolean deep1491(boolean x) { - return deep1492(x); - } - - public static boolean deep1492(boolean x) { - return deep1493(x); - } - - public static boolean deep1493(boolean x) { - return deep1494(x); - } - - public static boolean deep1494(boolean x) { - return deep1495(x); - } - - public static boolean deep1495(boolean x) { - return deep1496(x); - } - - public static boolean deep1496(boolean x) { - return deep1497(x); - } - - public static boolean deep1497(boolean x) { - return deep1498(x); - } - - public static boolean deep1498(boolean x) { - return deep1499(x); - } - - public static boolean deep1499(boolean x) { - return deep1500(x); - } - - public static boolean deep1500(boolean x) { - return deep1501(x); - } - - public static boolean deep1501(boolean x) { - return deep1502(x); - } - - public static boolean deep1502(boolean x) { - return deep1503(x); - } - - public static boolean deep1503(boolean x) { - return deep1504(x); - } - - public static boolean deep1504(boolean x) { - return deep1505(x); - } - - public static boolean deep1505(boolean x) { - return deep1506(x); - } - - public static boolean deep1506(boolean x) { - return deep1507(x); - } - - public static boolean deep1507(boolean x) { - return deep1508(x); - } - - public static boolean deep1508(boolean x) { - return deep1509(x); - } - - public static boolean deep1509(boolean x) { - return deep1510(x); - } - - public static boolean deep1510(boolean x) { - return deep1511(x); - } - - public static boolean deep1511(boolean x) { - return deep1512(x); - } - - public static boolean deep1512(boolean x) { - return deep1513(x); - } - - public static boolean deep1513(boolean x) { - return deep1514(x); - } - - public static boolean deep1514(boolean x) { - return deep1515(x); - } - - public static boolean deep1515(boolean x) { - return deep1516(x); - } - - public static boolean deep1516(boolean x) { - return deep1517(x); - } - - public static boolean deep1517(boolean x) { - return deep1518(x); - } - - public static boolean deep1518(boolean x) { - return deep1519(x); - } - - public static boolean deep1519(boolean x) { - return deep1520(x); - } - - public static boolean deep1520(boolean x) { - return deep1521(x); - } - - public static boolean deep1521(boolean x) { - return deep1522(x); - } - - public static boolean deep1522(boolean x) { - return deep1523(x); - } - - public static boolean deep1523(boolean x) { - return deep1524(x); - } - - public static boolean deep1524(boolean x) { - return deep1525(x); - } - - public static boolean deep1525(boolean x) { - return deep1526(x); - } - - public static boolean deep1526(boolean x) { - return deep1527(x); - } - - public static boolean deep1527(boolean x) { - return deep1528(x); - } - - public static boolean deep1528(boolean x) { - return deep1529(x); - } - - public static boolean deep1529(boolean x) { - return deep1530(x); - } - - public static boolean deep1530(boolean x) { - return deep1531(x); - } - - public static boolean deep1531(boolean x) { - return deep1532(x); - } - - public static boolean deep1532(boolean x) { - return deep1533(x); - } - - public static boolean deep1533(boolean x) { - return deep1534(x); - } - - public static boolean deep1534(boolean x) { - return deep1535(x); - } - - public static boolean deep1535(boolean x) { - return deep1536(x); - } - - public static boolean deep1536(boolean x) { - return deep1537(x); - } - - public static boolean deep1537(boolean x) { - return deep1538(x); - } - - public static boolean deep1538(boolean x) { - return deep1539(x); - } - - public static boolean deep1539(boolean x) { - return deep1540(x); - } - - public static boolean deep1540(boolean x) { - return deep1541(x); - } - - public static boolean deep1541(boolean x) { - return deep1542(x); - } - - public static boolean deep1542(boolean x) { - return deep1543(x); - } - - public static boolean deep1543(boolean x) { - return deep1544(x); - } - - public static boolean deep1544(boolean x) { - return deep1545(x); - } - - public static boolean deep1545(boolean x) { - return deep1546(x); - } - - public static boolean deep1546(boolean x) { - return deep1547(x); - } - - public static boolean deep1547(boolean x) { - return deep1548(x); - } - - public static boolean deep1548(boolean x) { - return deep1549(x); - } - - public static boolean deep1549(boolean x) { - return deep1550(x); - } - - public static boolean deep1550(boolean x) { - return deep1551(x); - } - - public static boolean deep1551(boolean x) { - return deep1552(x); - } - - public static boolean deep1552(boolean x) { - return deep1553(x); - } - - public static boolean deep1553(boolean x) { - return deep1554(x); - } - - public static boolean deep1554(boolean x) { - return deep1555(x); - } - - public static boolean deep1555(boolean x) { - return deep1556(x); - } - - public static boolean deep1556(boolean x) { - return deep1557(x); - } - - public static boolean deep1557(boolean x) { - return deep1558(x); - } - - public static boolean deep1558(boolean x) { - return deep1559(x); - } - - public static boolean deep1559(boolean x) { - return deep1560(x); - } - - public static boolean deep1560(boolean x) { - return deep1561(x); - } - - public static boolean deep1561(boolean x) { - return deep1562(x); - } - - public static boolean deep1562(boolean x) { - return deep1563(x); - } - - public static boolean deep1563(boolean x) { - return deep1564(x); - } - - public static boolean deep1564(boolean x) { - return deep1565(x); - } - - public static boolean deep1565(boolean x) { - return deep1566(x); - } - - public static boolean deep1566(boolean x) { - return deep1567(x); - } - - public static boolean deep1567(boolean x) { - return deep1568(x); - } - - public static boolean deep1568(boolean x) { - return deep1569(x); - } - - public static boolean deep1569(boolean x) { - return deep1570(x); - } - - public static boolean deep1570(boolean x) { - return deep1571(x); - } - - public static boolean deep1571(boolean x) { - return deep1572(x); - } - - public static boolean deep1572(boolean x) { - return deep1573(x); - } - - public static boolean deep1573(boolean x) { - return deep1574(x); - } - - public static boolean deep1574(boolean x) { - return deep1575(x); - } - - public static boolean deep1575(boolean x) { - return deep1576(x); - } - - public static boolean deep1576(boolean x) { - return deep1577(x); - } - - public static boolean deep1577(boolean x) { - return deep1578(x); - } - - public static boolean deep1578(boolean x) { - return deep1579(x); - } - - public static boolean deep1579(boolean x) { - return deep1580(x); - } - - public static boolean deep1580(boolean x) { - return deep1581(x); - } - - public static boolean deep1581(boolean x) { - return deep1582(x); - } - - public static boolean deep1582(boolean x) { - return deep1583(x); - } - - public static boolean deep1583(boolean x) { - return deep1584(x); - } - - public static boolean deep1584(boolean x) { - return deep1585(x); - } - - public static boolean deep1585(boolean x) { - return deep1586(x); - } - - public static boolean deep1586(boolean x) { - return deep1587(x); - } - - public static boolean deep1587(boolean x) { - return deep1588(x); - } - - public static boolean deep1588(boolean x) { - return deep1589(x); - } - - public static boolean deep1589(boolean x) { - return deep1590(x); - } - - public static boolean deep1590(boolean x) { - return deep1591(x); - } - - public static boolean deep1591(boolean x) { - return deep1592(x); - } - - public static boolean deep1592(boolean x) { - return deep1593(x); - } - - public static boolean deep1593(boolean x) { - return deep1594(x); - } - - public static boolean deep1594(boolean x) { - return deep1595(x); - } - - public static boolean deep1595(boolean x) { - return deep1596(x); - } - - public static boolean deep1596(boolean x) { - return deep1597(x); - } - - public static boolean deep1597(boolean x) { - return deep1598(x); - } - - public static boolean deep1598(boolean x) { - return deep1599(x); - } - - public static boolean deep1599(boolean x) { - return deep1600(x); - } - - public static boolean deep1600(boolean x) { - return deep1601(x); - } - - public static boolean deep1601(boolean x) { - return deep1602(x); - } - - public static boolean deep1602(boolean x) { - return deep1603(x); - } - - public static boolean deep1603(boolean x) { - return deep1604(x); - } - - public static boolean deep1604(boolean x) { - return deep1605(x); - } - - public static boolean deep1605(boolean x) { - return deep1606(x); - } - - public static boolean deep1606(boolean x) { - return deep1607(x); - } - - public static boolean deep1607(boolean x) { - return deep1608(x); - } - - public static boolean deep1608(boolean x) { - return deep1609(x); - } - - public static boolean deep1609(boolean x) { - return deep1610(x); - } - - public static boolean deep1610(boolean x) { - return deep1611(x); - } - - public static boolean deep1611(boolean x) { - return deep1612(x); - } - - public static boolean deep1612(boolean x) { - return deep1613(x); - } - - public static boolean deep1613(boolean x) { - return deep1614(x); - } - - public static boolean deep1614(boolean x) { - return deep1615(x); - } - - public static boolean deep1615(boolean x) { - return deep1616(x); - } - - public static boolean deep1616(boolean x) { - return deep1617(x); - } - - public static boolean deep1617(boolean x) { - return deep1618(x); - } - - public static boolean deep1618(boolean x) { - return deep1619(x); - } - - public static boolean deep1619(boolean x) { - return deep1620(x); - } - - public static boolean deep1620(boolean x) { - return deep1621(x); - } - - public static boolean deep1621(boolean x) { - return deep1622(x); - } - - public static boolean deep1622(boolean x) { - return deep1623(x); - } - - public static boolean deep1623(boolean x) { - return deep1624(x); - } - - public static boolean deep1624(boolean x) { - return deep1625(x); - } - - public static boolean deep1625(boolean x) { - return deep1626(x); - } - - public static boolean deep1626(boolean x) { - return deep1627(x); - } - - public static boolean deep1627(boolean x) { - return deep1628(x); - } - - public static boolean deep1628(boolean x) { - return deep1629(x); - } - - public static boolean deep1629(boolean x) { - return deep1630(x); - } - - public static boolean deep1630(boolean x) { - return deep1631(x); - } - - public static boolean deep1631(boolean x) { - return deep1632(x); - } - - public static boolean deep1632(boolean x) { - return deep1633(x); - } - - public static boolean deep1633(boolean x) { - return deep1634(x); - } - - public static boolean deep1634(boolean x) { - return deep1635(x); - } - - public static boolean deep1635(boolean x) { - return deep1636(x); - } - - public static boolean deep1636(boolean x) { - return deep1637(x); - } - - public static boolean deep1637(boolean x) { - return deep1638(x); - } - - public static boolean deep1638(boolean x) { - return deep1639(x); - } - - public static boolean deep1639(boolean x) { - return deep1640(x); - } - - public static boolean deep1640(boolean x) { - return deep1641(x); - } - - public static boolean deep1641(boolean x) { - return deep1642(x); - } - - public static boolean deep1642(boolean x) { - return deep1643(x); - } - - public static boolean deep1643(boolean x) { - return deep1644(x); - } - - public static boolean deep1644(boolean x) { - return deep1645(x); - } - - public static boolean deep1645(boolean x) { - return deep1646(x); - } - - public static boolean deep1646(boolean x) { - return deep1647(x); - } - - public static boolean deep1647(boolean x) { - return deep1648(x); - } - - public static boolean deep1648(boolean x) { - return deep1649(x); - } - - public static boolean deep1649(boolean x) { - return deep1650(x); - } - - public static boolean deep1650(boolean x) { - return deep1651(x); - } - - public static boolean deep1651(boolean x) { - return deep1652(x); - } - - public static boolean deep1652(boolean x) { - return deep1653(x); - } - - public static boolean deep1653(boolean x) { - return deep1654(x); - } - - public static boolean deep1654(boolean x) { - return deep1655(x); - } - - public static boolean deep1655(boolean x) { - return deep1656(x); - } - - public static boolean deep1656(boolean x) { - return deep1657(x); - } - - public static boolean deep1657(boolean x) { - return deep1658(x); - } - - public static boolean deep1658(boolean x) { - return deep1659(x); - } - - public static boolean deep1659(boolean x) { - return deep1660(x); - } - - public static boolean deep1660(boolean x) { - return deep1661(x); - } - - public static boolean deep1661(boolean x) { - return deep1662(x); - } - - public static boolean deep1662(boolean x) { - return deep1663(x); - } - - public static boolean deep1663(boolean x) { - return deep1664(x); - } - - public static boolean deep1664(boolean x) { - return deep1665(x); - } - - public static boolean deep1665(boolean x) { - return deep1666(x); - } - - public static boolean deep1666(boolean x) { - return deep1667(x); - } - - public static boolean deep1667(boolean x) { - return deep1668(x); - } - - public static boolean deep1668(boolean x) { - return deep1669(x); - } - - public static boolean deep1669(boolean x) { - return deep1670(x); - } - - public static boolean deep1670(boolean x) { - return deep1671(x); - } - - public static boolean deep1671(boolean x) { - return deep1672(x); - } - - public static boolean deep1672(boolean x) { - return deep1673(x); - } - - public static boolean deep1673(boolean x) { - return deep1674(x); - } - - public static boolean deep1674(boolean x) { - return deep1675(x); - } - - public static boolean deep1675(boolean x) { - return deep1676(x); - } - - public static boolean deep1676(boolean x) { - return deep1677(x); - } - - public static boolean deep1677(boolean x) { - return deep1678(x); - } - - public static boolean deep1678(boolean x) { - return deep1679(x); - } - - public static boolean deep1679(boolean x) { - return deep1680(x); - } - - public static boolean deep1680(boolean x) { - return deep1681(x); - } - - public static boolean deep1681(boolean x) { - return deep1682(x); - } - - public static boolean deep1682(boolean x) { - return deep1683(x); - } - - public static boolean deep1683(boolean x) { - return deep1684(x); - } - - public static boolean deep1684(boolean x) { - return deep1685(x); - } - - public static boolean deep1685(boolean x) { - return deep1686(x); - } - - public static boolean deep1686(boolean x) { - return deep1687(x); - } - - public static boolean deep1687(boolean x) { - return deep1688(x); - } - - public static boolean deep1688(boolean x) { - return deep1689(x); - } - - public static boolean deep1689(boolean x) { - return deep1690(x); - } - - public static boolean deep1690(boolean x) { - return deep1691(x); - } - - public static boolean deep1691(boolean x) { - return deep1692(x); - } - - public static boolean deep1692(boolean x) { - return deep1693(x); - } - - public static boolean deep1693(boolean x) { - return deep1694(x); - } - - public static boolean deep1694(boolean x) { - return deep1695(x); - } - - public static boolean deep1695(boolean x) { - return deep1696(x); - } - - public static boolean deep1696(boolean x) { - return deep1697(x); - } - - public static boolean deep1697(boolean x) { - return deep1698(x); - } - - public static boolean deep1698(boolean x) { - return deep1699(x); - } - - public static boolean deep1699(boolean x) { - return deep1700(x); - } - - public static boolean deep1700(boolean x) { - return deep1701(x); - } - - public static boolean deep1701(boolean x) { - return deep1702(x); - } - - public static boolean deep1702(boolean x) { - return deep1703(x); - } - - public static boolean deep1703(boolean x) { - return deep1704(x); - } - - public static boolean deep1704(boolean x) { - return deep1705(x); - } - - public static boolean deep1705(boolean x) { - return deep1706(x); - } - - public static boolean deep1706(boolean x) { - return deep1707(x); - } - - public static boolean deep1707(boolean x) { - return deep1708(x); - } - - public static boolean deep1708(boolean x) { - return deep1709(x); - } - - public static boolean deep1709(boolean x) { - return deep1710(x); - } - - public static boolean deep1710(boolean x) { - return deep1711(x); - } - - public static boolean deep1711(boolean x) { - return deep1712(x); - } - - public static boolean deep1712(boolean x) { - return deep1713(x); - } - - public static boolean deep1713(boolean x) { - return deep1714(x); - } - - public static boolean deep1714(boolean x) { - return deep1715(x); - } - - public static boolean deep1715(boolean x) { - return deep1716(x); - } - - public static boolean deep1716(boolean x) { - return deep1717(x); - } - - public static boolean deep1717(boolean x) { - return deep1718(x); - } - - public static boolean deep1718(boolean x) { - return deep1719(x); - } - - public static boolean deep1719(boolean x) { - return deep1720(x); - } - - public static boolean deep1720(boolean x) { - return deep1721(x); - } - - public static boolean deep1721(boolean x) { - return deep1722(x); - } - - public static boolean deep1722(boolean x) { - return deep1723(x); - } - - public static boolean deep1723(boolean x) { - return deep1724(x); - } - - public static boolean deep1724(boolean x) { - return deep1725(x); - } - - public static boolean deep1725(boolean x) { - return deep1726(x); - } - - public static boolean deep1726(boolean x) { - return deep1727(x); - } - - public static boolean deep1727(boolean x) { - return deep1728(x); - } - - public static boolean deep1728(boolean x) { - return deep1729(x); - } - - public static boolean deep1729(boolean x) { - return deep1730(x); - } - - public static boolean deep1730(boolean x) { - return deep1731(x); - } - - public static boolean deep1731(boolean x) { - return deep1732(x); - } - - public static boolean deep1732(boolean x) { - return deep1733(x); - } - - public static boolean deep1733(boolean x) { - return deep1734(x); - } - - public static boolean deep1734(boolean x) { - return deep1735(x); - } - - public static boolean deep1735(boolean x) { - return deep1736(x); - } - - public static boolean deep1736(boolean x) { - return deep1737(x); - } - - public static boolean deep1737(boolean x) { - return deep1738(x); - } - - public static boolean deep1738(boolean x) { - return deep1739(x); - } - - public static boolean deep1739(boolean x) { - return deep1740(x); - } - - public static boolean deep1740(boolean x) { - return deep1741(x); - } - - public static boolean deep1741(boolean x) { - return deep1742(x); - } - - public static boolean deep1742(boolean x) { - return deep1743(x); - } - - public static boolean deep1743(boolean x) { - return deep1744(x); - } - - public static boolean deep1744(boolean x) { - return deep1745(x); - } - - public static boolean deep1745(boolean x) { - return deep1746(x); - } - - public static boolean deep1746(boolean x) { - return deep1747(x); - } - - public static boolean deep1747(boolean x) { - return deep1748(x); - } - - public static boolean deep1748(boolean x) { - return deep1749(x); - } - - public static boolean deep1749(boolean x) { - return deep1750(x); - } - - public static boolean deep1750(boolean x) { - return deep1751(x); - } - - public static boolean deep1751(boolean x) { - return deep1752(x); - } - - public static boolean deep1752(boolean x) { - return deep1753(x); - } - - public static boolean deep1753(boolean x) { - return deep1754(x); - } - - public static boolean deep1754(boolean x) { - return deep1755(x); - } - - public static boolean deep1755(boolean x) { - return deep1756(x); - } - - public static boolean deep1756(boolean x) { - return deep1757(x); - } - - public static boolean deep1757(boolean x) { - return deep1758(x); - } - - public static boolean deep1758(boolean x) { - return deep1759(x); - } - - public static boolean deep1759(boolean x) { - return deep1760(x); - } - - public static boolean deep1760(boolean x) { - return deep1761(x); - } - - public static boolean deep1761(boolean x) { - return deep1762(x); - } - - public static boolean deep1762(boolean x) { - return deep1763(x); - } - - public static boolean deep1763(boolean x) { - return deep1764(x); - } - - public static boolean deep1764(boolean x) { - return deep1765(x); - } - - public static boolean deep1765(boolean x) { - return deep1766(x); - } - - public static boolean deep1766(boolean x) { - return deep1767(x); - } - - public static boolean deep1767(boolean x) { - return deep1768(x); - } - - public static boolean deep1768(boolean x) { - return deep1769(x); - } - - public static boolean deep1769(boolean x) { - return deep1770(x); - } - - public static boolean deep1770(boolean x) { - return deep1771(x); - } - - public static boolean deep1771(boolean x) { - return deep1772(x); - } - - public static boolean deep1772(boolean x) { - return deep1773(x); - } - - public static boolean deep1773(boolean x) { - return deep1774(x); - } - - public static boolean deep1774(boolean x) { - return deep1775(x); - } - - public static boolean deep1775(boolean x) { - return deep1776(x); - } - - public static boolean deep1776(boolean x) { - return deep1777(x); - } - - public static boolean deep1777(boolean x) { - return deep1778(x); - } - - public static boolean deep1778(boolean x) { - return deep1779(x); - } - - public static boolean deep1779(boolean x) { - return deep1780(x); - } - - public static boolean deep1780(boolean x) { - return deep1781(x); - } - - public static boolean deep1781(boolean x) { - return deep1782(x); - } - - public static boolean deep1782(boolean x) { - return deep1783(x); - } - - public static boolean deep1783(boolean x) { - return deep1784(x); - } - - public static boolean deep1784(boolean x) { - return deep1785(x); - } - - public static boolean deep1785(boolean x) { - return deep1786(x); - } - - public static boolean deep1786(boolean x) { - return deep1787(x); - } - - public static boolean deep1787(boolean x) { - return deep1788(x); - } - - public static boolean deep1788(boolean x) { - return deep1789(x); - } - - public static boolean deep1789(boolean x) { - return deep1790(x); - } - - public static boolean deep1790(boolean x) { - return deep1791(x); - } - - public static boolean deep1791(boolean x) { - return deep1792(x); - } - - public static boolean deep1792(boolean x) { - return deep1793(x); - } - - public static boolean deep1793(boolean x) { - return deep1794(x); - } - - public static boolean deep1794(boolean x) { - return deep1795(x); - } - - public static boolean deep1795(boolean x) { - return deep1796(x); - } - - public static boolean deep1796(boolean x) { - return deep1797(x); - } - - public static boolean deep1797(boolean x) { - return deep1798(x); - } - - public static boolean deep1798(boolean x) { - return deep1799(x); - } - - public static boolean deep1799(boolean x) { - return deep1800(x); - } - - public static boolean deep1800(boolean x) { - return deep1801(x); - } - - public static boolean deep1801(boolean x) { - return deep1802(x); - } - - public static boolean deep1802(boolean x) { - return deep1803(x); - } - - public static boolean deep1803(boolean x) { - return deep1804(x); - } - - public static boolean deep1804(boolean x) { - return deep1805(x); - } - - public static boolean deep1805(boolean x) { - return deep1806(x); - } - - public static boolean deep1806(boolean x) { - return deep1807(x); - } - - public static boolean deep1807(boolean x) { - return deep1808(x); - } - - public static boolean deep1808(boolean x) { - return deep1809(x); - } - - public static boolean deep1809(boolean x) { - return deep1810(x); - } - - public static boolean deep1810(boolean x) { - return deep1811(x); - } - - public static boolean deep1811(boolean x) { - return deep1812(x); - } - - public static boolean deep1812(boolean x) { - return deep1813(x); - } - - public static boolean deep1813(boolean x) { - return deep1814(x); - } - - public static boolean deep1814(boolean x) { - return deep1815(x); - } - - public static boolean deep1815(boolean x) { - return deep1816(x); - } - - public static boolean deep1816(boolean x) { - return deep1817(x); - } - - public static boolean deep1817(boolean x) { - return deep1818(x); - } - - public static boolean deep1818(boolean x) { - return deep1819(x); - } - - public static boolean deep1819(boolean x) { - return deep1820(x); - } - - public static boolean deep1820(boolean x) { - return deep1821(x); - } - - public static boolean deep1821(boolean x) { - return deep1822(x); - } - - public static boolean deep1822(boolean x) { - return deep1823(x); - } - - public static boolean deep1823(boolean x) { - return deep1824(x); - } - - public static boolean deep1824(boolean x) { - return deep1825(x); - } - - public static boolean deep1825(boolean x) { - return deep1826(x); - } - - public static boolean deep1826(boolean x) { - return deep1827(x); - } - - public static boolean deep1827(boolean x) { - return deep1828(x); - } - - public static boolean deep1828(boolean x) { - return deep1829(x); - } - - public static boolean deep1829(boolean x) { - return deep1830(x); - } - - public static boolean deep1830(boolean x) { - return deep1831(x); - } - - public static boolean deep1831(boolean x) { - return deep1832(x); - } - - public static boolean deep1832(boolean x) { - return deep1833(x); - } - - public static boolean deep1833(boolean x) { - return deep1834(x); - } - - public static boolean deep1834(boolean x) { - return deep1835(x); - } - - public static boolean deep1835(boolean x) { - return deep1836(x); - } - - public static boolean deep1836(boolean x) { - return deep1837(x); - } - - public static boolean deep1837(boolean x) { - return deep1838(x); - } - - public static boolean deep1838(boolean x) { - return deep1839(x); - } - - public static boolean deep1839(boolean x) { - return deep1840(x); - } - - public static boolean deep1840(boolean x) { - return deep1841(x); - } - - public static boolean deep1841(boolean x) { - return deep1842(x); - } - - public static boolean deep1842(boolean x) { - return deep1843(x); - } - - public static boolean deep1843(boolean x) { - return deep1844(x); - } - - public static boolean deep1844(boolean x) { - return deep1845(x); - } - - public static boolean deep1845(boolean x) { - return deep1846(x); - } - - public static boolean deep1846(boolean x) { - return deep1847(x); - } - - public static boolean deep1847(boolean x) { - return deep1848(x); - } - - public static boolean deep1848(boolean x) { - return deep1849(x); - } - - public static boolean deep1849(boolean x) { - return deep1850(x); - } - - public static boolean deep1850(boolean x) { - return deep1851(x); - } - - public static boolean deep1851(boolean x) { - return deep1852(x); - } - - public static boolean deep1852(boolean x) { - return deep1853(x); - } - - public static boolean deep1853(boolean x) { - return deep1854(x); - } - - public static boolean deep1854(boolean x) { - return deep1855(x); - } - - public static boolean deep1855(boolean x) { - return deep1856(x); - } - - public static boolean deep1856(boolean x) { - return deep1857(x); - } - - public static boolean deep1857(boolean x) { - return deep1858(x); - } - - public static boolean deep1858(boolean x) { - return deep1859(x); - } - - public static boolean deep1859(boolean x) { - return deep1860(x); - } - - public static boolean deep1860(boolean x) { - return deep1861(x); - } - - public static boolean deep1861(boolean x) { - return deep1862(x); - } - - public static boolean deep1862(boolean x) { - return deep1863(x); - } - - public static boolean deep1863(boolean x) { - return deep1864(x); - } - - public static boolean deep1864(boolean x) { - return deep1865(x); - } - - public static boolean deep1865(boolean x) { - return deep1866(x); - } - - public static boolean deep1866(boolean x) { - return deep1867(x); - } - - public static boolean deep1867(boolean x) { - return deep1868(x); - } - - public static boolean deep1868(boolean x) { - return deep1869(x); - } - - public static boolean deep1869(boolean x) { - return deep1870(x); - } - - public static boolean deep1870(boolean x) { - return deep1871(x); - } - - public static boolean deep1871(boolean x) { - return deep1872(x); - } - - public static boolean deep1872(boolean x) { - return deep1873(x); - } - - public static boolean deep1873(boolean x) { - return deep1874(x); - } - - public static boolean deep1874(boolean x) { - return deep1875(x); - } - - public static boolean deep1875(boolean x) { - return deep1876(x); - } - - public static boolean deep1876(boolean x) { - return deep1877(x); - } - - public static boolean deep1877(boolean x) { - return deep1878(x); - } - - public static boolean deep1878(boolean x) { - return deep1879(x); - } - - public static boolean deep1879(boolean x) { - return deep1880(x); - } - - public static boolean deep1880(boolean x) { - return deep1881(x); - } - - public static boolean deep1881(boolean x) { - return deep1882(x); - } - - public static boolean deep1882(boolean x) { - return deep1883(x); - } - - public static boolean deep1883(boolean x) { - return deep1884(x); - } - - public static boolean deep1884(boolean x) { - return deep1885(x); - } - - public static boolean deep1885(boolean x) { - return deep1886(x); - } - - public static boolean deep1886(boolean x) { - return deep1887(x); - } - - public static boolean deep1887(boolean x) { - return deep1888(x); - } - - public static boolean deep1888(boolean x) { - return deep1889(x); - } - - public static boolean deep1889(boolean x) { - return deep1890(x); - } - - public static boolean deep1890(boolean x) { - return deep1891(x); - } - - public static boolean deep1891(boolean x) { - return deep1892(x); - } - - public static boolean deep1892(boolean x) { - return deep1893(x); - } - - public static boolean deep1893(boolean x) { - return deep1894(x); - } - - public static boolean deep1894(boolean x) { - return deep1895(x); - } - - public static boolean deep1895(boolean x) { - return deep1896(x); - } - - public static boolean deep1896(boolean x) { - return deep1897(x); - } - - public static boolean deep1897(boolean x) { - return deep1898(x); - } - - public static boolean deep1898(boolean x) { - return deep1899(x); - } - - public static boolean deep1899(boolean x) { - return deep1900(x); - } - - public static boolean deep1900(boolean x) { - return deep1901(x); - } - - public static boolean deep1901(boolean x) { - return deep1902(x); - } - - public static boolean deep1902(boolean x) { - return deep1903(x); - } - - public static boolean deep1903(boolean x) { - return deep1904(x); - } - - public static boolean deep1904(boolean x) { - return deep1905(x); - } - - public static boolean deep1905(boolean x) { - return deep1906(x); - } - - public static boolean deep1906(boolean x) { - return deep1907(x); - } - - public static boolean deep1907(boolean x) { - return deep1908(x); - } - - public static boolean deep1908(boolean x) { - return deep1909(x); - } - - public static boolean deep1909(boolean x) { - return deep1910(x); - } - - public static boolean deep1910(boolean x) { - return deep1911(x); - } - - public static boolean deep1911(boolean x) { - return deep1912(x); - } - - public static boolean deep1912(boolean x) { - return deep1913(x); - } - - public static boolean deep1913(boolean x) { - return deep1914(x); - } - - public static boolean deep1914(boolean x) { - return deep1915(x); - } - - public static boolean deep1915(boolean x) { - return deep1916(x); - } - - public static boolean deep1916(boolean x) { - return deep1917(x); - } - - public static boolean deep1917(boolean x) { - return deep1918(x); - } - - public static boolean deep1918(boolean x) { - return deep1919(x); - } - - public static boolean deep1919(boolean x) { - return deep1920(x); - } - - public static boolean deep1920(boolean x) { - return deep1921(x); - } - - public static boolean deep1921(boolean x) { - return deep1922(x); - } - - public static boolean deep1922(boolean x) { - return deep1923(x); - } - - public static boolean deep1923(boolean x) { - return deep1924(x); - } - - public static boolean deep1924(boolean x) { - return deep1925(x); - } - - public static boolean deep1925(boolean x) { - return deep1926(x); - } - - public static boolean deep1926(boolean x) { - return deep1927(x); - } - - public static boolean deep1927(boolean x) { - return deep1928(x); - } - - public static boolean deep1928(boolean x) { - return deep1929(x); - } - - public static boolean deep1929(boolean x) { - return deep1930(x); - } - - public static boolean deep1930(boolean x) { - return deep1931(x); - } - - public static boolean deep1931(boolean x) { - return deep1932(x); - } - - public static boolean deep1932(boolean x) { - return deep1933(x); - } - - public static boolean deep1933(boolean x) { - return deep1934(x); - } - - public static boolean deep1934(boolean x) { - return deep1935(x); - } - - public static boolean deep1935(boolean x) { - return deep1936(x); - } - - public static boolean deep1936(boolean x) { - return deep1937(x); - } - - public static boolean deep1937(boolean x) { - return deep1938(x); - } - - public static boolean deep1938(boolean x) { - return deep1939(x); - } - - public static boolean deep1939(boolean x) { - return deep1940(x); - } - - public static boolean deep1940(boolean x) { - return deep1941(x); - } - - public static boolean deep1941(boolean x) { - return deep1942(x); - } - - public static boolean deep1942(boolean x) { - return deep1943(x); - } - - public static boolean deep1943(boolean x) { - return deep1944(x); - } - - public static boolean deep1944(boolean x) { - return deep1945(x); - } - - public static boolean deep1945(boolean x) { - return deep1946(x); - } - - public static boolean deep1946(boolean x) { - return deep1947(x); - } - - public static boolean deep1947(boolean x) { - return deep1948(x); - } - - public static boolean deep1948(boolean x) { - return deep1949(x); - } - - public static boolean deep1949(boolean x) { - return deep1950(x); - } - - public static boolean deep1950(boolean x) { - return deep1951(x); - } - - public static boolean deep1951(boolean x) { - return deep1952(x); - } - - public static boolean deep1952(boolean x) { - return deep1953(x); - } - - public static boolean deep1953(boolean x) { - return deep1954(x); - } - - public static boolean deep1954(boolean x) { - return deep1955(x); - } - - public static boolean deep1955(boolean x) { - return deep1956(x); - } - - public static boolean deep1956(boolean x) { - return deep1957(x); - } - - public static boolean deep1957(boolean x) { - return deep1958(x); - } - - public static boolean deep1958(boolean x) { - return deep1959(x); - } - - public static boolean deep1959(boolean x) { - return deep1960(x); - } - - public static boolean deep1960(boolean x) { - return deep1961(x); - } - - public static boolean deep1961(boolean x) { - return deep1962(x); - } - - public static boolean deep1962(boolean x) { - return deep1963(x); - } - - public static boolean deep1963(boolean x) { - return deep1964(x); - } - - public static boolean deep1964(boolean x) { - return deep1965(x); - } - - public static boolean deep1965(boolean x) { - return deep1966(x); - } - - public static boolean deep1966(boolean x) { - return deep1967(x); - } - - public static boolean deep1967(boolean x) { - return deep1968(x); - } - - public static boolean deep1968(boolean x) { - return deep1969(x); - } - - public static boolean deep1969(boolean x) { - return deep1970(x); - } - - public static boolean deep1970(boolean x) { - return deep1971(x); - } - - public static boolean deep1971(boolean x) { - return deep1972(x); - } - - public static boolean deep1972(boolean x) { - return deep1973(x); - } - - public static boolean deep1973(boolean x) { - return deep1974(x); - } - - public static boolean deep1974(boolean x) { - return deep1975(x); - } - - public static boolean deep1975(boolean x) { - return deep1976(x); - } - - public static boolean deep1976(boolean x) { - return deep1977(x); - } - - public static boolean deep1977(boolean x) { - return deep1978(x); - } - - public static boolean deep1978(boolean x) { - return deep1979(x); - } - - public static boolean deep1979(boolean x) { - return deep1980(x); - } - - public static boolean deep1980(boolean x) { - return deep1981(x); - } - - public static boolean deep1981(boolean x) { - return deep1982(x); - } - - public static boolean deep1982(boolean x) { - return deep1983(x); - } - - public static boolean deep1983(boolean x) { - return deep1984(x); - } - - public static boolean deep1984(boolean x) { - return deep1985(x); - } - - public static boolean deep1985(boolean x) { - return deep1986(x); - } - - public static boolean deep1986(boolean x) { - return deep1987(x); - } - - public static boolean deep1987(boolean x) { - return deep1988(x); - } - - public static boolean deep1988(boolean x) { - return deep1989(x); - } - - public static boolean deep1989(boolean x) { - return deep1990(x); - } - - public static boolean deep1990(boolean x) { - return deep1991(x); - } - - public static boolean deep1991(boolean x) { - return deep1992(x); - } - - public static boolean deep1992(boolean x) { - return deep1993(x); - } - - public static boolean deep1993(boolean x) { - return deep1994(x); - } - - public static boolean deep1994(boolean x) { - return deep1995(x); - } - - public static boolean deep1995(boolean x) { - return deep1996(x); - } - - public static boolean deep1996(boolean x) { - return deep1997(x); - } - - public static boolean deep1997(boolean x) { - return deep1998(x); - } - - public static boolean deep1998(boolean x) { - return deep1999(x); - } - - public static boolean deep1999(boolean x) { - return deep2000(x); - } - - public static boolean deep2000(boolean x) { - return deep2001(x); - } - - public static boolean deep2001(boolean x) { - return deep2002(x); - } - - public static boolean deep2002(boolean x) { - return deep2003(x); - } - - public static boolean deep2003(boolean x) { - return deep2004(x); - } - - public static boolean deep2004(boolean x) { - return deep2005(x); - } - - public static boolean deep2005(boolean x) { - return deep2006(x); - } - - public static boolean deep2006(boolean x) { - return deep2007(x); - } - - public static boolean deep2007(boolean x) { - return deep2008(x); - } - - public static boolean deep2008(boolean x) { - return deep2009(x); - } - - public static boolean deep2009(boolean x) { - return deep2010(x); - } - - public static boolean deep2010(boolean x) { - return deep2011(x); - } - - public static boolean deep2011(boolean x) { - return deep2012(x); - } - - public static boolean deep2012(boolean x) { - return deep2013(x); - } - - public static boolean deep2013(boolean x) { - return deep2014(x); - } - - public static boolean deep2014(boolean x) { - return deep2015(x); - } - - public static boolean deep2015(boolean x) { - return deep2016(x); - } - - public static boolean deep2016(boolean x) { - return deep2017(x); - } - - public static boolean deep2017(boolean x) { - return deep2018(x); - } - - public static boolean deep2018(boolean x) { - return deep2019(x); - } - - public static boolean deep2019(boolean x) { - return deep2020(x); - } - - public static boolean deep2020(boolean x) { - return deep2021(x); - } - - public static boolean deep2021(boolean x) { - return deep2022(x); - } - - public static boolean deep2022(boolean x) { - return deep2023(x); - } - - public static boolean deep2023(boolean x) { - return deep2024(x); - } - - public static boolean deep2024(boolean x) { - return deep2025(x); - } - - public static boolean deep2025(boolean x) { - return deep2026(x); - } - - public static boolean deep2026(boolean x) { - return deep2027(x); - } - - public static boolean deep2027(boolean x) { - return deep2028(x); - } - - public static boolean deep2028(boolean x) { - return deep2029(x); - } - - public static boolean deep2029(boolean x) { - return deep2030(x); - } - - public static boolean deep2030(boolean x) { - return deep2031(x); - } - - public static boolean deep2031(boolean x) { - return deep2032(x); - } - - public static boolean deep2032(boolean x) { - return deep2033(x); - } - - public static boolean deep2033(boolean x) { - return deep2034(x); - } - - public static boolean deep2034(boolean x) { - return deep2035(x); - } - - public static boolean deep2035(boolean x) { - return deep2036(x); - } - - public static boolean deep2036(boolean x) { - return deep2037(x); - } - - public static boolean deep2037(boolean x) { - return deep2038(x); - } - - public static boolean deep2038(boolean x) { - return deep2039(x); - } - - public static boolean deep2039(boolean x) { - return deep2040(x); - } - - public static boolean deep2040(boolean x) { - return deep2041(x); - } - - public static boolean deep2041(boolean x) { - return deep2042(x); - } - - public static boolean deep2042(boolean x) { - return deep2043(x); - } - - public static boolean deep2043(boolean x) { - return deep2044(x); - } - - public static boolean deep2044(boolean x) { - return deep2045(x); - } - - public static boolean deep2045(boolean x) { - return deep2046(x); - } - - public static boolean deep2046(boolean x) { - return deep2047(x); - } - - public static boolean deep2047(boolean x) { - return deep2048(x); - } - - public static boolean deep2048(boolean x) { - return deep2049(x); - } - - public static boolean deep2049(boolean x) { - return deep2050(x); - } - - public static boolean deep2050(boolean x) { - return deep2051(x); - } - - public static boolean deep2051(boolean x) { - return deep2052(x); - } - - public static boolean deep2052(boolean x) { - return deep2053(x); - } - - public static boolean deep2053(boolean x) { - return deep2054(x); - } - - public static boolean deep2054(boolean x) { - return deep2055(x); - } - - public static boolean deep2055(boolean x) { - return deep2056(x); - } - - public static boolean deep2056(boolean x) { - return deep2057(x); - } - - public static boolean deep2057(boolean x) { - return deep2058(x); - } - - public static boolean deep2058(boolean x) { - return deep2059(x); - } - - public static boolean deep2059(boolean x) { - return deep2060(x); - } - - public static boolean deep2060(boolean x) { - return deep2061(x); - } - - public static boolean deep2061(boolean x) { - return deep2062(x); - } - - public static boolean deep2062(boolean x) { - return deep2063(x); - } - - public static boolean deep2063(boolean x) { - return deep2064(x); - } - - public static boolean deep2064(boolean x) { - return deep2065(x); - } - - public static boolean deep2065(boolean x) { - return deep2066(x); - } - - public static boolean deep2066(boolean x) { - return deep2067(x); - } - - public static boolean deep2067(boolean x) { - return deep2068(x); - } - - public static boolean deep2068(boolean x) { - return deep2069(x); - } - - public static boolean deep2069(boolean x) { - return deep2070(x); - } - - public static boolean deep2070(boolean x) { - return deep2071(x); - } - - public static boolean deep2071(boolean x) { - return deep2072(x); - } - - public static boolean deep2072(boolean x) { - return deep2073(x); - } - - public static boolean deep2073(boolean x) { - return deep2074(x); - } - - public static boolean deep2074(boolean x) { - return deep2075(x); - } - - public static boolean deep2075(boolean x) { - return deep2076(x); - } - - public static boolean deep2076(boolean x) { - return deep2077(x); - } - - public static boolean deep2077(boolean x) { - return deep2078(x); - } - - public static boolean deep2078(boolean x) { - return deep2079(x); - } - - public static boolean deep2079(boolean x) { - return deep2080(x); - } - - public static boolean deep2080(boolean x) { - return deep2081(x); - } - - public static boolean deep2081(boolean x) { - return deep2082(x); - } - - public static boolean deep2082(boolean x) { - return deep2083(x); - } - - public static boolean deep2083(boolean x) { - return deep2084(x); - } - - public static boolean deep2084(boolean x) { - return deep2085(x); - } - - public static boolean deep2085(boolean x) { - return deep2086(x); - } - - public static boolean deep2086(boolean x) { - return deep2087(x); - } - - public static boolean deep2087(boolean x) { - return deep2088(x); - } - - public static boolean deep2088(boolean x) { - return deep2089(x); - } - - public static boolean deep2089(boolean x) { - return deep2090(x); - } - - public static boolean deep2090(boolean x) { - return deep2091(x); - } - - public static boolean deep2091(boolean x) { - return deep2092(x); - } - - public static boolean deep2092(boolean x) { - return deep2093(x); - } - - public static boolean deep2093(boolean x) { - return deep2094(x); - } - - public static boolean deep2094(boolean x) { - return deep2095(x); - } - - public static boolean deep2095(boolean x) { - return deep2096(x); - } - - public static boolean deep2096(boolean x) { - return deep2097(x); - } - - public static boolean deep2097(boolean x) { - return deep2098(x); - } - - public static boolean deep2098(boolean x) { - return deep2099(x); - } - - public static boolean deep2099(boolean x) { - return deep2100(x); - } - - public static boolean deep2100(boolean x) { - return deep2101(x); - } - - public static boolean deep2101(boolean x) { - return deep2102(x); - } - - public static boolean deep2102(boolean x) { - return deep2103(x); - } - - public static boolean deep2103(boolean x) { - return deep2104(x); - } - - public static boolean deep2104(boolean x) { - return deep2105(x); - } - - public static boolean deep2105(boolean x) { - return deep2106(x); - } - - public static boolean deep2106(boolean x) { - return deep2107(x); - } - - public static boolean deep2107(boolean x) { - return deep2108(x); - } - - public static boolean deep2108(boolean x) { - return deep2109(x); - } - - public static boolean deep2109(boolean x) { - return deep2110(x); - } - - public static boolean deep2110(boolean x) { - return deep2111(x); - } - - public static boolean deep2111(boolean x) { - return deep2112(x); - } - - public static boolean deep2112(boolean x) { - return deep2113(x); - } - - public static boolean deep2113(boolean x) { - return deep2114(x); - } - - public static boolean deep2114(boolean x) { - return deep2115(x); - } - - public static boolean deep2115(boolean x) { - return deep2116(x); - } - - public static boolean deep2116(boolean x) { - return deep2117(x); - } - - public static boolean deep2117(boolean x) { - return deep2118(x); - } - - public static boolean deep2118(boolean x) { - return deep2119(x); - } - - public static boolean deep2119(boolean x) { - return deep2120(x); - } - - public static boolean deep2120(boolean x) { - return deep2121(x); - } - - public static boolean deep2121(boolean x) { - return deep2122(x); - } - - public static boolean deep2122(boolean x) { - return deep2123(x); - } - - public static boolean deep2123(boolean x) { - return deep2124(x); - } - - public static boolean deep2124(boolean x) { - return deep2125(x); - } - - public static boolean deep2125(boolean x) { - return deep2126(x); - } - - public static boolean deep2126(boolean x) { - return deep2127(x); - } - - public static boolean deep2127(boolean x) { - return deep2128(x); - } - - public static boolean deep2128(boolean x) { - return deep2129(x); - } - - public static boolean deep2129(boolean x) { - return deep2130(x); - } - - public static boolean deep2130(boolean x) { - return deep2131(x); - } - - public static boolean deep2131(boolean x) { - return deep2132(x); - } - - public static boolean deep2132(boolean x) { - return deep2133(x); - } - - public static boolean deep2133(boolean x) { - return deep2134(x); - } - - public static boolean deep2134(boolean x) { - return deep2135(x); - } - - public static boolean deep2135(boolean x) { - return deep2136(x); - } - - public static boolean deep2136(boolean x) { - return deep2137(x); - } - - public static boolean deep2137(boolean x) { - return deep2138(x); - } - - public static boolean deep2138(boolean x) { - return deep2139(x); - } - - public static boolean deep2139(boolean x) { - return deep2140(x); - } - - public static boolean deep2140(boolean x) { - return deep2141(x); - } - - public static boolean deep2141(boolean x) { - return deep2142(x); - } - - public static boolean deep2142(boolean x) { - return deep2143(x); - } - - public static boolean deep2143(boolean x) { - return deep2144(x); - } - - public static boolean deep2144(boolean x) { - return deep2145(x); - } - - public static boolean deep2145(boolean x) { - return deep2146(x); - } - - public static boolean deep2146(boolean x) { - return deep2147(x); - } - - public static boolean deep2147(boolean x) { - return deep2148(x); - } - - public static boolean deep2148(boolean x) { - return deep2149(x); - } - - public static boolean deep2149(boolean x) { - return deep2150(x); - } - - public static boolean deep2150(boolean x) { - return deep2151(x); - } - - public static boolean deep2151(boolean x) { - return deep2152(x); - } - - public static boolean deep2152(boolean x) { - return deep2153(x); - } - - public static boolean deep2153(boolean x) { - return deep2154(x); - } - - public static boolean deep2154(boolean x) { - return deep2155(x); - } - - public static boolean deep2155(boolean x) { - return deep2156(x); - } - - public static boolean deep2156(boolean x) { - return deep2157(x); - } - - public static boolean deep2157(boolean x) { - return deep2158(x); - } - - public static boolean deep2158(boolean x) { - return deep2159(x); - } - - public static boolean deep2159(boolean x) { - return deep2160(x); - } - - public static boolean deep2160(boolean x) { - return deep2161(x); - } - - public static boolean deep2161(boolean x) { - return deep2162(x); - } - - public static boolean deep2162(boolean x) { - return deep2163(x); - } - - public static boolean deep2163(boolean x) { - return deep2164(x); - } - - public static boolean deep2164(boolean x) { - return deep2165(x); - } - - public static boolean deep2165(boolean x) { - return deep2166(x); - } - - public static boolean deep2166(boolean x) { - return deep2167(x); - } - - public static boolean deep2167(boolean x) { - return deep2168(x); - } - - public static boolean deep2168(boolean x) { - return deep2169(x); - } - - public static boolean deep2169(boolean x) { - return deep2170(x); - } - - public static boolean deep2170(boolean x) { - return deep2171(x); - } - - public static boolean deep2171(boolean x) { - return deep2172(x); - } - - public static boolean deep2172(boolean x) { - return deep2173(x); - } - - public static boolean deep2173(boolean x) { - return deep2174(x); - } - - public static boolean deep2174(boolean x) { - return deep2175(x); - } - - public static boolean deep2175(boolean x) { - return deep2176(x); - } - - public static boolean deep2176(boolean x) { - return deep2177(x); - } - - public static boolean deep2177(boolean x) { - return deep2178(x); - } - - public static boolean deep2178(boolean x) { - return deep2179(x); - } - - public static boolean deep2179(boolean x) { - return deep2180(x); - } - - public static boolean deep2180(boolean x) { - return deep2181(x); - } - - public static boolean deep2181(boolean x) { - return deep2182(x); - } - - public static boolean deep2182(boolean x) { - return deep2183(x); - } - - public static boolean deep2183(boolean x) { - return deep2184(x); - } - - public static boolean deep2184(boolean x) { - return deep2185(x); - } - - public static boolean deep2185(boolean x) { - return deep2186(x); - } - - public static boolean deep2186(boolean x) { - return deep2187(x); - } - - public static boolean deep2187(boolean x) { - return deep2188(x); - } - - public static boolean deep2188(boolean x) { - return deep2189(x); - } - - public static boolean deep2189(boolean x) { - return deep2190(x); - } - - public static boolean deep2190(boolean x) { - return deep2191(x); - } - - public static boolean deep2191(boolean x) { - return deep2192(x); - } - - public static boolean deep2192(boolean x) { - return deep2193(x); - } - - public static boolean deep2193(boolean x) { - return deep2194(x); - } - - public static boolean deep2194(boolean x) { - return deep2195(x); - } - - public static boolean deep2195(boolean x) { - return deep2196(x); - } - - public static boolean deep2196(boolean x) { - return deep2197(x); - } - - public static boolean deep2197(boolean x) { - return deep2198(x); - } - - public static boolean deep2198(boolean x) { - return deep2199(x); - } - - public static boolean deep2199(boolean x) { - return deep2200(x); - } - - public static boolean deep2200(boolean x) { - return deep2201(x); - } - - public static boolean deep2201(boolean x) { - return deep2202(x); - } - - public static boolean deep2202(boolean x) { - return deep2203(x); - } - - public static boolean deep2203(boolean x) { - return deep2204(x); - } - - public static boolean deep2204(boolean x) { - return deep2205(x); - } - - public static boolean deep2205(boolean x) { - return deep2206(x); - } - - public static boolean deep2206(boolean x) { - return deep2207(x); - } - - public static boolean deep2207(boolean x) { - return deep2208(x); - } - - public static boolean deep2208(boolean x) { - return deep2209(x); - } - - public static boolean deep2209(boolean x) { - return deep2210(x); - } - - public static boolean deep2210(boolean x) { - return deep2211(x); - } - - public static boolean deep2211(boolean x) { - return deep2212(x); - } - - public static boolean deep2212(boolean x) { - return deep2213(x); - } - - public static boolean deep2213(boolean x) { - return deep2214(x); - } - - public static boolean deep2214(boolean x) { - return deep2215(x); - } - - public static boolean deep2215(boolean x) { - return deep2216(x); - } - - public static boolean deep2216(boolean x) { - return deep2217(x); - } - - public static boolean deep2217(boolean x) { - return deep2218(x); - } - - public static boolean deep2218(boolean x) { - return deep2219(x); - } - - public static boolean deep2219(boolean x) { - return deep2220(x); - } - - public static boolean deep2220(boolean x) { - return deep2221(x); - } - - public static boolean deep2221(boolean x) { - return deep2222(x); - } - - public static boolean deep2222(boolean x) { - return deep2223(x); - } - - public static boolean deep2223(boolean x) { - return deep2224(x); - } - - public static boolean deep2224(boolean x) { - return deep2225(x); - } - - public static boolean deep2225(boolean x) { - return deep2226(x); - } - - public static boolean deep2226(boolean x) { - return deep2227(x); - } - - public static boolean deep2227(boolean x) { - return deep2228(x); - } - - public static boolean deep2228(boolean x) { - return deep2229(x); - } - - public static boolean deep2229(boolean x) { - return deep2230(x); - } - - public static boolean deep2230(boolean x) { - return deep2231(x); - } - - public static boolean deep2231(boolean x) { - return deep2232(x); - } - - public static boolean deep2232(boolean x) { - return deep2233(x); - } - - public static boolean deep2233(boolean x) { - return deep2234(x); - } - - public static boolean deep2234(boolean x) { - return deep2235(x); - } - - public static boolean deep2235(boolean x) { - return deep2236(x); - } - - public static boolean deep2236(boolean x) { - return deep2237(x); - } - - public static boolean deep2237(boolean x) { - return deep2238(x); - } - - public static boolean deep2238(boolean x) { - return deep2239(x); - } - - public static boolean deep2239(boolean x) { - return deep2240(x); - } - - public static boolean deep2240(boolean x) { - return deep2241(x); - } - - public static boolean deep2241(boolean x) { - return deep2242(x); - } - - public static boolean deep2242(boolean x) { - return deep2243(x); - } - - public static boolean deep2243(boolean x) { - return deep2244(x); - } - - public static boolean deep2244(boolean x) { - return deep2245(x); - } - - public static boolean deep2245(boolean x) { - return deep2246(x); - } - - public static boolean deep2246(boolean x) { - return deep2247(x); - } - - public static boolean deep2247(boolean x) { - return deep2248(x); - } - - public static boolean deep2248(boolean x) { - return deep2249(x); - } - - public static boolean deep2249(boolean x) { - return deep2250(x); - } - - public static boolean deep2250(boolean x) { - return deep2251(x); - } - - public static boolean deep2251(boolean x) { - return deep2252(x); - } - - public static boolean deep2252(boolean x) { - return deep2253(x); - } - - public static boolean deep2253(boolean x) { - return deep2254(x); - } - - public static boolean deep2254(boolean x) { - return deep2255(x); - } - - public static boolean deep2255(boolean x) { - return deep2256(x); - } - - public static boolean deep2256(boolean x) { - return deep2257(x); - } - - public static boolean deep2257(boolean x) { - return deep2258(x); - } - - public static boolean deep2258(boolean x) { - return deep2259(x); - } - - public static boolean deep2259(boolean x) { - return deep2260(x); - } - - public static boolean deep2260(boolean x) { - return deep2261(x); - } - - public static boolean deep2261(boolean x) { - return deep2262(x); - } - - public static boolean deep2262(boolean x) { - return deep2263(x); - } - - public static boolean deep2263(boolean x) { - return deep2264(x); - } - - public static boolean deep2264(boolean x) { - return deep2265(x); - } - - public static boolean deep2265(boolean x) { - return deep2266(x); - } - - public static boolean deep2266(boolean x) { - return deep2267(x); - } - - public static boolean deep2267(boolean x) { - return deep2268(x); - } - - public static boolean deep2268(boolean x) { - return deep2269(x); - } - - public static boolean deep2269(boolean x) { - return deep2270(x); - } - - public static boolean deep2270(boolean x) { - return deep2271(x); - } - - public static boolean deep2271(boolean x) { - return deep2272(x); - } - - public static boolean deep2272(boolean x) { - return deep2273(x); - } - - public static boolean deep2273(boolean x) { - return deep2274(x); - } - - public static boolean deep2274(boolean x) { - return deep2275(x); - } - - public static boolean deep2275(boolean x) { - return deep2276(x); - } - - public static boolean deep2276(boolean x) { - return deep2277(x); - } - - public static boolean deep2277(boolean x) { - return deep2278(x); - } - - public static boolean deep2278(boolean x) { - return deep2279(x); - } - - public static boolean deep2279(boolean x) { - return deep2280(x); - } - - public static boolean deep2280(boolean x) { - return deep2281(x); - } - - public static boolean deep2281(boolean x) { - return deep2282(x); - } - - public static boolean deep2282(boolean x) { - return deep2283(x); - } - - public static boolean deep2283(boolean x) { - return deep2284(x); - } - - public static boolean deep2284(boolean x) { - return deep2285(x); - } - - public static boolean deep2285(boolean x) { - return deep2286(x); - } - - public static boolean deep2286(boolean x) { - return deep2287(x); - } - - public static boolean deep2287(boolean x) { - return deep2288(x); - } - - public static boolean deep2288(boolean x) { - return deep2289(x); - } - - public static boolean deep2289(boolean x) { - return deep2290(x); - } - - public static boolean deep2290(boolean x) { - return deep2291(x); - } - - public static boolean deep2291(boolean x) { - return deep2292(x); - } - - public static boolean deep2292(boolean x) { - return deep2293(x); - } - - public static boolean deep2293(boolean x) { - return deep2294(x); - } - - public static boolean deep2294(boolean x) { - return deep2295(x); - } - - public static boolean deep2295(boolean x) { - return deep2296(x); - } - - public static boolean deep2296(boolean x) { - return deep2297(x); - } - - public static boolean deep2297(boolean x) { - return deep2298(x); - } - - public static boolean deep2298(boolean x) { - return deep2299(x); - } - - public static boolean deep2299(boolean x) { - return deep2300(x); - } - - public static boolean deep2300(boolean x) { - return deep2301(x); - } - - public static boolean deep2301(boolean x) { - return deep2302(x); - } - - public static boolean deep2302(boolean x) { - return deep2303(x); - } - - public static boolean deep2303(boolean x) { - return deep2304(x); - } - - public static boolean deep2304(boolean x) { - return deep2305(x); - } - - public static boolean deep2305(boolean x) { - return deep2306(x); - } - - public static boolean deep2306(boolean x) { - return deep2307(x); - } - - public static boolean deep2307(boolean x) { - return deep2308(x); - } - - public static boolean deep2308(boolean x) { - return deep2309(x); - } - - public static boolean deep2309(boolean x) { - return deep2310(x); - } - - public static boolean deep2310(boolean x) { - return deep2311(x); - } - - public static boolean deep2311(boolean x) { - return deep2312(x); - } - - public static boolean deep2312(boolean x) { - return deep2313(x); - } - - public static boolean deep2313(boolean x) { - return deep2314(x); - } - - public static boolean deep2314(boolean x) { - return deep2315(x); - } - - public static boolean deep2315(boolean x) { - return deep2316(x); - } - - public static boolean deep2316(boolean x) { - return deep2317(x); - } - - public static boolean deep2317(boolean x) { - return deep2318(x); - } - - public static boolean deep2318(boolean x) { - return deep2319(x); - } - - public static boolean deep2319(boolean x) { - return deep2320(x); - } - - public static boolean deep2320(boolean x) { - return deep2321(x); - } - - public static boolean deep2321(boolean x) { - return deep2322(x); - } - - public static boolean deep2322(boolean x) { - return deep2323(x); - } - - public static boolean deep2323(boolean x) { - return deep2324(x); - } - - public static boolean deep2324(boolean x) { - return deep2325(x); - } - - public static boolean deep2325(boolean x) { - return deep2326(x); - } - - public static boolean deep2326(boolean x) { - return deep2327(x); - } - - public static boolean deep2327(boolean x) { - return deep2328(x); - } - - public static boolean deep2328(boolean x) { - return deep2329(x); - } - - public static boolean deep2329(boolean x) { - return deep2330(x); - } - - public static boolean deep2330(boolean x) { - return deep2331(x); - } - - public static boolean deep2331(boolean x) { - return deep2332(x); - } - - public static boolean deep2332(boolean x) { - return deep2333(x); - } - - public static boolean deep2333(boolean x) { - return deep2334(x); - } - - public static boolean deep2334(boolean x) { - return deep2335(x); - } - - public static boolean deep2335(boolean x) { - return deep2336(x); - } - - public static boolean deep2336(boolean x) { - return deep2337(x); - } - - public static boolean deep2337(boolean x) { - return deep2338(x); - } - - public static boolean deep2338(boolean x) { - return deep2339(x); - } - - public static boolean deep2339(boolean x) { - return deep2340(x); - } - - public static boolean deep2340(boolean x) { - return deep2341(x); - } - - public static boolean deep2341(boolean x) { - return deep2342(x); - } - - public static boolean deep2342(boolean x) { - return deep2343(x); - } - - public static boolean deep2343(boolean x) { - return deep2344(x); - } - - public static boolean deep2344(boolean x) { - return deep2345(x); - } - - public static boolean deep2345(boolean x) { - return deep2346(x); - } - - public static boolean deep2346(boolean x) { - return deep2347(x); - } - - public static boolean deep2347(boolean x) { - return deep2348(x); - } - - public static boolean deep2348(boolean x) { - return deep2349(x); - } - - public static boolean deep2349(boolean x) { - return deep2350(x); - } - - public static boolean deep2350(boolean x) { - return deep2351(x); - } - - public static boolean deep2351(boolean x) { - return deep2352(x); - } - - public static boolean deep2352(boolean x) { - return deep2353(x); - } - - public static boolean deep2353(boolean x) { - return deep2354(x); - } - - public static boolean deep2354(boolean x) { - return deep2355(x); - } - - public static boolean deep2355(boolean x) { - return deep2356(x); - } - - public static boolean deep2356(boolean x) { - return deep2357(x); - } - - public static boolean deep2357(boolean x) { - return deep2358(x); - } - - public static boolean deep2358(boolean x) { - return deep2359(x); - } - - public static boolean deep2359(boolean x) { - return deep2360(x); - } - - public static boolean deep2360(boolean x) { - return deep2361(x); - } - - public static boolean deep2361(boolean x) { - return deep2362(x); - } - - public static boolean deep2362(boolean x) { - return deep2363(x); - } - - public static boolean deep2363(boolean x) { - return deep2364(x); - } - - public static boolean deep2364(boolean x) { - return deep2365(x); - } - - public static boolean deep2365(boolean x) { - return deep2366(x); - } - - public static boolean deep2366(boolean x) { - return deep2367(x); - } - - public static boolean deep2367(boolean x) { - return deep2368(x); - } - - public static boolean deep2368(boolean x) { - return deep2369(x); - } - - public static boolean deep2369(boolean x) { - return deep2370(x); - } - - public static boolean deep2370(boolean x) { - return deep2371(x); - } - - public static boolean deep2371(boolean x) { - return deep2372(x); - } - - public static boolean deep2372(boolean x) { - return deep2373(x); - } - - public static boolean deep2373(boolean x) { - return deep2374(x); - } - - public static boolean deep2374(boolean x) { - return deep2375(x); - } - - public static boolean deep2375(boolean x) { - return deep2376(x); - } - - public static boolean deep2376(boolean x) { - return deep2377(x); - } - - public static boolean deep2377(boolean x) { - return deep2378(x); - } - - public static boolean deep2378(boolean x) { - return deep2379(x); - } - - public static boolean deep2379(boolean x) { - return deep2380(x); - } - - public static boolean deep2380(boolean x) { - return deep2381(x); - } - - public static boolean deep2381(boolean x) { - return deep2382(x); - } - - public static boolean deep2382(boolean x) { - return deep2383(x); - } - - public static boolean deep2383(boolean x) { - return deep2384(x); - } - - public static boolean deep2384(boolean x) { - return deep2385(x); - } - - public static boolean deep2385(boolean x) { - return deep2386(x); - } - - public static boolean deep2386(boolean x) { - return deep2387(x); - } - - public static boolean deep2387(boolean x) { - return deep2388(x); - } - - public static boolean deep2388(boolean x) { - return deep2389(x); - } - - public static boolean deep2389(boolean x) { - return deep2390(x); - } - - public static boolean deep2390(boolean x) { - return deep2391(x); - } - - public static boolean deep2391(boolean x) { - return deep2392(x); - } - - public static boolean deep2392(boolean x) { - return deep2393(x); - } - - public static boolean deep2393(boolean x) { - return deep2394(x); - } - - public static boolean deep2394(boolean x) { - return deep2395(x); - } - - public static boolean deep2395(boolean x) { - return deep2396(x); - } - - public static boolean deep2396(boolean x) { - return deep2397(x); - } - - public static boolean deep2397(boolean x) { - return deep2398(x); - } - - public static boolean deep2398(boolean x) { - return deep2399(x); - } - - public static boolean deep2399(boolean x) { - return deep2400(x); - } - - public static boolean deep2400(boolean x) { - return deep2401(x); - } - - public static boolean deep2401(boolean x) { - return deep2402(x); - } - - public static boolean deep2402(boolean x) { - return deep2403(x); - } - - public static boolean deep2403(boolean x) { - return deep2404(x); - } - - public static boolean deep2404(boolean x) { - return deep2405(x); - } - - public static boolean deep2405(boolean x) { - return deep2406(x); - } - - public static boolean deep2406(boolean x) { - return deep2407(x); - } - - public static boolean deep2407(boolean x) { - return deep2408(x); - } - - public static boolean deep2408(boolean x) { - return deep2409(x); - } - - public static boolean deep2409(boolean x) { - return deep2410(x); - } - - public static boolean deep2410(boolean x) { - return deep2411(x); - } - - public static boolean deep2411(boolean x) { - return deep2412(x); - } - - public static boolean deep2412(boolean x) { - return deep2413(x); - } - - public static boolean deep2413(boolean x) { - return deep2414(x); - } - - public static boolean deep2414(boolean x) { - return deep2415(x); - } - - public static boolean deep2415(boolean x) { - return deep2416(x); - } - - public static boolean deep2416(boolean x) { - return deep2417(x); - } - - public static boolean deep2417(boolean x) { - return deep2418(x); - } - - public static boolean deep2418(boolean x) { - return deep2419(x); - } - - public static boolean deep2419(boolean x) { - return deep2420(x); - } - - public static boolean deep2420(boolean x) { - return deep2421(x); - } - - public static boolean deep2421(boolean x) { - return deep2422(x); - } - - public static boolean deep2422(boolean x) { - return deep2423(x); - } - - public static boolean deep2423(boolean x) { - return deep2424(x); - } - - public static boolean deep2424(boolean x) { - return deep2425(x); - } - - public static boolean deep2425(boolean x) { - return deep2426(x); - } - - public static boolean deep2426(boolean x) { - return deep2427(x); - } - - public static boolean deep2427(boolean x) { - return deep2428(x); - } - - public static boolean deep2428(boolean x) { - return deep2429(x); - } - - public static boolean deep2429(boolean x) { - return deep2430(x); - } - - public static boolean deep2430(boolean x) { - return deep2431(x); - } - - public static boolean deep2431(boolean x) { - return deep2432(x); - } - - public static boolean deep2432(boolean x) { - return deep2433(x); - } - - public static boolean deep2433(boolean x) { - return deep2434(x); - } - - public static boolean deep2434(boolean x) { - return deep2435(x); - } - - public static boolean deep2435(boolean x) { - return deep2436(x); - } - - public static boolean deep2436(boolean x) { - return deep2437(x); - } - - public static boolean deep2437(boolean x) { - return deep2438(x); - } - - public static boolean deep2438(boolean x) { - return deep2439(x); - } - - public static boolean deep2439(boolean x) { - return deep2440(x); - } - - public static boolean deep2440(boolean x) { - return deep2441(x); - } - - public static boolean deep2441(boolean x) { - return deep2442(x); - } - - public static boolean deep2442(boolean x) { - return deep2443(x); - } - - public static boolean deep2443(boolean x) { - return deep2444(x); - } - - public static boolean deep2444(boolean x) { - return deep2445(x); - } - - public static boolean deep2445(boolean x) { - return deep2446(x); - } - - public static boolean deep2446(boolean x) { - return deep2447(x); - } - - public static boolean deep2447(boolean x) { - return deep2448(x); - } - - public static boolean deep2448(boolean x) { - return deep2449(x); - } - - public static boolean deep2449(boolean x) { - return deep2450(x); - } - - public static boolean deep2450(boolean x) { - return deep2451(x); - } - - public static boolean deep2451(boolean x) { - return deep2452(x); - } - - public static boolean deep2452(boolean x) { - return deep2453(x); - } - - public static boolean deep2453(boolean x) { - return deep2454(x); - } - - public static boolean deep2454(boolean x) { - return deep2455(x); - } - - public static boolean deep2455(boolean x) { - return deep2456(x); - } - - public static boolean deep2456(boolean x) { - return deep2457(x); - } - - public static boolean deep2457(boolean x) { - return deep2458(x); - } - - public static boolean deep2458(boolean x) { - return deep2459(x); - } - - public static boolean deep2459(boolean x) { - return deep2460(x); - } - - public static boolean deep2460(boolean x) { - return deep2461(x); - } - - public static boolean deep2461(boolean x) { - return deep2462(x); - } - - public static boolean deep2462(boolean x) { - return deep2463(x); - } - - public static boolean deep2463(boolean x) { - return deep2464(x); - } - - public static boolean deep2464(boolean x) { - return deep2465(x); - } - - public static boolean deep2465(boolean x) { - return deep2466(x); - } - - public static boolean deep2466(boolean x) { - return deep2467(x); - } - - public static boolean deep2467(boolean x) { - return deep2468(x); - } - - public static boolean deep2468(boolean x) { - return deep2469(x); - } - - public static boolean deep2469(boolean x) { - return deep2470(x); - } - - public static boolean deep2470(boolean x) { - return deep2471(x); - } - - public static boolean deep2471(boolean x) { - return deep2472(x); - } - - public static boolean deep2472(boolean x) { - return deep2473(x); - } - - public static boolean deep2473(boolean x) { - return deep2474(x); - } - - public static boolean deep2474(boolean x) { - return deep2475(x); - } - - public static boolean deep2475(boolean x) { - return deep2476(x); - } - - public static boolean deep2476(boolean x) { - return deep2477(x); - } - - public static boolean deep2477(boolean x) { - return deep2478(x); - } - - public static boolean deep2478(boolean x) { - return deep2479(x); - } - - public static boolean deep2479(boolean x) { - return deep2480(x); - } - - public static boolean deep2480(boolean x) { - return deep2481(x); - } - - public static boolean deep2481(boolean x) { - return deep2482(x); - } - - public static boolean deep2482(boolean x) { - return deep2483(x); - } - - public static boolean deep2483(boolean x) { - return deep2484(x); - } - - public static boolean deep2484(boolean x) { - return deep2485(x); - } - - public static boolean deep2485(boolean x) { - return deep2486(x); - } - - public static boolean deep2486(boolean x) { - return deep2487(x); - } - - public static boolean deep2487(boolean x) { - return deep2488(x); - } - - public static boolean deep2488(boolean x) { - return deep2489(x); - } - - public static boolean deep2489(boolean x) { - return deep2490(x); - } - - public static boolean deep2490(boolean x) { - return deep2491(x); - } - - public static boolean deep2491(boolean x) { - return deep2492(x); - } - - public static boolean deep2492(boolean x) { - return deep2493(x); - } - - public static boolean deep2493(boolean x) { - return deep2494(x); - } - - public static boolean deep2494(boolean x) { - return deep2495(x); - } - - public static boolean deep2495(boolean x) { - return deep2496(x); - } - - public static boolean deep2496(boolean x) { - return deep2497(x); - } - - public static boolean deep2497(boolean x) { - return deep2498(x); - } - - public static boolean deep2498(boolean x) { - return deep2499(x); - } - - public static boolean deep2499(boolean x) { - return deep2500(x); - } - - public static boolean deep2500(boolean x) { - return deep2501(x); - } - - public static boolean deep2501(boolean x) { - return deep2502(x); - } - - public static boolean deep2502(boolean x) { - return deep2503(x); - } - - public static boolean deep2503(boolean x) { - return deep2504(x); - } - - public static boolean deep2504(boolean x) { - return deep2505(x); - } - - public static boolean deep2505(boolean x) { - return deep2506(x); - } - - public static boolean deep2506(boolean x) { - return deep2507(x); - } - - public static boolean deep2507(boolean x) { - return deep2508(x); - } - - public static boolean deep2508(boolean x) { - return deep2509(x); - } - - public static boolean deep2509(boolean x) { - return deep2510(x); - } - - public static boolean deep2510(boolean x) { - return deep2511(x); - } - - public static boolean deep2511(boolean x) { - return deep2512(x); - } - - public static boolean deep2512(boolean x) { - return deep2513(x); - } - - public static boolean deep2513(boolean x) { - return deep2514(x); - } - - public static boolean deep2514(boolean x) { - return deep2515(x); - } - - public static boolean deep2515(boolean x) { - return deep2516(x); - } - - public static boolean deep2516(boolean x) { - return deep2517(x); - } - - public static boolean deep2517(boolean x) { - return deep2518(x); - } - - public static boolean deep2518(boolean x) { - return deep2519(x); - } - - public static boolean deep2519(boolean x) { - return deep2520(x); - } - - public static boolean deep2520(boolean x) { - return deep2521(x); - } - - public static boolean deep2521(boolean x) { - return deep2522(x); - } - - public static boolean deep2522(boolean x) { - return deep2523(x); - } - - public static boolean deep2523(boolean x) { - return deep2524(x); - } - - public static boolean deep2524(boolean x) { - return deep2525(x); - } - - public static boolean deep2525(boolean x) { - return deep2526(x); - } - - public static boolean deep2526(boolean x) { - return deep2527(x); - } - - public static boolean deep2527(boolean x) { - return deep2528(x); - } - - public static boolean deep2528(boolean x) { - return deep2529(x); - } - - public static boolean deep2529(boolean x) { - return deep2530(x); - } - - public static boolean deep2530(boolean x) { - return deep2531(x); - } - - public static boolean deep2531(boolean x) { - return deep2532(x); - } - - public static boolean deep2532(boolean x) { - return deep2533(x); - } - - public static boolean deep2533(boolean x) { - return deep2534(x); - } - - public static boolean deep2534(boolean x) { - return deep2535(x); - } - - public static boolean deep2535(boolean x) { - return deep2536(x); - } - - public static boolean deep2536(boolean x) { - return deep2537(x); - } - - public static boolean deep2537(boolean x) { - return deep2538(x); - } - - public static boolean deep2538(boolean x) { - return deep2539(x); - } - - public static boolean deep2539(boolean x) { - return deep2540(x); - } - - public static boolean deep2540(boolean x) { - return deep2541(x); - } - - public static boolean deep2541(boolean x) { - return deep2542(x); - } - - public static boolean deep2542(boolean x) { - return deep2543(x); - } - - public static boolean deep2543(boolean x) { - return deep2544(x); - } - - public static boolean deep2544(boolean x) { - return deep2545(x); - } - - public static boolean deep2545(boolean x) { - return deep2546(x); - } - - public static boolean deep2546(boolean x) { - return deep2547(x); - } - - public static boolean deep2547(boolean x) { - return deep2548(x); - } - - public static boolean deep2548(boolean x) { - return deep2549(x); - } - - public static boolean deep2549(boolean x) { - return deep2550(x); - } - - public static boolean deep2550(boolean x) { - return deep2551(x); - } - - public static boolean deep2551(boolean x) { - return deep2552(x); - } - - public static boolean deep2552(boolean x) { - return deep2553(x); - } - - public static boolean deep2553(boolean x) { - return deep2554(x); - } - - public static boolean deep2554(boolean x) { - return deep2555(x); - } - - public static boolean deep2555(boolean x) { - return deep2556(x); - } - - public static boolean deep2556(boolean x) { - return deep2557(x); - } - - public static boolean deep2557(boolean x) { - return deep2558(x); - } - - public static boolean deep2558(boolean x) { - return deep2559(x); - } - - public static boolean deep2559(boolean x) { - return deep2560(x); - } - - public static boolean deep2560(boolean x) { - return deep2561(x); - } - - public static boolean deep2561(boolean x) { - return deep2562(x); - } - - public static boolean deep2562(boolean x) { - return deep2563(x); - } - - public static boolean deep2563(boolean x) { - return deep2564(x); - } - - public static boolean deep2564(boolean x) { - return deep2565(x); - } - - public static boolean deep2565(boolean x) { - return deep2566(x); - } - - public static boolean deep2566(boolean x) { - return deep2567(x); - } - - public static boolean deep2567(boolean x) { - return deep2568(x); - } - - public static boolean deep2568(boolean x) { - return deep2569(x); - } - - public static boolean deep2569(boolean x) { - return deep2570(x); - } - - public static boolean deep2570(boolean x) { - return deep2571(x); - } - - public static boolean deep2571(boolean x) { - return deep2572(x); - } - - public static boolean deep2572(boolean x) { - return deep2573(x); - } - - public static boolean deep2573(boolean x) { - return deep2574(x); - } - - public static boolean deep2574(boolean x) { - return deep2575(x); - } - - public static boolean deep2575(boolean x) { - return deep2576(x); - } - - public static boolean deep2576(boolean x) { - return deep2577(x); - } - - public static boolean deep2577(boolean x) { - return deep2578(x); - } - - public static boolean deep2578(boolean x) { - return deep2579(x); - } - - public static boolean deep2579(boolean x) { - return deep2580(x); - } - - public static boolean deep2580(boolean x) { - return deep2581(x); - } - - public static boolean deep2581(boolean x) { - return deep2582(x); - } - - public static boolean deep2582(boolean x) { - return deep2583(x); - } - - public static boolean deep2583(boolean x) { - return deep2584(x); - } - - public static boolean deep2584(boolean x) { - return deep2585(x); - } - - public static boolean deep2585(boolean x) { - return deep2586(x); - } - - public static boolean deep2586(boolean x) { - return deep2587(x); - } - - public static boolean deep2587(boolean x) { - return deep2588(x); - } - - public static boolean deep2588(boolean x) { - return deep2589(x); - } - - public static boolean deep2589(boolean x) { - return deep2590(x); - } - - public static boolean deep2590(boolean x) { - return deep2591(x); - } - - public static boolean deep2591(boolean x) { - return deep2592(x); - } - - public static boolean deep2592(boolean x) { - return deep2593(x); - } - - public static boolean deep2593(boolean x) { - return deep2594(x); - } - - public static boolean deep2594(boolean x) { - return deep2595(x); - } - - public static boolean deep2595(boolean x) { - return deep2596(x); - } - - public static boolean deep2596(boolean x) { - return deep2597(x); - } - - public static boolean deep2597(boolean x) { - return deep2598(x); - } - - public static boolean deep2598(boolean x) { - return deep2599(x); - } - - public static boolean deep2599(boolean x) { - return deep2600(x); - } - - public static boolean deep2600(boolean x) { - return deep2601(x); - } - - public static boolean deep2601(boolean x) { - return deep2602(x); - } - - public static boolean deep2602(boolean x) { - return deep2603(x); - } - - public static boolean deep2603(boolean x) { - return deep2604(x); - } - - public static boolean deep2604(boolean x) { - return deep2605(x); - } - - public static boolean deep2605(boolean x) { - return deep2606(x); - } - - public static boolean deep2606(boolean x) { - return deep2607(x); - } - - public static boolean deep2607(boolean x) { - return deep2608(x); - } - - public static boolean deep2608(boolean x) { - return deep2609(x); - } - - public static boolean deep2609(boolean x) { - return deep2610(x); - } - - public static boolean deep2610(boolean x) { - return deep2611(x); - } - - public static boolean deep2611(boolean x) { - return deep2612(x); - } - - public static boolean deep2612(boolean x) { - return deep2613(x); - } - - public static boolean deep2613(boolean x) { - return deep2614(x); - } - - public static boolean deep2614(boolean x) { - return deep2615(x); - } - - public static boolean deep2615(boolean x) { - return deep2616(x); - } - - public static boolean deep2616(boolean x) { - return deep2617(x); - } - - public static boolean deep2617(boolean x) { - return deep2618(x); - } - - public static boolean deep2618(boolean x) { - return deep2619(x); - } - - public static boolean deep2619(boolean x) { - return deep2620(x); - } - - public static boolean deep2620(boolean x) { - return deep2621(x); - } - - public static boolean deep2621(boolean x) { - return deep2622(x); - } - - public static boolean deep2622(boolean x) { - return deep2623(x); - } - - public static boolean deep2623(boolean x) { - return deep2624(x); - } - - public static boolean deep2624(boolean x) { - return deep2625(x); - } - - public static boolean deep2625(boolean x) { - return deep2626(x); - } - - public static boolean deep2626(boolean x) { - return deep2627(x); - } - - public static boolean deep2627(boolean x) { - return deep2628(x); - } - - public static boolean deep2628(boolean x) { - return deep2629(x); - } - - public static boolean deep2629(boolean x) { - return deep2630(x); - } - - public static boolean deep2630(boolean x) { - return deep2631(x); - } - - public static boolean deep2631(boolean x) { - return deep2632(x); - } - - public static boolean deep2632(boolean x) { - return deep2633(x); - } - - public static boolean deep2633(boolean x) { - return deep2634(x); - } - - public static boolean deep2634(boolean x) { - return deep2635(x); - } - - public static boolean deep2635(boolean x) { - return deep2636(x); - } - - public static boolean deep2636(boolean x) { - return deep2637(x); - } - - public static boolean deep2637(boolean x) { - return deep2638(x); - } - - public static boolean deep2638(boolean x) { - return deep2639(x); - } - - public static boolean deep2639(boolean x) { - return deep2640(x); - } - - public static boolean deep2640(boolean x) { - return deep2641(x); - } - - public static boolean deep2641(boolean x) { - return deep2642(x); - } - - public static boolean deep2642(boolean x) { - return deep2643(x); - } - - public static boolean deep2643(boolean x) { - return deep2644(x); - } - - public static boolean deep2644(boolean x) { - return deep2645(x); - } - - public static boolean deep2645(boolean x) { - return deep2646(x); - } - - public static boolean deep2646(boolean x) { - return deep2647(x); - } - - public static boolean deep2647(boolean x) { - return deep2648(x); - } - - public static boolean deep2648(boolean x) { - return deep2649(x); - } - - public static boolean deep2649(boolean x) { - return deep2650(x); - } - - public static boolean deep2650(boolean x) { - return deep2651(x); - } - - public static boolean deep2651(boolean x) { - return deep2652(x); - } - - public static boolean deep2652(boolean x) { - return deep2653(x); - } - - public static boolean deep2653(boolean x) { - return deep2654(x); - } - - public static boolean deep2654(boolean x) { - return deep2655(x); - } - - public static boolean deep2655(boolean x) { - return deep2656(x); - } - - public static boolean deep2656(boolean x) { - return deep2657(x); - } - - public static boolean deep2657(boolean x) { - return deep2658(x); - } - - public static boolean deep2658(boolean x) { - return deep2659(x); - } - - public static boolean deep2659(boolean x) { - return deep2660(x); - } - - public static boolean deep2660(boolean x) { - return deep2661(x); - } - - public static boolean deep2661(boolean x) { - return deep2662(x); - } - - public static boolean deep2662(boolean x) { - return deep2663(x); - } - - public static boolean deep2663(boolean x) { - return deep2664(x); - } - - public static boolean deep2664(boolean x) { - return deep2665(x); - } - - public static boolean deep2665(boolean x) { - return deep2666(x); - } - - public static boolean deep2666(boolean x) { - return deep2667(x); - } - - public static boolean deep2667(boolean x) { - return deep2668(x); - } - - public static boolean deep2668(boolean x) { - return deep2669(x); - } - - public static boolean deep2669(boolean x) { - return deep2670(x); - } - - public static boolean deep2670(boolean x) { - return deep2671(x); - } - - public static boolean deep2671(boolean x) { - return deep2672(x); - } - - public static boolean deep2672(boolean x) { - return deep2673(x); - } - - public static boolean deep2673(boolean x) { - return deep2674(x); - } - - public static boolean deep2674(boolean x) { - return deep2675(x); - } - - public static boolean deep2675(boolean x) { - return deep2676(x); - } - - public static boolean deep2676(boolean x) { - return deep2677(x); - } - - public static boolean deep2677(boolean x) { - return deep2678(x); - } - - public static boolean deep2678(boolean x) { - return deep2679(x); - } - - public static boolean deep2679(boolean x) { - return deep2680(x); - } - - public static boolean deep2680(boolean x) { - return deep2681(x); - } - - public static boolean deep2681(boolean x) { - return deep2682(x); - } - - public static boolean deep2682(boolean x) { - return deep2683(x); - } - - public static boolean deep2683(boolean x) { - return deep2684(x); - } - - public static boolean deep2684(boolean x) { - return deep2685(x); - } - - public static boolean deep2685(boolean x) { - return deep2686(x); - } - - public static boolean deep2686(boolean x) { - return deep2687(x); - } - - public static boolean deep2687(boolean x) { - return deep2688(x); - } - - public static boolean deep2688(boolean x) { - return deep2689(x); - } - - public static boolean deep2689(boolean x) { - return deep2690(x); - } - - public static boolean deep2690(boolean x) { - return deep2691(x); - } - - public static boolean deep2691(boolean x) { - return deep2692(x); - } - - public static boolean deep2692(boolean x) { - return deep2693(x); - } - - public static boolean deep2693(boolean x) { - return deep2694(x); - } - - public static boolean deep2694(boolean x) { - return deep2695(x); - } - - public static boolean deep2695(boolean x) { - return deep2696(x); - } - - public static boolean deep2696(boolean x) { - return deep2697(x); - } - - public static boolean deep2697(boolean x) { - return deep2698(x); - } - - public static boolean deep2698(boolean x) { - return deep2699(x); - } - - public static boolean deep2699(boolean x) { - return deep2700(x); - } - - public static boolean deep2700(boolean x) { - return deep2701(x); - } - - public static boolean deep2701(boolean x) { - return deep2702(x); - } - - public static boolean deep2702(boolean x) { - return deep2703(x); - } - - public static boolean deep2703(boolean x) { - return deep2704(x); - } - - public static boolean deep2704(boolean x) { - return deep2705(x); - } - - public static boolean deep2705(boolean x) { - return deep2706(x); - } - - public static boolean deep2706(boolean x) { - return deep2707(x); - } - - public static boolean deep2707(boolean x) { - return deep2708(x); - } - - public static boolean deep2708(boolean x) { - return deep2709(x); - } - - public static boolean deep2709(boolean x) { - return deep2710(x); - } - - public static boolean deep2710(boolean x) { - return deep2711(x); - } - - public static boolean deep2711(boolean x) { - return deep2712(x); - } - - public static boolean deep2712(boolean x) { - return deep2713(x); - } - - public static boolean deep2713(boolean x) { - return deep2714(x); - } - - public static boolean deep2714(boolean x) { - return deep2715(x); - } - - public static boolean deep2715(boolean x) { - return deep2716(x); - } - - public static boolean deep2716(boolean x) { - return deep2717(x); - } - - public static boolean deep2717(boolean x) { - return deep2718(x); - } - - public static boolean deep2718(boolean x) { - return deep2719(x); - } - - public static boolean deep2719(boolean x) { - return deep2720(x); - } - - public static boolean deep2720(boolean x) { - return deep2721(x); - } - - public static boolean deep2721(boolean x) { - return deep2722(x); - } - - public static boolean deep2722(boolean x) { - return deep2723(x); - } - - public static boolean deep2723(boolean x) { - return deep2724(x); - } - - public static boolean deep2724(boolean x) { - return deep2725(x); - } - - public static boolean deep2725(boolean x) { - return deep2726(x); - } - - public static boolean deep2726(boolean x) { - return deep2727(x); - } - - public static boolean deep2727(boolean x) { - return deep2728(x); - } - - public static boolean deep2728(boolean x) { - return deep2729(x); - } - - public static boolean deep2729(boolean x) { - return deep2730(x); - } - - public static boolean deep2730(boolean x) { - return deep2731(x); - } - - public static boolean deep2731(boolean x) { - return deep2732(x); - } - - public static boolean deep2732(boolean x) { - return deep2733(x); - } - - public static boolean deep2733(boolean x) { - return deep2734(x); - } - - public static boolean deep2734(boolean x) { - return deep2735(x); - } - - public static boolean deep2735(boolean x) { - return deep2736(x); - } - - public static boolean deep2736(boolean x) { - return deep2737(x); - } - - public static boolean deep2737(boolean x) { - return deep2738(x); - } - - public static boolean deep2738(boolean x) { - return deep2739(x); - } - - public static boolean deep2739(boolean x) { - return deep2740(x); - } - - public static boolean deep2740(boolean x) { - return deep2741(x); - } - - public static boolean deep2741(boolean x) { - return deep2742(x); - } - - public static boolean deep2742(boolean x) { - return deep2743(x); - } - - public static boolean deep2743(boolean x) { - return deep2744(x); - } - - public static boolean deep2744(boolean x) { - return deep2745(x); - } - - public static boolean deep2745(boolean x) { - return deep2746(x); - } - - public static boolean deep2746(boolean x) { - return deep2747(x); - } - - public static boolean deep2747(boolean x) { - return deep2748(x); - } - - public static boolean deep2748(boolean x) { - return deep2749(x); - } - - public static boolean deep2749(boolean x) { - return deep2750(x); - } - - public static boolean deep2750(boolean x) { - return deep2751(x); - } - - public static boolean deep2751(boolean x) { - return deep2752(x); - } - - public static boolean deep2752(boolean x) { - return deep2753(x); - } - - public static boolean deep2753(boolean x) { - return deep2754(x); - } - - public static boolean deep2754(boolean x) { - return deep2755(x); - } - - public static boolean deep2755(boolean x) { - return deep2756(x); - } - - public static boolean deep2756(boolean x) { - return deep2757(x); - } - - public static boolean deep2757(boolean x) { - return deep2758(x); - } - - public static boolean deep2758(boolean x) { - return deep2759(x); - } - - public static boolean deep2759(boolean x) { - return deep2760(x); - } - - public static boolean deep2760(boolean x) { - return deep2761(x); - } - - public static boolean deep2761(boolean x) { - return deep2762(x); - } - - public static boolean deep2762(boolean x) { - return deep2763(x); - } - - public static boolean deep2763(boolean x) { - return deep2764(x); - } - - public static boolean deep2764(boolean x) { - return deep2765(x); - } - - public static boolean deep2765(boolean x) { - return deep2766(x); - } - - public static boolean deep2766(boolean x) { - return deep2767(x); - } - - public static boolean deep2767(boolean x) { - return deep2768(x); - } - - public static boolean deep2768(boolean x) { - return deep2769(x); - } - - public static boolean deep2769(boolean x) { - return deep2770(x); - } - - public static boolean deep2770(boolean x) { - return deep2771(x); - } - - public static boolean deep2771(boolean x) { - return deep2772(x); - } - - public static boolean deep2772(boolean x) { - return deep2773(x); - } - - public static boolean deep2773(boolean x) { - return deep2774(x); - } - - public static boolean deep2774(boolean x) { - return deep2775(x); - } - - public static boolean deep2775(boolean x) { - return deep2776(x); - } - - public static boolean deep2776(boolean x) { - return deep2777(x); - } - - public static boolean deep2777(boolean x) { - return deep2778(x); - } - - public static boolean deep2778(boolean x) { - return deep2779(x); - } - - public static boolean deep2779(boolean x) { - return deep2780(x); - } - - public static boolean deep2780(boolean x) { - return deep2781(x); - } - - public static boolean deep2781(boolean x) { - return deep2782(x); - } - - public static boolean deep2782(boolean x) { - return deep2783(x); - } - - public static boolean deep2783(boolean x) { - return deep2784(x); - } - - public static boolean deep2784(boolean x) { - return deep2785(x); - } - - public static boolean deep2785(boolean x) { - return deep2786(x); - } - - public static boolean deep2786(boolean x) { - return deep2787(x); - } - - public static boolean deep2787(boolean x) { - return deep2788(x); - } - - public static boolean deep2788(boolean x) { - return deep2789(x); - } - - public static boolean deep2789(boolean x) { - return deep2790(x); - } - - public static boolean deep2790(boolean x) { - return deep2791(x); - } - - public static boolean deep2791(boolean x) { - return deep2792(x); - } - - public static boolean deep2792(boolean x) { - return deep2793(x); - } - - public static boolean deep2793(boolean x) { - return deep2794(x); - } - - public static boolean deep2794(boolean x) { - return deep2795(x); - } - - public static boolean deep2795(boolean x) { - return deep2796(x); - } - - public static boolean deep2796(boolean x) { - return deep2797(x); - } - - public static boolean deep2797(boolean x) { - return deep2798(x); - } - - public static boolean deep2798(boolean x) { - return deep2799(x); - } - - public static boolean deep2799(boolean x) { - return deep2800(x); - } - - public static boolean deep2800(boolean x) { - return deep2801(x); - } - - public static boolean deep2801(boolean x) { - return deep2802(x); - } - - public static boolean deep2802(boolean x) { - return deep2803(x); - } - - public static boolean deep2803(boolean x) { - return deep2804(x); - } - - public static boolean deep2804(boolean x) { - return deep2805(x); - } - - public static boolean deep2805(boolean x) { - return deep2806(x); - } - - public static boolean deep2806(boolean x) { - return deep2807(x); - } - - public static boolean deep2807(boolean x) { - return deep2808(x); - } - - public static boolean deep2808(boolean x) { - return deep2809(x); - } - - public static boolean deep2809(boolean x) { - return deep2810(x); - } - - public static boolean deep2810(boolean x) { - return deep2811(x); - } - - public static boolean deep2811(boolean x) { - return deep2812(x); - } - - public static boolean deep2812(boolean x) { - return deep2813(x); - } - - public static boolean deep2813(boolean x) { - return deep2814(x); - } - - public static boolean deep2814(boolean x) { - return deep2815(x); - } - - public static boolean deep2815(boolean x) { - return deep2816(x); - } - - public static boolean deep2816(boolean x) { - return deep2817(x); - } - - public static boolean deep2817(boolean x) { - return deep2818(x); - } - - public static boolean deep2818(boolean x) { - return deep2819(x); - } - - public static boolean deep2819(boolean x) { - return deep2820(x); - } - - public static boolean deep2820(boolean x) { - return deep2821(x); - } - - public static boolean deep2821(boolean x) { - return deep2822(x); - } - - public static boolean deep2822(boolean x) { - return deep2823(x); - } - - public static boolean deep2823(boolean x) { - return deep2824(x); - } - - public static boolean deep2824(boolean x) { - return deep2825(x); - } - - public static boolean deep2825(boolean x) { - return deep2826(x); - } - - public static boolean deep2826(boolean x) { - return deep2827(x); - } - - public static boolean deep2827(boolean x) { - return deep2828(x); - } - - public static boolean deep2828(boolean x) { - return deep2829(x); - } - - public static boolean deep2829(boolean x) { - return deep2830(x); - } - - public static boolean deep2830(boolean x) { - return deep2831(x); - } - - public static boolean deep2831(boolean x) { - return deep2832(x); - } - - public static boolean deep2832(boolean x) { - return deep2833(x); - } - - public static boolean deep2833(boolean x) { - return deep2834(x); - } - - public static boolean deep2834(boolean x) { - return deep2835(x); - } - - public static boolean deep2835(boolean x) { - return deep2836(x); - } - - public static boolean deep2836(boolean x) { - return deep2837(x); - } - - public static boolean deep2837(boolean x) { - return deep2838(x); - } - - public static boolean deep2838(boolean x) { - return deep2839(x); - } - - public static boolean deep2839(boolean x) { - return deep2840(x); - } - - public static boolean deep2840(boolean x) { - return deep2841(x); - } - - public static boolean deep2841(boolean x) { - return deep2842(x); - } - - public static boolean deep2842(boolean x) { - return deep2843(x); - } - - public static boolean deep2843(boolean x) { - return deep2844(x); - } - - public static boolean deep2844(boolean x) { - return deep2845(x); - } - - public static boolean deep2845(boolean x) { - return deep2846(x); - } - - public static boolean deep2846(boolean x) { - return deep2847(x); - } - - public static boolean deep2847(boolean x) { - return deep2848(x); - } - - public static boolean deep2848(boolean x) { - return deep2849(x); - } - - public static boolean deep2849(boolean x) { - return deep2850(x); - } - - public static boolean deep2850(boolean x) { - return deep2851(x); - } - - public static boolean deep2851(boolean x) { - return deep2852(x); - } - - public static boolean deep2852(boolean x) { - return deep2853(x); - } - - public static boolean deep2853(boolean x) { - return deep2854(x); - } - - public static boolean deep2854(boolean x) { - return deep2855(x); - } - - public static boolean deep2855(boolean x) { - return deep2856(x); - } - - public static boolean deep2856(boolean x) { - return deep2857(x); - } - - public static boolean deep2857(boolean x) { - return deep2858(x); - } - - public static boolean deep2858(boolean x) { - return deep2859(x); - } - - public static boolean deep2859(boolean x) { - return deep2860(x); - } - - public static boolean deep2860(boolean x) { - return deep2861(x); - } - - public static boolean deep2861(boolean x) { - return deep2862(x); - } - - public static boolean deep2862(boolean x) { - return deep2863(x); - } - - public static boolean deep2863(boolean x) { - return deep2864(x); - } - - public static boolean deep2864(boolean x) { - return deep2865(x); - } - - public static boolean deep2865(boolean x) { - return deep2866(x); - } - - public static boolean deep2866(boolean x) { - return deep2867(x); - } - - public static boolean deep2867(boolean x) { - return deep2868(x); - } - - public static boolean deep2868(boolean x) { - return deep2869(x); - } - - public static boolean deep2869(boolean x) { - return deep2870(x); - } - - public static boolean deep2870(boolean x) { - return deep2871(x); - } - - public static boolean deep2871(boolean x) { - return deep2872(x); - } - - public static boolean deep2872(boolean x) { - return deep2873(x); - } - - public static boolean deep2873(boolean x) { - return deep2874(x); - } - - public static boolean deep2874(boolean x) { - return deep2875(x); - } - - public static boolean deep2875(boolean x) { - return deep2876(x); - } - - public static boolean deep2876(boolean x) { - return deep2877(x); - } - - public static boolean deep2877(boolean x) { - return deep2878(x); - } - - public static boolean deep2878(boolean x) { - return deep2879(x); - } - - public static boolean deep2879(boolean x) { - return deep2880(x); - } - - public static boolean deep2880(boolean x) { - return deep2881(x); - } - - public static boolean deep2881(boolean x) { - return deep2882(x); - } - - public static boolean deep2882(boolean x) { - return deep2883(x); - } - - public static boolean deep2883(boolean x) { - return deep2884(x); - } - - public static boolean deep2884(boolean x) { - return deep2885(x); - } - - public static boolean deep2885(boolean x) { - return deep2886(x); - } - - public static boolean deep2886(boolean x) { - return deep2887(x); - } - - public static boolean deep2887(boolean x) { - return deep2888(x); - } - - public static boolean deep2888(boolean x) { - return deep2889(x); - } - - public static boolean deep2889(boolean x) { - return deep2890(x); - } - - public static boolean deep2890(boolean x) { - return deep2891(x); - } - - public static boolean deep2891(boolean x) { - return deep2892(x); - } - - public static boolean deep2892(boolean x) { - return deep2893(x); - } - - public static boolean deep2893(boolean x) { - return deep2894(x); - } - - public static boolean deep2894(boolean x) { - return deep2895(x); - } - - public static boolean deep2895(boolean x) { - return deep2896(x); - } - - public static boolean deep2896(boolean x) { - return deep2897(x); - } - - public static boolean deep2897(boolean x) { - return deep2898(x); - } - - public static boolean deep2898(boolean x) { - return deep2899(x); - } - - public static boolean deep2899(boolean x) { - return deep2900(x); - } - - public static boolean deep2900(boolean x) { - return deep2901(x); - } - - public static boolean deep2901(boolean x) { - return deep2902(x); - } - - public static boolean deep2902(boolean x) { - return deep2903(x); - } - - public static boolean deep2903(boolean x) { - return deep2904(x); - } - - public static boolean deep2904(boolean x) { - return deep2905(x); - } - - public static boolean deep2905(boolean x) { - return deep2906(x); - } - - public static boolean deep2906(boolean x) { - return deep2907(x); - } - - public static boolean deep2907(boolean x) { - return deep2908(x); - } - - public static boolean deep2908(boolean x) { - return deep2909(x); - } - - public static boolean deep2909(boolean x) { - return deep2910(x); - } - - public static boolean deep2910(boolean x) { - return deep2911(x); - } - - public static boolean deep2911(boolean x) { - return deep2912(x); - } - - public static boolean deep2912(boolean x) { - return deep2913(x); - } - - public static boolean deep2913(boolean x) { - return deep2914(x); - } - - public static boolean deep2914(boolean x) { - return deep2915(x); - } - - public static boolean deep2915(boolean x) { - return deep2916(x); - } - - public static boolean deep2916(boolean x) { - return deep2917(x); - } - - public static boolean deep2917(boolean x) { - return deep2918(x); - } - - public static boolean deep2918(boolean x) { - return deep2919(x); - } - - public static boolean deep2919(boolean x) { - return deep2920(x); - } - - public static boolean deep2920(boolean x) { - return deep2921(x); - } - - public static boolean deep2921(boolean x) { - return deep2922(x); - } - - public static boolean deep2922(boolean x) { - return deep2923(x); - } - - public static boolean deep2923(boolean x) { - return deep2924(x); - } - - public static boolean deep2924(boolean x) { - return deep2925(x); - } - - public static boolean deep2925(boolean x) { - return deep2926(x); - } - - public static boolean deep2926(boolean x) { - return deep2927(x); - } - - public static boolean deep2927(boolean x) { - return deep2928(x); - } - - public static boolean deep2928(boolean x) { - return deep2929(x); - } - - public static boolean deep2929(boolean x) { - return deep2930(x); - } - - public static boolean deep2930(boolean x) { - return deep2931(x); - } - - public static boolean deep2931(boolean x) { - return deep2932(x); - } - - public static boolean deep2932(boolean x) { - return deep2933(x); - } - - public static boolean deep2933(boolean x) { - return deep2934(x); - } - - public static boolean deep2934(boolean x) { - return deep2935(x); - } - - public static boolean deep2935(boolean x) { - return deep2936(x); - } - - public static boolean deep2936(boolean x) { - return deep2937(x); - } - - public static boolean deep2937(boolean x) { - return deep2938(x); - } - - public static boolean deep2938(boolean x) { - return deep2939(x); - } - - public static boolean deep2939(boolean x) { - return deep2940(x); - } - - public static boolean deep2940(boolean x) { - return deep2941(x); - } - - public static boolean deep2941(boolean x) { - return deep2942(x); - } - - public static boolean deep2942(boolean x) { - return deep2943(x); - } - - public static boolean deep2943(boolean x) { - return deep2944(x); - } - - public static boolean deep2944(boolean x) { - return deep2945(x); - } - - public static boolean deep2945(boolean x) { - return deep2946(x); - } - - public static boolean deep2946(boolean x) { - return deep2947(x); - } - - public static boolean deep2947(boolean x) { - return deep2948(x); - } - - public static boolean deep2948(boolean x) { - return deep2949(x); - } - - public static boolean deep2949(boolean x) { - return deep2950(x); - } - - public static boolean deep2950(boolean x) { - return deep2951(x); - } - - public static boolean deep2951(boolean x) { - return deep2952(x); - } - - public static boolean deep2952(boolean x) { - return deep2953(x); - } - - public static boolean deep2953(boolean x) { - return deep2954(x); - } - - public static boolean deep2954(boolean x) { - return deep2955(x); - } - - public static boolean deep2955(boolean x) { - return deep2956(x); - } - - public static boolean deep2956(boolean x) { - return deep2957(x); - } - - public static boolean deep2957(boolean x) { - return deep2958(x); - } - - public static boolean deep2958(boolean x) { - return deep2959(x); - } - - public static boolean deep2959(boolean x) { - return deep2960(x); - } - - public static boolean deep2960(boolean x) { - return deep2961(x); - } - - public static boolean deep2961(boolean x) { - return deep2962(x); - } - - public static boolean deep2962(boolean x) { - return deep2963(x); - } - - public static boolean deep2963(boolean x) { - return deep2964(x); - } - - public static boolean deep2964(boolean x) { - return deep2965(x); - } - - public static boolean deep2965(boolean x) { - return deep2966(x); - } - - public static boolean deep2966(boolean x) { - return deep2967(x); - } - - public static boolean deep2967(boolean x) { - return deep2968(x); - } - - public static boolean deep2968(boolean x) { - return deep2969(x); - } - - public static boolean deep2969(boolean x) { - return deep2970(x); - } - - public static boolean deep2970(boolean x) { - return deep2971(x); - } - - public static boolean deep2971(boolean x) { - return deep2972(x); - } - - public static boolean deep2972(boolean x) { - return deep2973(x); - } - - public static boolean deep2973(boolean x) { - return deep2974(x); - } - - public static boolean deep2974(boolean x) { - return deep2975(x); - } - - public static boolean deep2975(boolean x) { - return deep2976(x); - } - - public static boolean deep2976(boolean x) { - return deep2977(x); - } - - public static boolean deep2977(boolean x) { - return deep2978(x); - } - - public static boolean deep2978(boolean x) { - return deep2979(x); - } - - public static boolean deep2979(boolean x) { - return deep2980(x); - } - - public static boolean deep2980(boolean x) { - return deep2981(x); - } - - public static boolean deep2981(boolean x) { - return deep2982(x); - } - - public static boolean deep2982(boolean x) { - return deep2983(x); - } - - public static boolean deep2983(boolean x) { - return deep2984(x); - } - - public static boolean deep2984(boolean x) { - return deep2985(x); - } - - public static boolean deep2985(boolean x) { - return deep2986(x); - } - - public static boolean deep2986(boolean x) { - return deep2987(x); - } - - public static boolean deep2987(boolean x) { - return deep2988(x); - } - - public static boolean deep2988(boolean x) { - return deep2989(x); - } - - public static boolean deep2989(boolean x) { - return deep2990(x); - } - - public static boolean deep2990(boolean x) { - return deep2991(x); - } - - public static boolean deep2991(boolean x) { - return deep2992(x); - } - - public static boolean deep2992(boolean x) { - return deep2993(x); - } - - public static boolean deep2993(boolean x) { - return deep2994(x); - } - - public static boolean deep2994(boolean x) { - return deep2995(x); - } - - public static boolean deep2995(boolean x) { - return deep2996(x); - } - - public static boolean deep2996(boolean x) { - return deep2997(x); - } - - public static boolean deep2997(boolean x) { - return deep2998(x); - } - - public static boolean deep2998(boolean x) { - return deep2999(x); - } - - public static boolean deep2999(boolean x) { - return deep3000(x); - } - - public static boolean deep3000(boolean x) { - return deep3001(x); - } - - public static boolean deep3001(boolean x) { - return deep3002(x); - } - - public static boolean deep3002(boolean x) { - return deep3003(x); - } - - public static boolean deep3003(boolean x) { - return deep3004(x); - } - - public static boolean deep3004(boolean x) { - return deep3005(x); - } - - public static boolean deep3005(boolean x) { - return deep3006(x); - } - - public static boolean deep3006(boolean x) { - return deep3007(x); - } - - public static boolean deep3007(boolean x) { - return deep3008(x); - } - - public static boolean deep3008(boolean x) { - return deep3009(x); - } - - public static boolean deep3009(boolean x) { - return deep3010(x); - } - - public static boolean deep3010(boolean x) { - return deep3011(x); - } - - public static boolean deep3011(boolean x) { - return deep3012(x); - } - - public static boolean deep3012(boolean x) { - return deep3013(x); - } - - public static boolean deep3013(boolean x) { - return deep3014(x); - } - - public static boolean deep3014(boolean x) { - return deep3015(x); - } - - public static boolean deep3015(boolean x) { - return deep3016(x); - } - - public static boolean deep3016(boolean x) { - return deep3017(x); - } - - public static boolean deep3017(boolean x) { - return deep3018(x); - } - - public static boolean deep3018(boolean x) { - return deep3019(x); - } - - public static boolean deep3019(boolean x) { - return deep3020(x); - } - - public static boolean deep3020(boolean x) { - return deep3021(x); - } - - public static boolean deep3021(boolean x) { - return deep3022(x); - } - - public static boolean deep3022(boolean x) { - return deep3023(x); - } - - public static boolean deep3023(boolean x) { - return deep3024(x); - } - - public static boolean deep3024(boolean x) { - return deep3025(x); - } - - public static boolean deep3025(boolean x) { - return deep3026(x); - } - - public static boolean deep3026(boolean x) { - return deep3027(x); - } - - public static boolean deep3027(boolean x) { - return deep3028(x); - } - - public static boolean deep3028(boolean x) { - return deep3029(x); - } - - public static boolean deep3029(boolean x) { - return deep3030(x); - } - - public static boolean deep3030(boolean x) { - return deep3031(x); - } - - public static boolean deep3031(boolean x) { - return deep3032(x); - } - - public static boolean deep3032(boolean x) { - return deep3033(x); - } - - public static boolean deep3033(boolean x) { - return deep3034(x); - } - - public static boolean deep3034(boolean x) { - return deep3035(x); - } - - public static boolean deep3035(boolean x) { - return deep3036(x); - } - - public static boolean deep3036(boolean x) { - return deep3037(x); - } - - public static boolean deep3037(boolean x) { - return deep3038(x); - } - - public static boolean deep3038(boolean x) { - return deep3039(x); - } - - public static boolean deep3039(boolean x) { - return deep3040(x); - } - - public static boolean deep3040(boolean x) { - return deep3041(x); - } - - public static boolean deep3041(boolean x) { - return deep3042(x); - } - - public static boolean deep3042(boolean x) { - return deep3043(x); - } - - public static boolean deep3043(boolean x) { - return deep3044(x); - } - - public static boolean deep3044(boolean x) { - return deep3045(x); - } - - public static boolean deep3045(boolean x) { - return deep3046(x); - } - - public static boolean deep3046(boolean x) { - return deep3047(x); - } - - public static boolean deep3047(boolean x) { - return deep3048(x); - } - - public static boolean deep3048(boolean x) { - return deep3049(x); - } - - public static boolean deep3049(boolean x) { - return deep3050(x); - } - - public static boolean deep3050(boolean x) { - return deep3051(x); - } - - public static boolean deep3051(boolean x) { - return deep3052(x); - } - - public static boolean deep3052(boolean x) { - return deep3053(x); - } - - public static boolean deep3053(boolean x) { - return deep3054(x); - } - - public static boolean deep3054(boolean x) { - return deep3055(x); - } - - public static boolean deep3055(boolean x) { - return deep3056(x); - } - - public static boolean deep3056(boolean x) { - return deep3057(x); - } - - public static boolean deep3057(boolean x) { - return deep3058(x); - } - - public static boolean deep3058(boolean x) { - return deep3059(x); - } - - public static boolean deep3059(boolean x) { - return deep3060(x); - } - - public static boolean deep3060(boolean x) { - return deep3061(x); - } - - public static boolean deep3061(boolean x) { - return deep3062(x); - } - - public static boolean deep3062(boolean x) { - return deep3063(x); - } - - public static boolean deep3063(boolean x) { - return deep3064(x); - } - - public static boolean deep3064(boolean x) { - return deep3065(x); - } - - public static boolean deep3065(boolean x) { - return deep3066(x); - } - - public static boolean deep3066(boolean x) { - return deep3067(x); - } - - public static boolean deep3067(boolean x) { - return deep3068(x); - } - - public static boolean deep3068(boolean x) { - return deep3069(x); - } - - public static boolean deep3069(boolean x) { - return deep3070(x); - } - - public static boolean deep3070(boolean x) { - return deep3071(x); - } - - public static boolean deep3071(boolean x) { - return deep3072(x); - } - - public static boolean deep3072(boolean x) { - return deep3073(x); - } - - public static boolean deep3073(boolean x) { - return deep3074(x); - } - - public static boolean deep3074(boolean x) { - return deep3075(x); - } - - public static boolean deep3075(boolean x) { - return deep3076(x); - } - - public static boolean deep3076(boolean x) { - return deep3077(x); - } - - public static boolean deep3077(boolean x) { - return deep3078(x); - } - - public static boolean deep3078(boolean x) { - return deep3079(x); - } - - public static boolean deep3079(boolean x) { - return deep3080(x); - } - - public static boolean deep3080(boolean x) { - return deep3081(x); - } - - public static boolean deep3081(boolean x) { - return deep3082(x); - } - - public static boolean deep3082(boolean x) { - return deep3083(x); - } - - public static boolean deep3083(boolean x) { - return deep3084(x); - } - - public static boolean deep3084(boolean x) { - return deep3085(x); - } - - public static boolean deep3085(boolean x) { - return deep3086(x); - } - - public static boolean deep3086(boolean x) { - return deep3087(x); - } - - public static boolean deep3087(boolean x) { - return deep3088(x); - } - - public static boolean deep3088(boolean x) { - return deep3089(x); - } - - public static boolean deep3089(boolean x) { - return deep3090(x); - } - - public static boolean deep3090(boolean x) { - return deep3091(x); - } - - public static boolean deep3091(boolean x) { - return deep3092(x); - } - - public static boolean deep3092(boolean x) { - return deep3093(x); - } - - public static boolean deep3093(boolean x) { - return deep3094(x); - } - - public static boolean deep3094(boolean x) { - return deep3095(x); - } - - public static boolean deep3095(boolean x) { - return deep3096(x); - } - - public static boolean deep3096(boolean x) { - return deep3097(x); - } - - public static boolean deep3097(boolean x) { - return deep3098(x); - } - - public static boolean deep3098(boolean x) { - return deep3099(x); - } - - public static boolean deep3099(boolean x) { - return deep3100(x); - } - - public static boolean deep3100(boolean x) { - return deep3101(x); - } - - public static boolean deep3101(boolean x) { - return deep3102(x); - } - - public static boolean deep3102(boolean x) { - return deep3103(x); - } - - public static boolean deep3103(boolean x) { - return deep3104(x); - } - - public static boolean deep3104(boolean x) { - return deep3105(x); - } - - public static boolean deep3105(boolean x) { - return deep3106(x); - } - - public static boolean deep3106(boolean x) { - return deep3107(x); - } - - public static boolean deep3107(boolean x) { - return deep3108(x); - } - - public static boolean deep3108(boolean x) { - return deep3109(x); - } - - public static boolean deep3109(boolean x) { - return deep3110(x); - } - - public static boolean deep3110(boolean x) { - return deep3111(x); - } - - public static boolean deep3111(boolean x) { - return deep3112(x); - } - - public static boolean deep3112(boolean x) { - return deep3113(x); - } - - public static boolean deep3113(boolean x) { - return deep3114(x); - } - - public static boolean deep3114(boolean x) { - return deep3115(x); - } - - public static boolean deep3115(boolean x) { - return deep3116(x); - } - - public static boolean deep3116(boolean x) { - return deep3117(x); - } - - public static boolean deep3117(boolean x) { - return deep3118(x); - } - - public static boolean deep3118(boolean x) { - return deep3119(x); - } - - public static boolean deep3119(boolean x) { - return deep3120(x); - } - - public static boolean deep3120(boolean x) { - return deep3121(x); - } - - public static boolean deep3121(boolean x) { - return deep3122(x); - } - - public static boolean deep3122(boolean x) { - return deep3123(x); - } - - public static boolean deep3123(boolean x) { - return deep3124(x); - } - - public static boolean deep3124(boolean x) { - return deep3125(x); - } - - public static boolean deep3125(boolean x) { - return deep3126(x); - } - - public static boolean deep3126(boolean x) { - return deep3127(x); - } - - public static boolean deep3127(boolean x) { - return deep3128(x); - } - - public static boolean deep3128(boolean x) { - return deep3129(x); - } - - public static boolean deep3129(boolean x) { - return deep3130(x); - } - - public static boolean deep3130(boolean x) { - return deep3131(x); - } - - public static boolean deep3131(boolean x) { - return deep3132(x); - } - - public static boolean deep3132(boolean x) { - return deep3133(x); - } - - public static boolean deep3133(boolean x) { - return deep3134(x); - } - - public static boolean deep3134(boolean x) { - return deep3135(x); - } - - public static boolean deep3135(boolean x) { - return deep3136(x); - } - - public static boolean deep3136(boolean x) { - return deep3137(x); - } - - public static boolean deep3137(boolean x) { - return deep3138(x); - } - - public static boolean deep3138(boolean x) { - return deep3139(x); - } - - public static boolean deep3139(boolean x) { - return deep3140(x); - } - - public static boolean deep3140(boolean x) { - return deep3141(x); - } - - public static boolean deep3141(boolean x) { - return deep3142(x); - } - - public static boolean deep3142(boolean x) { - return deep3143(x); - } - - public static boolean deep3143(boolean x) { - return deep3144(x); - } - - public static boolean deep3144(boolean x) { - return deep3145(x); - } - - public static boolean deep3145(boolean x) { - return deep3146(x); - } - - public static boolean deep3146(boolean x) { - return deep3147(x); - } - - public static boolean deep3147(boolean x) { - return deep3148(x); - } - - public static boolean deep3148(boolean x) { - return deep3149(x); - } - - public static boolean deep3149(boolean x) { - return deep3150(x); - } - - public static boolean deep3150(boolean x) { - return deep3151(x); - } - - public static boolean deep3151(boolean x) { - return deep3152(x); - } - - public static boolean deep3152(boolean x) { - return deep3153(x); - } - - public static boolean deep3153(boolean x) { - return deep3154(x); - } - - public static boolean deep3154(boolean x) { - return deep3155(x); - } - - public static boolean deep3155(boolean x) { - return deep3156(x); - } - - public static boolean deep3156(boolean x) { - return deep3157(x); - } - - public static boolean deep3157(boolean x) { - return deep3158(x); - } - - public static boolean deep3158(boolean x) { - return deep3159(x); - } - - public static boolean deep3159(boolean x) { - return deep3160(x); - } - - public static boolean deep3160(boolean x) { - return deep3161(x); - } - - public static boolean deep3161(boolean x) { - return deep3162(x); - } - - public static boolean deep3162(boolean x) { - return deep3163(x); - } - - public static boolean deep3163(boolean x) { - return deep3164(x); - } - - public static boolean deep3164(boolean x) { - return deep3165(x); - } - - public static boolean deep3165(boolean x) { - return deep3166(x); - } - - public static boolean deep3166(boolean x) { - return deep3167(x); - } - - public static boolean deep3167(boolean x) { - return deep3168(x); - } - - public static boolean deep3168(boolean x) { - return deep3169(x); - } - - public static boolean deep3169(boolean x) { - return deep3170(x); - } - - public static boolean deep3170(boolean x) { - return deep3171(x); - } - - public static boolean deep3171(boolean x) { - return deep3172(x); - } - - public static boolean deep3172(boolean x) { - return deep3173(x); - } - - public static boolean deep3173(boolean x) { - return deep3174(x); - } - - public static boolean deep3174(boolean x) { - return deep3175(x); - } - - public static boolean deep3175(boolean x) { - return deep3176(x); - } - - public static boolean deep3176(boolean x) { - return deep3177(x); - } - - public static boolean deep3177(boolean x) { - return deep3178(x); - } - - public static boolean deep3178(boolean x) { - return deep3179(x); - } - - public static boolean deep3179(boolean x) { - return deep3180(x); - } - - public static boolean deep3180(boolean x) { - return deep3181(x); - } - - public static boolean deep3181(boolean x) { - return deep3182(x); - } - - public static boolean deep3182(boolean x) { - return deep3183(x); - } - - public static boolean deep3183(boolean x) { - return deep3184(x); - } - - public static boolean deep3184(boolean x) { - return deep3185(x); - } - - public static boolean deep3185(boolean x) { - return deep3186(x); - } - - public static boolean deep3186(boolean x) { - return deep3187(x); - } - - public static boolean deep3187(boolean x) { - return deep3188(x); - } - - public static boolean deep3188(boolean x) { - return deep3189(x); - } - - public static boolean deep3189(boolean x) { - return deep3190(x); - } - - public static boolean deep3190(boolean x) { - return deep3191(x); - } - - public static boolean deep3191(boolean x) { - return deep3192(x); - } - - public static boolean deep3192(boolean x) { - return deep3193(x); - } - - public static boolean deep3193(boolean x) { - return deep3194(x); - } - - public static boolean deep3194(boolean x) { - return deep3195(x); - } - - public static boolean deep3195(boolean x) { - return deep3196(x); - } - - public static boolean deep3196(boolean x) { - return deep3197(x); - } - - public static boolean deep3197(boolean x) { - return deep3198(x); - } - - public static boolean deep3198(boolean x) { - return deep3199(x); - } - - public static boolean deep3199(boolean x) { - return deep3200(x); - } - - public static boolean deep3200(boolean x) { - return deep3201(x); - } - - public static boolean deep3201(boolean x) { - return deep3202(x); - } - - public static boolean deep3202(boolean x) { - return deep3203(x); - } - - public static boolean deep3203(boolean x) { - return deep3204(x); - } - - public static boolean deep3204(boolean x) { - return deep3205(x); - } - - public static boolean deep3205(boolean x) { - return deep3206(x); - } - - public static boolean deep3206(boolean x) { - return deep3207(x); - } - - public static boolean deep3207(boolean x) { - return deep3208(x); - } - - public static boolean deep3208(boolean x) { - return deep3209(x); - } - - public static boolean deep3209(boolean x) { - return deep3210(x); - } - - public static boolean deep3210(boolean x) { - return deep3211(x); - } - - public static boolean deep3211(boolean x) { - return deep3212(x); - } - - public static boolean deep3212(boolean x) { - return deep3213(x); - } - - public static boolean deep3213(boolean x) { - return deep3214(x); - } - - public static boolean deep3214(boolean x) { - return deep3215(x); - } - - public static boolean deep3215(boolean x) { - return deep3216(x); - } - - public static boolean deep3216(boolean x) { - return deep3217(x); - } - - public static boolean deep3217(boolean x) { - return deep3218(x); - } - - public static boolean deep3218(boolean x) { - return deep3219(x); - } - - public static boolean deep3219(boolean x) { - return deep3220(x); - } - - public static boolean deep3220(boolean x) { - return deep3221(x); - } - - public static boolean deep3221(boolean x) { - return deep3222(x); - } - - public static boolean deep3222(boolean x) { - return deep3223(x); - } - - public static boolean deep3223(boolean x) { - return deep3224(x); - } - - public static boolean deep3224(boolean x) { - return deep3225(x); - } - - public static boolean deep3225(boolean x) { - return deep3226(x); - } - - public static boolean deep3226(boolean x) { - return deep3227(x); - } - - public static boolean deep3227(boolean x) { - return deep3228(x); - } - - public static boolean deep3228(boolean x) { - return deep3229(x); - } - - public static boolean deep3229(boolean x) { - return deep3230(x); - } - - public static boolean deep3230(boolean x) { - return deep3231(x); - } - - public static boolean deep3231(boolean x) { - return deep3232(x); - } - - public static boolean deep3232(boolean x) { - return deep3233(x); - } - - public static boolean deep3233(boolean x) { - return deep3234(x); - } - - public static boolean deep3234(boolean x) { - return deep3235(x); - } - - public static boolean deep3235(boolean x) { - return deep3236(x); - } - - public static boolean deep3236(boolean x) { - return deep3237(x); - } - - public static boolean deep3237(boolean x) { - return deep3238(x); - } - - public static boolean deep3238(boolean x) { - return deep3239(x); - } - - public static boolean deep3239(boolean x) { - return deep3240(x); - } - - public static boolean deep3240(boolean x) { - return deep3241(x); - } - - public static boolean deep3241(boolean x) { - return deep3242(x); - } - - public static boolean deep3242(boolean x) { - return deep3243(x); - } - - public static boolean deep3243(boolean x) { - return deep3244(x); - } - - public static boolean deep3244(boolean x) { - return deep3245(x); - } - - public static boolean deep3245(boolean x) { - return deep3246(x); - } - - public static boolean deep3246(boolean x) { - return deep3247(x); - } - - public static boolean deep3247(boolean x) { - return deep3248(x); - } - - public static boolean deep3248(boolean x) { - return deep3249(x); - } - - public static boolean deep3249(boolean x) { - return deep3250(x); - } - - public static boolean deep3250(boolean x) { - return deep3251(x); - } - - public static boolean deep3251(boolean x) { - return deep3252(x); - } - - public static boolean deep3252(boolean x) { - return deep3253(x); - } - - public static boolean deep3253(boolean x) { - return deep3254(x); - } - - public static boolean deep3254(boolean x) { - return deep3255(x); - } - - public static boolean deep3255(boolean x) { - return deep3256(x); - } - - public static boolean deep3256(boolean x) { - return deep3257(x); - } - - public static boolean deep3257(boolean x) { - return deep3258(x); - } - - public static boolean deep3258(boolean x) { - return deep3259(x); - } - - public static boolean deep3259(boolean x) { - return deep3260(x); - } - - public static boolean deep3260(boolean x) { - return deep3261(x); - } - - public static boolean deep3261(boolean x) { - return deep3262(x); - } - - public static boolean deep3262(boolean x) { - return deep3263(x); - } - - public static boolean deep3263(boolean x) { - return deep3264(x); - } - - public static boolean deep3264(boolean x) { - return deep3265(x); - } - - public static boolean deep3265(boolean x) { - return deep3266(x); - } - - public static boolean deep3266(boolean x) { - return deep3267(x); - } - - public static boolean deep3267(boolean x) { - return deep3268(x); - } - - public static boolean deep3268(boolean x) { - return deep3269(x); - } - - public static boolean deep3269(boolean x) { - return deep3270(x); - } - - public static boolean deep3270(boolean x) { - return deep3271(x); - } - - public static boolean deep3271(boolean x) { - return deep3272(x); - } - - public static boolean deep3272(boolean x) { - return deep3273(x); - } - - public static boolean deep3273(boolean x) { - return deep3274(x); - } - - public static boolean deep3274(boolean x) { - return deep3275(x); - } - - public static boolean deep3275(boolean x) { - return deep3276(x); - } - - public static boolean deep3276(boolean x) { - return deep3277(x); - } - - public static boolean deep3277(boolean x) { - return deep3278(x); - } - - public static boolean deep3278(boolean x) { - return deep3279(x); - } - - public static boolean deep3279(boolean x) { - return deep3280(x); - } - - public static boolean deep3280(boolean x) { - return deep3281(x); - } - - public static boolean deep3281(boolean x) { - return deep3282(x); - } - - public static boolean deep3282(boolean x) { - return deep3283(x); - } - - public static boolean deep3283(boolean x) { - return deep3284(x); - } - - public static boolean deep3284(boolean x) { - return deep3285(x); - } - - public static boolean deep3285(boolean x) { - return deep3286(x); - } - - public static boolean deep3286(boolean x) { - return deep3287(x); - } - - public static boolean deep3287(boolean x) { - return deep3288(x); - } - - public static boolean deep3288(boolean x) { - return deep3289(x); - } - - public static boolean deep3289(boolean x) { - return deep3290(x); - } - - public static boolean deep3290(boolean x) { - return deep3291(x); - } - - public static boolean deep3291(boolean x) { - return deep3292(x); - } - - public static boolean deep3292(boolean x) { - return deep3293(x); - } - - public static boolean deep3293(boolean x) { - return deep3294(x); - } - - public static boolean deep3294(boolean x) { - return deep3295(x); - } - - public static boolean deep3295(boolean x) { - return deep3296(x); - } - - public static boolean deep3296(boolean x) { - return deep3297(x); - } - - public static boolean deep3297(boolean x) { - return deep3298(x); - } - - public static boolean deep3298(boolean x) { - return deep3299(x); - } - - public static boolean deep3299(boolean x) { - return deep3300(x); - } - - public static boolean deep3300(boolean x) { - return deep3301(x); - } - - public static boolean deep3301(boolean x) { - return deep3302(x); - } - - public static boolean deep3302(boolean x) { - return deep3303(x); - } - - public static boolean deep3303(boolean x) { - return deep3304(x); - } - - public static boolean deep3304(boolean x) { - return deep3305(x); - } - - public static boolean deep3305(boolean x) { - return deep3306(x); - } - - public static boolean deep3306(boolean x) { - return deep3307(x); - } - - public static boolean deep3307(boolean x) { - return deep3308(x); - } - - public static boolean deep3308(boolean x) { - return deep3309(x); - } - - public static boolean deep3309(boolean x) { - return deep3310(x); - } - - public static boolean deep3310(boolean x) { - return deep3311(x); - } - - public static boolean deep3311(boolean x) { - return deep3312(x); - } - - public static boolean deep3312(boolean x) { - return deep3313(x); - } - - public static boolean deep3313(boolean x) { - return deep3314(x); - } - - public static boolean deep3314(boolean x) { - return deep3315(x); - } - - public static boolean deep3315(boolean x) { - return deep3316(x); - } - - public static boolean deep3316(boolean x) { - return deep3317(x); - } - - public static boolean deep3317(boolean x) { - return deep3318(x); - } - - public static boolean deep3318(boolean x) { - return deep3319(x); - } - - public static boolean deep3319(boolean x) { - return deep3320(x); - } - - public static boolean deep3320(boolean x) { - return deep3321(x); - } - - public static boolean deep3321(boolean x) { - return deep3322(x); - } - - public static boolean deep3322(boolean x) { - return deep3323(x); - } - - public static boolean deep3323(boolean x) { - return deep3324(x); - } - - public static boolean deep3324(boolean x) { - return deep3325(x); - } - - public static boolean deep3325(boolean x) { - return deep3326(x); - } - - public static boolean deep3326(boolean x) { - return deep3327(x); - } - - public static boolean deep3327(boolean x) { - return deep3328(x); - } - - public static boolean deep3328(boolean x) { - return deep3329(x); - } - - public static boolean deep3329(boolean x) { - return deep3330(x); - } - - public static boolean deep3330(boolean x) { - return deep3331(x); - } - - public static boolean deep3331(boolean x) { - return deep3332(x); - } - - public static boolean deep3332(boolean x) { - return deep3333(x); - } - - public static boolean deep3333(boolean x) { - return deep3334(x); - } - - public static boolean deep3334(boolean x) { - return deep3335(x); - } - - public static boolean deep3335(boolean x) { - return deep3336(x); - } - - public static boolean deep3336(boolean x) { - return deep3337(x); - } - - public static boolean deep3337(boolean x) { - return deep3338(x); - } - - public static boolean deep3338(boolean x) { - return deep3339(x); - } - - public static boolean deep3339(boolean x) { - return deep3340(x); - } - - public static boolean deep3340(boolean x) { - return deep3341(x); - } - - public static boolean deep3341(boolean x) { - return deep3342(x); - } - - public static boolean deep3342(boolean x) { - return deep3343(x); - } - - public static boolean deep3343(boolean x) { - return deep3344(x); - } - - public static boolean deep3344(boolean x) { - return deep3345(x); - } - - public static boolean deep3345(boolean x) { - return deep3346(x); - } - - public static boolean deep3346(boolean x) { - return deep3347(x); - } - - public static boolean deep3347(boolean x) { - return deep3348(x); - } - - public static boolean deep3348(boolean x) { - return deep3349(x); - } - - public static boolean deep3349(boolean x) { - return deep3350(x); - } - - public static boolean deep3350(boolean x) { - return deep3351(x); - } - - public static boolean deep3351(boolean x) { - return deep3352(x); - } - - public static boolean deep3352(boolean x) { - return deep3353(x); - } - - public static boolean deep3353(boolean x) { - return deep3354(x); - } - - public static boolean deep3354(boolean x) { - return deep3355(x); - } - - public static boolean deep3355(boolean x) { - return deep3356(x); - } - - public static boolean deep3356(boolean x) { - return deep3357(x); - } - - public static boolean deep3357(boolean x) { - return deep3358(x); - } - - public static boolean deep3358(boolean x) { - return deep3359(x); - } - - public static boolean deep3359(boolean x) { - return deep3360(x); - } - - public static boolean deep3360(boolean x) { - return deep3361(x); - } - - public static boolean deep3361(boolean x) { - return deep3362(x); - } - - public static boolean deep3362(boolean x) { - return deep3363(x); - } - - public static boolean deep3363(boolean x) { - return deep3364(x); - } - - public static boolean deep3364(boolean x) { - return deep3365(x); - } - - public static boolean deep3365(boolean x) { - return deep3366(x); - } - - public static boolean deep3366(boolean x) { - return deep3367(x); - } - - public static boolean deep3367(boolean x) { - return deep3368(x); - } - - public static boolean deep3368(boolean x) { - return deep3369(x); - } - - public static boolean deep3369(boolean x) { - return deep3370(x); - } - - public static boolean deep3370(boolean x) { - return deep3371(x); - } - - public static boolean deep3371(boolean x) { - return deep3372(x); - } - - public static boolean deep3372(boolean x) { - return deep3373(x); - } - - public static boolean deep3373(boolean x) { - return deep3374(x); - } - - public static boolean deep3374(boolean x) { - return deep3375(x); - } - - public static boolean deep3375(boolean x) { - return deep3376(x); - } - - public static boolean deep3376(boolean x) { - return deep3377(x); - } - - public static boolean deep3377(boolean x) { - return deep3378(x); - } - - public static boolean deep3378(boolean x) { - return deep3379(x); - } - - public static boolean deep3379(boolean x) { - return deep3380(x); - } - - public static boolean deep3380(boolean x) { - return deep3381(x); - } - - public static boolean deep3381(boolean x) { - return deep3382(x); - } - - public static boolean deep3382(boolean x) { - return deep3383(x); - } - - public static boolean deep3383(boolean x) { - return deep3384(x); - } - - public static boolean deep3384(boolean x) { - return deep3385(x); - } - - public static boolean deep3385(boolean x) { - return deep3386(x); - } - - public static boolean deep3386(boolean x) { - return deep3387(x); - } - - public static boolean deep3387(boolean x) { - return deep3388(x); - } - - public static boolean deep3388(boolean x) { - return deep3389(x); - } - - public static boolean deep3389(boolean x) { - return deep3390(x); - } - - public static boolean deep3390(boolean x) { - return deep3391(x); - } - - public static boolean deep3391(boolean x) { - return deep3392(x); - } - - public static boolean deep3392(boolean x) { - return deep3393(x); - } - - public static boolean deep3393(boolean x) { - return deep3394(x); - } - - public static boolean deep3394(boolean x) { - return deep3395(x); - } - - public static boolean deep3395(boolean x) { - return deep3396(x); - } - - public static boolean deep3396(boolean x) { - return deep3397(x); - } - - public static boolean deep3397(boolean x) { - return deep3398(x); - } - - public static boolean deep3398(boolean x) { - return deep3399(x); - } - - public static boolean deep3399(boolean x) { - return deep3400(x); - } - - public static boolean deep3400(boolean x) { - return deep3401(x); - } - - public static boolean deep3401(boolean x) { - return deep3402(x); - } - - public static boolean deep3402(boolean x) { - return deep3403(x); - } - - public static boolean deep3403(boolean x) { - return deep3404(x); - } - - public static boolean deep3404(boolean x) { - return deep3405(x); - } - - public static boolean deep3405(boolean x) { - return deep3406(x); - } - - public static boolean deep3406(boolean x) { - return deep3407(x); - } - - public static boolean deep3407(boolean x) { - return deep3408(x); - } - - public static boolean deep3408(boolean x) { - return deep3409(x); - } - - public static boolean deep3409(boolean x) { - return deep3410(x); - } - - public static boolean deep3410(boolean x) { - return deep3411(x); - } - - public static boolean deep3411(boolean x) { - return deep3412(x); - } - - public static boolean deep3412(boolean x) { - return deep3413(x); - } - - public static boolean deep3413(boolean x) { - return deep3414(x); - } - - public static boolean deep3414(boolean x) { - return deep3415(x); - } - - public static boolean deep3415(boolean x) { - return deep3416(x); - } - - public static boolean deep3416(boolean x) { - return deep3417(x); - } - - public static boolean deep3417(boolean x) { - return deep3418(x); - } - - public static boolean deep3418(boolean x) { - return deep3419(x); - } - - public static boolean deep3419(boolean x) { - return deep3420(x); - } - - public static boolean deep3420(boolean x) { - return deep3421(x); - } - - public static boolean deep3421(boolean x) { - return deep3422(x); - } - - public static boolean deep3422(boolean x) { - return deep3423(x); - } - - public static boolean deep3423(boolean x) { - return deep3424(x); - } - - public static boolean deep3424(boolean x) { - return deep3425(x); - } - - public static boolean deep3425(boolean x) { - return deep3426(x); - } - - public static boolean deep3426(boolean x) { - return deep3427(x); - } - - public static boolean deep3427(boolean x) { - return deep3428(x); - } - - public static boolean deep3428(boolean x) { - return deep3429(x); - } - - public static boolean deep3429(boolean x) { - return deep3430(x); - } - - public static boolean deep3430(boolean x) { - return deep3431(x); - } - - public static boolean deep3431(boolean x) { - return deep3432(x); - } - - public static boolean deep3432(boolean x) { - return deep3433(x); - } - - public static boolean deep3433(boolean x) { - return deep3434(x); - } - - public static boolean deep3434(boolean x) { - return deep3435(x); - } - - public static boolean deep3435(boolean x) { - return deep3436(x); - } - - public static boolean deep3436(boolean x) { - return deep3437(x); - } - - public static boolean deep3437(boolean x) { - return deep3438(x); - } - - public static boolean deep3438(boolean x) { - return deep3439(x); - } - - public static boolean deep3439(boolean x) { - return deep3440(x); - } - - public static boolean deep3440(boolean x) { - return deep3441(x); - } - - public static boolean deep3441(boolean x) { - return deep3442(x); - } - - public static boolean deep3442(boolean x) { - return deep3443(x); - } - - public static boolean deep3443(boolean x) { - return deep3444(x); - } - - public static boolean deep3444(boolean x) { - return deep3445(x); - } - - public static boolean deep3445(boolean x) { - return deep3446(x); - } - - public static boolean deep3446(boolean x) { - return deep3447(x); - } - - public static boolean deep3447(boolean x) { - return deep3448(x); - } - - public static boolean deep3448(boolean x) { - return deep3449(x); - } - - public static boolean deep3449(boolean x) { - return deep3450(x); - } - - public static boolean deep3450(boolean x) { - return deep3451(x); - } - - public static boolean deep3451(boolean x) { - return deep3452(x); - } - - public static boolean deep3452(boolean x) { - return deep3453(x); - } - - public static boolean deep3453(boolean x) { - return deep3454(x); - } - - public static boolean deep3454(boolean x) { - return deep3455(x); - } - - public static boolean deep3455(boolean x) { - return deep3456(x); - } - - public static boolean deep3456(boolean x) { - return deep3457(x); - } - - public static boolean deep3457(boolean x) { - return deep3458(x); - } - - public static boolean deep3458(boolean x) { - return deep3459(x); - } - - public static boolean deep3459(boolean x) { - return deep3460(x); - } - - public static boolean deep3460(boolean x) { - return deep3461(x); - } - - public static boolean deep3461(boolean x) { - return deep3462(x); - } - - public static boolean deep3462(boolean x) { - return deep3463(x); - } - - public static boolean deep3463(boolean x) { - return deep3464(x); - } - - public static boolean deep3464(boolean x) { - return deep3465(x); - } - - public static boolean deep3465(boolean x) { - return deep3466(x); - } - - public static boolean deep3466(boolean x) { - return deep3467(x); - } - - public static boolean deep3467(boolean x) { - return deep3468(x); - } - - public static boolean deep3468(boolean x) { - return deep3469(x); - } - - public static boolean deep3469(boolean x) { - return deep3470(x); - } - - public static boolean deep3470(boolean x) { - return deep3471(x); - } - - public static boolean deep3471(boolean x) { - return deep3472(x); - } - - public static boolean deep3472(boolean x) { - return deep3473(x); - } - - public static boolean deep3473(boolean x) { - return deep3474(x); - } - - public static boolean deep3474(boolean x) { - return deep3475(x); - } - - public static boolean deep3475(boolean x) { - return deep3476(x); - } - - public static boolean deep3476(boolean x) { - return deep3477(x); - } - - public static boolean deep3477(boolean x) { - return deep3478(x); - } - - public static boolean deep3478(boolean x) { - return deep3479(x); - } - - public static boolean deep3479(boolean x) { - return deep3480(x); - } - - public static boolean deep3480(boolean x) { - return deep3481(x); - } - - public static boolean deep3481(boolean x) { - return deep3482(x); - } - - public static boolean deep3482(boolean x) { - return deep3483(x); - } - - public static boolean deep3483(boolean x) { - return deep3484(x); - } - - public static boolean deep3484(boolean x) { - return deep3485(x); - } - - public static boolean deep3485(boolean x) { - return deep3486(x); - } - - public static boolean deep3486(boolean x) { - return deep3487(x); - } - - public static boolean deep3487(boolean x) { - return deep3488(x); - } - - public static boolean deep3488(boolean x) { - return deep3489(x); - } - - public static boolean deep3489(boolean x) { - return deep3490(x); - } - - public static boolean deep3490(boolean x) { - return deep3491(x); - } - - public static boolean deep3491(boolean x) { - return deep3492(x); - } - - public static boolean deep3492(boolean x) { - return deep3493(x); - } - - public static boolean deep3493(boolean x) { - return deep3494(x); - } - - public static boolean deep3494(boolean x) { - return deep3495(x); - } - - public static boolean deep3495(boolean x) { - return deep3496(x); - } - - public static boolean deep3496(boolean x) { - return deep3497(x); - } - - public static boolean deep3497(boolean x) { - return deep3498(x); - } - - public static boolean deep3498(boolean x) { - return deep3499(x); - } - - public static boolean deep3499(boolean x) { - return deep3500(x); - } - - public static boolean deep3500(boolean x) { - return deep3501(x); - } - - public static boolean deep3501(boolean x) { - return deep3502(x); - } - - public static boolean deep3502(boolean x) { - return deep3503(x); - } - - public static boolean deep3503(boolean x) { - return deep3504(x); - } - - public static boolean deep3504(boolean x) { - return deep3505(x); - } - - public static boolean deep3505(boolean x) { - return deep3506(x); - } - - public static boolean deep3506(boolean x) { - return deep3507(x); - } - - public static boolean deep3507(boolean x) { - return deep3508(x); - } - - public static boolean deep3508(boolean x) { - return deep3509(x); - } - - public static boolean deep3509(boolean x) { - return deep3510(x); - } - - public static boolean deep3510(boolean x) { - return deep3511(x); - } - - public static boolean deep3511(boolean x) { - return deep3512(x); - } - - public static boolean deep3512(boolean x) { - return deep3513(x); - } - - public static boolean deep3513(boolean x) { - return deep3514(x); - } - - public static boolean deep3514(boolean x) { - return deep3515(x); - } - - public static boolean deep3515(boolean x) { - return deep3516(x); - } - - public static boolean deep3516(boolean x) { - return deep3517(x); - } - - public static boolean deep3517(boolean x) { - return deep3518(x); - } - - public static boolean deep3518(boolean x) { - return deep3519(x); - } - - public static boolean deep3519(boolean x) { - return deep3520(x); - } - - public static boolean deep3520(boolean x) { - return deep3521(x); - } - - public static boolean deep3521(boolean x) { - return deep3522(x); - } - - public static boolean deep3522(boolean x) { - return deep3523(x); - } - - public static boolean deep3523(boolean x) { - return deep3524(x); - } - - public static boolean deep3524(boolean x) { - return deep3525(x); - } - - public static boolean deep3525(boolean x) { - return deep3526(x); - } - - public static boolean deep3526(boolean x) { - return deep3527(x); - } - - public static boolean deep3527(boolean x) { - return deep3528(x); - } - - public static boolean deep3528(boolean x) { - return deep3529(x); - } - - public static boolean deep3529(boolean x) { - return deep3530(x); - } - - public static boolean deep3530(boolean x) { - return deep3531(x); - } - - public static boolean deep3531(boolean x) { - return deep3532(x); - } - - public static boolean deep3532(boolean x) { - return deep3533(x); - } - - public static boolean deep3533(boolean x) { - return deep3534(x); - } - - public static boolean deep3534(boolean x) { - return deep3535(x); - } - - public static boolean deep3535(boolean x) { - return deep3536(x); - } - - public static boolean deep3536(boolean x) { - return deep3537(x); - } - - public static boolean deep3537(boolean x) { - return deep3538(x); - } - - public static boolean deep3538(boolean x) { - return deep3539(x); - } - - public static boolean deep3539(boolean x) { - return deep3540(x); - } - - public static boolean deep3540(boolean x) { - return deep3541(x); - } - - public static boolean deep3541(boolean x) { - return deep3542(x); - } - - public static boolean deep3542(boolean x) { - return deep3543(x); - } - - public static boolean deep3543(boolean x) { - return deep3544(x); - } - - public static boolean deep3544(boolean x) { - return deep3545(x); - } - - public static boolean deep3545(boolean x) { - return deep3546(x); - } - - public static boolean deep3546(boolean x) { - return deep3547(x); - } - - public static boolean deep3547(boolean x) { - return deep3548(x); - } - - public static boolean deep3548(boolean x) { - return deep3549(x); - } - - public static boolean deep3549(boolean x) { - return deep3550(x); - } - - public static boolean deep3550(boolean x) { - return deep3551(x); - } - - public static boolean deep3551(boolean x) { - return deep3552(x); - } - - public static boolean deep3552(boolean x) { - return deep3553(x); - } - - public static boolean deep3553(boolean x) { - return deep3554(x); - } - - public static boolean deep3554(boolean x) { - return deep3555(x); - } - - public static boolean deep3555(boolean x) { - return deep3556(x); - } - - public static boolean deep3556(boolean x) { - return deep3557(x); - } - - public static boolean deep3557(boolean x) { - return deep3558(x); - } - - public static boolean deep3558(boolean x) { - return deep3559(x); - } - - public static boolean deep3559(boolean x) { - return deep3560(x); - } - - public static boolean deep3560(boolean x) { - return deep3561(x); - } - - public static boolean deep3561(boolean x) { - return deep3562(x); - } - - public static boolean deep3562(boolean x) { - return deep3563(x); - } - - public static boolean deep3563(boolean x) { - return deep3564(x); - } - - public static boolean deep3564(boolean x) { - return deep3565(x); - } - - public static boolean deep3565(boolean x) { - return deep3566(x); - } - - public static boolean deep3566(boolean x) { - return deep3567(x); - } - - public static boolean deep3567(boolean x) { - return deep3568(x); - } - - public static boolean deep3568(boolean x) { - return deep3569(x); - } - - public static boolean deep3569(boolean x) { - return deep3570(x); - } - - public static boolean deep3570(boolean x) { - return deep3571(x); - } - - public static boolean deep3571(boolean x) { - return deep3572(x); - } - - public static boolean deep3572(boolean x) { - return deep3573(x); - } - - public static boolean deep3573(boolean x) { - return deep3574(x); - } - - public static boolean deep3574(boolean x) { - return deep3575(x); - } - - public static boolean deep3575(boolean x) { - return deep3576(x); - } - - public static boolean deep3576(boolean x) { - return deep3577(x); - } - - public static boolean deep3577(boolean x) { - return deep3578(x); - } - - public static boolean deep3578(boolean x) { - return deep3579(x); - } - - public static boolean deep3579(boolean x) { - return deep3580(x); - } - - public static boolean deep3580(boolean x) { - return deep3581(x); - } - - public static boolean deep3581(boolean x) { - return deep3582(x); - } - - public static boolean deep3582(boolean x) { - return deep3583(x); - } - - public static boolean deep3583(boolean x) { - return deep3584(x); - } - - public static boolean deep3584(boolean x) { - return deep3585(x); - } - - public static boolean deep3585(boolean x) { - return deep3586(x); - } - - public static boolean deep3586(boolean x) { - return deep3587(x); - } - - public static boolean deep3587(boolean x) { - return deep3588(x); - } - - public static boolean deep3588(boolean x) { - return deep3589(x); - } - - public static boolean deep3589(boolean x) { - return deep3590(x); - } - - public static boolean deep3590(boolean x) { - return deep3591(x); - } - - public static boolean deep3591(boolean x) { - return deep3592(x); - } - - public static boolean deep3592(boolean x) { - return deep3593(x); - } - - public static boolean deep3593(boolean x) { - return deep3594(x); - } - - public static boolean deep3594(boolean x) { - return deep3595(x); - } - - public static boolean deep3595(boolean x) { - return deep3596(x); - } - - public static boolean deep3596(boolean x) { - return deep3597(x); - } - - public static boolean deep3597(boolean x) { - return deep3598(x); - } - - public static boolean deep3598(boolean x) { - return deep3599(x); - } - - public static boolean deep3599(boolean x) { - return deep3600(x); - } - - public static boolean deep3600(boolean x) { - return deep3601(x); - } - - public static boolean deep3601(boolean x) { - return deep3602(x); - } - - public static boolean deep3602(boolean x) { - return deep3603(x); - } - - public static boolean deep3603(boolean x) { - return deep3604(x); - } - - public static boolean deep3604(boolean x) { - return deep3605(x); - } - - public static boolean deep3605(boolean x) { - return deep3606(x); - } - - public static boolean deep3606(boolean x) { - return deep3607(x); - } - - public static boolean deep3607(boolean x) { - return deep3608(x); - } - - public static boolean deep3608(boolean x) { - return deep3609(x); - } - - public static boolean deep3609(boolean x) { - return deep3610(x); - } - - public static boolean deep3610(boolean x) { - return deep3611(x); - } - - public static boolean deep3611(boolean x) { - return deep3612(x); - } - - public static boolean deep3612(boolean x) { - return deep3613(x); - } - - public static boolean deep3613(boolean x) { - return deep3614(x); - } - - public static boolean deep3614(boolean x) { - return deep3615(x); - } - - public static boolean deep3615(boolean x) { - return deep3616(x); - } - - public static boolean deep3616(boolean x) { - return deep3617(x); - } - - public static boolean deep3617(boolean x) { - return deep3618(x); - } - - public static boolean deep3618(boolean x) { - return deep3619(x); - } - - public static boolean deep3619(boolean x) { - return deep3620(x); - } - - public static boolean deep3620(boolean x) { - return deep3621(x); - } - - public static boolean deep3621(boolean x) { - return deep3622(x); - } - - public static boolean deep3622(boolean x) { - return deep3623(x); - } - - public static boolean deep3623(boolean x) { - return deep3624(x); - } - - public static boolean deep3624(boolean x) { - return deep3625(x); - } - - public static boolean deep3625(boolean x) { - return deep3626(x); - } - - public static boolean deep3626(boolean x) { - return deep3627(x); - } - - public static boolean deep3627(boolean x) { - return deep3628(x); - } - - public static boolean deep3628(boolean x) { - return deep3629(x); - } - - public static boolean deep3629(boolean x) { - return deep3630(x); - } - - public static boolean deep3630(boolean x) { - return deep3631(x); - } - - public static boolean deep3631(boolean x) { - return deep3632(x); - } - - public static boolean deep3632(boolean x) { - return deep3633(x); - } - - public static boolean deep3633(boolean x) { - return deep3634(x); - } - - public static boolean deep3634(boolean x) { - return deep3635(x); - } - - public static boolean deep3635(boolean x) { - return deep3636(x); - } - - public static boolean deep3636(boolean x) { - return deep3637(x); - } - - public static boolean deep3637(boolean x) { - return deep3638(x); - } - - public static boolean deep3638(boolean x) { - return deep3639(x); - } - - public static boolean deep3639(boolean x) { - return deep3640(x); - } - - public static boolean deep3640(boolean x) { - return deep3641(x); - } - - public static boolean deep3641(boolean x) { - return deep3642(x); - } - - public static boolean deep3642(boolean x) { - return deep3643(x); - } - - public static boolean deep3643(boolean x) { - return deep3644(x); - } - - public static boolean deep3644(boolean x) { - return deep3645(x); - } - - public static boolean deep3645(boolean x) { - return deep3646(x); - } - - public static boolean deep3646(boolean x) { - return deep3647(x); - } - - public static boolean deep3647(boolean x) { - return deep3648(x); - } - - public static boolean deep3648(boolean x) { - return deep3649(x); - } - - public static boolean deep3649(boolean x) { - return deep3650(x); - } - - public static boolean deep3650(boolean x) { - return deep3651(x); - } - - public static boolean deep3651(boolean x) { - return deep3652(x); - } - - public static boolean deep3652(boolean x) { - return deep3653(x); - } - - public static boolean deep3653(boolean x) { - return deep3654(x); - } - - public static boolean deep3654(boolean x) { - return deep3655(x); - } - - public static boolean deep3655(boolean x) { - return deep3656(x); - } - - public static boolean deep3656(boolean x) { - return deep3657(x); - } - - public static boolean deep3657(boolean x) { - return deep3658(x); - } - - public static boolean deep3658(boolean x) { - return deep3659(x); - } - - public static boolean deep3659(boolean x) { - return deep3660(x); - } - - public static boolean deep3660(boolean x) { - return deep3661(x); - } - - public static boolean deep3661(boolean x) { - return deep3662(x); - } - - public static boolean deep3662(boolean x) { - return deep3663(x); - } - - public static boolean deep3663(boolean x) { - return deep3664(x); - } - - public static boolean deep3664(boolean x) { - return deep3665(x); - } - - public static boolean deep3665(boolean x) { - return deep3666(x); - } - - public static boolean deep3666(boolean x) { - return deep3667(x); - } - - public static boolean deep3667(boolean x) { - return deep3668(x); - } - - public static boolean deep3668(boolean x) { - return deep3669(x); - } - - public static boolean deep3669(boolean x) { - return deep3670(x); - } - - public static boolean deep3670(boolean x) { - return deep3671(x); - } - - public static boolean deep3671(boolean x) { - return deep3672(x); - } - - public static boolean deep3672(boolean x) { - return deep3673(x); - } - - public static boolean deep3673(boolean x) { - return deep3674(x); - } - - public static boolean deep3674(boolean x) { - return deep3675(x); - } - - public static boolean deep3675(boolean x) { - return deep3676(x); - } - - public static boolean deep3676(boolean x) { - return deep3677(x); - } - - public static boolean deep3677(boolean x) { - return deep3678(x); - } - - public static boolean deep3678(boolean x) { - return deep3679(x); - } - - public static boolean deep3679(boolean x) { - return deep3680(x); - } - - public static boolean deep3680(boolean x) { - return deep3681(x); - } - - public static boolean deep3681(boolean x) { - return deep3682(x); - } - - public static boolean deep3682(boolean x) { - return deep3683(x); - } - - public static boolean deep3683(boolean x) { - return deep3684(x); - } - - public static boolean deep3684(boolean x) { - return deep3685(x); - } - - public static boolean deep3685(boolean x) { - return deep3686(x); - } - - public static boolean deep3686(boolean x) { - return deep3687(x); - } - - public static boolean deep3687(boolean x) { - return deep3688(x); - } - - public static boolean deep3688(boolean x) { - return deep3689(x); - } - - public static boolean deep3689(boolean x) { - return deep3690(x); - } - - public static boolean deep3690(boolean x) { - return deep3691(x); - } - - public static boolean deep3691(boolean x) { - return deep3692(x); - } - - public static boolean deep3692(boolean x) { - return deep3693(x); - } - - public static boolean deep3693(boolean x) { - return deep3694(x); - } - - public static boolean deep3694(boolean x) { - return deep3695(x); - } - - public static boolean deep3695(boolean x) { - return deep3696(x); - } - - public static boolean deep3696(boolean x) { - return deep3697(x); - } - - public static boolean deep3697(boolean x) { - return deep3698(x); - } - - public static boolean deep3698(boolean x) { - return deep3699(x); - } - - public static boolean deep3699(boolean x) { - return deep3700(x); - } - - public static boolean deep3700(boolean x) { - return deep3701(x); - } - - public static boolean deep3701(boolean x) { - return deep3702(x); - } - - public static boolean deep3702(boolean x) { - return deep3703(x); - } - - public static boolean deep3703(boolean x) { - return deep3704(x); - } - - public static boolean deep3704(boolean x) { - return deep3705(x); - } - - public static boolean deep3705(boolean x) { - return deep3706(x); - } - - public static boolean deep3706(boolean x) { - return deep3707(x); - } - - public static boolean deep3707(boolean x) { - return deep3708(x); - } - - public static boolean deep3708(boolean x) { - return deep3709(x); - } - - public static boolean deep3709(boolean x) { - return deep3710(x); - } - - public static boolean deep3710(boolean x) { - return deep3711(x); - } - - public static boolean deep3711(boolean x) { - return deep3712(x); - } - - public static boolean deep3712(boolean x) { - return deep3713(x); - } - - public static boolean deep3713(boolean x) { - return deep3714(x); - } - - public static boolean deep3714(boolean x) { - return deep3715(x); - } - - public static boolean deep3715(boolean x) { - return deep3716(x); - } - - public static boolean deep3716(boolean x) { - return deep3717(x); - } - - public static boolean deep3717(boolean x) { - return deep3718(x); - } - - public static boolean deep3718(boolean x) { - return deep3719(x); - } - - public static boolean deep3719(boolean x) { - return deep3720(x); - } - - public static boolean deep3720(boolean x) { - return deep3721(x); - } - - public static boolean deep3721(boolean x) { - return deep3722(x); - } - - public static boolean deep3722(boolean x) { - return deep3723(x); - } - - public static boolean deep3723(boolean x) { - return deep3724(x); - } - - public static boolean deep3724(boolean x) { - return deep3725(x); - } - - public static boolean deep3725(boolean x) { - return deep3726(x); - } - - public static boolean deep3726(boolean x) { - return deep3727(x); - } - - public static boolean deep3727(boolean x) { - return deep3728(x); - } - - public static boolean deep3728(boolean x) { - return deep3729(x); - } - - public static boolean deep3729(boolean x) { - return deep3730(x); - } - - public static boolean deep3730(boolean x) { - return deep3731(x); - } - - public static boolean deep3731(boolean x) { - return deep3732(x); - } - - public static boolean deep3732(boolean x) { - return deep3733(x); - } - - public static boolean deep3733(boolean x) { - return deep3734(x); - } - - public static boolean deep3734(boolean x) { - return deep3735(x); - } - - public static boolean deep3735(boolean x) { - return deep3736(x); - } - - public static boolean deep3736(boolean x) { - return deep3737(x); - } - - public static boolean deep3737(boolean x) { - return deep3738(x); - } - - public static boolean deep3738(boolean x) { - return deep3739(x); - } - - public static boolean deep3739(boolean x) { - return deep3740(x); - } - - public static boolean deep3740(boolean x) { - return deep3741(x); - } - - public static boolean deep3741(boolean x) { - return deep3742(x); - } - - public static boolean deep3742(boolean x) { - return deep3743(x); - } - - public static boolean deep3743(boolean x) { - return deep3744(x); - } - - public static boolean deep3744(boolean x) { - return deep3745(x); - } - - public static boolean deep3745(boolean x) { - return deep3746(x); - } - - public static boolean deep3746(boolean x) { - return deep3747(x); - } - - public static boolean deep3747(boolean x) { - return deep3748(x); - } - - public static boolean deep3748(boolean x) { - return deep3749(x); - } - - public static boolean deep3749(boolean x) { - return deep3750(x); - } - - public static boolean deep3750(boolean x) { - return deep3751(x); - } - - public static boolean deep3751(boolean x) { - return deep3752(x); - } - - public static boolean deep3752(boolean x) { - return deep3753(x); - } - - public static boolean deep3753(boolean x) { - return deep3754(x); - } - - public static boolean deep3754(boolean x) { - return deep3755(x); - } - - public static boolean deep3755(boolean x) { - return deep3756(x); - } - - public static boolean deep3756(boolean x) { - return deep3757(x); - } - - public static boolean deep3757(boolean x) { - return deep3758(x); - } - - public static boolean deep3758(boolean x) { - return deep3759(x); - } - - public static boolean deep3759(boolean x) { - return deep3760(x); - } - - public static boolean deep3760(boolean x) { - return deep3761(x); - } - - public static boolean deep3761(boolean x) { - return deep3762(x); - } - - public static boolean deep3762(boolean x) { - return deep3763(x); - } - - public static boolean deep3763(boolean x) { - return deep3764(x); - } - - public static boolean deep3764(boolean x) { - return deep3765(x); - } - - public static boolean deep3765(boolean x) { - return deep3766(x); - } - - public static boolean deep3766(boolean x) { - return deep3767(x); - } - - public static boolean deep3767(boolean x) { - return deep3768(x); - } - - public static boolean deep3768(boolean x) { - return deep3769(x); - } - - public static boolean deep3769(boolean x) { - return deep3770(x); - } - - public static boolean deep3770(boolean x) { - return deep3771(x); - } - - public static boolean deep3771(boolean x) { - return deep3772(x); - } - - public static boolean deep3772(boolean x) { - return deep3773(x); - } - - public static boolean deep3773(boolean x) { - return deep3774(x); - } - - public static boolean deep3774(boolean x) { - return deep3775(x); - } - - public static boolean deep3775(boolean x) { - return deep3776(x); - } - - public static boolean deep3776(boolean x) { - return deep3777(x); - } - - public static boolean deep3777(boolean x) { - return deep3778(x); - } - - public static boolean deep3778(boolean x) { - return deep3779(x); - } - - public static boolean deep3779(boolean x) { - return deep3780(x); - } - - public static boolean deep3780(boolean x) { - return deep3781(x); - } - - public static boolean deep3781(boolean x) { - return deep3782(x); - } - - public static boolean deep3782(boolean x) { - return deep3783(x); - } - - public static boolean deep3783(boolean x) { - return deep3784(x); - } - - public static boolean deep3784(boolean x) { - return deep3785(x); - } - - public static boolean deep3785(boolean x) { - return deep3786(x); - } - - public static boolean deep3786(boolean x) { - return deep3787(x); - } - - public static boolean deep3787(boolean x) { - return deep3788(x); - } - - public static boolean deep3788(boolean x) { - return deep3789(x); - } - - public static boolean deep3789(boolean x) { - return deep3790(x); - } - - public static boolean deep3790(boolean x) { - return deep3791(x); - } - - public static boolean deep3791(boolean x) { - return deep3792(x); - } - - public static boolean deep3792(boolean x) { - return deep3793(x); - } - - public static boolean deep3793(boolean x) { - return deep3794(x); - } - - public static boolean deep3794(boolean x) { - return deep3795(x); - } - - public static boolean deep3795(boolean x) { - return deep3796(x); - } - - public static boolean deep3796(boolean x) { - return deep3797(x); - } - - public static boolean deep3797(boolean x) { - return deep3798(x); - } - - public static boolean deep3798(boolean x) { - return deep3799(x); - } - - public static boolean deep3799(boolean x) { - return deep3800(x); - } - - public static boolean deep3800(boolean x) { - return deep3801(x); - } - - public static boolean deep3801(boolean x) { - return deep3802(x); - } - - public static boolean deep3802(boolean x) { - return deep3803(x); - } - - public static boolean deep3803(boolean x) { - return deep3804(x); - } - - public static boolean deep3804(boolean x) { - return deep3805(x); - } - - public static boolean deep3805(boolean x) { - return deep3806(x); - } - - public static boolean deep3806(boolean x) { - return deep3807(x); - } - - public static boolean deep3807(boolean x) { - return deep3808(x); - } - - public static boolean deep3808(boolean x) { - return deep3809(x); - } - - public static boolean deep3809(boolean x) { - return deep3810(x); - } - - public static boolean deep3810(boolean x) { - return deep3811(x); - } - - public static boolean deep3811(boolean x) { - return deep3812(x); - } - - public static boolean deep3812(boolean x) { - return deep3813(x); - } - - public static boolean deep3813(boolean x) { - return deep3814(x); - } - - public static boolean deep3814(boolean x) { - return deep3815(x); - } - - public static boolean deep3815(boolean x) { - return deep3816(x); - } - - public static boolean deep3816(boolean x) { - return deep3817(x); - } - - public static boolean deep3817(boolean x) { - return deep3818(x); - } - - public static boolean deep3818(boolean x) { - return deep3819(x); - } - - public static boolean deep3819(boolean x) { - return deep3820(x); - } - - public static boolean deep3820(boolean x) { - return deep3821(x); - } - - public static boolean deep3821(boolean x) { - return deep3822(x); - } - - public static boolean deep3822(boolean x) { - return deep3823(x); - } - - public static boolean deep3823(boolean x) { - return deep3824(x); - } - - public static boolean deep3824(boolean x) { - return deep3825(x); - } - - public static boolean deep3825(boolean x) { - return deep3826(x); - } - - public static boolean deep3826(boolean x) { - return deep3827(x); - } - - public static boolean deep3827(boolean x) { - return deep3828(x); - } - - public static boolean deep3828(boolean x) { - return deep3829(x); - } - - public static boolean deep3829(boolean x) { - return deep3830(x); - } - - public static boolean deep3830(boolean x) { - return deep3831(x); - } - - public static boolean deep3831(boolean x) { - return deep3832(x); - } - - public static boolean deep3832(boolean x) { - return deep3833(x); - } - - public static boolean deep3833(boolean x) { - return deep3834(x); - } - - public static boolean deep3834(boolean x) { - return deep3835(x); - } - - public static boolean deep3835(boolean x) { - return deep3836(x); - } - - public static boolean deep3836(boolean x) { - return deep3837(x); - } - - public static boolean deep3837(boolean x) { - return deep3838(x); - } - - public static boolean deep3838(boolean x) { - return deep3839(x); - } - - public static boolean deep3839(boolean x) { - return deep3840(x); - } - - public static boolean deep3840(boolean x) { - return deep3841(x); - } - - public static boolean deep3841(boolean x) { - return deep3842(x); - } - - public static boolean deep3842(boolean x) { - return deep3843(x); - } - - public static boolean deep3843(boolean x) { - return deep3844(x); - } - - public static boolean deep3844(boolean x) { - return deep3845(x); - } - - public static boolean deep3845(boolean x) { - return deep3846(x); - } - - public static boolean deep3846(boolean x) { - return deep3847(x); - } - - public static boolean deep3847(boolean x) { - return deep3848(x); - } - - public static boolean deep3848(boolean x) { - return deep3849(x); - } - - public static boolean deep3849(boolean x) { - return deep3850(x); - } - - public static boolean deep3850(boolean x) { - return deep3851(x); - } - - public static boolean deep3851(boolean x) { - return deep3852(x); - } - - public static boolean deep3852(boolean x) { - return deep3853(x); - } - - public static boolean deep3853(boolean x) { - return deep3854(x); - } - - public static boolean deep3854(boolean x) { - return deep3855(x); - } - - public static boolean deep3855(boolean x) { - return deep3856(x); - } - - public static boolean deep3856(boolean x) { - return deep3857(x); - } - - public static boolean deep3857(boolean x) { - return deep3858(x); - } - - public static boolean deep3858(boolean x) { - return deep3859(x); - } - - public static boolean deep3859(boolean x) { - return deep3860(x); - } - - public static boolean deep3860(boolean x) { - return deep3861(x); - } - - public static boolean deep3861(boolean x) { - return deep3862(x); - } - - public static boolean deep3862(boolean x) { - return deep3863(x); - } - - public static boolean deep3863(boolean x) { - return deep3864(x); - } - - public static boolean deep3864(boolean x) { - return deep3865(x); - } - - public static boolean deep3865(boolean x) { - return deep3866(x); - } - - public static boolean deep3866(boolean x) { - return deep3867(x); - } - - public static boolean deep3867(boolean x) { - return deep3868(x); - } - - public static boolean deep3868(boolean x) { - return deep3869(x); - } - - public static boolean deep3869(boolean x) { - return deep3870(x); - } - - public static boolean deep3870(boolean x) { - return deep3871(x); - } - - public static boolean deep3871(boolean x) { - return deep3872(x); - } - - public static boolean deep3872(boolean x) { - return deep3873(x); - } - - public static boolean deep3873(boolean x) { - return deep3874(x); - } - - public static boolean deep3874(boolean x) { - return deep3875(x); - } - - public static boolean deep3875(boolean x) { - return deep3876(x); - } - - public static boolean deep3876(boolean x) { - return deep3877(x); - } - - public static boolean deep3877(boolean x) { - return deep3878(x); - } - - public static boolean deep3878(boolean x) { - return deep3879(x); - } - - public static boolean deep3879(boolean x) { - return deep3880(x); - } - - public static boolean deep3880(boolean x) { - return deep3881(x); - } - - public static boolean deep3881(boolean x) { - return deep3882(x); - } - - public static boolean deep3882(boolean x) { - return deep3883(x); - } - - public static boolean deep3883(boolean x) { - return deep3884(x); - } - - public static boolean deep3884(boolean x) { - return deep3885(x); - } - - public static boolean deep3885(boolean x) { - return deep3886(x); - } - - public static boolean deep3886(boolean x) { - return deep3887(x); - } - - public static boolean deep3887(boolean x) { - return deep3888(x); - } - - public static boolean deep3888(boolean x) { - return deep3889(x); - } - - public static boolean deep3889(boolean x) { - return deep3890(x); - } - - public static boolean deep3890(boolean x) { - return deep3891(x); - } - - public static boolean deep3891(boolean x) { - return deep3892(x); - } - - public static boolean deep3892(boolean x) { - return deep3893(x); - } - - public static boolean deep3893(boolean x) { - return deep3894(x); - } - - public static boolean deep3894(boolean x) { - return deep3895(x); - } - - public static boolean deep3895(boolean x) { - return deep3896(x); - } - - public static boolean deep3896(boolean x) { - return deep3897(x); - } - - public static boolean deep3897(boolean x) { - return deep3898(x); - } - - public static boolean deep3898(boolean x) { - return deep3899(x); - } - - public static boolean deep3899(boolean x) { - return deep3900(x); - } - - public static boolean deep3900(boolean x) { - return deep3901(x); - } - - public static boolean deep3901(boolean x) { - return deep3902(x); - } - - public static boolean deep3902(boolean x) { - return deep3903(x); - } - - public static boolean deep3903(boolean x) { - return deep3904(x); - } - - public static boolean deep3904(boolean x) { - return deep3905(x); - } - - public static boolean deep3905(boolean x) { - return deep3906(x); - } - - public static boolean deep3906(boolean x) { - return deep3907(x); - } - - public static boolean deep3907(boolean x) { - return deep3908(x); - } - - public static boolean deep3908(boolean x) { - return deep3909(x); - } - - public static boolean deep3909(boolean x) { - return deep3910(x); - } - - public static boolean deep3910(boolean x) { - return deep3911(x); - } - - public static boolean deep3911(boolean x) { - return deep3912(x); - } - - public static boolean deep3912(boolean x) { - return deep3913(x); - } - - public static boolean deep3913(boolean x) { - return deep3914(x); - } - - public static boolean deep3914(boolean x) { - return deep3915(x); - } - - public static boolean deep3915(boolean x) { - return deep3916(x); - } - - public static boolean deep3916(boolean x) { - return deep3917(x); - } - - public static boolean deep3917(boolean x) { - return deep3918(x); - } - - public static boolean deep3918(boolean x) { - return deep3919(x); - } - - public static boolean deep3919(boolean x) { - return deep3920(x); - } - - public static boolean deep3920(boolean x) { - return deep3921(x); - } - - public static boolean deep3921(boolean x) { - return deep3922(x); - } - - public static boolean deep3922(boolean x) { - return deep3923(x); - } - - public static boolean deep3923(boolean x) { - return deep3924(x); - } - - public static boolean deep3924(boolean x) { - return deep3925(x); - } - - public static boolean deep3925(boolean x) { - return deep3926(x); - } - - public static boolean deep3926(boolean x) { - return deep3927(x); - } - - public static boolean deep3927(boolean x) { - return deep3928(x); - } - - public static boolean deep3928(boolean x) { - return deep3929(x); - } - - public static boolean deep3929(boolean x) { - return deep3930(x); - } - - public static boolean deep3930(boolean x) { - return deep3931(x); - } - - public static boolean deep3931(boolean x) { - return deep3932(x); - } - - public static boolean deep3932(boolean x) { - return deep3933(x); - } - - public static boolean deep3933(boolean x) { - return deep3934(x); - } - - public static boolean deep3934(boolean x) { - return deep3935(x); - } - - public static boolean deep3935(boolean x) { - return deep3936(x); - } - - public static boolean deep3936(boolean x) { - return deep3937(x); - } - - public static boolean deep3937(boolean x) { - return deep3938(x); - } - - public static boolean deep3938(boolean x) { - return deep3939(x); - } - - public static boolean deep3939(boolean x) { - return deep3940(x); - } - - public static boolean deep3940(boolean x) { - return deep3941(x); - } - - public static boolean deep3941(boolean x) { - return deep3942(x); - } - - public static boolean deep3942(boolean x) { - return deep3943(x); - } - - public static boolean deep3943(boolean x) { - return deep3944(x); - } - - public static boolean deep3944(boolean x) { - return deep3945(x); - } - - public static boolean deep3945(boolean x) { - return deep3946(x); - } - - public static boolean deep3946(boolean x) { - return deep3947(x); - } - - public static boolean deep3947(boolean x) { - return deep3948(x); - } - - public static boolean deep3948(boolean x) { - return deep3949(x); - } - - public static boolean deep3949(boolean x) { - return deep3950(x); - } - - public static boolean deep3950(boolean x) { - return deep3951(x); - } - - public static boolean deep3951(boolean x) { - return deep3952(x); - } - - public static boolean deep3952(boolean x) { - return deep3953(x); - } - - public static boolean deep3953(boolean x) { - return deep3954(x); - } - - public static boolean deep3954(boolean x) { - return deep3955(x); - } - - public static boolean deep3955(boolean x) { - return deep3956(x); - } - - public static boolean deep3956(boolean x) { - return deep3957(x); - } - - public static boolean deep3957(boolean x) { - return deep3958(x); - } - - public static boolean deep3958(boolean x) { - return deep3959(x); - } - - public static boolean deep3959(boolean x) { - return deep3960(x); - } - - public static boolean deep3960(boolean x) { - return deep3961(x); - } - - public static boolean deep3961(boolean x) { - return deep3962(x); - } - - public static boolean deep3962(boolean x) { - return deep3963(x); - } - - public static boolean deep3963(boolean x) { - return deep3964(x); - } - - public static boolean deep3964(boolean x) { - return deep3965(x); - } - - public static boolean deep3965(boolean x) { - return deep3966(x); - } - - public static boolean deep3966(boolean x) { - return deep3967(x); - } - - public static boolean deep3967(boolean x) { - return deep3968(x); - } - - public static boolean deep3968(boolean x) { - return deep3969(x); - } - - public static boolean deep3969(boolean x) { - return deep3970(x); - } - - public static boolean deep3970(boolean x) { - return deep3971(x); - } - - public static boolean deep3971(boolean x) { - return deep3972(x); - } - - public static boolean deep3972(boolean x) { - return deep3973(x); - } - - public static boolean deep3973(boolean x) { - return deep3974(x); - } - - public static boolean deep3974(boolean x) { - return deep3975(x); - } - - public static boolean deep3975(boolean x) { - return deep3976(x); - } - - public static boolean deep3976(boolean x) { - return deep3977(x); - } - - public static boolean deep3977(boolean x) { - return deep3978(x); - } - - public static boolean deep3978(boolean x) { - return deep3979(x); - } - - public static boolean deep3979(boolean x) { - return deep3980(x); - } - - public static boolean deep3980(boolean x) { - return deep3981(x); - } - - public static boolean deep3981(boolean x) { - return deep3982(x); - } - - public static boolean deep3982(boolean x) { - return deep3983(x); - } - - public static boolean deep3983(boolean x) { - return deep3984(x); - } - - public static boolean deep3984(boolean x) { - return deep3985(x); - } - - public static boolean deep3985(boolean x) { - return deep3986(x); - } - - public static boolean deep3986(boolean x) { - return deep3987(x); - } - - public static boolean deep3987(boolean x) { - return deep3988(x); - } - - public static boolean deep3988(boolean x) { - return deep3989(x); - } - - public static boolean deep3989(boolean x) { - return deep3990(x); - } - - public static boolean deep3990(boolean x) { - return deep3991(x); - } - - public static boolean deep3991(boolean x) { - return deep3992(x); - } - - public static boolean deep3992(boolean x) { - return deep3993(x); - } - - public static boolean deep3993(boolean x) { - return deep3994(x); - } - - public static boolean deep3994(boolean x) { - return deep3995(x); - } - - public static boolean deep3995(boolean x) { - return deep3996(x); - } - - public static boolean deep3996(boolean x) { - return deep3997(x); - } - - public static boolean deep3997(boolean x) { - return deep3998(x); - } - - public static boolean deep3998(boolean x) { - return deep3999(x); - } - - public static boolean deep3999(boolean x) { - return deep4000(x); - } - - public static boolean deep4000(boolean x) { - return deep4001(x); - } - - public static boolean deep4001(boolean x) { - return deep4002(x); - } - - public static boolean deep4002(boolean x) { - return deep4003(x); - } - - public static boolean deep4003(boolean x) { - return deep4004(x); - } - - public static boolean deep4004(boolean x) { - return deep4005(x); - } - - public static boolean deep4005(boolean x) { - return deep4006(x); - } - - public static boolean deep4006(boolean x) { - return deep4007(x); - } - - public static boolean deep4007(boolean x) { - return deep4008(x); - } - - public static boolean deep4008(boolean x) { - return deep4009(x); - } - - public static boolean deep4009(boolean x) { - return deep4010(x); - } - - public static boolean deep4010(boolean x) { - return deep4011(x); - } - - public static boolean deep4011(boolean x) { - return deep4012(x); - } - - public static boolean deep4012(boolean x) { - return deep4013(x); - } - - public static boolean deep4013(boolean x) { - return deep4014(x); - } - - public static boolean deep4014(boolean x) { - return deep4015(x); - } - - public static boolean deep4015(boolean x) { - return deep4016(x); - } - - public static boolean deep4016(boolean x) { - return deep4017(x); - } - - public static boolean deep4017(boolean x) { - return deep4018(x); - } - - public static boolean deep4018(boolean x) { - return deep4019(x); - } - - public static boolean deep4019(boolean x) { - return deep4020(x); - } - - public static boolean deep4020(boolean x) { - return deep4021(x); - } - - public static boolean deep4021(boolean x) { - return deep4022(x); - } - - public static boolean deep4022(boolean x) { - return deep4023(x); - } - - public static boolean deep4023(boolean x) { - return deep4024(x); - } - - public static boolean deep4024(boolean x) { - return deep4025(x); - } - - public static boolean deep4025(boolean x) { - return deep4026(x); - } - - public static boolean deep4026(boolean x) { - return deep4027(x); - } - - public static boolean deep4027(boolean x) { - return deep4028(x); - } - - public static boolean deep4028(boolean x) { - return deep4029(x); - } - - public static boolean deep4029(boolean x) { - return deep4030(x); - } - - public static boolean deep4030(boolean x) { - return deep4031(x); - } - - public static boolean deep4031(boolean x) { - return deep4032(x); - } - - public static boolean deep4032(boolean x) { - return deep4033(x); - } - - public static boolean deep4033(boolean x) { - return deep4034(x); - } - - public static boolean deep4034(boolean x) { - return deep4035(x); - } - - public static boolean deep4035(boolean x) { - return deep4036(x); - } - - public static boolean deep4036(boolean x) { - return deep4037(x); - } - - public static boolean deep4037(boolean x) { - return deep4038(x); - } - - public static boolean deep4038(boolean x) { - return deep4039(x); - } - - public static boolean deep4039(boolean x) { - return deep4040(x); - } - - public static boolean deep4040(boolean x) { - return deep4041(x); - } - - public static boolean deep4041(boolean x) { - return deep4042(x); - } - - public static boolean deep4042(boolean x) { - return deep4043(x); - } - - public static boolean deep4043(boolean x) { - return deep4044(x); - } - - public static boolean deep4044(boolean x) { - return deep4045(x); - } - - public static boolean deep4045(boolean x) { - return deep4046(x); - } - - public static boolean deep4046(boolean x) { - return deep4047(x); - } - - public static boolean deep4047(boolean x) { - return deep4048(x); - } - - public static boolean deep4048(boolean x) { - return deep4049(x); - } - - public static boolean deep4049(boolean x) { - return deep4050(x); - } - - public static boolean deep4050(boolean x) { - return deep4051(x); - } - - public static boolean deep4051(boolean x) { - return deep4052(x); - } - - public static boolean deep4052(boolean x) { - return deep4053(x); - } - - public static boolean deep4053(boolean x) { - return deep4054(x); - } - - public static boolean deep4054(boolean x) { - return deep4055(x); - } - - public static boolean deep4055(boolean x) { - return deep4056(x); - } - - public static boolean deep4056(boolean x) { - return deep4057(x); - } - - public static boolean deep4057(boolean x) { - return deep4058(x); - } - - public static boolean deep4058(boolean x) { - return deep4059(x); - } - - public static boolean deep4059(boolean x) { - return deep4060(x); - } - - public static boolean deep4060(boolean x) { - return deep4061(x); - } - - public static boolean deep4061(boolean x) { - return deep4062(x); - } - - public static boolean deep4062(boolean x) { - return deep4063(x); - } - - public static boolean deep4063(boolean x) { - return deep4064(x); - } - - public static boolean deep4064(boolean x) { - return deep4065(x); - } - - public static boolean deep4065(boolean x) { - return deep4066(x); - } - - public static boolean deep4066(boolean x) { - return deep4067(x); - } - - public static boolean deep4067(boolean x) { - return deep4068(x); - } - - public static boolean deep4068(boolean x) { - return deep4069(x); - } - - public static boolean deep4069(boolean x) { - return deep4070(x); - } - - public static boolean deep4070(boolean x) { - return deep4071(x); - } - - public static boolean deep4071(boolean x) { - return deep4072(x); - } - - public static boolean deep4072(boolean x) { - return deep4073(x); - } - - public static boolean deep4073(boolean x) { - return deep4074(x); - } - - public static boolean deep4074(boolean x) { - return deep4075(x); - } - - public static boolean deep4075(boolean x) { - return deep4076(x); - } - - public static boolean deep4076(boolean x) { - return deep4077(x); - } - - public static boolean deep4077(boolean x) { - return deep4078(x); - } - - public static boolean deep4078(boolean x) { - return deep4079(x); - } - - public static boolean deep4079(boolean x) { - return deep4080(x); - } - - public static boolean deep4080(boolean x) { - return deep4081(x); - } - - public static boolean deep4081(boolean x) { - return deep4082(x); - } - - public static boolean deep4082(boolean x) { - return deep4083(x); - } - - public static boolean deep4083(boolean x) { - return deep4084(x); - } - - public static boolean deep4084(boolean x) { - return deep4085(x); - } - - public static boolean deep4085(boolean x) { - return deep4086(x); - } - - public static boolean deep4086(boolean x) { - return deep4087(x); - } - - public static boolean deep4087(boolean x) { - return deep4088(x); - } - - public static boolean deep4088(boolean x) { - return deep4089(x); - } - - public static boolean deep4089(boolean x) { - return deep4090(x); - } - - public static boolean deep4090(boolean x) { - return deep4091(x); - } - - public static boolean deep4091(boolean x) { - return deep4092(x); - } - - public static boolean deep4092(boolean x) { - return deep4093(x); - } - - public static boolean deep4093(boolean x) { - return deep4094(x); - } - - public static boolean deep4094(boolean x) { - return deep4095(x); - } - - public static boolean deep4095(boolean x) { - return deep4096(x); - } - - public static boolean deep4096(boolean x) { - return deep4097(x); - } - - public static boolean deep4097(boolean x) { - return deep4098(x); - } - - public static boolean deep4098(boolean x) { - return deep4099(x); - } - - public static boolean deep4099(boolean x) { - return deep4100(x); - } - - public static boolean deep4100(boolean x) { - return deep4101(x); - } - - public static boolean deep4101(boolean x) { - return deep4102(x); - } - - public static boolean deep4102(boolean x) { - return deep4103(x); - } - - public static boolean deep4103(boolean x) { - return deep4104(x); - } - - public static boolean deep4104(boolean x) { - return deep4105(x); - } - - public static boolean deep4105(boolean x) { - return deep4106(x); - } - - public static boolean deep4106(boolean x) { - return deep4107(x); - } - - public static boolean deep4107(boolean x) { - return deep4108(x); - } - - public static boolean deep4108(boolean x) { - return deep4109(x); - } - - public static boolean deep4109(boolean x) { - return deep4110(x); - } - - public static boolean deep4110(boolean x) { - return deep4111(x); - } - - public static boolean deep4111(boolean x) { - return deep4112(x); - } - - public static boolean deep4112(boolean x) { - return deep4113(x); - } - - public static boolean deep4113(boolean x) { - return deep4114(x); - } - - public static boolean deep4114(boolean x) { - return deep4115(x); - } - - public static boolean deep4115(boolean x) { - return deep4116(x); - } - - public static boolean deep4116(boolean x) { - return deep4117(x); - } - - public static boolean deep4117(boolean x) { - return deep4118(x); - } - - public static boolean deep4118(boolean x) { - return deep4119(x); - } - - public static boolean deep4119(boolean x) { - return deep4120(x); - } - - public static boolean deep4120(boolean x) { - return deep4121(x); - } - - public static boolean deep4121(boolean x) { - return deep4122(x); - } - - public static boolean deep4122(boolean x) { - return deep4123(x); - } - - public static boolean deep4123(boolean x) { - return deep4124(x); - } - - public static boolean deep4124(boolean x) { - return deep4125(x); - } - - public static boolean deep4125(boolean x) { - return deep4126(x); - } - - public static boolean deep4126(boolean x) { - return deep4127(x); - } - - public static boolean deep4127(boolean x) { - return deep4128(x); - } - - public static boolean deep4128(boolean x) { - return deep4129(x); - } - - public static boolean deep4129(boolean x) { - return deep4130(x); - } - - public static boolean deep4130(boolean x) { - return deep4131(x); - } - - public static boolean deep4131(boolean x) { - return deep4132(x); - } - - public static boolean deep4132(boolean x) { - return deep4133(x); - } - - public static boolean deep4133(boolean x) { - return deep4134(x); - } - - public static boolean deep4134(boolean x) { - return deep4135(x); - } - - public static boolean deep4135(boolean x) { - return deep4136(x); - } - - public static boolean deep4136(boolean x) { - return deep4137(x); - } - - public static boolean deep4137(boolean x) { - return deep4138(x); - } - - public static boolean deep4138(boolean x) { - return deep4139(x); - } - - public static boolean deep4139(boolean x) { - return deep4140(x); - } - - public static boolean deep4140(boolean x) { - return deep4141(x); - } - - public static boolean deep4141(boolean x) { - return deep4142(x); - } - - public static boolean deep4142(boolean x) { - return deep4143(x); - } - - public static boolean deep4143(boolean x) { - return deep4144(x); - } - - public static boolean deep4144(boolean x) { - return deep4145(x); - } - - public static boolean deep4145(boolean x) { - return deep4146(x); - } - - public static boolean deep4146(boolean x) { - return deep4147(x); - } - - public static boolean deep4147(boolean x) { - return deep4148(x); - } - - public static boolean deep4148(boolean x) { - return deep4149(x); - } - - public static boolean deep4149(boolean x) { - return deep4150(x); - } - - public static boolean deep4150(boolean x) { - return deep4151(x); - } - - public static boolean deep4151(boolean x) { - return deep4152(x); - } - - public static boolean deep4152(boolean x) { - return deep4153(x); - } - - public static boolean deep4153(boolean x) { - return deep4154(x); - } - - public static boolean deep4154(boolean x) { - return deep4155(x); - } - - public static boolean deep4155(boolean x) { - return deep4156(x); - } - - public static boolean deep4156(boolean x) { - return deep4157(x); - } - - public static boolean deep4157(boolean x) { - return deep4158(x); - } - - public static boolean deep4158(boolean x) { - return deep4159(x); - } - - public static boolean deep4159(boolean x) { - return deep4160(x); - } - - public static boolean deep4160(boolean x) { - return deep4161(x); - } - - public static boolean deep4161(boolean x) { - return deep4162(x); - } - - public static boolean deep4162(boolean x) { - return deep4163(x); - } - - public static boolean deep4163(boolean x) { - return deep4164(x); - } - - public static boolean deep4164(boolean x) { - return deep4165(x); - } - - public static boolean deep4165(boolean x) { - return deep4166(x); - } - - public static boolean deep4166(boolean x) { - return deep4167(x); - } - - public static boolean deep4167(boolean x) { - return deep4168(x); - } - - public static boolean deep4168(boolean x) { - return deep4169(x); - } - - public static boolean deep4169(boolean x) { - return deep4170(x); - } - - public static boolean deep4170(boolean x) { - return deep4171(x); - } - - public static boolean deep4171(boolean x) { - return deep4172(x); - } - - public static boolean deep4172(boolean x) { - return deep4173(x); - } - - public static boolean deep4173(boolean x) { - return deep4174(x); - } - - public static boolean deep4174(boolean x) { - return deep4175(x); - } - - public static boolean deep4175(boolean x) { - return deep4176(x); - } - - public static boolean deep4176(boolean x) { - return deep4177(x); - } - - public static boolean deep4177(boolean x) { - return deep4178(x); - } - - public static boolean deep4178(boolean x) { - return deep4179(x); - } - - public static boolean deep4179(boolean x) { - return deep4180(x); - } - - public static boolean deep4180(boolean x) { - return deep4181(x); - } - - public static boolean deep4181(boolean x) { - return deep4182(x); - } - - public static boolean deep4182(boolean x) { - return deep4183(x); - } - - public static boolean deep4183(boolean x) { - return deep4184(x); - } - - public static boolean deep4184(boolean x) { - return deep4185(x); - } - - public static boolean deep4185(boolean x) { - return deep4186(x); - } - - public static boolean deep4186(boolean x) { - return deep4187(x); - } - - public static boolean deep4187(boolean x) { - return deep4188(x); - } - - public static boolean deep4188(boolean x) { - return deep4189(x); - } - - public static boolean deep4189(boolean x) { - return deep4190(x); - } - - public static boolean deep4190(boolean x) { - return deep4191(x); - } - - public static boolean deep4191(boolean x) { - return deep4192(x); - } - - public static boolean deep4192(boolean x) { - return deep4193(x); - } - - public static boolean deep4193(boolean x) { - return deep4194(x); - } - - public static boolean deep4194(boolean x) { - return deep4195(x); - } - - public static boolean deep4195(boolean x) { - return deep4196(x); - } - - public static boolean deep4196(boolean x) { - return deep4197(x); - } - - public static boolean deep4197(boolean x) { - return deep4198(x); - } - - public static boolean deep4198(boolean x) { - return deep4199(x); - } - - public static boolean deep4199(boolean x) { - return deep4200(x); - } - - public static boolean deep4200(boolean x) { - return deep4201(x); - } - - public static boolean deep4201(boolean x) { - return deep4202(x); - } - - public static boolean deep4202(boolean x) { - return deep4203(x); - } - - public static boolean deep4203(boolean x) { - return deep4204(x); - } - - public static boolean deep4204(boolean x) { - return deep4205(x); - } - - public static boolean deep4205(boolean x) { - return deep4206(x); - } - - public static boolean deep4206(boolean x) { - return deep4207(x); - } - - public static boolean deep4207(boolean x) { - return deep4208(x); - } - - public static boolean deep4208(boolean x) { - return deep4209(x); - } - - public static boolean deep4209(boolean x) { - return deep4210(x); - } - - public static boolean deep4210(boolean x) { - return deep4211(x); - } - - public static boolean deep4211(boolean x) { - return deep4212(x); - } - - public static boolean deep4212(boolean x) { - return deep4213(x); - } - - public static boolean deep4213(boolean x) { - return deep4214(x); - } - - public static boolean deep4214(boolean x) { - return deep4215(x); - } - - public static boolean deep4215(boolean x) { - return deep4216(x); - } - - public static boolean deep4216(boolean x) { - return deep4217(x); - } - - public static boolean deep4217(boolean x) { - return deep4218(x); - } - - public static boolean deep4218(boolean x) { - return deep4219(x); - } - - public static boolean deep4219(boolean x) { - return deep4220(x); - } - - public static boolean deep4220(boolean x) { - return deep4221(x); - } - - public static boolean deep4221(boolean x) { - return deep4222(x); - } - - public static boolean deep4222(boolean x) { - return deep4223(x); - } - - public static boolean deep4223(boolean x) { - return deep4224(x); - } - - public static boolean deep4224(boolean x) { - return deep4225(x); - } - - public static boolean deep4225(boolean x) { - return deep4226(x); - } - - public static boolean deep4226(boolean x) { - return deep4227(x); - } - - public static boolean deep4227(boolean x) { - return deep4228(x); - } - - public static boolean deep4228(boolean x) { - return deep4229(x); - } - - public static boolean deep4229(boolean x) { - return deep4230(x); - } - - public static boolean deep4230(boolean x) { - return deep4231(x); - } - - public static boolean deep4231(boolean x) { - return deep4232(x); - } - - public static boolean deep4232(boolean x) { - return deep4233(x); - } - - public static boolean deep4233(boolean x) { - return deep4234(x); - } - - public static boolean deep4234(boolean x) { - return deep4235(x); - } - - public static boolean deep4235(boolean x) { - return deep4236(x); - } - - public static boolean deep4236(boolean x) { - return deep4237(x); - } - - public static boolean deep4237(boolean x) { - return deep4238(x); - } - - public static boolean deep4238(boolean x) { - return deep4239(x); - } - - public static boolean deep4239(boolean x) { - return deep4240(x); - } - - public static boolean deep4240(boolean x) { - return deep4241(x); - } - - public static boolean deep4241(boolean x) { - return deep4242(x); - } - - public static boolean deep4242(boolean x) { - return deep4243(x); - } - - public static boolean deep4243(boolean x) { - return deep4244(x); - } - - public static boolean deep4244(boolean x) { - return deep4245(x); - } - - public static boolean deep4245(boolean x) { - return deep4246(x); - } - - public static boolean deep4246(boolean x) { - return deep4247(x); - } - - public static boolean deep4247(boolean x) { - return deep4248(x); - } - - public static boolean deep4248(boolean x) { - return deep4249(x); - } - - public static boolean deep4249(boolean x) { - return deep4250(x); - } - - public static boolean deep4250(boolean x) { - return deep4251(x); - } - - public static boolean deep4251(boolean x) { - return deep4252(x); - } - - public static boolean deep4252(boolean x) { - return deep4253(x); - } - - public static boolean deep4253(boolean x) { - return deep4254(x); - } - - public static boolean deep4254(boolean x) { - return deep4255(x); - } - - public static boolean deep4255(boolean x) { - return deep4256(x); - } - - public static boolean deep4256(boolean x) { - return deep4257(x); - } - - public static boolean deep4257(boolean x) { - return deep4258(x); - } - - public static boolean deep4258(boolean x) { - return deep4259(x); - } - - public static boolean deep4259(boolean x) { - return deep4260(x); - } - - public static boolean deep4260(boolean x) { - return deep4261(x); - } - - public static boolean deep4261(boolean x) { - return deep4262(x); - } - - public static boolean deep4262(boolean x) { - return deep4263(x); - } - - public static boolean deep4263(boolean x) { - return deep4264(x); - } - - public static boolean deep4264(boolean x) { - return deep4265(x); - } - - public static boolean deep4265(boolean x) { - return deep4266(x); - } - - public static boolean deep4266(boolean x) { - return deep4267(x); - } - - public static boolean deep4267(boolean x) { - return deep4268(x); - } - - public static boolean deep4268(boolean x) { - return deep4269(x); - } - - public static boolean deep4269(boolean x) { - return deep4270(x); - } - - public static boolean deep4270(boolean x) { - return deep4271(x); - } - - public static boolean deep4271(boolean x) { - return deep4272(x); - } - - public static boolean deep4272(boolean x) { - return deep4273(x); - } - - public static boolean deep4273(boolean x) { - return deep4274(x); - } - - public static boolean deep4274(boolean x) { - return deep4275(x); - } - - public static boolean deep4275(boolean x) { - return deep4276(x); - } - - public static boolean deep4276(boolean x) { - return deep4277(x); - } - - public static boolean deep4277(boolean x) { - return deep4278(x); - } - - public static boolean deep4278(boolean x) { - return deep4279(x); - } - - public static boolean deep4279(boolean x) { - return deep4280(x); - } - - public static boolean deep4280(boolean x) { - return deep4281(x); - } - - public static boolean deep4281(boolean x) { - return deep4282(x); - } - - public static boolean deep4282(boolean x) { - return deep4283(x); - } - - public static boolean deep4283(boolean x) { - return deep4284(x); - } - - public static boolean deep4284(boolean x) { - return deep4285(x); - } - - public static boolean deep4285(boolean x) { - return deep4286(x); - } - - public static boolean deep4286(boolean x) { - return deep4287(x); - } - - public static boolean deep4287(boolean x) { - return deep4288(x); - } - - public static boolean deep4288(boolean x) { - return deep4289(x); - } - - public static boolean deep4289(boolean x) { - return deep4290(x); - } - - public static boolean deep4290(boolean x) { - return deep4291(x); - } - - public static boolean deep4291(boolean x) { - return deep4292(x); - } - - public static boolean deep4292(boolean x) { - return deep4293(x); - } - - public static boolean deep4293(boolean x) { - return deep4294(x); - } - - public static boolean deep4294(boolean x) { - return deep4295(x); - } - - public static boolean deep4295(boolean x) { - return deep4296(x); - } - - public static boolean deep4296(boolean x) { - return deep4297(x); - } - - public static boolean deep4297(boolean x) { - return deep4298(x); - } - - public static boolean deep4298(boolean x) { - return deep4299(x); - } - - public static boolean deep4299(boolean x) { - return deep4300(x); - } - - public static boolean deep4300(boolean x) { - return deep4301(x); - } - - public static boolean deep4301(boolean x) { - return deep4302(x); - } - - public static boolean deep4302(boolean x) { - return deep4303(x); - } - - public static boolean deep4303(boolean x) { - return deep4304(x); - } - - public static boolean deep4304(boolean x) { - return deep4305(x); - } - - public static boolean deep4305(boolean x) { - return deep4306(x); - } - - public static boolean deep4306(boolean x) { - return deep4307(x); - } - - public static boolean deep4307(boolean x) { - return deep4308(x); - } - - public static boolean deep4308(boolean x) { - return deep4309(x); - } - - public static boolean deep4309(boolean x) { - return deep4310(x); - } - - public static boolean deep4310(boolean x) { - return deep4311(x); - } - - public static boolean deep4311(boolean x) { - return deep4312(x); - } - - public static boolean deep4312(boolean x) { - return deep4313(x); - } - - public static boolean deep4313(boolean x) { - return deep4314(x); - } - - public static boolean deep4314(boolean x) { - return deep4315(x); - } - - public static boolean deep4315(boolean x) { - return deep4316(x); - } - - public static boolean deep4316(boolean x) { - return deep4317(x); - } - - public static boolean deep4317(boolean x) { - return deep4318(x); - } - - public static boolean deep4318(boolean x) { - return deep4319(x); - } - - public static boolean deep4319(boolean x) { - return deep4320(x); - } - - public static boolean deep4320(boolean x) { - return deep4321(x); - } - - public static boolean deep4321(boolean x) { - return deep4322(x); - } - - public static boolean deep4322(boolean x) { - return deep4323(x); - } - - public static boolean deep4323(boolean x) { - return deep4324(x); - } - - public static boolean deep4324(boolean x) { - return deep4325(x); - } - - public static boolean deep4325(boolean x) { - return deep4326(x); - } - - public static boolean deep4326(boolean x) { - return deep4327(x); - } - - public static boolean deep4327(boolean x) { - return deep4328(x); - } - - public static boolean deep4328(boolean x) { - return deep4329(x); - } - - public static boolean deep4329(boolean x) { - return deep4330(x); - } - - public static boolean deep4330(boolean x) { - return deep4331(x); - } - - public static boolean deep4331(boolean x) { - return deep4332(x); - } - - public static boolean deep4332(boolean x) { - return deep4333(x); - } - - public static boolean deep4333(boolean x) { - return deep4334(x); - } - - public static boolean deep4334(boolean x) { - return deep4335(x); - } - - public static boolean deep4335(boolean x) { - return deep4336(x); - } - - public static boolean deep4336(boolean x) { - return deep4337(x); - } - - public static boolean deep4337(boolean x) { - return deep4338(x); - } - - public static boolean deep4338(boolean x) { - return deep4339(x); - } - - public static boolean deep4339(boolean x) { - return deep4340(x); - } - - public static boolean deep4340(boolean x) { - return deep4341(x); - } - - public static boolean deep4341(boolean x) { - return deep4342(x); - } - - public static boolean deep4342(boolean x) { - return deep4343(x); - } - - public static boolean deep4343(boolean x) { - return deep4344(x); - } - - public static boolean deep4344(boolean x) { - return deep4345(x); - } - - public static boolean deep4345(boolean x) { - return deep4346(x); - } - - public static boolean deep4346(boolean x) { - return deep4347(x); - } - - public static boolean deep4347(boolean x) { - return deep4348(x); - } - - public static boolean deep4348(boolean x) { - return deep4349(x); - } - - public static boolean deep4349(boolean x) { - return deep4350(x); - } - - public static boolean deep4350(boolean x) { - return deep4351(x); - } - - public static boolean deep4351(boolean x) { - return deep4352(x); - } - - public static boolean deep4352(boolean x) { - return deep4353(x); - } - - public static boolean deep4353(boolean x) { - return deep4354(x); - } - - public static boolean deep4354(boolean x) { - return deep4355(x); - } - - public static boolean deep4355(boolean x) { - return deep4356(x); - } - - public static boolean deep4356(boolean x) { - return deep4357(x); - } - - public static boolean deep4357(boolean x) { - return deep4358(x); - } - - public static boolean deep4358(boolean x) { - return deep4359(x); - } - - public static boolean deep4359(boolean x) { - return deep4360(x); - } - - public static boolean deep4360(boolean x) { - return deep4361(x); - } - - public static boolean deep4361(boolean x) { - return deep4362(x); - } - - public static boolean deep4362(boolean x) { - return deep4363(x); - } - - public static boolean deep4363(boolean x) { - return deep4364(x); - } - - public static boolean deep4364(boolean x) { - return deep4365(x); - } - - public static boolean deep4365(boolean x) { - return deep4366(x); - } - - public static boolean deep4366(boolean x) { - return deep4367(x); - } - - public static boolean deep4367(boolean x) { - return deep4368(x); - } - - public static boolean deep4368(boolean x) { - return deep4369(x); - } - - public static boolean deep4369(boolean x) { - return deep4370(x); - } - - public static boolean deep4370(boolean x) { - return deep4371(x); - } - - public static boolean deep4371(boolean x) { - return deep4372(x); - } - - public static boolean deep4372(boolean x) { - return deep4373(x); - } - - public static boolean deep4373(boolean x) { - return deep4374(x); - } - - public static boolean deep4374(boolean x) { - return deep4375(x); - } - - public static boolean deep4375(boolean x) { - return deep4376(x); - } - - public static boolean deep4376(boolean x) { - return deep4377(x); - } - - public static boolean deep4377(boolean x) { - return deep4378(x); - } - - public static boolean deep4378(boolean x) { - return deep4379(x); - } - - public static boolean deep4379(boolean x) { - return deep4380(x); - } - - public static boolean deep4380(boolean x) { - return deep4381(x); - } - - public static boolean deep4381(boolean x) { - return deep4382(x); - } - - public static boolean deep4382(boolean x) { - return deep4383(x); - } - - public static boolean deep4383(boolean x) { - return deep4384(x); - } - - public static boolean deep4384(boolean x) { - return deep4385(x); - } - - public static boolean deep4385(boolean x) { - return deep4386(x); - } - - public static boolean deep4386(boolean x) { - return deep4387(x); - } - - public static boolean deep4387(boolean x) { - return deep4388(x); - } - - public static boolean deep4388(boolean x) { - return deep4389(x); - } - - public static boolean deep4389(boolean x) { - return deep4390(x); - } - - public static boolean deep4390(boolean x) { - return deep4391(x); - } - - public static boolean deep4391(boolean x) { - return deep4392(x); - } - - public static boolean deep4392(boolean x) { - return deep4393(x); - } - - public static boolean deep4393(boolean x) { - return deep4394(x); - } - - public static boolean deep4394(boolean x) { - return deep4395(x); - } - - public static boolean deep4395(boolean x) { - return deep4396(x); - } - - public static boolean deep4396(boolean x) { - return deep4397(x); - } - - public static boolean deep4397(boolean x) { - return deep4398(x); - } - - public static boolean deep4398(boolean x) { - return deep4399(x); - } - - public static boolean deep4399(boolean x) { - return deep4400(x); - } - - public static boolean deep4400(boolean x) { - return deep4401(x); - } - - public static boolean deep4401(boolean x) { - return deep4402(x); - } - - public static boolean deep4402(boolean x) { - return deep4403(x); - } - - public static boolean deep4403(boolean x) { - return deep4404(x); - } - - public static boolean deep4404(boolean x) { - return deep4405(x); - } - - public static boolean deep4405(boolean x) { - return deep4406(x); - } - - public static boolean deep4406(boolean x) { - return deep4407(x); - } - - public static boolean deep4407(boolean x) { - return deep4408(x); - } - - public static boolean deep4408(boolean x) { - return deep4409(x); - } - - public static boolean deep4409(boolean x) { - return deep4410(x); - } - - public static boolean deep4410(boolean x) { - return deep4411(x); - } - - public static boolean deep4411(boolean x) { - return deep4412(x); - } - - public static boolean deep4412(boolean x) { - return deep4413(x); - } - - public static boolean deep4413(boolean x) { - return deep4414(x); - } - - public static boolean deep4414(boolean x) { - return deep4415(x); - } - - public static boolean deep4415(boolean x) { - return deep4416(x); - } - - public static boolean deep4416(boolean x) { - return deep4417(x); - } - - public static boolean deep4417(boolean x) { - return deep4418(x); - } - - public static boolean deep4418(boolean x) { - return deep4419(x); - } - - public static boolean deep4419(boolean x) { - return deep4420(x); - } - - public static boolean deep4420(boolean x) { - return deep4421(x); - } - - public static boolean deep4421(boolean x) { - return deep4422(x); - } - - public static boolean deep4422(boolean x) { - return deep4423(x); - } - - public static boolean deep4423(boolean x) { - return deep4424(x); - } - - public static boolean deep4424(boolean x) { - return deep4425(x); - } - - public static boolean deep4425(boolean x) { - return deep4426(x); - } - - public static boolean deep4426(boolean x) { - return deep4427(x); - } - - public static boolean deep4427(boolean x) { - return deep4428(x); - } - - public static boolean deep4428(boolean x) { - return deep4429(x); - } - - public static boolean deep4429(boolean x) { - return deep4430(x); - } - - public static boolean deep4430(boolean x) { - return deep4431(x); - } - - public static boolean deep4431(boolean x) { - return deep4432(x); - } - - public static boolean deep4432(boolean x) { - return deep4433(x); - } - - public static boolean deep4433(boolean x) { - return deep4434(x); - } - - public static boolean deep4434(boolean x) { - return deep4435(x); - } - - public static boolean deep4435(boolean x) { - return deep4436(x); - } - - public static boolean deep4436(boolean x) { - return deep4437(x); - } - - public static boolean deep4437(boolean x) { - return deep4438(x); - } - - public static boolean deep4438(boolean x) { - return deep4439(x); - } - - public static boolean deep4439(boolean x) { - return deep4440(x); - } - - public static boolean deep4440(boolean x) { - return deep4441(x); - } - - public static boolean deep4441(boolean x) { - return deep4442(x); - } - - public static boolean deep4442(boolean x) { - return deep4443(x); - } - - public static boolean deep4443(boolean x) { - return deep4444(x); - } - - public static boolean deep4444(boolean x) { - return deep4445(x); - } - - public static boolean deep4445(boolean x) { - return deep4446(x); - } - - public static boolean deep4446(boolean x) { - return deep4447(x); - } - - public static boolean deep4447(boolean x) { - return deep4448(x); - } - - public static boolean deep4448(boolean x) { - return deep4449(x); - } - - public static boolean deep4449(boolean x) { - return deep4450(x); - } - - public static boolean deep4450(boolean x) { - return deep4451(x); - } - - public static boolean deep4451(boolean x) { - return deep4452(x); - } - - public static boolean deep4452(boolean x) { - return deep4453(x); - } - - public static boolean deep4453(boolean x) { - return deep4454(x); - } - - public static boolean deep4454(boolean x) { - return deep4455(x); - } - - public static boolean deep4455(boolean x) { - return deep4456(x); - } - - public static boolean deep4456(boolean x) { - return deep4457(x); - } - - public static boolean deep4457(boolean x) { - return deep4458(x); - } - - public static boolean deep4458(boolean x) { - return deep4459(x); - } - - public static boolean deep4459(boolean x) { - return deep4460(x); - } - - public static boolean deep4460(boolean x) { - return deep4461(x); - } - - public static boolean deep4461(boolean x) { - return deep4462(x); - } - - public static boolean deep4462(boolean x) { - return deep4463(x); - } - - public static boolean deep4463(boolean x) { - return deep4464(x); - } - - public static boolean deep4464(boolean x) { - return deep4465(x); - } - - public static boolean deep4465(boolean x) { - return deep4466(x); - } - - public static boolean deep4466(boolean x) { - return deep4467(x); - } - - public static boolean deep4467(boolean x) { - return deep4468(x); - } - - public static boolean deep4468(boolean x) { - return deep4469(x); - } - - public static boolean deep4469(boolean x) { - return deep4470(x); - } - - public static boolean deep4470(boolean x) { - return deep4471(x); - } - - public static boolean deep4471(boolean x) { - return deep4472(x); - } - - public static boolean deep4472(boolean x) { - return deep4473(x); - } - - public static boolean deep4473(boolean x) { - return deep4474(x); - } - - public static boolean deep4474(boolean x) { - return deep4475(x); - } - - public static boolean deep4475(boolean x) { - return deep4476(x); - } - - public static boolean deep4476(boolean x) { - return deep4477(x); - } - - public static boolean deep4477(boolean x) { - return deep4478(x); - } - - public static boolean deep4478(boolean x) { - return deep4479(x); - } - - public static boolean deep4479(boolean x) { - return deep4480(x); - } - - public static boolean deep4480(boolean x) { - return deep4481(x); - } - - public static boolean deep4481(boolean x) { - return deep4482(x); - } - - public static boolean deep4482(boolean x) { - return deep4483(x); - } - - public static boolean deep4483(boolean x) { - return deep4484(x); - } - - public static boolean deep4484(boolean x) { - return deep4485(x); - } - - public static boolean deep4485(boolean x) { - return deep4486(x); - } - - public static boolean deep4486(boolean x) { - return deep4487(x); - } - - public static boolean deep4487(boolean x) { - return deep4488(x); - } - - public static boolean deep4488(boolean x) { - return deep4489(x); - } - - public static boolean deep4489(boolean x) { - return deep4490(x); - } - - public static boolean deep4490(boolean x) { - return deep4491(x); - } - - public static boolean deep4491(boolean x) { - return deep4492(x); - } - - public static boolean deep4492(boolean x) { - return deep4493(x); - } - - public static boolean deep4493(boolean x) { - return deep4494(x); - } - - public static boolean deep4494(boolean x) { - return deep4495(x); - } - - public static boolean deep4495(boolean x) { - return deep4496(x); - } - - public static boolean deep4496(boolean x) { - return deep4497(x); - } - - public static boolean deep4497(boolean x) { - return deep4498(x); - } - - public static boolean deep4498(boolean x) { - return deep4499(x); - } - - public static boolean deep4499(boolean x) { - return deep4500(x); - } - - public static boolean deep4500(boolean x) { - return deep4501(x); - } - - public static boolean deep4501(boolean x) { - return deep4502(x); - } - - public static boolean deep4502(boolean x) { - return deep4503(x); - } - - public static boolean deep4503(boolean x) { - return deep4504(x); - } - - public static boolean deep4504(boolean x) { - return deep4505(x); - } - - public static boolean deep4505(boolean x) { - return deep4506(x); - } - - public static boolean deep4506(boolean x) { - return deep4507(x); - } - - public static boolean deep4507(boolean x) { - return deep4508(x); - } - - public static boolean deep4508(boolean x) { - return deep4509(x); - } - - public static boolean deep4509(boolean x) { - return deep4510(x); - } - - public static boolean deep4510(boolean x) { - return deep4511(x); - } - - public static boolean deep4511(boolean x) { - return deep4512(x); - } - - public static boolean deep4512(boolean x) { - return deep4513(x); - } - - public static boolean deep4513(boolean x) { - return deep4514(x); - } - - public static boolean deep4514(boolean x) { - return deep4515(x); - } - - public static boolean deep4515(boolean x) { - return deep4516(x); - } - - public static boolean deep4516(boolean x) { - return deep4517(x); - } - - public static boolean deep4517(boolean x) { - return deep4518(x); - } - - public static boolean deep4518(boolean x) { - return deep4519(x); - } - - public static boolean deep4519(boolean x) { - return deep4520(x); - } - - public static boolean deep4520(boolean x) { - return deep4521(x); - } - - public static boolean deep4521(boolean x) { - return deep4522(x); - } - - public static boolean deep4522(boolean x) { - return deep4523(x); - } - - public static boolean deep4523(boolean x) { - return deep4524(x); - } - - public static boolean deep4524(boolean x) { - return deep4525(x); - } - - public static boolean deep4525(boolean x) { - return deep4526(x); - } - - public static boolean deep4526(boolean x) { - return deep4527(x); - } - - public static boolean deep4527(boolean x) { - return deep4528(x); - } - - public static boolean deep4528(boolean x) { - return deep4529(x); - } - - public static boolean deep4529(boolean x) { - return deep4530(x); - } - - public static boolean deep4530(boolean x) { - return deep4531(x); - } - - public static boolean deep4531(boolean x) { - return deep4532(x); - } - - public static boolean deep4532(boolean x) { - return deep4533(x); - } - - public static boolean deep4533(boolean x) { - return deep4534(x); - } - - public static boolean deep4534(boolean x) { - return deep4535(x); - } - - public static boolean deep4535(boolean x) { - return deep4536(x); - } - - public static boolean deep4536(boolean x) { - return deep4537(x); - } - - public static boolean deep4537(boolean x) { - return deep4538(x); - } - - public static boolean deep4538(boolean x) { - return deep4539(x); - } - - public static boolean deep4539(boolean x) { - return deep4540(x); - } - - public static boolean deep4540(boolean x) { - return deep4541(x); - } - - public static boolean deep4541(boolean x) { - return deep4542(x); - } - - public static boolean deep4542(boolean x) { - return deep4543(x); - } - - public static boolean deep4543(boolean x) { - return deep4544(x); - } - - public static boolean deep4544(boolean x) { - return deep4545(x); - } - - public static boolean deep4545(boolean x) { - return deep4546(x); - } - - public static boolean deep4546(boolean x) { - return deep4547(x); - } - - public static boolean deep4547(boolean x) { - return deep4548(x); - } - - public static boolean deep4548(boolean x) { - return deep4549(x); - } - - public static boolean deep4549(boolean x) { - return deep4550(x); - } - - public static boolean deep4550(boolean x) { - return deep4551(x); - } - - public static boolean deep4551(boolean x) { - return deep4552(x); - } - - public static boolean deep4552(boolean x) { - return deep4553(x); - } - - public static boolean deep4553(boolean x) { - return deep4554(x); - } - - public static boolean deep4554(boolean x) { - return deep4555(x); - } - - public static boolean deep4555(boolean x) { - return deep4556(x); - } - - public static boolean deep4556(boolean x) { - return deep4557(x); - } - - public static boolean deep4557(boolean x) { - return deep4558(x); - } - - public static boolean deep4558(boolean x) { - return deep4559(x); - } - - public static boolean deep4559(boolean x) { - return deep4560(x); - } - - public static boolean deep4560(boolean x) { - return deep4561(x); - } - - public static boolean deep4561(boolean x) { - return deep4562(x); - } - - public static boolean deep4562(boolean x) { - return deep4563(x); - } - - public static boolean deep4563(boolean x) { - return deep4564(x); - } - - public static boolean deep4564(boolean x) { - return deep4565(x); - } - - public static boolean deep4565(boolean x) { - return deep4566(x); - } - - public static boolean deep4566(boolean x) { - return deep4567(x); - } - - public static boolean deep4567(boolean x) { - return deep4568(x); - } - - public static boolean deep4568(boolean x) { - return deep4569(x); - } - - public static boolean deep4569(boolean x) { - return deep4570(x); - } - - public static boolean deep4570(boolean x) { - return deep4571(x); - } - - public static boolean deep4571(boolean x) { - return deep4572(x); - } - - public static boolean deep4572(boolean x) { - return deep4573(x); - } - - public static boolean deep4573(boolean x) { - return deep4574(x); - } - - public static boolean deep4574(boolean x) { - return deep4575(x); - } - - public static boolean deep4575(boolean x) { - return deep4576(x); - } - - public static boolean deep4576(boolean x) { - return deep4577(x); - } - - public static boolean deep4577(boolean x) { - return deep4578(x); - } - - public static boolean deep4578(boolean x) { - return deep4579(x); - } - - public static boolean deep4579(boolean x) { - return deep4580(x); - } - - public static boolean deep4580(boolean x) { - return deep4581(x); - } - - public static boolean deep4581(boolean x) { - return deep4582(x); - } - - public static boolean deep4582(boolean x) { - return deep4583(x); - } - - public static boolean deep4583(boolean x) { - return deep4584(x); - } - - public static boolean deep4584(boolean x) { - return deep4585(x); - } - - public static boolean deep4585(boolean x) { - return deep4586(x); - } - - public static boolean deep4586(boolean x) { - return deep4587(x); - } - - public static boolean deep4587(boolean x) { - return deep4588(x); - } - - public static boolean deep4588(boolean x) { - return deep4589(x); - } - - public static boolean deep4589(boolean x) { - return deep4590(x); - } - - public static boolean deep4590(boolean x) { - return deep4591(x); - } - - public static boolean deep4591(boolean x) { - return deep4592(x); - } - - public static boolean deep4592(boolean x) { - return deep4593(x); - } - - public static boolean deep4593(boolean x) { - return deep4594(x); - } - - public static boolean deep4594(boolean x) { - return deep4595(x); - } - - public static boolean deep4595(boolean x) { - return deep4596(x); - } - - public static boolean deep4596(boolean x) { - return deep4597(x); - } - - public static boolean deep4597(boolean x) { - return deep4598(x); - } - - public static boolean deep4598(boolean x) { - return deep4599(x); - } - - public static boolean deep4599(boolean x) { - return deep4600(x); - } - - public static boolean deep4600(boolean x) { - return deep4601(x); - } - - public static boolean deep4601(boolean x) { - return deep4602(x); - } - - public static boolean deep4602(boolean x) { - return deep4603(x); - } - - public static boolean deep4603(boolean x) { - return deep4604(x); - } - - public static boolean deep4604(boolean x) { - return deep4605(x); - } - - public static boolean deep4605(boolean x) { - return deep4606(x); - } - - public static boolean deep4606(boolean x) { - return deep4607(x); - } - - public static boolean deep4607(boolean x) { - return deep4608(x); - } - - public static boolean deep4608(boolean x) { - return deep4609(x); - } - - public static boolean deep4609(boolean x) { - return deep4610(x); - } - - public static boolean deep4610(boolean x) { - return deep4611(x); - } - - public static boolean deep4611(boolean x) { - return deep4612(x); - } - - public static boolean deep4612(boolean x) { - return deep4613(x); - } - - public static boolean deep4613(boolean x) { - return deep4614(x); - } - - public static boolean deep4614(boolean x) { - return deep4615(x); - } - - public static boolean deep4615(boolean x) { - return deep4616(x); - } - - public static boolean deep4616(boolean x) { - return deep4617(x); - } - - public static boolean deep4617(boolean x) { - return deep4618(x); - } - - public static boolean deep4618(boolean x) { - return deep4619(x); - } - - public static boolean deep4619(boolean x) { - return deep4620(x); - } - - public static boolean deep4620(boolean x) { - return deep4621(x); - } - - public static boolean deep4621(boolean x) { - return deep4622(x); - } - - public static boolean deep4622(boolean x) { - return deep4623(x); - } - - public static boolean deep4623(boolean x) { - return deep4624(x); - } - - public static boolean deep4624(boolean x) { - return deep4625(x); - } - - public static boolean deep4625(boolean x) { - return deep4626(x); - } - - public static boolean deep4626(boolean x) { - return deep4627(x); - } - - public static boolean deep4627(boolean x) { - return deep4628(x); - } - - public static boolean deep4628(boolean x) { - return deep4629(x); - } - - public static boolean deep4629(boolean x) { - return deep4630(x); - } - - public static boolean deep4630(boolean x) { - return deep4631(x); - } - - public static boolean deep4631(boolean x) { - return deep4632(x); - } - - public static boolean deep4632(boolean x) { - return deep4633(x); - } - - public static boolean deep4633(boolean x) { - return deep4634(x); - } - - public static boolean deep4634(boolean x) { - return deep4635(x); - } - - public static boolean deep4635(boolean x) { - return deep4636(x); - } - - public static boolean deep4636(boolean x) { - return deep4637(x); - } - - public static boolean deep4637(boolean x) { - return deep4638(x); - } - - public static boolean deep4638(boolean x) { - return deep4639(x); - } - - public static boolean deep4639(boolean x) { - return deep4640(x); - } - - public static boolean deep4640(boolean x) { - return deep4641(x); - } - - public static boolean deep4641(boolean x) { - return deep4642(x); - } - - public static boolean deep4642(boolean x) { - return deep4643(x); - } - - public static boolean deep4643(boolean x) { - return deep4644(x); - } - - public static boolean deep4644(boolean x) { - return deep4645(x); - } - - public static boolean deep4645(boolean x) { - return deep4646(x); - } - - public static boolean deep4646(boolean x) { - return deep4647(x); - } - - public static boolean deep4647(boolean x) { - return deep4648(x); - } - - public static boolean deep4648(boolean x) { - return deep4649(x); - } - - public static boolean deep4649(boolean x) { - return deep4650(x); - } - - public static boolean deep4650(boolean x) { - return deep4651(x); - } - - public static boolean deep4651(boolean x) { - return deep4652(x); - } - - public static boolean deep4652(boolean x) { - return deep4653(x); - } - - public static boolean deep4653(boolean x) { - return deep4654(x); - } - - public static boolean deep4654(boolean x) { - return deep4655(x); - } - - public static boolean deep4655(boolean x) { - return deep4656(x); - } - - public static boolean deep4656(boolean x) { - return deep4657(x); - } - - public static boolean deep4657(boolean x) { - return deep4658(x); - } - - public static boolean deep4658(boolean x) { - return deep4659(x); - } - - public static boolean deep4659(boolean x) { - return deep4660(x); - } - - public static boolean deep4660(boolean x) { - return deep4661(x); - } - - public static boolean deep4661(boolean x) { - return deep4662(x); - } - - public static boolean deep4662(boolean x) { - return deep4663(x); - } - - public static boolean deep4663(boolean x) { - return deep4664(x); - } - - public static boolean deep4664(boolean x) { - return deep4665(x); - } - - public static boolean deep4665(boolean x) { - return deep4666(x); - } - - public static boolean deep4666(boolean x) { - return deep4667(x); - } - - public static boolean deep4667(boolean x) { - return deep4668(x); - } - - public static boolean deep4668(boolean x) { - return deep4669(x); - } - - public static boolean deep4669(boolean x) { - return deep4670(x); - } - - public static boolean deep4670(boolean x) { - return deep4671(x); - } - - public static boolean deep4671(boolean x) { - return deep4672(x); - } - - public static boolean deep4672(boolean x) { - return deep4673(x); - } - - public static boolean deep4673(boolean x) { - return deep4674(x); - } - - public static boolean deep4674(boolean x) { - return deep4675(x); - } - - public static boolean deep4675(boolean x) { - return deep4676(x); - } - - public static boolean deep4676(boolean x) { - return deep4677(x); - } - - public static boolean deep4677(boolean x) { - return deep4678(x); - } - - public static boolean deep4678(boolean x) { - return deep4679(x); - } - - public static boolean deep4679(boolean x) { - return deep4680(x); - } - - public static boolean deep4680(boolean x) { - return deep4681(x); - } - - public static boolean deep4681(boolean x) { - return deep4682(x); - } - - public static boolean deep4682(boolean x) { - return deep4683(x); - } - - public static boolean deep4683(boolean x) { - return deep4684(x); - } - - public static boolean deep4684(boolean x) { - return deep4685(x); - } - - public static boolean deep4685(boolean x) { - return deep4686(x); - } - - public static boolean deep4686(boolean x) { - return deep4687(x); - } - - public static boolean deep4687(boolean x) { - return deep4688(x); - } - - public static boolean deep4688(boolean x) { - return deep4689(x); - } - - public static boolean deep4689(boolean x) { - return deep4690(x); - } - - public static boolean deep4690(boolean x) { - return deep4691(x); - } - - public static boolean deep4691(boolean x) { - return deep4692(x); - } - - public static boolean deep4692(boolean x) { - return deep4693(x); - } - - public static boolean deep4693(boolean x) { - return deep4694(x); - } - - public static boolean deep4694(boolean x) { - return deep4695(x); - } - - public static boolean deep4695(boolean x) { - return deep4696(x); - } - - public static boolean deep4696(boolean x) { - return deep4697(x); - } - - public static boolean deep4697(boolean x) { - return deep4698(x); - } - - public static boolean deep4698(boolean x) { - return deep4699(x); - } - - public static boolean deep4699(boolean x) { - return deep4700(x); - } - - public static boolean deep4700(boolean x) { - return deep4701(x); - } - - public static boolean deep4701(boolean x) { - return deep4702(x); - } - - public static boolean deep4702(boolean x) { - return deep4703(x); - } - - public static boolean deep4703(boolean x) { - return deep4704(x); - } - - public static boolean deep4704(boolean x) { - return deep4705(x); - } - - public static boolean deep4705(boolean x) { - return deep4706(x); - } - - public static boolean deep4706(boolean x) { - return deep4707(x); - } - - public static boolean deep4707(boolean x) { - return deep4708(x); - } - - public static boolean deep4708(boolean x) { - return deep4709(x); - } - - public static boolean deep4709(boolean x) { - return deep4710(x); - } - - public static boolean deep4710(boolean x) { - return deep4711(x); - } - - public static boolean deep4711(boolean x) { - return deep4712(x); - } - - public static boolean deep4712(boolean x) { - return deep4713(x); - } - - public static boolean deep4713(boolean x) { - return deep4714(x); - } - - public static boolean deep4714(boolean x) { - return deep4715(x); - } - - public static boolean deep4715(boolean x) { - return deep4716(x); - } - - public static boolean deep4716(boolean x) { - return deep4717(x); - } - - public static boolean deep4717(boolean x) { - return deep4718(x); - } - - public static boolean deep4718(boolean x) { - return deep4719(x); - } - - public static boolean deep4719(boolean x) { - return deep4720(x); - } - - public static boolean deep4720(boolean x) { - return deep4721(x); - } - - public static boolean deep4721(boolean x) { - return deep4722(x); - } - - public static boolean deep4722(boolean x) { - return deep4723(x); - } - - public static boolean deep4723(boolean x) { - return deep4724(x); - } - - public static boolean deep4724(boolean x) { - return deep4725(x); - } - - public static boolean deep4725(boolean x) { - return deep4726(x); - } - - public static boolean deep4726(boolean x) { - return deep4727(x); - } - - public static boolean deep4727(boolean x) { - return deep4728(x); - } - - public static boolean deep4728(boolean x) { - return deep4729(x); - } - - public static boolean deep4729(boolean x) { - return deep4730(x); - } - - public static boolean deep4730(boolean x) { - return deep4731(x); - } - - public static boolean deep4731(boolean x) { - return deep4732(x); - } - - public static boolean deep4732(boolean x) { - return deep4733(x); - } - - public static boolean deep4733(boolean x) { - return deep4734(x); - } - - public static boolean deep4734(boolean x) { - return deep4735(x); - } - - public static boolean deep4735(boolean x) { - return deep4736(x); - } - - public static boolean deep4736(boolean x) { - return deep4737(x); - } - - public static boolean deep4737(boolean x) { - return deep4738(x); - } - - public static boolean deep4738(boolean x) { - return deep4739(x); - } - - public static boolean deep4739(boolean x) { - return deep4740(x); - } - - public static boolean deep4740(boolean x) { - return deep4741(x); - } - - public static boolean deep4741(boolean x) { - return deep4742(x); - } - - public static boolean deep4742(boolean x) { - return deep4743(x); - } - - public static boolean deep4743(boolean x) { - return deep4744(x); - } - - public static boolean deep4744(boolean x) { - return deep4745(x); - } - - public static boolean deep4745(boolean x) { - return deep4746(x); - } - - public static boolean deep4746(boolean x) { - return deep4747(x); - } - - public static boolean deep4747(boolean x) { - return deep4748(x); - } - - public static boolean deep4748(boolean x) { - return deep4749(x); - } - - public static boolean deep4749(boolean x) { - return deep4750(x); - } - - public static boolean deep4750(boolean x) { - return deep4751(x); - } - - public static boolean deep4751(boolean x) { - return deep4752(x); - } - - public static boolean deep4752(boolean x) { - return deep4753(x); - } - - public static boolean deep4753(boolean x) { - return deep4754(x); - } - - public static boolean deep4754(boolean x) { - return deep4755(x); - } - - public static boolean deep4755(boolean x) { - return deep4756(x); - } - - public static boolean deep4756(boolean x) { - return deep4757(x); - } - - public static boolean deep4757(boolean x) { - return deep4758(x); - } - - public static boolean deep4758(boolean x) { - return deep4759(x); - } - - public static boolean deep4759(boolean x) { - return deep4760(x); - } - - public static boolean deep4760(boolean x) { - return deep4761(x); - } - - public static boolean deep4761(boolean x) { - return deep4762(x); - } - - public static boolean deep4762(boolean x) { - return deep4763(x); - } - - public static boolean deep4763(boolean x) { - return deep4764(x); - } - - public static boolean deep4764(boolean x) { - return deep4765(x); - } - - public static boolean deep4765(boolean x) { - return deep4766(x); - } - - public static boolean deep4766(boolean x) { - return deep4767(x); - } - - public static boolean deep4767(boolean x) { - return deep4768(x); - } - - public static boolean deep4768(boolean x) { - return deep4769(x); - } - - public static boolean deep4769(boolean x) { - return deep4770(x); - } - - public static boolean deep4770(boolean x) { - return deep4771(x); - } - - public static boolean deep4771(boolean x) { - return deep4772(x); - } - - public static boolean deep4772(boolean x) { - return deep4773(x); - } - - public static boolean deep4773(boolean x) { - return deep4774(x); - } - - public static boolean deep4774(boolean x) { - return deep4775(x); - } - - public static boolean deep4775(boolean x) { - return deep4776(x); - } - - public static boolean deep4776(boolean x) { - return deep4777(x); - } - - public static boolean deep4777(boolean x) { - return deep4778(x); - } - - public static boolean deep4778(boolean x) { - return deep4779(x); - } - - public static boolean deep4779(boolean x) { - return deep4780(x); - } - - public static boolean deep4780(boolean x) { - return deep4781(x); - } - - public static boolean deep4781(boolean x) { - return deep4782(x); - } - - public static boolean deep4782(boolean x) { - return deep4783(x); - } - - public static boolean deep4783(boolean x) { - return deep4784(x); - } - - public static boolean deep4784(boolean x) { - return deep4785(x); - } - - public static boolean deep4785(boolean x) { - return deep4786(x); - } - - public static boolean deep4786(boolean x) { - return deep4787(x); - } - - public static boolean deep4787(boolean x) { - return deep4788(x); - } - - public static boolean deep4788(boolean x) { - return deep4789(x); - } - - public static boolean deep4789(boolean x) { - return deep4790(x); - } - - public static boolean deep4790(boolean x) { - return deep4791(x); - } - - public static boolean deep4791(boolean x) { - return deep4792(x); - } - - public static boolean deep4792(boolean x) { - return deep4793(x); - } - - public static boolean deep4793(boolean x) { - return deep4794(x); - } - - public static boolean deep4794(boolean x) { - return deep4795(x); - } - - public static boolean deep4795(boolean x) { - return deep4796(x); - } - - public static boolean deep4796(boolean x) { - return deep4797(x); - } - - public static boolean deep4797(boolean x) { - return deep4798(x); - } - - public static boolean deep4798(boolean x) { - return deep4799(x); - } - - public static boolean deep4799(boolean x) { - return deep4800(x); - } - - public static boolean deep4800(boolean x) { - return deep4801(x); - } - - public static boolean deep4801(boolean x) { - return deep4802(x); - } - - public static boolean deep4802(boolean x) { - return deep4803(x); - } - - public static boolean deep4803(boolean x) { - return deep4804(x); - } - - public static boolean deep4804(boolean x) { - return deep4805(x); - } - - public static boolean deep4805(boolean x) { - return deep4806(x); - } - - public static boolean deep4806(boolean x) { - return deep4807(x); - } - - public static boolean deep4807(boolean x) { - return deep4808(x); - } - - public static boolean deep4808(boolean x) { - return deep4809(x); - } - - public static boolean deep4809(boolean x) { - return deep4810(x); - } - - public static boolean deep4810(boolean x) { - return deep4811(x); - } - - public static boolean deep4811(boolean x) { - return deep4812(x); - } - - public static boolean deep4812(boolean x) { - return deep4813(x); - } - - public static boolean deep4813(boolean x) { - return deep4814(x); - } - - public static boolean deep4814(boolean x) { - return deep4815(x); - } - - public static boolean deep4815(boolean x) { - return deep4816(x); - } - - public static boolean deep4816(boolean x) { - return deep4817(x); - } - - public static boolean deep4817(boolean x) { - return deep4818(x); - } - - public static boolean deep4818(boolean x) { - return deep4819(x); - } - - public static boolean deep4819(boolean x) { - return deep4820(x); - } - - public static boolean deep4820(boolean x) { - return deep4821(x); - } - - public static boolean deep4821(boolean x) { - return deep4822(x); - } - - public static boolean deep4822(boolean x) { - return deep4823(x); - } - - public static boolean deep4823(boolean x) { - return deep4824(x); - } - - public static boolean deep4824(boolean x) { - return deep4825(x); - } - - public static boolean deep4825(boolean x) { - return deep4826(x); - } - - public static boolean deep4826(boolean x) { - return deep4827(x); - } - - public static boolean deep4827(boolean x) { - return deep4828(x); - } - - public static boolean deep4828(boolean x) { - return deep4829(x); - } - - public static boolean deep4829(boolean x) { - return deep4830(x); - } - - public static boolean deep4830(boolean x) { - return deep4831(x); - } - - public static boolean deep4831(boolean x) { - return deep4832(x); - } - - public static boolean deep4832(boolean x) { - return deep4833(x); - } - - public static boolean deep4833(boolean x) { - return deep4834(x); - } - - public static boolean deep4834(boolean x) { - return deep4835(x); - } - - public static boolean deep4835(boolean x) { - return deep4836(x); - } - - public static boolean deep4836(boolean x) { - return deep4837(x); - } - - public static boolean deep4837(boolean x) { - return deep4838(x); - } - - public static boolean deep4838(boolean x) { - return deep4839(x); - } - - public static boolean deep4839(boolean x) { - return deep4840(x); - } - - public static boolean deep4840(boolean x) { - return deep4841(x); - } - - public static boolean deep4841(boolean x) { - return deep4842(x); - } - - public static boolean deep4842(boolean x) { - return deep4843(x); - } - - public static boolean deep4843(boolean x) { - return deep4844(x); - } - - public static boolean deep4844(boolean x) { - return deep4845(x); - } - - public static boolean deep4845(boolean x) { - return deep4846(x); - } - - public static boolean deep4846(boolean x) { - return deep4847(x); - } - - public static boolean deep4847(boolean x) { - return deep4848(x); - } - - public static boolean deep4848(boolean x) { - return deep4849(x); - } - - public static boolean deep4849(boolean x) { - return deep4850(x); - } - - public static boolean deep4850(boolean x) { - return deep4851(x); - } - - public static boolean deep4851(boolean x) { - return deep4852(x); - } - - public static boolean deep4852(boolean x) { - return deep4853(x); - } - - public static boolean deep4853(boolean x) { - return deep4854(x); - } - - public static boolean deep4854(boolean x) { - return deep4855(x); - } - - public static boolean deep4855(boolean x) { - return deep4856(x); - } - - public static boolean deep4856(boolean x) { - return deep4857(x); - } - - public static boolean deep4857(boolean x) { - return deep4858(x); - } - - public static boolean deep4858(boolean x) { - return deep4859(x); - } - - public static boolean deep4859(boolean x) { - return deep4860(x); - } - - public static boolean deep4860(boolean x) { - return deep4861(x); - } - - public static boolean deep4861(boolean x) { - return deep4862(x); - } - - public static boolean deep4862(boolean x) { - return deep4863(x); - } - - public static boolean deep4863(boolean x) { - return deep4864(x); - } - - public static boolean deep4864(boolean x) { - return deep4865(x); - } - - public static boolean deep4865(boolean x) { - return deep4866(x); - } - - public static boolean deep4866(boolean x) { - return deep4867(x); - } - - public static boolean deep4867(boolean x) { - return deep4868(x); - } - - public static boolean deep4868(boolean x) { - return deep4869(x); - } - - public static boolean deep4869(boolean x) { - return deep4870(x); - } - - public static boolean deep4870(boolean x) { - return deep4871(x); - } - - public static boolean deep4871(boolean x) { - return deep4872(x); - } - - public static boolean deep4872(boolean x) { - return deep4873(x); - } - - public static boolean deep4873(boolean x) { - return deep4874(x); - } - - public static boolean deep4874(boolean x) { - return deep4875(x); - } - - public static boolean deep4875(boolean x) { - return deep4876(x); - } - - public static boolean deep4876(boolean x) { - return deep4877(x); - } - - public static boolean deep4877(boolean x) { - return deep4878(x); - } - - public static boolean deep4878(boolean x) { - return deep4879(x); - } - - public static boolean deep4879(boolean x) { - return deep4880(x); - } - - public static boolean deep4880(boolean x) { - return deep4881(x); - } - - public static boolean deep4881(boolean x) { - return deep4882(x); - } - - public static boolean deep4882(boolean x) { - return deep4883(x); - } - - public static boolean deep4883(boolean x) { - return deep4884(x); - } - - public static boolean deep4884(boolean x) { - return deep4885(x); - } - - public static boolean deep4885(boolean x) { - return deep4886(x); - } - - public static boolean deep4886(boolean x) { - return deep4887(x); - } - - public static boolean deep4887(boolean x) { - return deep4888(x); - } - - public static boolean deep4888(boolean x) { - return deep4889(x); - } - - public static boolean deep4889(boolean x) { - return deep4890(x); - } - - public static boolean deep4890(boolean x) { - return deep4891(x); - } - - public static boolean deep4891(boolean x) { - return deep4892(x); - } - - public static boolean deep4892(boolean x) { - return deep4893(x); - } - - public static boolean deep4893(boolean x) { - return deep4894(x); - } - - public static boolean deep4894(boolean x) { - return deep4895(x); - } - - public static boolean deep4895(boolean x) { - return deep4896(x); - } - - public static boolean deep4896(boolean x) { - return deep4897(x); - } - - public static boolean deep4897(boolean x) { - return deep4898(x); - } - - public static boolean deep4898(boolean x) { - return deep4899(x); - } - - public static boolean deep4899(boolean x) { - return deep4900(x); - } - - public static boolean deep4900(boolean x) { - return deep4901(x); - } - - public static boolean deep4901(boolean x) { - return deep4902(x); - } - - public static boolean deep4902(boolean x) { - return deep4903(x); - } - - public static boolean deep4903(boolean x) { - return deep4904(x); - } - - public static boolean deep4904(boolean x) { - return deep4905(x); - } - - public static boolean deep4905(boolean x) { - return deep4906(x); - } - - public static boolean deep4906(boolean x) { - return deep4907(x); - } - - public static boolean deep4907(boolean x) { - return deep4908(x); - } - - public static boolean deep4908(boolean x) { - return deep4909(x); - } - - public static boolean deep4909(boolean x) { - return deep4910(x); - } - - public static boolean deep4910(boolean x) { - return deep4911(x); - } - - public static boolean deep4911(boolean x) { - return deep4912(x); - } - - public static boolean deep4912(boolean x) { - return deep4913(x); - } - - public static boolean deep4913(boolean x) { - return deep4914(x); - } - - public static boolean deep4914(boolean x) { - return deep4915(x); - } - - public static boolean deep4915(boolean x) { - return deep4916(x); - } - - public static boolean deep4916(boolean x) { - return deep4917(x); - } - - public static boolean deep4917(boolean x) { - return deep4918(x); - } - - public static boolean deep4918(boolean x) { - return deep4919(x); - } - - public static boolean deep4919(boolean x) { - return deep4920(x); - } - - public static boolean deep4920(boolean x) { - return deep4921(x); - } - - public static boolean deep4921(boolean x) { - return deep4922(x); - } - - public static boolean deep4922(boolean x) { - return deep4923(x); - } - - public static boolean deep4923(boolean x) { - return deep4924(x); - } - - public static boolean deep4924(boolean x) { - return deep4925(x); - } - - public static boolean deep4925(boolean x) { - return deep4926(x); - } - - public static boolean deep4926(boolean x) { - return deep4927(x); - } - - public static boolean deep4927(boolean x) { - return deep4928(x); - } - - public static boolean deep4928(boolean x) { - return deep4929(x); - } - - public static boolean deep4929(boolean x) { - return deep4930(x); - } - - public static boolean deep4930(boolean x) { - return deep4931(x); - } - - public static boolean deep4931(boolean x) { - return deep4932(x); - } - - public static boolean deep4932(boolean x) { - return deep4933(x); - } - - public static boolean deep4933(boolean x) { - return deep4934(x); - } - - public static boolean deep4934(boolean x) { - return deep4935(x); - } - - public static boolean deep4935(boolean x) { - return deep4936(x); - } - - public static boolean deep4936(boolean x) { - return deep4937(x); - } - - public static boolean deep4937(boolean x) { - return deep4938(x); - } - - public static boolean deep4938(boolean x) { - return deep4939(x); - } - - public static boolean deep4939(boolean x) { - return deep4940(x); - } - - public static boolean deep4940(boolean x) { - return deep4941(x); - } - - public static boolean deep4941(boolean x) { - return deep4942(x); - } - - public static boolean deep4942(boolean x) { - return deep4943(x); - } - - public static boolean deep4943(boolean x) { - return deep4944(x); - } - - public static boolean deep4944(boolean x) { - return deep4945(x); - } - - public static boolean deep4945(boolean x) { - return deep4946(x); - } - - public static boolean deep4946(boolean x) { - return deep4947(x); - } - - public static boolean deep4947(boolean x) { - return deep4948(x); - } - - public static boolean deep4948(boolean x) { - return deep4949(x); - } - - public static boolean deep4949(boolean x) { - return deep4950(x); - } - - public static boolean deep4950(boolean x) { - return deep4951(x); - } - - public static boolean deep4951(boolean x) { - return deep4952(x); - } - - public static boolean deep4952(boolean x) { - return deep4953(x); - } - - public static boolean deep4953(boolean x) { - return deep4954(x); - } - - public static boolean deep4954(boolean x) { - return deep4955(x); - } - - public static boolean deep4955(boolean x) { - return deep4956(x); - } - - public static boolean deep4956(boolean x) { - return deep4957(x); - } - - public static boolean deep4957(boolean x) { - return deep4958(x); - } - - public static boolean deep4958(boolean x) { - return deep4959(x); - } - - public static boolean deep4959(boolean x) { - return deep4960(x); - } - - public static boolean deep4960(boolean x) { - return deep4961(x); - } - - public static boolean deep4961(boolean x) { - return deep4962(x); - } - - public static boolean deep4962(boolean x) { - return deep4963(x); - } - - public static boolean deep4963(boolean x) { - return deep4964(x); - } - - public static boolean deep4964(boolean x) { - return deep4965(x); - } - - public static boolean deep4965(boolean x) { - return deep4966(x); - } - - public static boolean deep4966(boolean x) { - return deep4967(x); - } - - public static boolean deep4967(boolean x) { - return deep4968(x); - } - - public static boolean deep4968(boolean x) { - return deep4969(x); - } - - public static boolean deep4969(boolean x) { - return deep4970(x); - } - - public static boolean deep4970(boolean x) { - return deep4971(x); - } - - public static boolean deep4971(boolean x) { - return deep4972(x); - } - - public static boolean deep4972(boolean x) { - return deep4973(x); - } - - public static boolean deep4973(boolean x) { - return deep4974(x); - } - - public static boolean deep4974(boolean x) { - return deep4975(x); - } - - public static boolean deep4975(boolean x) { - return deep4976(x); - } - - public static boolean deep4976(boolean x) { - return deep4977(x); - } - - public static boolean deep4977(boolean x) { - return deep4978(x); - } - - public static boolean deep4978(boolean x) { - return deep4979(x); - } - - public static boolean deep4979(boolean x) { - return deep4980(x); - } - - public static boolean deep4980(boolean x) { - return deep4981(x); - } - - public static boolean deep4981(boolean x) { - return deep4982(x); - } - - public static boolean deep4982(boolean x) { - return deep4983(x); - } - - public static boolean deep4983(boolean x) { - return deep4984(x); - } - - public static boolean deep4984(boolean x) { - return deep4985(x); - } - - public static boolean deep4985(boolean x) { - return deep4986(x); - } - - public static boolean deep4986(boolean x) { - return deep4987(x); - } - - public static boolean deep4987(boolean x) { - return deep4988(x); - } - - public static boolean deep4988(boolean x) { - return deep4989(x); - } - - public static boolean deep4989(boolean x) { - return deep4990(x); - } - - public static boolean deep4990(boolean x) { - return deep4991(x); - } - - public static boolean deep4991(boolean x) { - return deep4992(x); - } - - public static boolean deep4992(boolean x) { - return deep4993(x); - } - - public static boolean deep4993(boolean x) { - return deep4994(x); - } - - public static boolean deep4994(boolean x) { - return deep4995(x); - } - - public static boolean deep4995(boolean x) { - return deep4996(x); - } - - public static boolean deep4996(boolean x) { - return deep4997(x); - } - - public static boolean deep4997(boolean x) { - return deep4998(x); - } - - public static boolean deep4998(boolean x) { - return deep4999(x); - } - - public static boolean deep4999(boolean x) { - return deep5000(x); - } - - public static boolean deep5000(boolean x) { - return deep5001(x); - } - - public static boolean deep5001(boolean x) { - return deep5002(x); - } - - public static boolean deep5002(boolean x) { - return deep5003(x); - } - - public static boolean deep5003(boolean x) { - return deep5004(x); - } - - public static boolean deep5004(boolean x) { - return deep5005(x); - } - - public static boolean deep5005(boolean x) { - return deep5006(x); - } - - public static boolean deep5006(boolean x) { - return deep5007(x); - } - - public static boolean deep5007(boolean x) { - return deep5008(x); - } - - public static boolean deep5008(boolean x) { - return deep5009(x); - } - - public static boolean deep5009(boolean x) { - return deep5010(x); - } - - public static boolean deep5010(boolean x) { - return deep5011(x); - } - - public static boolean deep5011(boolean x) { - return deep5012(x); - } - - public static boolean deep5012(boolean x) { - return deep5013(x); - } - - public static boolean deep5013(boolean x) { - return deep5014(x); - } - - public static boolean deep5014(boolean x) { - return deep5015(x); - } - - public static boolean deep5015(boolean x) { - return deep5016(x); - } - - public static boolean deep5016(boolean x) { - return deep5017(x); - } - - public static boolean deep5017(boolean x) { - return deep5018(x); - } - - public static boolean deep5018(boolean x) { - return deep5019(x); - } - - public static boolean deep5019(boolean x) { - return deep5020(x); - } - - public static boolean deep5020(boolean x) { - return deep5021(x); - } - - public static boolean deep5021(boolean x) { - return deep5022(x); - } - - public static boolean deep5022(boolean x) { - return deep5023(x); - } - - public static boolean deep5023(boolean x) { - return deep5024(x); - } - - public static boolean deep5024(boolean x) { - return deep5025(x); - } - - public static boolean deep5025(boolean x) { - return deep5026(x); - } - - public static boolean deep5026(boolean x) { - return deep5027(x); - } - - public static boolean deep5027(boolean x) { - return deep5028(x); - } - - public static boolean deep5028(boolean x) { - return deep5029(x); - } - - public static boolean deep5029(boolean x) { - return deep5030(x); - } - - public static boolean deep5030(boolean x) { - return deep5031(x); - } - - public static boolean deep5031(boolean x) { - return deep5032(x); - } - - public static boolean deep5032(boolean x) { - return deep5033(x); - } - - public static boolean deep5033(boolean x) { - return deep5034(x); - } - - public static boolean deep5034(boolean x) { - return deep5035(x); - } - - public static boolean deep5035(boolean x) { - return deep5036(x); - } - - public static boolean deep5036(boolean x) { - return deep5037(x); - } - - public static boolean deep5037(boolean x) { - return deep5038(x); - } - - public static boolean deep5038(boolean x) { - return deep5039(x); - } - - public static boolean deep5039(boolean x) { - return deep5040(x); - } - - public static boolean deep5040(boolean x) { - return deep5041(x); - } - - public static boolean deep5041(boolean x) { - return deep5042(x); - } - - public static boolean deep5042(boolean x) { - return deep5043(x); - } - - public static boolean deep5043(boolean x) { - return deep5044(x); - } - - public static boolean deep5044(boolean x) { - return deep5045(x); - } - - public static boolean deep5045(boolean x) { - return deep5046(x); - } - - public static boolean deep5046(boolean x) { - return deep5047(x); - } - - public static boolean deep5047(boolean x) { - return deep5048(x); - } - - public static boolean deep5048(boolean x) { - return deep5049(x); - } - - public static boolean deep5049(boolean x) { - return deep5050(x); - } - - public static boolean deep5050(boolean x) { - return deep5051(x); - } - - public static boolean deep5051(boolean x) { - return deep5052(x); - } - - public static boolean deep5052(boolean x) { - return deep5053(x); - } - - public static boolean deep5053(boolean x) { - return deep5054(x); - } - - public static boolean deep5054(boolean x) { - return deep5055(x); - } - - public static boolean deep5055(boolean x) { - return deep5056(x); - } - - public static boolean deep5056(boolean x) { - return deep5057(x); - } - - public static boolean deep5057(boolean x) { - return deep5058(x); - } - - public static boolean deep5058(boolean x) { - return deep5059(x); - } - - public static boolean deep5059(boolean x) { - return deep5060(x); - } - - public static boolean deep5060(boolean x) { - return deep5061(x); - } - - public static boolean deep5061(boolean x) { - return deep5062(x); - } - - public static boolean deep5062(boolean x) { - return deep5063(x); - } - - public static boolean deep5063(boolean x) { - return deep5064(x); - } - - public static boolean deep5064(boolean x) { - return deep5065(x); - } - - public static boolean deep5065(boolean x) { - return deep5066(x); - } - - public static boolean deep5066(boolean x) { - return deep5067(x); - } - - public static boolean deep5067(boolean x) { - return deep5068(x); - } - - public static boolean deep5068(boolean x) { - return deep5069(x); - } - - public static boolean deep5069(boolean x) { - return deep5070(x); - } - - public static boolean deep5070(boolean x) { - return deep5071(x); - } - - public static boolean deep5071(boolean x) { - return deep5072(x); - } - - public static boolean deep5072(boolean x) { - return deep5073(x); - } - - public static boolean deep5073(boolean x) { - return deep5074(x); - } - - public static boolean deep5074(boolean x) { - return deep5075(x); - } - - public static boolean deep5075(boolean x) { - return deep5076(x); - } - - public static boolean deep5076(boolean x) { - return deep5077(x); - } - - public static boolean deep5077(boolean x) { - return deep5078(x); - } - - public static boolean deep5078(boolean x) { - return deep5079(x); - } - - public static boolean deep5079(boolean x) { - return deep5080(x); - } - - public static boolean deep5080(boolean x) { - return deep5081(x); - } - - public static boolean deep5081(boolean x) { - return deep5082(x); - } - - public static boolean deep5082(boolean x) { - return deep5083(x); - } - - public static boolean deep5083(boolean x) { - return deep5084(x); - } - - public static boolean deep5084(boolean x) { - return deep5085(x); - } - - public static boolean deep5085(boolean x) { - return deep5086(x); - } - - public static boolean deep5086(boolean x) { - return deep5087(x); - } - - public static boolean deep5087(boolean x) { - return deep5088(x); - } - - public static boolean deep5088(boolean x) { - return deep5089(x); - } - - public static boolean deep5089(boolean x) { - return deep5090(x); - } - - public static boolean deep5090(boolean x) { - return deep5091(x); - } - - public static boolean deep5091(boolean x) { - return deep5092(x); - } - - public static boolean deep5092(boolean x) { - return deep5093(x); - } - - public static boolean deep5093(boolean x) { - return deep5094(x); - } - - public static boolean deep5094(boolean x) { - return deep5095(x); - } - - public static boolean deep5095(boolean x) { - return deep5096(x); - } - - public static boolean deep5096(boolean x) { - return deep5097(x); - } - - public static boolean deep5097(boolean x) { - return deep5098(x); - } - - public static boolean deep5098(boolean x) { - return deep5099(x); - } - - public static boolean deep5099(boolean x) { - return deep5100(x); - } - - public static boolean deep5100(boolean x) { - return deep5101(x); - } - - public static boolean deep5101(boolean x) { - return deep5102(x); - } - - public static boolean deep5102(boolean x) { - return deep5103(x); - } - - public static boolean deep5103(boolean x) { - return deep5104(x); - } - - public static boolean deep5104(boolean x) { - return deep5105(x); - } - - public static boolean deep5105(boolean x) { - return deep5106(x); - } - - public static boolean deep5106(boolean x) { - return deep5107(x); - } - - public static boolean deep5107(boolean x) { - return deep5108(x); - } - - public static boolean deep5108(boolean x) { - return deep5109(x); - } - - public static boolean deep5109(boolean x) { - return deep5110(x); - } - - public static boolean deep5110(boolean x) { - return deep5111(x); - } - - public static boolean deep5111(boolean x) { - return deep5112(x); - } - - public static boolean deep5112(boolean x) { - return deep5113(x); - } - - public static boolean deep5113(boolean x) { - return deep5114(x); - } - - public static boolean deep5114(boolean x) { - return deep5115(x); - } - - public static boolean deep5115(boolean x) { - return deep5116(x); - } - - public static boolean deep5116(boolean x) { - return deep5117(x); - } - - public static boolean deep5117(boolean x) { - return deep5118(x); - } - - public static boolean deep5118(boolean x) { - return deep5119(x); - } - - public static boolean deep5119(boolean x) { - return deep5120(x); - } - - public static boolean deep5120(boolean x) { - return deep5121(x); - } - - public static boolean deep5121(boolean x) { - return deep5122(x); - } - - public static boolean deep5122(boolean x) { - return deep5123(x); - } - - public static boolean deep5123(boolean x) { - return deep5124(x); - } - - public static boolean deep5124(boolean x) { - return deep5125(x); - } - - public static boolean deep5125(boolean x) { - return deep5126(x); - } - - public static boolean deep5126(boolean x) { - return deep5127(x); - } - - public static boolean deep5127(boolean x) { - return deep5128(x); - } - - public static boolean deep5128(boolean x) { - return deep5129(x); - } - - public static boolean deep5129(boolean x) { - return deep5130(x); - } - - public static boolean deep5130(boolean x) { - return deep5131(x); - } - - public static boolean deep5131(boolean x) { - return deep5132(x); - } - - public static boolean deep5132(boolean x) { - return deep5133(x); - } - - public static boolean deep5133(boolean x) { - return deep5134(x); - } - - public static boolean deep5134(boolean x) { - return deep5135(x); - } - - public static boolean deep5135(boolean x) { - return deep5136(x); - } - - public static boolean deep5136(boolean x) { - return deep5137(x); - } - - public static boolean deep5137(boolean x) { - return deep5138(x); - } - - public static boolean deep5138(boolean x) { - return deep5139(x); - } - - public static boolean deep5139(boolean x) { - return deep5140(x); - } - - public static boolean deep5140(boolean x) { - return deep5141(x); - } - - public static boolean deep5141(boolean x) { - return deep5142(x); - } - - public static boolean deep5142(boolean x) { - return deep5143(x); - } - - public static boolean deep5143(boolean x) { - return deep5144(x); - } - - public static boolean deep5144(boolean x) { - return deep5145(x); - } - - public static boolean deep5145(boolean x) { - return deep5146(x); - } - - public static boolean deep5146(boolean x) { - return deep5147(x); - } - - public static boolean deep5147(boolean x) { - return deep5148(x); - } - - public static boolean deep5148(boolean x) { - return deep5149(x); - } - - public static boolean deep5149(boolean x) { - return deep5150(x); - } - - public static boolean deep5150(boolean x) { - return deep5151(x); - } - - public static boolean deep5151(boolean x) { - return deep5152(x); - } - - public static boolean deep5152(boolean x) { - return deep5153(x); - } - - public static boolean deep5153(boolean x) { - return deep5154(x); - } - - public static boolean deep5154(boolean x) { - return deep5155(x); - } - - public static boolean deep5155(boolean x) { - return deep5156(x); - } - - public static boolean deep5156(boolean x) { - return deep5157(x); - } - - public static boolean deep5157(boolean x) { - return deep5158(x); - } - - public static boolean deep5158(boolean x) { - return deep5159(x); - } - - public static boolean deep5159(boolean x) { - return deep5160(x); - } - - public static boolean deep5160(boolean x) { - return deep5161(x); - } - - public static boolean deep5161(boolean x) { - return deep5162(x); - } - - public static boolean deep5162(boolean x) { - return deep5163(x); - } - - public static boolean deep5163(boolean x) { - return deep5164(x); - } - - public static boolean deep5164(boolean x) { - return deep5165(x); - } - - public static boolean deep5165(boolean x) { - return deep5166(x); - } - - public static boolean deep5166(boolean x) { - return deep5167(x); - } - - public static boolean deep5167(boolean x) { - return deep5168(x); - } - - public static boolean deep5168(boolean x) { - return deep5169(x); - } - - public static boolean deep5169(boolean x) { - return deep5170(x); - } - - public static boolean deep5170(boolean x) { - return deep5171(x); - } - - public static boolean deep5171(boolean x) { - return deep5172(x); - } - - public static boolean deep5172(boolean x) { - return deep5173(x); - } - - public static boolean deep5173(boolean x) { - return deep5174(x); - } - - public static boolean deep5174(boolean x) { - return deep5175(x); - } - - public static boolean deep5175(boolean x) { - return deep5176(x); - } - - public static boolean deep5176(boolean x) { - return deep5177(x); - } - - public static boolean deep5177(boolean x) { - return deep5178(x); - } - - public static boolean deep5178(boolean x) { - return deep5179(x); - } - - public static boolean deep5179(boolean x) { - return deep5180(x); - } - - public static boolean deep5180(boolean x) { - return deep5181(x); - } - - public static boolean deep5181(boolean x) { - return deep5182(x); - } - - public static boolean deep5182(boolean x) { - return deep5183(x); - } - - public static boolean deep5183(boolean x) { - return deep5184(x); - } - - public static boolean deep5184(boolean x) { - return deep5185(x); - } - - public static boolean deep5185(boolean x) { - return deep5186(x); - } - - public static boolean deep5186(boolean x) { - return deep5187(x); - } - - public static boolean deep5187(boolean x) { - return deep5188(x); - } - - public static boolean deep5188(boolean x) { - return deep5189(x); - } - - public static boolean deep5189(boolean x) { - return deep5190(x); - } - - public static boolean deep5190(boolean x) { - return deep5191(x); - } - - public static boolean deep5191(boolean x) { - return deep5192(x); - } - - public static boolean deep5192(boolean x) { - return deep5193(x); - } - - public static boolean deep5193(boolean x) { - return deep5194(x); - } - - public static boolean deep5194(boolean x) { - return deep5195(x); - } - - public static boolean deep5195(boolean x) { - return deep5196(x); - } - - public static boolean deep5196(boolean x) { - return deep5197(x); - } - - public static boolean deep5197(boolean x) { - return deep5198(x); - } - - public static boolean deep5198(boolean x) { - return deep5199(x); - } - - public static boolean deep5199(boolean x) { - return deep5200(x); - } - - public static boolean deep5200(boolean x) { - return deep5201(x); - } - - public static boolean deep5201(boolean x) { - return deep5202(x); - } - - public static boolean deep5202(boolean x) { - return deep5203(x); - } - - public static boolean deep5203(boolean x) { - return deep5204(x); - } - - public static boolean deep5204(boolean x) { - return deep5205(x); - } - - public static boolean deep5205(boolean x) { - return deep5206(x); - } - - public static boolean deep5206(boolean x) { - return deep5207(x); - } - - public static boolean deep5207(boolean x) { - return deep5208(x); - } - - public static boolean deep5208(boolean x) { - return deep5209(x); - } - - public static boolean deep5209(boolean x) { - return deep5210(x); - } - - public static boolean deep5210(boolean x) { - return deep5211(x); - } - - public static boolean deep5211(boolean x) { - return deep5212(x); - } - - public static boolean deep5212(boolean x) { - return deep5213(x); - } - - public static boolean deep5213(boolean x) { - return deep5214(x); - } - - public static boolean deep5214(boolean x) { - return deep5215(x); - } - - public static boolean deep5215(boolean x) { - return deep5216(x); - } - - public static boolean deep5216(boolean x) { - return deep5217(x); - } - - public static boolean deep5217(boolean x) { - return deep5218(x); - } - - public static boolean deep5218(boolean x) { - return deep5219(x); - } - - public static boolean deep5219(boolean x) { - return deep5220(x); - } - - public static boolean deep5220(boolean x) { - return deep5221(x); - } - - public static boolean deep5221(boolean x) { - return deep5222(x); - } - - public static boolean deep5222(boolean x) { - return deep5223(x); - } - - public static boolean deep5223(boolean x) { - return deep5224(x); - } - - public static boolean deep5224(boolean x) { - return deep5225(x); - } - - public static boolean deep5225(boolean x) { - return deep5226(x); - } - - public static boolean deep5226(boolean x) { - return deep5227(x); - } - - public static boolean deep5227(boolean x) { - return deep5228(x); - } - - public static boolean deep5228(boolean x) { - return deep5229(x); - } - - public static boolean deep5229(boolean x) { - return deep5230(x); - } - - public static boolean deep5230(boolean x) { - return deep5231(x); - } - - public static boolean deep5231(boolean x) { - return deep5232(x); - } - - public static boolean deep5232(boolean x) { - return deep5233(x); - } - - public static boolean deep5233(boolean x) { - return deep5234(x); - } - - public static boolean deep5234(boolean x) { - return deep5235(x); - } - - public static boolean deep5235(boolean x) { - return deep5236(x); - } - - public static boolean deep5236(boolean x) { - return deep5237(x); - } - - public static boolean deep5237(boolean x) { - return deep5238(x); - } - - public static boolean deep5238(boolean x) { - return deep5239(x); - } - - public static boolean deep5239(boolean x) { - return deep5240(x); - } - - public static boolean deep5240(boolean x) { - return deep5241(x); - } - - public static boolean deep5241(boolean x) { - return deep5242(x); - } - - public static boolean deep5242(boolean x) { - return deep5243(x); - } - - public static boolean deep5243(boolean x) { - return deep5244(x); - } - - public static boolean deep5244(boolean x) { - return deep5245(x); - } - - public static boolean deep5245(boolean x) { - return deep5246(x); - } - - public static boolean deep5246(boolean x) { - return deep5247(x); - } - - public static boolean deep5247(boolean x) { - return deep5248(x); - } - - public static boolean deep5248(boolean x) { - return deep5249(x); - } - - public static boolean deep5249(boolean x) { - return deep5250(x); - } - - public static boolean deep5250(boolean x) { - return deep5251(x); - } - - public static boolean deep5251(boolean x) { - return deep5252(x); - } - - public static boolean deep5252(boolean x) { - return deep5253(x); - } - - public static boolean deep5253(boolean x) { - return deep5254(x); - } - - public static boolean deep5254(boolean x) { - return deep5255(x); - } - - public static boolean deep5255(boolean x) { - return deep5256(x); - } - - public static boolean deep5256(boolean x) { - return deep5257(x); - } - - public static boolean deep5257(boolean x) { - return deep5258(x); - } - - public static boolean deep5258(boolean x) { - return deep5259(x); - } - - public static boolean deep5259(boolean x) { - return deep5260(x); - } - - public static boolean deep5260(boolean x) { - return deep5261(x); - } - - public static boolean deep5261(boolean x) { - return deep5262(x); - } - - public static boolean deep5262(boolean x) { - return deep5263(x); - } - - public static boolean deep5263(boolean x) { - return deep5264(x); - } - - public static boolean deep5264(boolean x) { - return deep5265(x); - } - - public static boolean deep5265(boolean x) { - return deep5266(x); - } - - public static boolean deep5266(boolean x) { - return deep5267(x); - } - - public static boolean deep5267(boolean x) { - return deep5268(x); - } - - public static boolean deep5268(boolean x) { - return deep5269(x); - } - - public static boolean deep5269(boolean x) { - return deep5270(x); - } - - public static boolean deep5270(boolean x) { - return deep5271(x); - } - - public static boolean deep5271(boolean x) { - return deep5272(x); - } - - public static boolean deep5272(boolean x) { - return deep5273(x); - } - - public static boolean deep5273(boolean x) { - return deep5274(x); - } - - public static boolean deep5274(boolean x) { - return deep5275(x); - } - - public static boolean deep5275(boolean x) { - return deep5276(x); - } - - public static boolean deep5276(boolean x) { - return deep5277(x); - } - - public static boolean deep5277(boolean x) { - return deep5278(x); - } - - public static boolean deep5278(boolean x) { - return deep5279(x); - } - - public static boolean deep5279(boolean x) { - return deep5280(x); - } - - public static boolean deep5280(boolean x) { - return deep5281(x); - } - - public static boolean deep5281(boolean x) { - return deep5282(x); - } - - public static boolean deep5282(boolean x) { - return deep5283(x); - } - - public static boolean deep5283(boolean x) { - return deep5284(x); - } - - public static boolean deep5284(boolean x) { - return deep5285(x); - } - - public static boolean deep5285(boolean x) { - return deep5286(x); - } - - public static boolean deep5286(boolean x) { - return deep5287(x); - } - - public static boolean deep5287(boolean x) { - return deep5288(x); - } - - public static boolean deep5288(boolean x) { - return deep5289(x); - } - - public static boolean deep5289(boolean x) { - return deep5290(x); - } - - public static boolean deep5290(boolean x) { - return deep5291(x); - } - - public static boolean deep5291(boolean x) { - return deep5292(x); - } - - public static boolean deep5292(boolean x) { - return deep5293(x); - } - - public static boolean deep5293(boolean x) { - return deep5294(x); - } - - public static boolean deep5294(boolean x) { - return deep5295(x); - } - - public static boolean deep5295(boolean x) { - return deep5296(x); - } - - public static boolean deep5296(boolean x) { - return deep5297(x); - } - - public static boolean deep5297(boolean x) { - return deep5298(x); - } - - public static boolean deep5298(boolean x) { - return deep5299(x); - } - - public static boolean deep5299(boolean x) { - return deep5300(x); - } - - public static boolean deep5300(boolean x) { - return deep5301(x); - } - - public static boolean deep5301(boolean x) { - return deep5302(x); - } - - public static boolean deep5302(boolean x) { - return deep5303(x); - } - - public static boolean deep5303(boolean x) { - return deep5304(x); - } - - public static boolean deep5304(boolean x) { - return deep5305(x); - } - - public static boolean deep5305(boolean x) { - return deep5306(x); - } - - public static boolean deep5306(boolean x) { - return deep5307(x); - } - - public static boolean deep5307(boolean x) { - return deep5308(x); - } - - public static boolean deep5308(boolean x) { - return deep5309(x); - } - - public static boolean deep5309(boolean x) { - return deep5310(x); - } - - public static boolean deep5310(boolean x) { - return deep5311(x); - } - - public static boolean deep5311(boolean x) { - return deep5312(x); - } - - public static boolean deep5312(boolean x) { - return deep5313(x); - } - - public static boolean deep5313(boolean x) { - return deep5314(x); - } - - public static boolean deep5314(boolean x) { - return deep5315(x); - } - - public static boolean deep5315(boolean x) { - return deep5316(x); - } - - public static boolean deep5316(boolean x) { - return deep5317(x); - } - - public static boolean deep5317(boolean x) { - return deep5318(x); - } - - public static boolean deep5318(boolean x) { - return deep5319(x); - } - - public static boolean deep5319(boolean x) { - return deep5320(x); - } - - public static boolean deep5320(boolean x) { - return deep5321(x); - } - - public static boolean deep5321(boolean x) { - return deep5322(x); - } - - public static boolean deep5322(boolean x) { - return deep5323(x); - } - - public static boolean deep5323(boolean x) { - return deep5324(x); - } - - public static boolean deep5324(boolean x) { - return deep5325(x); - } - - public static boolean deep5325(boolean x) { - return deep5326(x); - } - - public static boolean deep5326(boolean x) { - return deep5327(x); - } - - public static boolean deep5327(boolean x) { - return deep5328(x); - } - - public static boolean deep5328(boolean x) { - return deep5329(x); - } - - public static boolean deep5329(boolean x) { - return deep5330(x); - } - - public static boolean deep5330(boolean x) { - return deep5331(x); - } - - public static boolean deep5331(boolean x) { - return deep5332(x); - } - - public static boolean deep5332(boolean x) { - return deep5333(x); - } - - public static boolean deep5333(boolean x) { - return deep5334(x); - } - - public static boolean deep5334(boolean x) { - return deep5335(x); - } - - public static boolean deep5335(boolean x) { - return deep5336(x); - } - - public static boolean deep5336(boolean x) { - return deep5337(x); - } - - public static boolean deep5337(boolean x) { - return deep5338(x); - } - - public static boolean deep5338(boolean x) { - return deep5339(x); - } - - public static boolean deep5339(boolean x) { - return deep5340(x); - } - - public static boolean deep5340(boolean x) { - return deep5341(x); - } - - public static boolean deep5341(boolean x) { - return deep5342(x); - } - - public static boolean deep5342(boolean x) { - return deep5343(x); - } - - public static boolean deep5343(boolean x) { - return deep5344(x); - } - - public static boolean deep5344(boolean x) { - return deep5345(x); - } - - public static boolean deep5345(boolean x) { - return deep5346(x); - } - - public static boolean deep5346(boolean x) { - return deep5347(x); - } - - public static boolean deep5347(boolean x) { - return deep5348(x); - } - - public static boolean deep5348(boolean x) { - return deep5349(x); - } - - public static boolean deep5349(boolean x) { - return deep5350(x); - } - - public static boolean deep5350(boolean x) { - return deep5351(x); - } - - public static boolean deep5351(boolean x) { - return deep5352(x); - } - - public static boolean deep5352(boolean x) { - return deep5353(x); - } - - public static boolean deep5353(boolean x) { - return deep5354(x); - } - - public static boolean deep5354(boolean x) { - return deep5355(x); - } - - public static boolean deep5355(boolean x) { - return deep5356(x); - } - - public static boolean deep5356(boolean x) { - return deep5357(x); - } - - public static boolean deep5357(boolean x) { - return deep5358(x); - } - - public static boolean deep5358(boolean x) { - return deep5359(x); - } - - public static boolean deep5359(boolean x) { - return deep5360(x); - } - - public static boolean deep5360(boolean x) { - return deep5361(x); - } - - public static boolean deep5361(boolean x) { - return deep5362(x); - } - - public static boolean deep5362(boolean x) { - return deep5363(x); - } - - public static boolean deep5363(boolean x) { - return deep5364(x); - } - - public static boolean deep5364(boolean x) { - return deep5365(x); - } - - public static boolean deep5365(boolean x) { - return deep5366(x); - } - - public static boolean deep5366(boolean x) { - return deep5367(x); - } - - public static boolean deep5367(boolean x) { - return deep5368(x); - } - - public static boolean deep5368(boolean x) { - return deep5369(x); - } - - public static boolean deep5369(boolean x) { - return deep5370(x); - } - - public static boolean deep5370(boolean x) { - return deep5371(x); - } - - public static boolean deep5371(boolean x) { - return deep5372(x); - } - - public static boolean deep5372(boolean x) { - return deep5373(x); - } - - public static boolean deep5373(boolean x) { - return deep5374(x); - } - - public static boolean deep5374(boolean x) { - return deep5375(x); - } - - public static boolean deep5375(boolean x) { - return deep5376(x); - } - - public static boolean deep5376(boolean x) { - return deep5377(x); - } - - public static boolean deep5377(boolean x) { - return deep5378(x); - } - - public static boolean deep5378(boolean x) { - return deep5379(x); - } - - public static boolean deep5379(boolean x) { - return deep5380(x); - } - - public static boolean deep5380(boolean x) { - return deep5381(x); - } - - public static boolean deep5381(boolean x) { - return deep5382(x); - } - - public static boolean deep5382(boolean x) { - return deep5383(x); - } - - public static boolean deep5383(boolean x) { - return deep5384(x); - } - - public static boolean deep5384(boolean x) { - return deep5385(x); - } - - public static boolean deep5385(boolean x) { - return deep5386(x); - } - - public static boolean deep5386(boolean x) { - return deep5387(x); - } - - public static boolean deep5387(boolean x) { - return deep5388(x); - } - - public static boolean deep5388(boolean x) { - return deep5389(x); - } - - public static boolean deep5389(boolean x) { - return deep5390(x); - } - - public static boolean deep5390(boolean x) { - return deep5391(x); - } - - public static boolean deep5391(boolean x) { - return deep5392(x); - } - - public static boolean deep5392(boolean x) { - return deep5393(x); - } - - public static boolean deep5393(boolean x) { - return deep5394(x); - } - - public static boolean deep5394(boolean x) { - return deep5395(x); - } - - public static boolean deep5395(boolean x) { - return deep5396(x); - } - - public static boolean deep5396(boolean x) { - return deep5397(x); - } - - public static boolean deep5397(boolean x) { - return deep5398(x); - } - - public static boolean deep5398(boolean x) { - return deep5399(x); - } - - public static boolean deep5399(boolean x) { - return deep5400(x); - } - - public static boolean deep5400(boolean x) { - return deep5401(x); - } - - public static boolean deep5401(boolean x) { - return deep5402(x); - } - - public static boolean deep5402(boolean x) { - return deep5403(x); - } - - public static boolean deep5403(boolean x) { - return deep5404(x); - } - - public static boolean deep5404(boolean x) { - return deep5405(x); - } - - public static boolean deep5405(boolean x) { - return deep5406(x); - } - - public static boolean deep5406(boolean x) { - return deep5407(x); - } - - public static boolean deep5407(boolean x) { - return deep5408(x); - } - - public static boolean deep5408(boolean x) { - return deep5409(x); - } - - public static boolean deep5409(boolean x) { - return deep5410(x); - } - - public static boolean deep5410(boolean x) { - return deep5411(x); - } - - public static boolean deep5411(boolean x) { - return deep5412(x); - } - - public static boolean deep5412(boolean x) { - return deep5413(x); - } - - public static boolean deep5413(boolean x) { - return deep5414(x); - } - - public static boolean deep5414(boolean x) { - return deep5415(x); - } - - public static boolean deep5415(boolean x) { - return deep5416(x); - } - - public static boolean deep5416(boolean x) { - return deep5417(x); - } - - public static boolean deep5417(boolean x) { - return deep5418(x); - } - - public static boolean deep5418(boolean x) { - return deep5419(x); - } - - public static boolean deep5419(boolean x) { - return deep5420(x); - } - - public static boolean deep5420(boolean x) { - return deep5421(x); - } - - public static boolean deep5421(boolean x) { - return deep5422(x); - } - - public static boolean deep5422(boolean x) { - return deep5423(x); - } - - public static boolean deep5423(boolean x) { - return deep5424(x); - } - - public static boolean deep5424(boolean x) { - return deep5425(x); - } - - public static boolean deep5425(boolean x) { - return deep5426(x); - } - - public static boolean deep5426(boolean x) { - return deep5427(x); - } - - public static boolean deep5427(boolean x) { - return deep5428(x); - } - - public static boolean deep5428(boolean x) { - return deep5429(x); - } - - public static boolean deep5429(boolean x) { - return deep5430(x); - } - - public static boolean deep5430(boolean x) { - return deep5431(x); - } - - public static boolean deep5431(boolean x) { - return deep5432(x); - } - - public static boolean deep5432(boolean x) { - return deep5433(x); - } - - public static boolean deep5433(boolean x) { - return deep5434(x); - } - - public static boolean deep5434(boolean x) { - return deep5435(x); - } - - public static boolean deep5435(boolean x) { - return deep5436(x); - } - - public static boolean deep5436(boolean x) { - return deep5437(x); - } - - public static boolean deep5437(boolean x) { - return deep5438(x); - } - - public static boolean deep5438(boolean x) { - return deep5439(x); - } - - public static boolean deep5439(boolean x) { - return deep5440(x); - } - - public static boolean deep5440(boolean x) { - return deep5441(x); - } - - public static boolean deep5441(boolean x) { - return deep5442(x); - } - - public static boolean deep5442(boolean x) { - return deep5443(x); - } - - public static boolean deep5443(boolean x) { - return deep5444(x); - } - - public static boolean deep5444(boolean x) { - return deep5445(x); - } - - public static boolean deep5445(boolean x) { - return deep5446(x); - } - - public static boolean deep5446(boolean x) { - return deep5447(x); - } - - public static boolean deep5447(boolean x) { - return deep5448(x); - } - - public static boolean deep5448(boolean x) { - return deep5449(x); - } - - public static boolean deep5449(boolean x) { - return deep5450(x); - } - - public static boolean deep5450(boolean x) { - return deep5451(x); - } - - public static boolean deep5451(boolean x) { - return deep5452(x); - } - - public static boolean deep5452(boolean x) { - return deep5453(x); - } - - public static boolean deep5453(boolean x) { - return deep5454(x); - } - - public static boolean deep5454(boolean x) { - return deep5455(x); - } - - public static boolean deep5455(boolean x) { - return deep5456(x); - } - - public static boolean deep5456(boolean x) { - return deep5457(x); - } - - public static boolean deep5457(boolean x) { - return deep5458(x); - } - - public static boolean deep5458(boolean x) { - return deep5459(x); - } - - public static boolean deep5459(boolean x) { - return deep5460(x); - } - - public static boolean deep5460(boolean x) { - return deep5461(x); - } - - public static boolean deep5461(boolean x) { - return deep5462(x); - } - - public static boolean deep5462(boolean x) { - return deep5463(x); - } - - public static boolean deep5463(boolean x) { - return deep5464(x); - } - - public static boolean deep5464(boolean x) { - return deep5465(x); - } - - public static boolean deep5465(boolean x) { - return deep5466(x); - } - - public static boolean deep5466(boolean x) { - return deep5467(x); - } - - public static boolean deep5467(boolean x) { - return deep5468(x); - } - - public static boolean deep5468(boolean x) { - return deep5469(x); - } - - public static boolean deep5469(boolean x) { - return deep5470(x); - } - - public static boolean deep5470(boolean x) { - return deep5471(x); - } - - public static boolean deep5471(boolean x) { - return deep5472(x); - } - - public static boolean deep5472(boolean x) { - return deep5473(x); - } - - public static boolean deep5473(boolean x) { - return deep5474(x); - } - - public static boolean deep5474(boolean x) { - return deep5475(x); - } - - public static boolean deep5475(boolean x) { - return deep5476(x); - } - - public static boolean deep5476(boolean x) { - return deep5477(x); - } - - public static boolean deep5477(boolean x) { - return deep5478(x); - } - - public static boolean deep5478(boolean x) { - return deep5479(x); - } - - public static boolean deep5479(boolean x) { - return deep5480(x); - } - - public static boolean deep5480(boolean x) { - return deep5481(x); - } - - public static boolean deep5481(boolean x) { - return deep5482(x); - } - - public static boolean deep5482(boolean x) { - return deep5483(x); - } - - public static boolean deep5483(boolean x) { - return deep5484(x); - } - - public static boolean deep5484(boolean x) { - return deep5485(x); - } - - public static boolean deep5485(boolean x) { - return deep5486(x); - } - - public static boolean deep5486(boolean x) { - return deep5487(x); - } - - public static boolean deep5487(boolean x) { - return deep5488(x); - } - - public static boolean deep5488(boolean x) { - return deep5489(x); - } - - public static boolean deep5489(boolean x) { - return deep5490(x); - } - - public static boolean deep5490(boolean x) { - return deep5491(x); - } - - public static boolean deep5491(boolean x) { - return deep5492(x); - } - - public static boolean deep5492(boolean x) { - return deep5493(x); - } - - public static boolean deep5493(boolean x) { - return deep5494(x); - } - - public static boolean deep5494(boolean x) { - return deep5495(x); - } - - public static boolean deep5495(boolean x) { - return deep5496(x); - } - - public static boolean deep5496(boolean x) { - return deep5497(x); - } - - public static boolean deep5497(boolean x) { - return deep5498(x); - } - - public static boolean deep5498(boolean x) { - return deep5499(x); - } - - public static boolean deep5499(boolean x) { - return deep5500(x); - } - - public static boolean deep5500(boolean x) { - return deep5501(x); - } - - public static boolean deep5501(boolean x) { - return deep5502(x); - } - - public static boolean deep5502(boolean x) { - return deep5503(x); - } - - public static boolean deep5503(boolean x) { - return deep5504(x); - } - - public static boolean deep5504(boolean x) { - return deep5505(x); - } - - public static boolean deep5505(boolean x) { - return deep5506(x); - } - - public static boolean deep5506(boolean x) { - return deep5507(x); - } - - public static boolean deep5507(boolean x) { - return deep5508(x); - } - - public static boolean deep5508(boolean x) { - return deep5509(x); - } - - public static boolean deep5509(boolean x) { - return deep5510(x); - } - - public static boolean deep5510(boolean x) { - return deep5511(x); - } - - public static boolean deep5511(boolean x) { - return deep5512(x); - } - - public static boolean deep5512(boolean x) { - return deep5513(x); - } - - public static boolean deep5513(boolean x) { - return deep5514(x); - } - - public static boolean deep5514(boolean x) { - return deep5515(x); - } - - public static boolean deep5515(boolean x) { - return deep5516(x); - } - - public static boolean deep5516(boolean x) { - return deep5517(x); - } - - public static boolean deep5517(boolean x) { - return deep5518(x); - } - - public static boolean deep5518(boolean x) { - return deep5519(x); - } - - public static boolean deep5519(boolean x) { - return deep5520(x); - } - - public static boolean deep5520(boolean x) { - return deep5521(x); - } - - public static boolean deep5521(boolean x) { - return deep5522(x); - } - - public static boolean deep5522(boolean x) { - return deep5523(x); - } - - public static boolean deep5523(boolean x) { - return deep5524(x); - } - - public static boolean deep5524(boolean x) { - return deep5525(x); - } - - public static boolean deep5525(boolean x) { - return deep5526(x); - } - - public static boolean deep5526(boolean x) { - return deep5527(x); - } - - public static boolean deep5527(boolean x) { - return deep5528(x); - } - - public static boolean deep5528(boolean x) { - return deep5529(x); - } - - public static boolean deep5529(boolean x) { - return deep5530(x); - } - - public static boolean deep5530(boolean x) { - return deep5531(x); - } - - public static boolean deep5531(boolean x) { - return deep5532(x); - } - - public static boolean deep5532(boolean x) { - return deep5533(x); - } - - public static boolean deep5533(boolean x) { - return deep5534(x); - } - - public static boolean deep5534(boolean x) { - return deep5535(x); - } - - public static boolean deep5535(boolean x) { - return deep5536(x); - } - - public static boolean deep5536(boolean x) { - return deep5537(x); - } - - public static boolean deep5537(boolean x) { - return deep5538(x); - } - - public static boolean deep5538(boolean x) { - return deep5539(x); - } - - public static boolean deep5539(boolean x) { - return deep5540(x); - } - - public static boolean deep5540(boolean x) { - return deep5541(x); - } - - public static boolean deep5541(boolean x) { - return deep5542(x); - } - - public static boolean deep5542(boolean x) { - return deep5543(x); - } - - public static boolean deep5543(boolean x) { - return deep5544(x); - } - - public static boolean deep5544(boolean x) { - return deep5545(x); - } - - public static boolean deep5545(boolean x) { - return deep5546(x); - } - - public static boolean deep5546(boolean x) { - return deep5547(x); - } - - public static boolean deep5547(boolean x) { - return deep5548(x); - } - - public static boolean deep5548(boolean x) { - return deep5549(x); - } - - public static boolean deep5549(boolean x) { - return deep5550(x); - } - - public static boolean deep5550(boolean x) { - return deep5551(x); - } - - public static boolean deep5551(boolean x) { - return deep5552(x); - } - - public static boolean deep5552(boolean x) { - return deep5553(x); - } - - public static boolean deep5553(boolean x) { - return deep5554(x); - } - - public static boolean deep5554(boolean x) { - return deep5555(x); - } - - public static boolean deep5555(boolean x) { - return deep5556(x); - } - - public static boolean deep5556(boolean x) { - return deep5557(x); - } - - public static boolean deep5557(boolean x) { - return deep5558(x); - } - - public static boolean deep5558(boolean x) { - return deep5559(x); - } - - public static boolean deep5559(boolean x) { - return deep5560(x); - } - - public static boolean deep5560(boolean x) { - return deep5561(x); - } - - public static boolean deep5561(boolean x) { - return deep5562(x); - } - - public static boolean deep5562(boolean x) { - return deep5563(x); - } - - public static boolean deep5563(boolean x) { - return deep5564(x); - } - - public static boolean deep5564(boolean x) { - return deep5565(x); - } - - public static boolean deep5565(boolean x) { - return deep5566(x); - } - - public static boolean deep5566(boolean x) { - return deep5567(x); - } - - public static boolean deep5567(boolean x) { - return deep5568(x); - } - - public static boolean deep5568(boolean x) { - return deep5569(x); - } - - public static boolean deep5569(boolean x) { - return deep5570(x); - } - - public static boolean deep5570(boolean x) { - return deep5571(x); - } - - public static boolean deep5571(boolean x) { - return deep5572(x); - } - - public static boolean deep5572(boolean x) { - return deep5573(x); - } - - public static boolean deep5573(boolean x) { - return deep5574(x); - } - - public static boolean deep5574(boolean x) { - return deep5575(x); - } - - public static boolean deep5575(boolean x) { - return deep5576(x); - } - - public static boolean deep5576(boolean x) { - return deep5577(x); - } - - public static boolean deep5577(boolean x) { - return deep5578(x); - } - - public static boolean deep5578(boolean x) { - return deep5579(x); - } - - public static boolean deep5579(boolean x) { - return deep5580(x); - } - - public static boolean deep5580(boolean x) { - return deep5581(x); - } - - public static boolean deep5581(boolean x) { - return deep5582(x); - } - - public static boolean deep5582(boolean x) { - return deep5583(x); - } - - public static boolean deep5583(boolean x) { - return deep5584(x); - } - - public static boolean deep5584(boolean x) { - return deep5585(x); - } - - public static boolean deep5585(boolean x) { - return deep5586(x); - } - - public static boolean deep5586(boolean x) { - return deep5587(x); - } - - public static boolean deep5587(boolean x) { - return deep5588(x); - } - - public static boolean deep5588(boolean x) { - return deep5589(x); - } - - public static boolean deep5589(boolean x) { - return deep5590(x); - } - - public static boolean deep5590(boolean x) { - return deep5591(x); - } - - public static boolean deep5591(boolean x) { - return deep5592(x); - } - - public static boolean deep5592(boolean x) { - return deep5593(x); - } - - public static boolean deep5593(boolean x) { - return deep5594(x); - } - - public static boolean deep5594(boolean x) { - return deep5595(x); - } - - public static boolean deep5595(boolean x) { - return deep5596(x); - } - - public static boolean deep5596(boolean x) { - return deep5597(x); - } - - public static boolean deep5597(boolean x) { - return deep5598(x); - } - - public static boolean deep5598(boolean x) { - return deep5599(x); - } - - public static boolean deep5599(boolean x) { - return deep5600(x); - } - - public static boolean deep5600(boolean x) { - return deep5601(x); - } - - public static boolean deep5601(boolean x) { - return deep5602(x); - } - - public static boolean deep5602(boolean x) { - return deep5603(x); - } - - public static boolean deep5603(boolean x) { - return deep5604(x); - } - - public static boolean deep5604(boolean x) { - return deep5605(x); - } - - public static boolean deep5605(boolean x) { - return deep5606(x); - } - - public static boolean deep5606(boolean x) { - return deep5607(x); - } - - public static boolean deep5607(boolean x) { - return deep5608(x); - } - - public static boolean deep5608(boolean x) { - return deep5609(x); - } - - public static boolean deep5609(boolean x) { - return deep5610(x); - } - - public static boolean deep5610(boolean x) { - return deep5611(x); - } - - public static boolean deep5611(boolean x) { - return deep5612(x); - } - - public static boolean deep5612(boolean x) { - return deep5613(x); - } - - public static boolean deep5613(boolean x) { - return deep5614(x); - } - - public static boolean deep5614(boolean x) { - return deep5615(x); - } - - public static boolean deep5615(boolean x) { - return deep5616(x); - } - - public static boolean deep5616(boolean x) { - return deep5617(x); - } - - public static boolean deep5617(boolean x) { - return deep5618(x); - } - - public static boolean deep5618(boolean x) { - return deep5619(x); - } - - public static boolean deep5619(boolean x) { - return deep5620(x); - } - - public static boolean deep5620(boolean x) { - return deep5621(x); - } - - public static boolean deep5621(boolean x) { - return deep5622(x); - } - - public static boolean deep5622(boolean x) { - return deep5623(x); - } - - public static boolean deep5623(boolean x) { - return deep5624(x); - } - - public static boolean deep5624(boolean x) { - return deep5625(x); - } - - public static boolean deep5625(boolean x) { - return deep5626(x); - } - - public static boolean deep5626(boolean x) { - return deep5627(x); - } - - public static boolean deep5627(boolean x) { - return deep5628(x); - } - - public static boolean deep5628(boolean x) { - return deep5629(x); - } - - public static boolean deep5629(boolean x) { - return deep5630(x); - } - - public static boolean deep5630(boolean x) { - return deep5631(x); - } - - public static boolean deep5631(boolean x) { - return deep5632(x); - } - - public static boolean deep5632(boolean x) { - return deep5633(x); - } - - public static boolean deep5633(boolean x) { - return deep5634(x); - } - - public static boolean deep5634(boolean x) { - return deep5635(x); - } - - public static boolean deep5635(boolean x) { - return deep5636(x); - } - - public static boolean deep5636(boolean x) { - return deep5637(x); - } - - public static boolean deep5637(boolean x) { - return deep5638(x); - } - - public static boolean deep5638(boolean x) { - return deep5639(x); - } - - public static boolean deep5639(boolean x) { - return deep5640(x); - } - - public static boolean deep5640(boolean x) { - return deep5641(x); - } - - public static boolean deep5641(boolean x) { - return deep5642(x); - } - - public static boolean deep5642(boolean x) { - return deep5643(x); - } - - public static boolean deep5643(boolean x) { - return deep5644(x); - } - - public static boolean deep5644(boolean x) { - return deep5645(x); - } - - public static boolean deep5645(boolean x) { - return deep5646(x); - } - - public static boolean deep5646(boolean x) { - return deep5647(x); - } - - public static boolean deep5647(boolean x) { - return deep5648(x); - } - - public static boolean deep5648(boolean x) { - return deep5649(x); - } - - public static boolean deep5649(boolean x) { - return deep5650(x); - } - - public static boolean deep5650(boolean x) { - return deep5651(x); - } - - public static boolean deep5651(boolean x) { - return deep5652(x); - } - - public static boolean deep5652(boolean x) { - return deep5653(x); - } - - public static boolean deep5653(boolean x) { - return deep5654(x); - } - - public static boolean deep5654(boolean x) { - return deep5655(x); - } - - public static boolean deep5655(boolean x) { - return deep5656(x); - } - - public static boolean deep5656(boolean x) { - return deep5657(x); - } - - public static boolean deep5657(boolean x) { - return deep5658(x); - } - - public static boolean deep5658(boolean x) { - return deep5659(x); - } - - public static boolean deep5659(boolean x) { - return deep5660(x); - } - - public static boolean deep5660(boolean x) { - return deep5661(x); - } - - public static boolean deep5661(boolean x) { - return deep5662(x); - } - - public static boolean deep5662(boolean x) { - return deep5663(x); - } - - public static boolean deep5663(boolean x) { - return deep5664(x); - } - - public static boolean deep5664(boolean x) { - return deep5665(x); - } - - public static boolean deep5665(boolean x) { - return deep5666(x); - } - - public static boolean deep5666(boolean x) { - return deep5667(x); - } - - public static boolean deep5667(boolean x) { - return deep5668(x); - } - - public static boolean deep5668(boolean x) { - return deep5669(x); - } - - public static boolean deep5669(boolean x) { - return deep5670(x); - } - - public static boolean deep5670(boolean x) { - return deep5671(x); - } - - public static boolean deep5671(boolean x) { - return deep5672(x); - } - - public static boolean deep5672(boolean x) { - return deep5673(x); - } - - public static boolean deep5673(boolean x) { - return deep5674(x); - } - - public static boolean deep5674(boolean x) { - return deep5675(x); - } - - public static boolean deep5675(boolean x) { - return deep5676(x); - } - - public static boolean deep5676(boolean x) { - return deep5677(x); - } - - public static boolean deep5677(boolean x) { - return deep5678(x); - } - - public static boolean deep5678(boolean x) { - return deep5679(x); - } - - public static boolean deep5679(boolean x) { - return deep5680(x); - } - - public static boolean deep5680(boolean x) { - return deep5681(x); - } - - public static boolean deep5681(boolean x) { - return deep5682(x); - } - - public static boolean deep5682(boolean x) { - return deep5683(x); - } - - public static boolean deep5683(boolean x) { - return deep5684(x); - } - - public static boolean deep5684(boolean x) { - return deep5685(x); - } - - public static boolean deep5685(boolean x) { - return deep5686(x); - } - - public static boolean deep5686(boolean x) { - return deep5687(x); - } - - public static boolean deep5687(boolean x) { - return deep5688(x); - } - - public static boolean deep5688(boolean x) { - return deep5689(x); - } - - public static boolean deep5689(boolean x) { - return deep5690(x); - } - - public static boolean deep5690(boolean x) { - return deep5691(x); - } - - public static boolean deep5691(boolean x) { - return deep5692(x); - } - - public static boolean deep5692(boolean x) { - return deep5693(x); - } - - public static boolean deep5693(boolean x) { - return deep5694(x); - } - - public static boolean deep5694(boolean x) { - return deep5695(x); - } - - public static boolean deep5695(boolean x) { - return deep5696(x); - } - - public static boolean deep5696(boolean x) { - return deep5697(x); - } - - public static boolean deep5697(boolean x) { - return deep5698(x); - } - - public static boolean deep5698(boolean x) { - return deep5699(x); - } - - public static boolean deep5699(boolean x) { - return deep5700(x); - } - - public static boolean deep5700(boolean x) { - return deep5701(x); - } - - public static boolean deep5701(boolean x) { - return deep5702(x); - } - - public static boolean deep5702(boolean x) { - return deep5703(x); - } - - public static boolean deep5703(boolean x) { - return deep5704(x); - } - - public static boolean deep5704(boolean x) { - return deep5705(x); - } - - public static boolean deep5705(boolean x) { - return deep5706(x); - } - - public static boolean deep5706(boolean x) { - return deep5707(x); - } - - public static boolean deep5707(boolean x) { - return deep5708(x); - } - - public static boolean deep5708(boolean x) { - return deep5709(x); - } - - public static boolean deep5709(boolean x) { - return deep5710(x); - } - - public static boolean deep5710(boolean x) { - return deep5711(x); - } - - public static boolean deep5711(boolean x) { - return deep5712(x); - } - - public static boolean deep5712(boolean x) { - return deep5713(x); - } - - public static boolean deep5713(boolean x) { - return deep5714(x); - } - - public static boolean deep5714(boolean x) { - return deep5715(x); - } - - public static boolean deep5715(boolean x) { - return deep5716(x); - } - - public static boolean deep5716(boolean x) { - return deep5717(x); - } - - public static boolean deep5717(boolean x) { - return deep5718(x); - } - - public static boolean deep5718(boolean x) { - return deep5719(x); - } - - public static boolean deep5719(boolean x) { - return deep5720(x); - } - - public static boolean deep5720(boolean x) { - return deep5721(x); - } - - public static boolean deep5721(boolean x) { - return deep5722(x); - } - - public static boolean deep5722(boolean x) { - return deep5723(x); - } - - public static boolean deep5723(boolean x) { - return deep5724(x); - } - - public static boolean deep5724(boolean x) { - return deep5725(x); - } - - public static boolean deep5725(boolean x) { - return deep5726(x); - } - - public static boolean deep5726(boolean x) { - return deep5727(x); - } - - public static boolean deep5727(boolean x) { - return deep5728(x); - } - - public static boolean deep5728(boolean x) { - return deep5729(x); - } - - public static boolean deep5729(boolean x) { - return deep5730(x); - } - - public static boolean deep5730(boolean x) { - return deep5731(x); - } - - public static boolean deep5731(boolean x) { - return deep5732(x); - } - - public static boolean deep5732(boolean x) { - return deep5733(x); - } - - public static boolean deep5733(boolean x) { - return deep5734(x); - } - - public static boolean deep5734(boolean x) { - return deep5735(x); - } - - public static boolean deep5735(boolean x) { - return deep5736(x); - } - - public static boolean deep5736(boolean x) { - return deep5737(x); - } - - public static boolean deep5737(boolean x) { - return deep5738(x); - } - - public static boolean deep5738(boolean x) { - return deep5739(x); - } - - public static boolean deep5739(boolean x) { - return deep5740(x); - } - - public static boolean deep5740(boolean x) { - return deep5741(x); - } - - public static boolean deep5741(boolean x) { - return deep5742(x); - } - - public static boolean deep5742(boolean x) { - return deep5743(x); - } - - public static boolean deep5743(boolean x) { - return deep5744(x); - } - - public static boolean deep5744(boolean x) { - return deep5745(x); - } - - public static boolean deep5745(boolean x) { - return deep5746(x); - } - - public static boolean deep5746(boolean x) { - return deep5747(x); - } - - public static boolean deep5747(boolean x) { - return deep5748(x); - } - - public static boolean deep5748(boolean x) { - return deep5749(x); - } - - public static boolean deep5749(boolean x) { - return deep5750(x); - } - - public static boolean deep5750(boolean x) { - return deep5751(x); - } - - public static boolean deep5751(boolean x) { - return deep5752(x); - } - - public static boolean deep5752(boolean x) { - return deep5753(x); - } - - public static boolean deep5753(boolean x) { - return deep5754(x); - } - - public static boolean deep5754(boolean x) { - return deep5755(x); - } - - public static boolean deep5755(boolean x) { - return deep5756(x); - } - - public static boolean deep5756(boolean x) { - return deep5757(x); - } - - public static boolean deep5757(boolean x) { - return deep5758(x); - } - - public static boolean deep5758(boolean x) { - return deep5759(x); - } - - public static boolean deep5759(boolean x) { - return deep5760(x); - } - - public static boolean deep5760(boolean x) { - return deep5761(x); - } - - public static boolean deep5761(boolean x) { - return deep5762(x); - } - - public static boolean deep5762(boolean x) { - return deep5763(x); - } - - public static boolean deep5763(boolean x) { - return deep5764(x); - } - - public static boolean deep5764(boolean x) { - return deep5765(x); - } - - public static boolean deep5765(boolean x) { - return deep5766(x); - } - - public static boolean deep5766(boolean x) { - return deep5767(x); - } - - public static boolean deep5767(boolean x) { - return deep5768(x); - } - - public static boolean deep5768(boolean x) { - return deep5769(x); - } - - public static boolean deep5769(boolean x) { - return deep5770(x); - } - - public static boolean deep5770(boolean x) { - return deep5771(x); - } - - public static boolean deep5771(boolean x) { - return deep5772(x); - } - - public static boolean deep5772(boolean x) { - return deep5773(x); - } - - public static boolean deep5773(boolean x) { - return deep5774(x); - } - - public static boolean deep5774(boolean x) { - return deep5775(x); - } - - public static boolean deep5775(boolean x) { - return deep5776(x); - } - - public static boolean deep5776(boolean x) { - return deep5777(x); - } - - public static boolean deep5777(boolean x) { - return deep5778(x); - } - - public static boolean deep5778(boolean x) { - return deep5779(x); - } - - public static boolean deep5779(boolean x) { - return deep5780(x); - } - - public static boolean deep5780(boolean x) { - return deep5781(x); - } - - public static boolean deep5781(boolean x) { - return deep5782(x); - } - - public static boolean deep5782(boolean x) { - return deep5783(x); - } - - public static boolean deep5783(boolean x) { - return deep5784(x); - } - - public static boolean deep5784(boolean x) { - return deep5785(x); - } - - public static boolean deep5785(boolean x) { - return deep5786(x); - } - - public static boolean deep5786(boolean x) { - return deep5787(x); - } - - public static boolean deep5787(boolean x) { - return deep5788(x); - } - - public static boolean deep5788(boolean x) { - return deep5789(x); - } - - public static boolean deep5789(boolean x) { - return deep5790(x); - } - - public static boolean deep5790(boolean x) { - return deep5791(x); - } - - public static boolean deep5791(boolean x) { - return deep5792(x); - } - - public static boolean deep5792(boolean x) { - return deep5793(x); - } - - public static boolean deep5793(boolean x) { - return deep5794(x); - } - - public static boolean deep5794(boolean x) { - return deep5795(x); - } - - public static boolean deep5795(boolean x) { - return deep5796(x); - } - - public static boolean deep5796(boolean x) { - return deep5797(x); - } - - public static boolean deep5797(boolean x) { - return deep5798(x); - } - - public static boolean deep5798(boolean x) { - return deep5799(x); - } - - public static boolean deep5799(boolean x) { - return deep5800(x); - } - - public static boolean deep5800(boolean x) { - return deep5801(x); - } - - public static boolean deep5801(boolean x) { - return deep5802(x); - } - - public static boolean deep5802(boolean x) { - return deep5803(x); - } - - public static boolean deep5803(boolean x) { - return deep5804(x); - } - - public static boolean deep5804(boolean x) { - return deep5805(x); - } - - public static boolean deep5805(boolean x) { - return deep5806(x); - } - - public static boolean deep5806(boolean x) { - return deep5807(x); - } - - public static boolean deep5807(boolean x) { - return deep5808(x); - } - - public static boolean deep5808(boolean x) { - return deep5809(x); - } - - public static boolean deep5809(boolean x) { - return deep5810(x); - } - - public static boolean deep5810(boolean x) { - return deep5811(x); - } - - public static boolean deep5811(boolean x) { - return deep5812(x); - } - - public static boolean deep5812(boolean x) { - return deep5813(x); - } - - public static boolean deep5813(boolean x) { - return deep5814(x); - } - - public static boolean deep5814(boolean x) { - return deep5815(x); - } - - public static boolean deep5815(boolean x) { - return deep5816(x); - } - - public static boolean deep5816(boolean x) { - return deep5817(x); - } - - public static boolean deep5817(boolean x) { - return deep5818(x); - } - - public static boolean deep5818(boolean x) { - return deep5819(x); - } - - public static boolean deep5819(boolean x) { - return deep5820(x); - } - - public static boolean deep5820(boolean x) { - return deep5821(x); - } - - public static boolean deep5821(boolean x) { - return deep5822(x); - } - - public static boolean deep5822(boolean x) { - return deep5823(x); - } - - public static boolean deep5823(boolean x) { - return deep5824(x); - } - - public static boolean deep5824(boolean x) { - return deep5825(x); - } - - public static boolean deep5825(boolean x) { - return deep5826(x); - } - - public static boolean deep5826(boolean x) { - return deep5827(x); - } - - public static boolean deep5827(boolean x) { - return deep5828(x); - } - - public static boolean deep5828(boolean x) { - return deep5829(x); - } - - public static boolean deep5829(boolean x) { - return deep5830(x); - } - - public static boolean deep5830(boolean x) { - return deep5831(x); - } - - public static boolean deep5831(boolean x) { - return deep5832(x); - } - - public static boolean deep5832(boolean x) { - return deep5833(x); - } - - public static boolean deep5833(boolean x) { - return deep5834(x); - } - - public static boolean deep5834(boolean x) { - return deep5835(x); - } - - public static boolean deep5835(boolean x) { - return deep5836(x); - } - - public static boolean deep5836(boolean x) { - return deep5837(x); - } - - public static boolean deep5837(boolean x) { - return deep5838(x); - } - - public static boolean deep5838(boolean x) { - return deep5839(x); - } - - public static boolean deep5839(boolean x) { - return deep5840(x); - } - - public static boolean deep5840(boolean x) { - return deep5841(x); - } - - public static boolean deep5841(boolean x) { - return deep5842(x); - } - - public static boolean deep5842(boolean x) { - return deep5843(x); - } - - public static boolean deep5843(boolean x) { - return deep5844(x); - } - - public static boolean deep5844(boolean x) { - return deep5845(x); - } - - public static boolean deep5845(boolean x) { - return deep5846(x); - } - - public static boolean deep5846(boolean x) { - return deep5847(x); - } - - public static boolean deep5847(boolean x) { - return deep5848(x); - } - - public static boolean deep5848(boolean x) { - return deep5849(x); - } - - public static boolean deep5849(boolean x) { - return deep5850(x); - } - - public static boolean deep5850(boolean x) { - return deep5851(x); - } - - public static boolean deep5851(boolean x) { - return deep5852(x); - } - - public static boolean deep5852(boolean x) { - return deep5853(x); - } - - public static boolean deep5853(boolean x) { - return deep5854(x); - } - - public static boolean deep5854(boolean x) { - return deep5855(x); - } - - public static boolean deep5855(boolean x) { - return deep5856(x); - } - - public static boolean deep5856(boolean x) { - return deep5857(x); - } - - public static boolean deep5857(boolean x) { - return deep5858(x); - } - - public static boolean deep5858(boolean x) { - return deep5859(x); - } - - public static boolean deep5859(boolean x) { - return deep5860(x); - } - - public static boolean deep5860(boolean x) { - return deep5861(x); - } - - public static boolean deep5861(boolean x) { - return deep5862(x); - } - - public static boolean deep5862(boolean x) { - return deep5863(x); - } - - public static boolean deep5863(boolean x) { - return deep5864(x); - } - - public static boolean deep5864(boolean x) { - return deep5865(x); - } - - public static boolean deep5865(boolean x) { - return deep5866(x); - } - - public static boolean deep5866(boolean x) { - return deep5867(x); - } - - public static boolean deep5867(boolean x) { - return deep5868(x); - } - - public static boolean deep5868(boolean x) { - return deep5869(x); - } - - public static boolean deep5869(boolean x) { - return deep5870(x); - } - - public static boolean deep5870(boolean x) { - return deep5871(x); - } - - public static boolean deep5871(boolean x) { - return deep5872(x); - } - - public static boolean deep5872(boolean x) { - return deep5873(x); - } - - public static boolean deep5873(boolean x) { - return deep5874(x); - } - - public static boolean deep5874(boolean x) { - return deep5875(x); - } - - public static boolean deep5875(boolean x) { - return deep5876(x); - } - - public static boolean deep5876(boolean x) { - return deep5877(x); - } - - public static boolean deep5877(boolean x) { - return deep5878(x); - } - - public static boolean deep5878(boolean x) { - return deep5879(x); - } - - public static boolean deep5879(boolean x) { - return deep5880(x); - } - - public static boolean deep5880(boolean x) { - return deep5881(x); - } - - public static boolean deep5881(boolean x) { - return deep5882(x); - } - - public static boolean deep5882(boolean x) { - return deep5883(x); - } - - public static boolean deep5883(boolean x) { - return deep5884(x); - } - - public static boolean deep5884(boolean x) { - return deep5885(x); - } - - public static boolean deep5885(boolean x) { - return deep5886(x); - } - - public static boolean deep5886(boolean x) { - return deep5887(x); - } - - public static boolean deep5887(boolean x) { - return deep5888(x); - } - - public static boolean deep5888(boolean x) { - return deep5889(x); - } - - public static boolean deep5889(boolean x) { - return deep5890(x); - } - - public static boolean deep5890(boolean x) { - return deep5891(x); - } - - public static boolean deep5891(boolean x) { - return deep5892(x); - } - - public static boolean deep5892(boolean x) { - return deep5893(x); - } - - public static boolean deep5893(boolean x) { - return deep5894(x); - } - - public static boolean deep5894(boolean x) { - return deep5895(x); - } - - public static boolean deep5895(boolean x) { - return deep5896(x); - } - - public static boolean deep5896(boolean x) { - return deep5897(x); - } - - public static boolean deep5897(boolean x) { - return deep5898(x); - } - - public static boolean deep5898(boolean x) { - return deep5899(x); - } - - public static boolean deep5899(boolean x) { - return deep5900(x); - } - - public static boolean deep5900(boolean x) { - return deep5901(x); - } - - public static boolean deep5901(boolean x) { - return deep5902(x); - } - - public static boolean deep5902(boolean x) { - return deep5903(x); - } - - public static boolean deep5903(boolean x) { - return deep5904(x); - } - - public static boolean deep5904(boolean x) { - return deep5905(x); - } - - public static boolean deep5905(boolean x) { - return deep5906(x); - } - - public static boolean deep5906(boolean x) { - return deep5907(x); - } - - public static boolean deep5907(boolean x) { - return deep5908(x); - } - - public static boolean deep5908(boolean x) { - return deep5909(x); - } - - public static boolean deep5909(boolean x) { - return deep5910(x); - } - - public static boolean deep5910(boolean x) { - return deep5911(x); - } - - public static boolean deep5911(boolean x) { - return deep5912(x); - } - - public static boolean deep5912(boolean x) { - return deep5913(x); - } - - public static boolean deep5913(boolean x) { - return deep5914(x); - } - - public static boolean deep5914(boolean x) { - return deep5915(x); - } - - public static boolean deep5915(boolean x) { - return deep5916(x); - } - - public static boolean deep5916(boolean x) { - return deep5917(x); - } - - public static boolean deep5917(boolean x) { - return deep5918(x); - } - - public static boolean deep5918(boolean x) { - return deep5919(x); - } - - public static boolean deep5919(boolean x) { - return deep5920(x); - } - - public static boolean deep5920(boolean x) { - return deep5921(x); - } - - public static boolean deep5921(boolean x) { - return deep5922(x); - } - - public static boolean deep5922(boolean x) { - return deep5923(x); - } - - public static boolean deep5923(boolean x) { - return deep5924(x); - } - - public static boolean deep5924(boolean x) { - return deep5925(x); - } - - public static boolean deep5925(boolean x) { - return deep5926(x); - } - - public static boolean deep5926(boolean x) { - return deep5927(x); - } - - public static boolean deep5927(boolean x) { - return deep5928(x); - } - - public static boolean deep5928(boolean x) { - return deep5929(x); - } - - public static boolean deep5929(boolean x) { - return deep5930(x); - } - - public static boolean deep5930(boolean x) { - return deep5931(x); - } - - public static boolean deep5931(boolean x) { - return deep5932(x); - } - - public static boolean deep5932(boolean x) { - return deep5933(x); - } - - public static boolean deep5933(boolean x) { - return deep5934(x); - } - - public static boolean deep5934(boolean x) { - return deep5935(x); - } - - public static boolean deep5935(boolean x) { - return deep5936(x); - } - - public static boolean deep5936(boolean x) { - return deep5937(x); - } - - public static boolean deep5937(boolean x) { - return deep5938(x); - } - - public static boolean deep5938(boolean x) { - return deep5939(x); - } - - public static boolean deep5939(boolean x) { - return deep5940(x); - } - - public static boolean deep5940(boolean x) { - return deep5941(x); - } - - public static boolean deep5941(boolean x) { - return deep5942(x); - } - - public static boolean deep5942(boolean x) { - return deep5943(x); - } - - public static boolean deep5943(boolean x) { - return deep5944(x); - } - - public static boolean deep5944(boolean x) { - return deep5945(x); - } - - public static boolean deep5945(boolean x) { - return deep5946(x); - } - - public static boolean deep5946(boolean x) { - return deep5947(x); - } - - public static boolean deep5947(boolean x) { - return deep5948(x); - } - - public static boolean deep5948(boolean x) { - return deep5949(x); - } - - public static boolean deep5949(boolean x) { - return deep5950(x); - } - - public static boolean deep5950(boolean x) { - return deep5951(x); - } - - public static boolean deep5951(boolean x) { - return deep5952(x); - } - - public static boolean deep5952(boolean x) { - return deep5953(x); - } - - public static boolean deep5953(boolean x) { - return deep5954(x); - } - - public static boolean deep5954(boolean x) { - return deep5955(x); - } - - public static boolean deep5955(boolean x) { - return deep5956(x); - } - - public static boolean deep5956(boolean x) { - return deep5957(x); - } - - public static boolean deep5957(boolean x) { - return deep5958(x); - } - - public static boolean deep5958(boolean x) { - return deep5959(x); - } - - public static boolean deep5959(boolean x) { - return deep5960(x); - } - - public static boolean deep5960(boolean x) { - return deep5961(x); - } - - public static boolean deep5961(boolean x) { - return deep5962(x); - } - - public static boolean deep5962(boolean x) { - return deep5963(x); - } - - public static boolean deep5963(boolean x) { - return deep5964(x); - } - - public static boolean deep5964(boolean x) { - return deep5965(x); - } - - public static boolean deep5965(boolean x) { - return deep5966(x); - } - - public static boolean deep5966(boolean x) { - return deep5967(x); - } - - public static boolean deep5967(boolean x) { - return deep5968(x); - } - - public static boolean deep5968(boolean x) { - return deep5969(x); - } - - public static boolean deep5969(boolean x) { - return deep5970(x); - } - - public static boolean deep5970(boolean x) { - return deep5971(x); - } - - public static boolean deep5971(boolean x) { - return deep5972(x); - } - - public static boolean deep5972(boolean x) { - return deep5973(x); - } - - public static boolean deep5973(boolean x) { - return deep5974(x); - } - - public static boolean deep5974(boolean x) { - return deep5975(x); - } - - public static boolean deep5975(boolean x) { - return deep5976(x); - } - - public static boolean deep5976(boolean x) { - return deep5977(x); - } - - public static boolean deep5977(boolean x) { - return deep5978(x); - } - - public static boolean deep5978(boolean x) { - return deep5979(x); - } - - public static boolean deep5979(boolean x) { - return deep5980(x); - } - - public static boolean deep5980(boolean x) { - return deep5981(x); - } - - public static boolean deep5981(boolean x) { - return deep5982(x); - } - - public static boolean deep5982(boolean x) { - return deep5983(x); - } - - public static boolean deep5983(boolean x) { - return deep5984(x); - } - - public static boolean deep5984(boolean x) { - return deep5985(x); - } - - public static boolean deep5985(boolean x) { - return deep5986(x); - } - - public static boolean deep5986(boolean x) { - return deep5987(x); - } - - public static boolean deep5987(boolean x) { - return deep5988(x); - } - - public static boolean deep5988(boolean x) { - return deep5989(x); - } - - public static boolean deep5989(boolean x) { - return deep5990(x); - } - - public static boolean deep5990(boolean x) { - return deep5991(x); - } - - public static boolean deep5991(boolean x) { - return deep5992(x); - } - - public static boolean deep5992(boolean x) { - return deep5993(x); - } - - public static boolean deep5993(boolean x) { - return deep5994(x); - } - - public static boolean deep5994(boolean x) { - return deep5995(x); - } - - public static boolean deep5995(boolean x) { - return deep5996(x); - } - - public static boolean deep5996(boolean x) { - return deep5997(x); - } - - public static boolean deep5997(boolean x) { - return deep5998(x); - } - - public static boolean deep5998(boolean x) { - return deep5999(x); - } - - public static boolean deep5999(boolean x) { - return deep6000(x); - } - - public static boolean deep6000(boolean x) { - return deep6001(x); - } - - public static boolean deep6001(boolean x) { - return deep6002(x); - } - - public static boolean deep6002(boolean x) { - return deep6003(x); - } - - public static boolean deep6003(boolean x) { - return deep6004(x); - } - - public static boolean deep6004(boolean x) { - return deep6005(x); - } - - public static boolean deep6005(boolean x) { - return deep6006(x); - } - - public static boolean deep6006(boolean x) { - return deep6007(x); - } - - public static boolean deep6007(boolean x) { - return deep6008(x); - } - - public static boolean deep6008(boolean x) { - return deep6009(x); - } - - public static boolean deep6009(boolean x) { - return deep6010(x); - } - - public static boolean deep6010(boolean x) { - return deep6011(x); - } - - public static boolean deep6011(boolean x) { - return deep6012(x); - } - - public static boolean deep6012(boolean x) { - return deep6013(x); - } - - public static boolean deep6013(boolean x) { - return deep6014(x); - } - - public static boolean deep6014(boolean x) { - return deep6015(x); - } - - public static boolean deep6015(boolean x) { - return deep6016(x); - } - - public static boolean deep6016(boolean x) { - return deep6017(x); - } - - public static boolean deep6017(boolean x) { - return deep6018(x); - } - - public static boolean deep6018(boolean x) { - return deep6019(x); - } - - public static boolean deep6019(boolean x) { - return deep6020(x); - } - - public static boolean deep6020(boolean x) { - return deep6021(x); - } - - public static boolean deep6021(boolean x) { - return deep6022(x); - } - - public static boolean deep6022(boolean x) { - return deep6023(x); - } - - public static boolean deep6023(boolean x) { - return deep6024(x); - } - - public static boolean deep6024(boolean x) { - return deep6025(x); - } - - public static boolean deep6025(boolean x) { - return deep6026(x); - } - - public static boolean deep6026(boolean x) { - return deep6027(x); - } - - public static boolean deep6027(boolean x) { - return deep6028(x); - } - - public static boolean deep6028(boolean x) { - return deep6029(x); - } - - public static boolean deep6029(boolean x) { - return deep6030(x); - } - - public static boolean deep6030(boolean x) { - return deep6031(x); - } - - public static boolean deep6031(boolean x) { - return deep6032(x); - } - - public static boolean deep6032(boolean x) { - return deep6033(x); - } - - public static boolean deep6033(boolean x) { - return deep6034(x); - } - - public static boolean deep6034(boolean x) { - return deep6035(x); - } - - public static boolean deep6035(boolean x) { - return deep6036(x); - } - - public static boolean deep6036(boolean x) { - return deep6037(x); - } - - public static boolean deep6037(boolean x) { - return deep6038(x); - } - - public static boolean deep6038(boolean x) { - return deep6039(x); - } - - public static boolean deep6039(boolean x) { - return deep6040(x); - } - - public static boolean deep6040(boolean x) { - return deep6041(x); - } - - public static boolean deep6041(boolean x) { - return deep6042(x); - } - - public static boolean deep6042(boolean x) { - return deep6043(x); - } - - public static boolean deep6043(boolean x) { - return deep6044(x); - } - - public static boolean deep6044(boolean x) { - return deep6045(x); - } - - public static boolean deep6045(boolean x) { - return deep6046(x); - } - - public static boolean deep6046(boolean x) { - return deep6047(x); - } - - public static boolean deep6047(boolean x) { - return deep6048(x); - } - - public static boolean deep6048(boolean x) { - return deep6049(x); - } - - public static boolean deep6049(boolean x) { - return deep6050(x); - } - - public static boolean deep6050(boolean x) { - return deep6051(x); - } - - public static boolean deep6051(boolean x) { - return deep6052(x); - } - - public static boolean deep6052(boolean x) { - return deep6053(x); - } - - public static boolean deep6053(boolean x) { - return deep6054(x); - } - - public static boolean deep6054(boolean x) { - return deep6055(x); - } - - public static boolean deep6055(boolean x) { - return deep6056(x); - } - - public static boolean deep6056(boolean x) { - return deep6057(x); - } - - public static boolean deep6057(boolean x) { - return deep6058(x); - } - - public static boolean deep6058(boolean x) { - return deep6059(x); - } - - public static boolean deep6059(boolean x) { - return deep6060(x); - } - - public static boolean deep6060(boolean x) { - return deep6061(x); - } - - public static boolean deep6061(boolean x) { - return deep6062(x); - } - - public static boolean deep6062(boolean x) { - return deep6063(x); - } - - public static boolean deep6063(boolean x) { - return deep6064(x); - } - - public static boolean deep6064(boolean x) { - return deep6065(x); - } - - public static boolean deep6065(boolean x) { - return deep6066(x); - } - - public static boolean deep6066(boolean x) { - return deep6067(x); - } - - public static boolean deep6067(boolean x) { - return deep6068(x); - } - - public static boolean deep6068(boolean x) { - return deep6069(x); - } - - public static boolean deep6069(boolean x) { - return deep6070(x); - } - - public static boolean deep6070(boolean x) { - return deep6071(x); - } - - public static boolean deep6071(boolean x) { - return deep6072(x); - } - - public static boolean deep6072(boolean x) { - return deep6073(x); - } - - public static boolean deep6073(boolean x) { - return deep6074(x); - } - - public static boolean deep6074(boolean x) { - return deep6075(x); - } - - public static boolean deep6075(boolean x) { - return deep6076(x); - } - - public static boolean deep6076(boolean x) { - return deep6077(x); - } - - public static boolean deep6077(boolean x) { - return deep6078(x); - } - - public static boolean deep6078(boolean x) { - return deep6079(x); - } - - public static boolean deep6079(boolean x) { - return deep6080(x); - } - - public static boolean deep6080(boolean x) { - return deep6081(x); - } - - public static boolean deep6081(boolean x) { - return deep6082(x); - } - - public static boolean deep6082(boolean x) { - return deep6083(x); - } - - public static boolean deep6083(boolean x) { - return deep6084(x); - } - - public static boolean deep6084(boolean x) { - return deep6085(x); - } - - public static boolean deep6085(boolean x) { - return deep6086(x); - } - - public static boolean deep6086(boolean x) { - return deep6087(x); - } - - public static boolean deep6087(boolean x) { - return deep6088(x); - } - - public static boolean deep6088(boolean x) { - return deep6089(x); - } - - public static boolean deep6089(boolean x) { - return deep6090(x); - } - - public static boolean deep6090(boolean x) { - return deep6091(x); - } - - public static boolean deep6091(boolean x) { - return deep6092(x); - } - - public static boolean deep6092(boolean x) { - return deep6093(x); - } - - public static boolean deep6093(boolean x) { - return deep6094(x); - } - - public static boolean deep6094(boolean x) { - return deep6095(x); - } - - public static boolean deep6095(boolean x) { - return deep6096(x); - } - - public static boolean deep6096(boolean x) { - return deep6097(x); - } - - public static boolean deep6097(boolean x) { - return deep6098(x); - } - - public static boolean deep6098(boolean x) { - return deep6099(x); - } - - public static boolean deep6099(boolean x) { - return deep6100(x); - } - - public static boolean deep6100(boolean x) { - return deep6101(x); - } - - public static boolean deep6101(boolean x) { - return deep6102(x); - } - - public static boolean deep6102(boolean x) { - return deep6103(x); - } - - public static boolean deep6103(boolean x) { - return deep6104(x); - } - - public static boolean deep6104(boolean x) { - return deep6105(x); - } - - public static boolean deep6105(boolean x) { - return deep6106(x); - } - - public static boolean deep6106(boolean x) { - return deep6107(x); - } - - public static boolean deep6107(boolean x) { - return deep6108(x); - } - - public static boolean deep6108(boolean x) { - return deep6109(x); - } - - public static boolean deep6109(boolean x) { - return deep6110(x); - } - - public static boolean deep6110(boolean x) { - return deep6111(x); - } - - public static boolean deep6111(boolean x) { - return deep6112(x); - } - - public static boolean deep6112(boolean x) { - return deep6113(x); - } - - public static boolean deep6113(boolean x) { - return deep6114(x); - } - - public static boolean deep6114(boolean x) { - return deep6115(x); - } - - public static boolean deep6115(boolean x) { - return deep6116(x); - } - - public static boolean deep6116(boolean x) { - return deep6117(x); - } - - public static boolean deep6117(boolean x) { - return deep6118(x); - } - - public static boolean deep6118(boolean x) { - return deep6119(x); - } - - public static boolean deep6119(boolean x) { - return deep6120(x); - } - - public static boolean deep6120(boolean x) { - return deep6121(x); - } - - public static boolean deep6121(boolean x) { - return deep6122(x); - } - - public static boolean deep6122(boolean x) { - return deep6123(x); - } - - public static boolean deep6123(boolean x) { - return deep6124(x); - } - - public static boolean deep6124(boolean x) { - return deep6125(x); - } - - public static boolean deep6125(boolean x) { - return deep6126(x); - } - - public static boolean deep6126(boolean x) { - return deep6127(x); - } - - public static boolean deep6127(boolean x) { - return deep6128(x); - } - - public static boolean deep6128(boolean x) { - return deep6129(x); - } - - public static boolean deep6129(boolean x) { - return deep6130(x); - } - - public static boolean deep6130(boolean x) { - return deep6131(x); - } - - public static boolean deep6131(boolean x) { - return deep6132(x); - } - - public static boolean deep6132(boolean x) { - return deep6133(x); - } - - public static boolean deep6133(boolean x) { - return deep6134(x); - } - - public static boolean deep6134(boolean x) { - return deep6135(x); - } - - public static boolean deep6135(boolean x) { - return deep6136(x); - } - - public static boolean deep6136(boolean x) { - return deep6137(x); - } - - public static boolean deep6137(boolean x) { - return deep6138(x); - } - - public static boolean deep6138(boolean x) { - return deep6139(x); - } - - public static boolean deep6139(boolean x) { - return deep6140(x); - } - - public static boolean deep6140(boolean x) { - return deep6141(x); - } - - public static boolean deep6141(boolean x) { - return deep6142(x); - } - - public static boolean deep6142(boolean x) { - return deep6143(x); - } - - public static boolean deep6143(boolean x) { - return deep6144(x); - } - - public static boolean deep6144(boolean x) { - return deep6145(x); - } - - public static boolean deep6145(boolean x) { - return deep6146(x); - } - - public static boolean deep6146(boolean x) { - return deep6147(x); - } - - public static boolean deep6147(boolean x) { - return deep6148(x); - } - - public static boolean deep6148(boolean x) { - return deep6149(x); - } - - public static boolean deep6149(boolean x) { - return deep6150(x); - } - - public static boolean deep6150(boolean x) { - return deep6151(x); - } - - public static boolean deep6151(boolean x) { - return deep6152(x); - } - - public static boolean deep6152(boolean x) { - return deep6153(x); - } - - public static boolean deep6153(boolean x) { - return deep6154(x); - } - - public static boolean deep6154(boolean x) { - return deep6155(x); - } - - public static boolean deep6155(boolean x) { - return deep6156(x); - } - - public static boolean deep6156(boolean x) { - return deep6157(x); - } - - public static boolean deep6157(boolean x) { - return deep6158(x); - } - - public static boolean deep6158(boolean x) { - return deep6159(x); - } - - public static boolean deep6159(boolean x) { - return deep6160(x); - } - - public static boolean deep6160(boolean x) { - return deep6161(x); - } - - public static boolean deep6161(boolean x) { - return deep6162(x); - } - - public static boolean deep6162(boolean x) { - return deep6163(x); - } - - public static boolean deep6163(boolean x) { - return deep6164(x); - } - - public static boolean deep6164(boolean x) { - return deep6165(x); - } - - public static boolean deep6165(boolean x) { - return deep6166(x); - } - - public static boolean deep6166(boolean x) { - return deep6167(x); - } - - public static boolean deep6167(boolean x) { - return deep6168(x); - } - - public static boolean deep6168(boolean x) { - return deep6169(x); - } - - public static boolean deep6169(boolean x) { - return deep6170(x); - } - - public static boolean deep6170(boolean x) { - return deep6171(x); - } - - public static boolean deep6171(boolean x) { - return deep6172(x); - } - - public static boolean deep6172(boolean x) { - return deep6173(x); - } - - public static boolean deep6173(boolean x) { - return deep6174(x); - } - - public static boolean deep6174(boolean x) { - return deep6175(x); - } - - public static boolean deep6175(boolean x) { - return deep6176(x); - } - - public static boolean deep6176(boolean x) { - return deep6177(x); - } - - public static boolean deep6177(boolean x) { - return deep6178(x); - } - - public static boolean deep6178(boolean x) { - return deep6179(x); - } - - public static boolean deep6179(boolean x) { - return deep6180(x); - } - - public static boolean deep6180(boolean x) { - return deep6181(x); - } - - public static boolean deep6181(boolean x) { - return deep6182(x); - } - - public static boolean deep6182(boolean x) { - return deep6183(x); - } - - public static boolean deep6183(boolean x) { - return deep6184(x); - } - - public static boolean deep6184(boolean x) { - return deep6185(x); - } - - public static boolean deep6185(boolean x) { - return deep6186(x); - } - - public static boolean deep6186(boolean x) { - return deep6187(x); - } - - public static boolean deep6187(boolean x) { - return deep6188(x); - } - - public static boolean deep6188(boolean x) { - return deep6189(x); - } - - public static boolean deep6189(boolean x) { - return deep6190(x); - } - - public static boolean deep6190(boolean x) { - return deep6191(x); - } - - public static boolean deep6191(boolean x) { - return deep6192(x); - } - - public static boolean deep6192(boolean x) { - return deep6193(x); - } - - public static boolean deep6193(boolean x) { - return deep6194(x); - } - - public static boolean deep6194(boolean x) { - return deep6195(x); - } - - public static boolean deep6195(boolean x) { - return deep6196(x); - } - - public static boolean deep6196(boolean x) { - return deep6197(x); - } - - public static boolean deep6197(boolean x) { - return deep6198(x); - } - - public static boolean deep6198(boolean x) { - return deep6199(x); - } - - public static boolean deep6199(boolean x) { - return deep6200(x); - } - - public static boolean deep6200(boolean x) { - return deep6201(x); - } - - public static boolean deep6201(boolean x) { - return deep6202(x); - } - - public static boolean deep6202(boolean x) { - return deep6203(x); - } - - public static boolean deep6203(boolean x) { - return deep6204(x); - } - - public static boolean deep6204(boolean x) { - return deep6205(x); - } - - public static boolean deep6205(boolean x) { - return deep6206(x); - } - - public static boolean deep6206(boolean x) { - return deep6207(x); - } - - public static boolean deep6207(boolean x) { - return deep6208(x); - } - - public static boolean deep6208(boolean x) { - return deep6209(x); - } - - public static boolean deep6209(boolean x) { - return deep6210(x); - } - - public static boolean deep6210(boolean x) { - return deep6211(x); - } - - public static boolean deep6211(boolean x) { - return deep6212(x); - } - - public static boolean deep6212(boolean x) { - return deep6213(x); - } - - public static boolean deep6213(boolean x) { - return deep6214(x); - } - - public static boolean deep6214(boolean x) { - return deep6215(x); - } - - public static boolean deep6215(boolean x) { - return deep6216(x); - } - - public static boolean deep6216(boolean x) { - return deep6217(x); - } - - public static boolean deep6217(boolean x) { - return deep6218(x); - } - - public static boolean deep6218(boolean x) { - return deep6219(x); - } - - public static boolean deep6219(boolean x) { - return deep6220(x); - } - - public static boolean deep6220(boolean x) { - return deep6221(x); - } - - public static boolean deep6221(boolean x) { - return deep6222(x); - } - - public static boolean deep6222(boolean x) { - return deep6223(x); - } - - public static boolean deep6223(boolean x) { - return deep6224(x); - } - - public static boolean deep6224(boolean x) { - return deep6225(x); - } - - public static boolean deep6225(boolean x) { - return deep6226(x); - } - - public static boolean deep6226(boolean x) { - return deep6227(x); - } - - public static boolean deep6227(boolean x) { - return deep6228(x); - } - - public static boolean deep6228(boolean x) { - return deep6229(x); - } - - public static boolean deep6229(boolean x) { - return deep6230(x); - } - - public static boolean deep6230(boolean x) { - return deep6231(x); - } - - public static boolean deep6231(boolean x) { - return deep6232(x); - } - - public static boolean deep6232(boolean x) { - return deep6233(x); - } - - public static boolean deep6233(boolean x) { - return deep6234(x); - } - - public static boolean deep6234(boolean x) { - return deep6235(x); - } - - public static boolean deep6235(boolean x) { - return deep6236(x); - } - - public static boolean deep6236(boolean x) { - return deep6237(x); - } - - public static boolean deep6237(boolean x) { - return deep6238(x); - } - - public static boolean deep6238(boolean x) { - return deep6239(x); - } - - public static boolean deep6239(boolean x) { - return deep6240(x); - } - - public static boolean deep6240(boolean x) { - return deep6241(x); - } - - public static boolean deep6241(boolean x) { - return deep6242(x); - } - - public static boolean deep6242(boolean x) { - return deep6243(x); - } - - public static boolean deep6243(boolean x) { - return deep6244(x); - } - - public static boolean deep6244(boolean x) { - return deep6245(x); - } - - public static boolean deep6245(boolean x) { - return deep6246(x); - } - - public static boolean deep6246(boolean x) { - return deep6247(x); - } - - public static boolean deep6247(boolean x) { - return deep6248(x); - } - - public static boolean deep6248(boolean x) { - return deep6249(x); - } - - public static boolean deep6249(boolean x) { - return deep6250(x); - } - - public static boolean deep6250(boolean x) { - return deep6251(x); - } - - public static boolean deep6251(boolean x) { - return deep6252(x); - } - - public static boolean deep6252(boolean x) { - return deep6253(x); - } - - public static boolean deep6253(boolean x) { - return deep6254(x); - } - - public static boolean deep6254(boolean x) { - return deep6255(x); - } - - public static boolean deep6255(boolean x) { - return deep6256(x); - } - - public static boolean deep6256(boolean x) { - return deep6257(x); - } - - public static boolean deep6257(boolean x) { - return deep6258(x); - } - - public static boolean deep6258(boolean x) { - return deep6259(x); - } - - public static boolean deep6259(boolean x) { - return deep6260(x); - } - - public static boolean deep6260(boolean x) { - return deep6261(x); - } - - public static boolean deep6261(boolean x) { - return deep6262(x); - } - - public static boolean deep6262(boolean x) { - return deep6263(x); - } - - public static boolean deep6263(boolean x) { - return deep6264(x); - } - - public static boolean deep6264(boolean x) { - return deep6265(x); - } - - public static boolean deep6265(boolean x) { - return deep6266(x); - } - - public static boolean deep6266(boolean x) { - return deep6267(x); - } - - public static boolean deep6267(boolean x) { - return deep6268(x); - } - - public static boolean deep6268(boolean x) { - return deep6269(x); - } - - public static boolean deep6269(boolean x) { - return deep6270(x); - } - - public static boolean deep6270(boolean x) { - return deep6271(x); - } - - public static boolean deep6271(boolean x) { - return deep6272(x); - } - - public static boolean deep6272(boolean x) { - return deep6273(x); - } - - public static boolean deep6273(boolean x) { - return deep6274(x); - } - - public static boolean deep6274(boolean x) { - return deep6275(x); - } - - public static boolean deep6275(boolean x) { - return deep6276(x); - } - - public static boolean deep6276(boolean x) { - return deep6277(x); - } - - public static boolean deep6277(boolean x) { - return deep6278(x); - } - - public static boolean deep6278(boolean x) { - return deep6279(x); - } - - public static boolean deep6279(boolean x) { - return deep6280(x); - } - - public static boolean deep6280(boolean x) { - return deep6281(x); - } - - public static boolean deep6281(boolean x) { - return deep6282(x); - } - - public static boolean deep6282(boolean x) { - return deep6283(x); - } - - public static boolean deep6283(boolean x) { - return deep6284(x); - } - - public static boolean deep6284(boolean x) { - return deep6285(x); - } - - public static boolean deep6285(boolean x) { - return deep6286(x); - } - - public static boolean deep6286(boolean x) { - return deep6287(x); - } - - public static boolean deep6287(boolean x) { - return deep6288(x); - } - - public static boolean deep6288(boolean x) { - return deep6289(x); - } - - public static boolean deep6289(boolean x) { - return deep6290(x); - } - - public static boolean deep6290(boolean x) { - return deep6291(x); - } - - public static boolean deep6291(boolean x) { - return deep6292(x); - } - - public static boolean deep6292(boolean x) { - return deep6293(x); - } - - public static boolean deep6293(boolean x) { - return deep6294(x); - } - - public static boolean deep6294(boolean x) { - return deep6295(x); - } - - public static boolean deep6295(boolean x) { - return deep6296(x); - } - - public static boolean deep6296(boolean x) { - return deep6297(x); - } - - public static boolean deep6297(boolean x) { - return deep6298(x); - } - - public static boolean deep6298(boolean x) { - return deep6299(x); - } - - public static boolean deep6299(boolean x) { - return deep6300(x); - } - - public static boolean deep6300(boolean x) { - return deep6301(x); - } - - public static boolean deep6301(boolean x) { - return deep6302(x); - } - - public static boolean deep6302(boolean x) { - return deep6303(x); - } - - public static boolean deep6303(boolean x) { - return deep6304(x); - } - - public static boolean deep6304(boolean x) { - return deep6305(x); - } - - public static boolean deep6305(boolean x) { - return deep6306(x); - } - - public static boolean deep6306(boolean x) { - return deep6307(x); - } - - public static boolean deep6307(boolean x) { - return deep6308(x); - } - - public static boolean deep6308(boolean x) { - return deep6309(x); - } - - public static boolean deep6309(boolean x) { - return deep6310(x); - } - - public static boolean deep6310(boolean x) { - return deep6311(x); - } - - public static boolean deep6311(boolean x) { - return deep6312(x); - } - - public static boolean deep6312(boolean x) { - return deep6313(x); - } - - public static boolean deep6313(boolean x) { - return deep6314(x); - } - - public static boolean deep6314(boolean x) { - return deep6315(x); - } - - public static boolean deep6315(boolean x) { - return deep6316(x); - } - - public static boolean deep6316(boolean x) { - return deep6317(x); - } - - public static boolean deep6317(boolean x) { - return deep6318(x); - } - - public static boolean deep6318(boolean x) { - return deep6319(x); - } - - public static boolean deep6319(boolean x) { - return deep6320(x); - } - - public static boolean deep6320(boolean x) { - return deep6321(x); - } - - public static boolean deep6321(boolean x) { - return deep6322(x); - } - - public static boolean deep6322(boolean x) { - return deep6323(x); - } - - public static boolean deep6323(boolean x) { - return deep6324(x); - } - - public static boolean deep6324(boolean x) { - return deep6325(x); - } - - public static boolean deep6325(boolean x) { - return deep6326(x); - } - - public static boolean deep6326(boolean x) { - return deep6327(x); - } - - public static boolean deep6327(boolean x) { - return deep6328(x); - } - - public static boolean deep6328(boolean x) { - return deep6329(x); - } - - public static boolean deep6329(boolean x) { - return deep6330(x); - } - - public static boolean deep6330(boolean x) { - return deep6331(x); - } - - public static boolean deep6331(boolean x) { - return deep6332(x); - } - - public static boolean deep6332(boolean x) { - return deep6333(x); - } - - public static boolean deep6333(boolean x) { - return deep6334(x); - } - - public static boolean deep6334(boolean x) { - return deep6335(x); - } - - public static boolean deep6335(boolean x) { - return deep6336(x); - } - - public static boolean deep6336(boolean x) { - return deep6337(x); - } - - public static boolean deep6337(boolean x) { - return deep6338(x); - } - - public static boolean deep6338(boolean x) { - return deep6339(x); - } - - public static boolean deep6339(boolean x) { - return deep6340(x); - } - - public static boolean deep6340(boolean x) { - return deep6341(x); - } - - public static boolean deep6341(boolean x) { - return deep6342(x); - } - - public static boolean deep6342(boolean x) { - return deep6343(x); - } - - public static boolean deep6343(boolean x) { - return deep6344(x); - } - - public static boolean deep6344(boolean x) { - return deep6345(x); - } - - public static boolean deep6345(boolean x) { - return deep6346(x); - } - - public static boolean deep6346(boolean x) { - return deep6347(x); - } - - public static boolean deep6347(boolean x) { - return deep6348(x); - } - - public static boolean deep6348(boolean x) { - return deep6349(x); - } - - public static boolean deep6349(boolean x) { - return deep6350(x); - } - - public static boolean deep6350(boolean x) { - return deep6351(x); - } - - public static boolean deep6351(boolean x) { - return deep6352(x); - } - - public static boolean deep6352(boolean x) { - return deep6353(x); - } - - public static boolean deep6353(boolean x) { - return deep6354(x); - } - - public static boolean deep6354(boolean x) { - return deep6355(x); - } - - public static boolean deep6355(boolean x) { - return deep6356(x); - } - - public static boolean deep6356(boolean x) { - return deep6357(x); - } - - public static boolean deep6357(boolean x) { - return deep6358(x); - } - - public static boolean deep6358(boolean x) { - return deep6359(x); - } - - public static boolean deep6359(boolean x) { - return deep6360(x); - } - - public static boolean deep6360(boolean x) { - return deep6361(x); - } - - public static boolean deep6361(boolean x) { - return deep6362(x); - } - - public static boolean deep6362(boolean x) { - return deep6363(x); - } - - public static boolean deep6363(boolean x) { - return deep6364(x); - } - - public static boolean deep6364(boolean x) { - return deep6365(x); - } - - public static boolean deep6365(boolean x) { - return deep6366(x); - } - - public static boolean deep6366(boolean x) { - return deep6367(x); - } - - public static boolean deep6367(boolean x) { - return deep6368(x); - } - - public static boolean deep6368(boolean x) { - return deep6369(x); - } - - public static boolean deep6369(boolean x) { - return deep6370(x); - } - - public static boolean deep6370(boolean x) { - return deep6371(x); - } - - public static boolean deep6371(boolean x) { - return deep6372(x); - } - - public static boolean deep6372(boolean x) { - return deep6373(x); - } - - public static boolean deep6373(boolean x) { - return deep6374(x); - } - - public static boolean deep6374(boolean x) { - return deep6375(x); - } - - public static boolean deep6375(boolean x) { - return deep6376(x); - } - - public static boolean deep6376(boolean x) { - return deep6377(x); - } - - public static boolean deep6377(boolean x) { - return deep6378(x); - } - - public static boolean deep6378(boolean x) { - return deep6379(x); - } - - public static boolean deep6379(boolean x) { - return deep6380(x); - } - - public static boolean deep6380(boolean x) { - return deep6381(x); - } - - public static boolean deep6381(boolean x) { - return deep6382(x); - } - - public static boolean deep6382(boolean x) { - return deep6383(x); - } - - public static boolean deep6383(boolean x) { - return deep6384(x); - } - - public static boolean deep6384(boolean x) { - return deep6385(x); - } - - public static boolean deep6385(boolean x) { - return deep6386(x); - } - - public static boolean deep6386(boolean x) { - return deep6387(x); - } - - public static boolean deep6387(boolean x) { - return deep6388(x); - } - - public static boolean deep6388(boolean x) { - return deep6389(x); - } - - public static boolean deep6389(boolean x) { - return deep6390(x); - } - - public static boolean deep6390(boolean x) { - return deep6391(x); - } - - public static boolean deep6391(boolean x) { - return deep6392(x); - } - - public static boolean deep6392(boolean x) { - return deep6393(x); - } - - public static boolean deep6393(boolean x) { - return deep6394(x); - } - - public static boolean deep6394(boolean x) { - return deep6395(x); - } - - public static boolean deep6395(boolean x) { - return deep6396(x); - } - - public static boolean deep6396(boolean x) { - return deep6397(x); - } - - public static boolean deep6397(boolean x) { - return deep6398(x); - } - - public static boolean deep6398(boolean x) { - return deep6399(x); - } - - public static boolean deep6399(boolean x) { - return deep6400(x); - } - - public static boolean deep6400(boolean x) { - return deep6401(x); - } - - public static boolean deep6401(boolean x) { - return deep6402(x); - } - - public static boolean deep6402(boolean x) { - return deep6403(x); - } - - public static boolean deep6403(boolean x) { - return deep6404(x); - } - - public static boolean deep6404(boolean x) { - return deep6405(x); - } - - public static boolean deep6405(boolean x) { - return deep6406(x); - } - - public static boolean deep6406(boolean x) { - return deep6407(x); - } - - public static boolean deep6407(boolean x) { - return deep6408(x); - } - - public static boolean deep6408(boolean x) { - return deep6409(x); - } - - public static boolean deep6409(boolean x) { - return deep6410(x); - } - - public static boolean deep6410(boolean x) { - return deep6411(x); - } - - public static boolean deep6411(boolean x) { - return deep6412(x); - } - - public static boolean deep6412(boolean x) { - return deep6413(x); - } - - public static boolean deep6413(boolean x) { - return deep6414(x); - } - - public static boolean deep6414(boolean x) { - return deep6415(x); - } - - public static boolean deep6415(boolean x) { - return deep6416(x); - } - - public static boolean deep6416(boolean x) { - return deep6417(x); - } - - public static boolean deep6417(boolean x) { - return deep6418(x); - } - - public static boolean deep6418(boolean x) { - return deep6419(x); - } - - public static boolean deep6419(boolean x) { - return deep6420(x); - } - - public static boolean deep6420(boolean x) { - return deep6421(x); - } - - public static boolean deep6421(boolean x) { - return deep6422(x); - } - - public static boolean deep6422(boolean x) { - return deep6423(x); - } - - public static boolean deep6423(boolean x) { - return deep6424(x); - } - - public static boolean deep6424(boolean x) { - return deep6425(x); - } - - public static boolean deep6425(boolean x) { - return deep6426(x); - } - - public static boolean deep6426(boolean x) { - return deep6427(x); - } - - public static boolean deep6427(boolean x) { - return deep6428(x); - } - - public static boolean deep6428(boolean x) { - return deep6429(x); - } - - public static boolean deep6429(boolean x) { - return deep6430(x); - } - - public static boolean deep6430(boolean x) { - return deep6431(x); - } - - public static boolean deep6431(boolean x) { - return deep6432(x); - } - - public static boolean deep6432(boolean x) { - return deep6433(x); - } - - public static boolean deep6433(boolean x) { - return deep6434(x); - } - - public static boolean deep6434(boolean x) { - return deep6435(x); - } - - public static boolean deep6435(boolean x) { - return deep6436(x); - } - - public static boolean deep6436(boolean x) { - return deep6437(x); - } - - public static boolean deep6437(boolean x) { - return deep6438(x); - } - - public static boolean deep6438(boolean x) { - return deep6439(x); - } - - public static boolean deep6439(boolean x) { - return deep6440(x); - } - - public static boolean deep6440(boolean x) { - return deep6441(x); - } - - public static boolean deep6441(boolean x) { - return deep6442(x); - } - - public static boolean deep6442(boolean x) { - return deep6443(x); - } - - public static boolean deep6443(boolean x) { - return deep6444(x); - } - - public static boolean deep6444(boolean x) { - return deep6445(x); - } - - public static boolean deep6445(boolean x) { - return deep6446(x); - } - - public static boolean deep6446(boolean x) { - return deep6447(x); - } - - public static boolean deep6447(boolean x) { - return deep6448(x); - } - - public static boolean deep6448(boolean x) { - return deep6449(x); - } - - public static boolean deep6449(boolean x) { - return deep6450(x); - } - - public static boolean deep6450(boolean x) { - return deep6451(x); - } - - public static boolean deep6451(boolean x) { - return deep6452(x); - } - - public static boolean deep6452(boolean x) { - return deep6453(x); - } - - public static boolean deep6453(boolean x) { - return deep6454(x); - } - - public static boolean deep6454(boolean x) { - return deep6455(x); - } - - public static boolean deep6455(boolean x) { - return deep6456(x); - } - - public static boolean deep6456(boolean x) { - return deep6457(x); - } - - public static boolean deep6457(boolean x) { - return deep6458(x); - } - - public static boolean deep6458(boolean x) { - return deep6459(x); - } - - public static boolean deep6459(boolean x) { - return deep6460(x); - } - - public static boolean deep6460(boolean x) { - return deep6461(x); - } - - public static boolean deep6461(boolean x) { - return deep6462(x); - } - - public static boolean deep6462(boolean x) { - return deep6463(x); - } - - public static boolean deep6463(boolean x) { - return deep6464(x); - } - - public static boolean deep6464(boolean x) { - return deep6465(x); - } - - public static boolean deep6465(boolean x) { - return deep6466(x); - } - - public static boolean deep6466(boolean x) { - return deep6467(x); - } - - public static boolean deep6467(boolean x) { - return deep6468(x); - } - - public static boolean deep6468(boolean x) { - return deep6469(x); - } - - public static boolean deep6469(boolean x) { - return deep6470(x); - } - - public static boolean deep6470(boolean x) { - return deep6471(x); - } - - public static boolean deep6471(boolean x) { - return deep6472(x); - } - - public static boolean deep6472(boolean x) { - return deep6473(x); - } - - public static boolean deep6473(boolean x) { - return deep6474(x); - } - - public static boolean deep6474(boolean x) { - return deep6475(x); - } - - public static boolean deep6475(boolean x) { - return deep6476(x); - } - - public static boolean deep6476(boolean x) { - return deep6477(x); - } - - public static boolean deep6477(boolean x) { - return deep6478(x); - } - - public static boolean deep6478(boolean x) { - return deep6479(x); - } - - public static boolean deep6479(boolean x) { - return deep6480(x); - } - - public static boolean deep6480(boolean x) { - return deep6481(x); - } - - public static boolean deep6481(boolean x) { - return deep6482(x); - } - - public static boolean deep6482(boolean x) { - return deep6483(x); - } - - public static boolean deep6483(boolean x) { - return deep6484(x); - } - - public static boolean deep6484(boolean x) { - return deep6485(x); - } - - public static boolean deep6485(boolean x) { - return deep6486(x); - } - - public static boolean deep6486(boolean x) { - return deep6487(x); - } - - public static boolean deep6487(boolean x) { - return deep6488(x); - } - - public static boolean deep6488(boolean x) { - return deep6489(x); - } - - public static boolean deep6489(boolean x) { - return deep6490(x); - } - - public static boolean deep6490(boolean x) { - return deep6491(x); - } - - public static boolean deep6491(boolean x) { - return deep6492(x); - } - - public static boolean deep6492(boolean x) { - return deep6493(x); - } - - public static boolean deep6493(boolean x) { - return deep6494(x); - } - - public static boolean deep6494(boolean x) { - return deep6495(x); - } - - public static boolean deep6495(boolean x) { - return deep6496(x); - } - - public static boolean deep6496(boolean x) { - return deep6497(x); - } - - public static boolean deep6497(boolean x) { - return deep6498(x); - } - - public static boolean deep6498(boolean x) { - return deep6499(x); - } - - public static boolean deep6499(boolean x) { - return deep6500(x); - } - - public static boolean deep6500(boolean x) { - return deep6501(x); - } - - public static boolean deep6501(boolean x) { - return deep6502(x); - } - - public static boolean deep6502(boolean x) { - return deep6503(x); - } - - public static boolean deep6503(boolean x) { - return deep6504(x); - } - - public static boolean deep6504(boolean x) { - return deep6505(x); - } - - public static boolean deep6505(boolean x) { - return deep6506(x); - } - - public static boolean deep6506(boolean x) { - return deep6507(x); - } - - public static boolean deep6507(boolean x) { - return deep6508(x); - } - - public static boolean deep6508(boolean x) { - return deep6509(x); - } - - public static boolean deep6509(boolean x) { - return deep6510(x); - } - - public static boolean deep6510(boolean x) { - return deep6511(x); - } - - public static boolean deep6511(boolean x) { - return deep6512(x); - } - - public static boolean deep6512(boolean x) { - return deep6513(x); - } - - public static boolean deep6513(boolean x) { - return deep6514(x); - } - - public static boolean deep6514(boolean x) { - return deep6515(x); - } - - public static boolean deep6515(boolean x) { - return deep6516(x); - } - - public static boolean deep6516(boolean x) { - return deep6517(x); - } - - public static boolean deep6517(boolean x) { - return deep6518(x); - } - - public static boolean deep6518(boolean x) { - return deep6519(x); - } - - public static boolean deep6519(boolean x) { - return deep6520(x); - } - - public static boolean deep6520(boolean x) { - return deep6521(x); - } - - public static boolean deep6521(boolean x) { - return deep6522(x); - } - - public static boolean deep6522(boolean x) { - return deep6523(x); - } - - public static boolean deep6523(boolean x) { - return deep6524(x); - } - - public static boolean deep6524(boolean x) { - return deep6525(x); - } - - public static boolean deep6525(boolean x) { - return deep6526(x); - } - - public static boolean deep6526(boolean x) { - return deep6527(x); - } - - public static boolean deep6527(boolean x) { - return deep6528(x); - } - - public static boolean deep6528(boolean x) { - return deep6529(x); - } - - public static boolean deep6529(boolean x) { - return deep6530(x); - } - - public static boolean deep6530(boolean x) { - return deep6531(x); - } - - public static boolean deep6531(boolean x) { - return deep6532(x); - } - - public static boolean deep6532(boolean x) { - return deep6533(x); - } - - public static boolean deep6533(boolean x) { - return deep6534(x); - } - - public static boolean deep6534(boolean x) { - return deep6535(x); - } - - public static boolean deep6535(boolean x) { - return deep6536(x); - } - - public static boolean deep6536(boolean x) { - return deep6537(x); - } - - public static boolean deep6537(boolean x) { - return deep6538(x); - } - - public static boolean deep6538(boolean x) { - return deep6539(x); - } - - public static boolean deep6539(boolean x) { - return deep6540(x); - } - - public static boolean deep6540(boolean x) { - return deep6541(x); - } - - public static boolean deep6541(boolean x) { - return deep6542(x); - } - - public static boolean deep6542(boolean x) { - return deep6543(x); - } - - public static boolean deep6543(boolean x) { - return deep6544(x); - } - - public static boolean deep6544(boolean x) { - return deep6545(x); - } - - public static boolean deep6545(boolean x) { - return deep6546(x); - } - - public static boolean deep6546(boolean x) { - return deep6547(x); - } - - public static boolean deep6547(boolean x) { - return deep6548(x); - } - - public static boolean deep6548(boolean x) { - return deep6549(x); - } - - public static boolean deep6549(boolean x) { - return deep6550(x); - } - - public static boolean deep6550(boolean x) { - return deep6551(x); - } - - public static boolean deep6551(boolean x) { - return deep6552(x); - } - - public static boolean deep6552(boolean x) { - return deep6553(x); - } - - public static boolean deep6553(boolean x) { - return deep6554(x); - } - - public static boolean deep6554(boolean x) { - return deep6555(x); - } - - public static boolean deep6555(boolean x) { - return deep6556(x); - } - - public static boolean deep6556(boolean x) { - return deep6557(x); - } - - public static boolean deep6557(boolean x) { - return deep6558(x); - } - - public static boolean deep6558(boolean x) { - return deep6559(x); - } - - public static boolean deep6559(boolean x) { - return deep6560(x); - } - - public static boolean deep6560(boolean x) { - return deep6561(x); - } - - public static boolean deep6561(boolean x) { - return deep6562(x); - } - - public static boolean deep6562(boolean x) { - return deep6563(x); - } - - public static boolean deep6563(boolean x) { - return deep6564(x); - } - - public static boolean deep6564(boolean x) { - return deep6565(x); - } - - public static boolean deep6565(boolean x) { - return deep6566(x); - } - - public static boolean deep6566(boolean x) { - return deep6567(x); - } - - public static boolean deep6567(boolean x) { - return deep6568(x); - } - - public static boolean deep6568(boolean x) { - return deep6569(x); - } - - public static boolean deep6569(boolean x) { - return deep6570(x); - } - - public static boolean deep6570(boolean x) { - return deep6571(x); - } - - public static boolean deep6571(boolean x) { - return deep6572(x); - } - - public static boolean deep6572(boolean x) { - return deep6573(x); - } - - public static boolean deep6573(boolean x) { - return deep6574(x); - } - - public static boolean deep6574(boolean x) { - return deep6575(x); - } - - public static boolean deep6575(boolean x) { - return deep6576(x); - } - - public static boolean deep6576(boolean x) { - return deep6577(x); - } - - public static boolean deep6577(boolean x) { - return deep6578(x); - } - - public static boolean deep6578(boolean x) { - return deep6579(x); - } - - public static boolean deep6579(boolean x) { - return deep6580(x); - } - - public static boolean deep6580(boolean x) { - return deep6581(x); - } - - public static boolean deep6581(boolean x) { - return deep6582(x); - } - - public static boolean deep6582(boolean x) { - return deep6583(x); - } - - public static boolean deep6583(boolean x) { - return deep6584(x); - } - - public static boolean deep6584(boolean x) { - return deep6585(x); - } - - public static boolean deep6585(boolean x) { - return deep6586(x); - } - - public static boolean deep6586(boolean x) { - return deep6587(x); - } - - public static boolean deep6587(boolean x) { - return deep6588(x); - } - - public static boolean deep6588(boolean x) { - return deep6589(x); - } - - public static boolean deep6589(boolean x) { - return deep6590(x); - } - - public static boolean deep6590(boolean x) { - return deep6591(x); - } - - public static boolean deep6591(boolean x) { - return deep6592(x); - } - - public static boolean deep6592(boolean x) { - return deep6593(x); - } - - public static boolean deep6593(boolean x) { - return deep6594(x); - } - - public static boolean deep6594(boolean x) { - return deep6595(x); - } - - public static boolean deep6595(boolean x) { - return deep6596(x); - } - - public static boolean deep6596(boolean x) { - return deep6597(x); - } - - public static boolean deep6597(boolean x) { - return deep6598(x); - } - - public static boolean deep6598(boolean x) { - return deep6599(x); - } - - public static boolean deep6599(boolean x) { - return deep6600(x); - } - - public static boolean deep6600(boolean x) { - return deep6601(x); - } - - public static boolean deep6601(boolean x) { - return deep6602(x); - } - - public static boolean deep6602(boolean x) { - return deep6603(x); - } - - public static boolean deep6603(boolean x) { - return deep6604(x); - } - - public static boolean deep6604(boolean x) { - return deep6605(x); - } - - public static boolean deep6605(boolean x) { - return deep6606(x); - } - - public static boolean deep6606(boolean x) { - return deep6607(x); - } - - public static boolean deep6607(boolean x) { - return deep6608(x); - } - - public static boolean deep6608(boolean x) { - return deep6609(x); - } - - public static boolean deep6609(boolean x) { - return deep6610(x); - } - - public static boolean deep6610(boolean x) { - return deep6611(x); - } - - public static boolean deep6611(boolean x) { - return deep6612(x); - } - - public static boolean deep6612(boolean x) { - return deep6613(x); - } - - public static boolean deep6613(boolean x) { - return deep6614(x); - } - - public static boolean deep6614(boolean x) { - return deep6615(x); - } - - public static boolean deep6615(boolean x) { - return deep6616(x); - } - - public static boolean deep6616(boolean x) { - return deep6617(x); - } - - public static boolean deep6617(boolean x) { - return deep6618(x); - } - - public static boolean deep6618(boolean x) { - return deep6619(x); - } - - public static boolean deep6619(boolean x) { - return deep6620(x); - } - - public static boolean deep6620(boolean x) { - return deep6621(x); - } - - public static boolean deep6621(boolean x) { - return deep6622(x); - } - - public static boolean deep6622(boolean x) { - return deep6623(x); - } - - public static boolean deep6623(boolean x) { - return deep6624(x); - } - - public static boolean deep6624(boolean x) { - return deep6625(x); - } - - public static boolean deep6625(boolean x) { - return deep6626(x); - } - - public static boolean deep6626(boolean x) { - return deep6627(x); - } - - public static boolean deep6627(boolean x) { - return deep6628(x); - } - - public static boolean deep6628(boolean x) { - return deep6629(x); - } - - public static boolean deep6629(boolean x) { - return deep6630(x); - } - - public static boolean deep6630(boolean x) { - return deep6631(x); - } - - public static boolean deep6631(boolean x) { - return deep6632(x); - } - - public static boolean deep6632(boolean x) { - return deep6633(x); - } - - public static boolean deep6633(boolean x) { - return deep6634(x); - } - - public static boolean deep6634(boolean x) { - return deep6635(x); - } - - public static boolean deep6635(boolean x) { - return deep6636(x); - } - - public static boolean deep6636(boolean x) { - return deep6637(x); - } - - public static boolean deep6637(boolean x) { - return deep6638(x); - } - - public static boolean deep6638(boolean x) { - return deep6639(x); - } - - public static boolean deep6639(boolean x) { - return deep6640(x); - } - - public static boolean deep6640(boolean x) { - return deep6641(x); - } - - public static boolean deep6641(boolean x) { - return deep6642(x); - } - - public static boolean deep6642(boolean x) { - return deep6643(x); - } - - public static boolean deep6643(boolean x) { - return deep6644(x); - } - - public static boolean deep6644(boolean x) { - return deep6645(x); - } - - public static boolean deep6645(boolean x) { - return deep6646(x); - } - - public static boolean deep6646(boolean x) { - return deep6647(x); - } - - public static boolean deep6647(boolean x) { - return deep6648(x); - } - - public static boolean deep6648(boolean x) { - return deep6649(x); - } - - public static boolean deep6649(boolean x) { - return deep6650(x); - } - - public static boolean deep6650(boolean x) { - return deep6651(x); - } - - public static boolean deep6651(boolean x) { - return deep6652(x); - } - - public static boolean deep6652(boolean x) { - return deep6653(x); - } - - public static boolean deep6653(boolean x) { - return deep6654(x); - } - - public static boolean deep6654(boolean x) { - return deep6655(x); - } - - public static boolean deep6655(boolean x) { - return deep6656(x); - } - - public static boolean deep6656(boolean x) { - return deep6657(x); - } - - public static boolean deep6657(boolean x) { - return deep6658(x); - } - - public static boolean deep6658(boolean x) { - return deep6659(x); - } - - public static boolean deep6659(boolean x) { - return deep6660(x); - } - - public static boolean deep6660(boolean x) { - return deep6661(x); - } - - public static boolean deep6661(boolean x) { - return deep6662(x); - } - - public static boolean deep6662(boolean x) { - return deep6663(x); - } - - public static boolean deep6663(boolean x) { - return deep6664(x); - } - - public static boolean deep6664(boolean x) { - return deep6665(x); - } - - public static boolean deep6665(boolean x) { - return deep6666(x); - } - - public static boolean deep6666(boolean x) { - return deep6667(x); - } - - public static boolean deep6667(boolean x) { - return deep6668(x); - } - - public static boolean deep6668(boolean x) { - return deep6669(x); - } - - public static boolean deep6669(boolean x) { - return deep6670(x); - } - - public static boolean deep6670(boolean x) { - return deep6671(x); - } - - public static boolean deep6671(boolean x) { - return deep6672(x); - } - - public static boolean deep6672(boolean x) { - return deep6673(x); - } - - public static boolean deep6673(boolean x) { - return deep6674(x); - } - - public static boolean deep6674(boolean x) { - return deep6675(x); - } - - public static boolean deep6675(boolean x) { - return deep6676(x); - } - - public static boolean deep6676(boolean x) { - return deep6677(x); - } - - public static boolean deep6677(boolean x) { - return deep6678(x); - } - - public static boolean deep6678(boolean x) { - return deep6679(x); - } - - public static boolean deep6679(boolean x) { - return deep6680(x); - } - - public static boolean deep6680(boolean x) { - return deep6681(x); - } - - public static boolean deep6681(boolean x) { - return deep6682(x); - } - - public static boolean deep6682(boolean x) { - return deep6683(x); - } - - public static boolean deep6683(boolean x) { - return deep6684(x); - } - - public static boolean deep6684(boolean x) { - return deep6685(x); - } - - public static boolean deep6685(boolean x) { - return deep6686(x); - } - - public static boolean deep6686(boolean x) { - return deep6687(x); - } - - public static boolean deep6687(boolean x) { - return deep6688(x); - } - - public static boolean deep6688(boolean x) { - return deep6689(x); - } - - public static boolean deep6689(boolean x) { - return deep6690(x); - } - - public static boolean deep6690(boolean x) { - return deep6691(x); - } - - public static boolean deep6691(boolean x) { - return deep6692(x); - } - - public static boolean deep6692(boolean x) { - return deep6693(x); - } - - public static boolean deep6693(boolean x) { - return deep6694(x); - } - - public static boolean deep6694(boolean x) { - return deep6695(x); - } - - public static boolean deep6695(boolean x) { - return deep6696(x); - } - - public static boolean deep6696(boolean x) { - return deep6697(x); - } - - public static boolean deep6697(boolean x) { - return deep6698(x); - } - - public static boolean deep6698(boolean x) { - return deep6699(x); - } - - public static boolean deep6699(boolean x) { - return deep6700(x); - } - - public static boolean deep6700(boolean x) { - return deep6701(x); - } - - public static boolean deep6701(boolean x) { - return deep6702(x); - } - - public static boolean deep6702(boolean x) { - return deep6703(x); - } - - public static boolean deep6703(boolean x) { - return deep6704(x); - } - - public static boolean deep6704(boolean x) { - return deep6705(x); - } - - public static boolean deep6705(boolean x) { - return deep6706(x); - } - - public static boolean deep6706(boolean x) { - return deep6707(x); - } - - public static boolean deep6707(boolean x) { - return deep6708(x); - } - - public static boolean deep6708(boolean x) { - return deep6709(x); - } - - public static boolean deep6709(boolean x) { - return deep6710(x); - } - - public static boolean deep6710(boolean x) { - return deep6711(x); - } - - public static boolean deep6711(boolean x) { - return deep6712(x); - } - - public static boolean deep6712(boolean x) { - return deep6713(x); - } - - public static boolean deep6713(boolean x) { - return deep6714(x); - } - - public static boolean deep6714(boolean x) { - return deep6715(x); - } - - public static boolean deep6715(boolean x) { - return deep6716(x); - } - - public static boolean deep6716(boolean x) { - return deep6717(x); - } - - public static boolean deep6717(boolean x) { - return deep6718(x); - } - - public static boolean deep6718(boolean x) { - return deep6719(x); - } - - public static boolean deep6719(boolean x) { - return deep6720(x); - } - - public static boolean deep6720(boolean x) { - return deep6721(x); - } - - public static boolean deep6721(boolean x) { - return deep6722(x); - } - - public static boolean deep6722(boolean x) { - return deep6723(x); - } - - public static boolean deep6723(boolean x) { - return deep6724(x); - } - - public static boolean deep6724(boolean x) { - return deep6725(x); - } - - public static boolean deep6725(boolean x) { - return deep6726(x); - } - - public static boolean deep6726(boolean x) { - return deep6727(x); - } - - public static boolean deep6727(boolean x) { - return deep6728(x); - } - - public static boolean deep6728(boolean x) { - return deep6729(x); - } - - public static boolean deep6729(boolean x) { - return deep6730(x); - } - - public static boolean deep6730(boolean x) { - return deep6731(x); - } - - public static boolean deep6731(boolean x) { - return deep6732(x); - } - - public static boolean deep6732(boolean x) { - return deep6733(x); - } - - public static boolean deep6733(boolean x) { - return deep6734(x); - } - - public static boolean deep6734(boolean x) { - return deep6735(x); - } - - public static boolean deep6735(boolean x) { - return deep6736(x); - } - - public static boolean deep6736(boolean x) { - return deep6737(x); - } - - public static boolean deep6737(boolean x) { - return deep6738(x); - } - - public static boolean deep6738(boolean x) { - return deep6739(x); - } - - public static boolean deep6739(boolean x) { - return deep6740(x); - } - - public static boolean deep6740(boolean x) { - return deep6741(x); - } - - public static boolean deep6741(boolean x) { - return deep6742(x); - } - - public static boolean deep6742(boolean x) { - return deep6743(x); - } - - public static boolean deep6743(boolean x) { - return deep6744(x); - } - - public static boolean deep6744(boolean x) { - return deep6745(x); - } - - public static boolean deep6745(boolean x) { - return deep6746(x); - } - - public static boolean deep6746(boolean x) { - return deep6747(x); - } - - public static boolean deep6747(boolean x) { - return deep6748(x); - } - - public static boolean deep6748(boolean x) { - return deep6749(x); - } - - public static boolean deep6749(boolean x) { - return deep6750(x); - } - - public static boolean deep6750(boolean x) { - return deep6751(x); - } - - public static boolean deep6751(boolean x) { - return deep6752(x); - } - - public static boolean deep6752(boolean x) { - return deep6753(x); - } - - public static boolean deep6753(boolean x) { - return deep6754(x); - } - - public static boolean deep6754(boolean x) { - return deep6755(x); - } - - public static boolean deep6755(boolean x) { - return deep6756(x); - } - - public static boolean deep6756(boolean x) { - return deep6757(x); - } - - public static boolean deep6757(boolean x) { - return deep6758(x); - } - - public static boolean deep6758(boolean x) { - return deep6759(x); - } - - public static boolean deep6759(boolean x) { - return deep6760(x); - } - - public static boolean deep6760(boolean x) { - return deep6761(x); - } - - public static boolean deep6761(boolean x) { - return deep6762(x); - } - - public static boolean deep6762(boolean x) { - return deep6763(x); - } - - public static boolean deep6763(boolean x) { - return deep6764(x); - } - - public static boolean deep6764(boolean x) { - return deep6765(x); - } - - public static boolean deep6765(boolean x) { - return deep6766(x); - } - - public static boolean deep6766(boolean x) { - return deep6767(x); - } - - public static boolean deep6767(boolean x) { - return deep6768(x); - } - - public static boolean deep6768(boolean x) { - return deep6769(x); - } - - public static boolean deep6769(boolean x) { - return deep6770(x); - } - - public static boolean deep6770(boolean x) { - return deep6771(x); - } - - public static boolean deep6771(boolean x) { - return deep6772(x); - } - - public static boolean deep6772(boolean x) { - return deep6773(x); - } - - public static boolean deep6773(boolean x) { - return deep6774(x); - } - - public static boolean deep6774(boolean x) { - return deep6775(x); - } - - public static boolean deep6775(boolean x) { - return deep6776(x); - } - - public static boolean deep6776(boolean x) { - return deep6777(x); - } - - public static boolean deep6777(boolean x) { - return deep6778(x); - } - - public static boolean deep6778(boolean x) { - return deep6779(x); - } - - public static boolean deep6779(boolean x) { - return deep6780(x); - } - - public static boolean deep6780(boolean x) { - return deep6781(x); - } - - public static boolean deep6781(boolean x) { - return deep6782(x); - } - - public static boolean deep6782(boolean x) { - return deep6783(x); - } - - public static boolean deep6783(boolean x) { - return deep6784(x); - } - - public static boolean deep6784(boolean x) { - return deep6785(x); - } - - public static boolean deep6785(boolean x) { - return deep6786(x); - } - - public static boolean deep6786(boolean x) { - return deep6787(x); - } - - public static boolean deep6787(boolean x) { - return deep6788(x); - } - - public static boolean deep6788(boolean x) { - return deep6789(x); - } - - public static boolean deep6789(boolean x) { - return deep6790(x); - } - - public static boolean deep6790(boolean x) { - return deep6791(x); - } - - public static boolean deep6791(boolean x) { - return deep6792(x); - } - - public static boolean deep6792(boolean x) { - return deep6793(x); - } - - public static boolean deep6793(boolean x) { - return deep6794(x); - } - - public static boolean deep6794(boolean x) { - return deep6795(x); - } - - public static boolean deep6795(boolean x) { - return deep6796(x); - } - - public static boolean deep6796(boolean x) { - return deep6797(x); - } - - public static boolean deep6797(boolean x) { - return deep6798(x); - } - - public static boolean deep6798(boolean x) { - return deep6799(x); - } - - public static boolean deep6799(boolean x) { - return deep6800(x); - } - - public static boolean deep6800(boolean x) { - return deep6801(x); - } - - public static boolean deep6801(boolean x) { - return deep6802(x); - } - - public static boolean deep6802(boolean x) { - return deep6803(x); - } - - public static boolean deep6803(boolean x) { - return deep6804(x); - } - - public static boolean deep6804(boolean x) { - return deep6805(x); - } - - public static boolean deep6805(boolean x) { - return deep6806(x); - } - - public static boolean deep6806(boolean x) { - return deep6807(x); - } - - public static boolean deep6807(boolean x) { - return deep6808(x); - } - - public static boolean deep6808(boolean x) { - return deep6809(x); - } - - public static boolean deep6809(boolean x) { - return deep6810(x); - } - - public static boolean deep6810(boolean x) { - return deep6811(x); - } - - public static boolean deep6811(boolean x) { - return deep6812(x); - } - - public static boolean deep6812(boolean x) { - return deep6813(x); - } - - public static boolean deep6813(boolean x) { - return deep6814(x); - } - - public static boolean deep6814(boolean x) { - return deep6815(x); - } - - public static boolean deep6815(boolean x) { - return deep6816(x); - } - - public static boolean deep6816(boolean x) { - return deep6817(x); - } - - public static boolean deep6817(boolean x) { - return deep6818(x); - } - - public static boolean deep6818(boolean x) { - return deep6819(x); - } - - public static boolean deep6819(boolean x) { - return deep6820(x); - } - - public static boolean deep6820(boolean x) { - return deep6821(x); - } - - public static boolean deep6821(boolean x) { - return deep6822(x); - } - - public static boolean deep6822(boolean x) { - return deep6823(x); - } - - public static boolean deep6823(boolean x) { - return deep6824(x); - } - - public static boolean deep6824(boolean x) { - return deep6825(x); - } - - public static boolean deep6825(boolean x) { - return deep6826(x); - } - - public static boolean deep6826(boolean x) { - return deep6827(x); - } - - public static boolean deep6827(boolean x) { - return deep6828(x); - } - - public static boolean deep6828(boolean x) { - return deep6829(x); - } - - public static boolean deep6829(boolean x) { - return deep6830(x); - } - - public static boolean deep6830(boolean x) { - return deep6831(x); - } - - public static boolean deep6831(boolean x) { - return deep6832(x); - } - - public static boolean deep6832(boolean x) { - return deep6833(x); - } - - public static boolean deep6833(boolean x) { - return deep6834(x); - } - - public static boolean deep6834(boolean x) { - return deep6835(x); - } - - public static boolean deep6835(boolean x) { - return deep6836(x); - } - - public static boolean deep6836(boolean x) { - return deep6837(x); - } - - public static boolean deep6837(boolean x) { - return deep6838(x); - } - - public static boolean deep6838(boolean x) { - return deep6839(x); - } - - public static boolean deep6839(boolean x) { - return deep6840(x); - } - - public static boolean deep6840(boolean x) { - return deep6841(x); - } - - public static boolean deep6841(boolean x) { - return deep6842(x); - } - - public static boolean deep6842(boolean x) { - return deep6843(x); - } - - public static boolean deep6843(boolean x) { - return deep6844(x); - } - - public static boolean deep6844(boolean x) { - return deep6845(x); - } - - public static boolean deep6845(boolean x) { - return deep6846(x); - } - - public static boolean deep6846(boolean x) { - return deep6847(x); - } - - public static boolean deep6847(boolean x) { - return deep6848(x); - } - - public static boolean deep6848(boolean x) { - return deep6849(x); - } - - public static boolean deep6849(boolean x) { - return deep6850(x); - } - - public static boolean deep6850(boolean x) { - return deep6851(x); - } - - public static boolean deep6851(boolean x) { - return deep6852(x); - } - - public static boolean deep6852(boolean x) { - return deep6853(x); - } - - public static boolean deep6853(boolean x) { - return deep6854(x); - } - - public static boolean deep6854(boolean x) { - return deep6855(x); - } - - public static boolean deep6855(boolean x) { - return deep6856(x); - } - - public static boolean deep6856(boolean x) { - return deep6857(x); - } - - public static boolean deep6857(boolean x) { - return deep6858(x); - } - - public static boolean deep6858(boolean x) { - return deep6859(x); - } - - public static boolean deep6859(boolean x) { - return deep6860(x); - } - - public static boolean deep6860(boolean x) { - return deep6861(x); - } - - public static boolean deep6861(boolean x) { - return deep6862(x); - } - - public static boolean deep6862(boolean x) { - return deep6863(x); - } - - public static boolean deep6863(boolean x) { - return deep6864(x); - } - - public static boolean deep6864(boolean x) { - return deep6865(x); - } - - public static boolean deep6865(boolean x) { - return deep6866(x); - } - - public static boolean deep6866(boolean x) { - return deep6867(x); - } - - public static boolean deep6867(boolean x) { - return deep6868(x); - } - - public static boolean deep6868(boolean x) { - return deep6869(x); - } - - public static boolean deep6869(boolean x) { - return deep6870(x); - } - - public static boolean deep6870(boolean x) { - return deep6871(x); - } - - public static boolean deep6871(boolean x) { - return deep6872(x); - } - - public static boolean deep6872(boolean x) { - return deep6873(x); - } - - public static boolean deep6873(boolean x) { - return deep6874(x); - } - - public static boolean deep6874(boolean x) { - return deep6875(x); - } - - public static boolean deep6875(boolean x) { - return deep6876(x); - } - - public static boolean deep6876(boolean x) { - return deep6877(x); - } - - public static boolean deep6877(boolean x) { - return deep6878(x); - } - - public static boolean deep6878(boolean x) { - return deep6879(x); - } - - public static boolean deep6879(boolean x) { - return deep6880(x); - } - - public static boolean deep6880(boolean x) { - return deep6881(x); - } - - public static boolean deep6881(boolean x) { - return deep6882(x); - } - - public static boolean deep6882(boolean x) { - return deep6883(x); - } - - public static boolean deep6883(boolean x) { - return deep6884(x); - } - - public static boolean deep6884(boolean x) { - return deep6885(x); - } - - public static boolean deep6885(boolean x) { - return deep6886(x); - } - - public static boolean deep6886(boolean x) { - return deep6887(x); - } - - public static boolean deep6887(boolean x) { - return deep6888(x); - } - - public static boolean deep6888(boolean x) { - return deep6889(x); - } - - public static boolean deep6889(boolean x) { - return deep6890(x); - } - - public static boolean deep6890(boolean x) { - return deep6891(x); - } - - public static boolean deep6891(boolean x) { - return deep6892(x); - } - - public static boolean deep6892(boolean x) { - return deep6893(x); - } - - public static boolean deep6893(boolean x) { - return deep6894(x); - } - - public static boolean deep6894(boolean x) { - return deep6895(x); - } - - public static boolean deep6895(boolean x) { - return deep6896(x); - } - - public static boolean deep6896(boolean x) { - return deep6897(x); - } - - public static boolean deep6897(boolean x) { - return deep6898(x); - } - - public static boolean deep6898(boolean x) { - return deep6899(x); - } - - public static boolean deep6899(boolean x) { - return deep6900(x); - } - - public static boolean deep6900(boolean x) { - return deep6901(x); - } - - public static boolean deep6901(boolean x) { - return deep6902(x); - } - - public static boolean deep6902(boolean x) { - return deep6903(x); - } - - public static boolean deep6903(boolean x) { - return deep6904(x); - } - - public static boolean deep6904(boolean x) { - return deep6905(x); - } - - public static boolean deep6905(boolean x) { - return deep6906(x); - } - - public static boolean deep6906(boolean x) { - return deep6907(x); - } - - public static boolean deep6907(boolean x) { - return deep6908(x); - } - - public static boolean deep6908(boolean x) { - return deep6909(x); - } - - public static boolean deep6909(boolean x) { - return deep6910(x); - } - - public static boolean deep6910(boolean x) { - return deep6911(x); - } - - public static boolean deep6911(boolean x) { - return deep6912(x); - } - - public static boolean deep6912(boolean x) { - return deep6913(x); - } - - public static boolean deep6913(boolean x) { - return deep6914(x); - } - - public static boolean deep6914(boolean x) { - return deep6915(x); - } - - public static boolean deep6915(boolean x) { - return deep6916(x); - } - - public static boolean deep6916(boolean x) { - return deep6917(x); - } - - public static boolean deep6917(boolean x) { - return deep6918(x); - } - - public static boolean deep6918(boolean x) { - return deep6919(x); - } - - public static boolean deep6919(boolean x) { - return deep6920(x); - } - - public static boolean deep6920(boolean x) { - return deep6921(x); - } - - public static boolean deep6921(boolean x) { - return deep6922(x); - } - - public static boolean deep6922(boolean x) { - return deep6923(x); - } - - public static boolean deep6923(boolean x) { - return deep6924(x); - } - - public static boolean deep6924(boolean x) { - return deep6925(x); - } - - public static boolean deep6925(boolean x) { - return deep6926(x); - } - - public static boolean deep6926(boolean x) { - return deep6927(x); - } - - public static boolean deep6927(boolean x) { - return deep6928(x); - } - - public static boolean deep6928(boolean x) { - return deep6929(x); - } - - public static boolean deep6929(boolean x) { - return deep6930(x); - } - - public static boolean deep6930(boolean x) { - return deep6931(x); - } - - public static boolean deep6931(boolean x) { - return deep6932(x); - } - - public static boolean deep6932(boolean x) { - return deep6933(x); - } - - public static boolean deep6933(boolean x) { - return deep6934(x); - } - - public static boolean deep6934(boolean x) { - return deep6935(x); - } - - public static boolean deep6935(boolean x) { - return deep6936(x); - } - - public static boolean deep6936(boolean x) { - return deep6937(x); - } - - public static boolean deep6937(boolean x) { - return deep6938(x); - } - - public static boolean deep6938(boolean x) { - return deep6939(x); - } - - public static boolean deep6939(boolean x) { - return deep6940(x); - } - - public static boolean deep6940(boolean x) { - return deep6941(x); - } - - public static boolean deep6941(boolean x) { - return deep6942(x); - } - - public static boolean deep6942(boolean x) { - return deep6943(x); - } - - public static boolean deep6943(boolean x) { - return deep6944(x); - } - - public static boolean deep6944(boolean x) { - return deep6945(x); - } - - public static boolean deep6945(boolean x) { - return deep6946(x); - } - - public static boolean deep6946(boolean x) { - return deep6947(x); - } - - public static boolean deep6947(boolean x) { - return deep6948(x); - } - - public static boolean deep6948(boolean x) { - return deep6949(x); - } - - public static boolean deep6949(boolean x) { - return deep6950(x); - } - - public static boolean deep6950(boolean x) { - return deep6951(x); - } - - public static boolean deep6951(boolean x) { - return deep6952(x); - } - - public static boolean deep6952(boolean x) { - return deep6953(x); - } - - public static boolean deep6953(boolean x) { - return deep6954(x); - } - - public static boolean deep6954(boolean x) { - return deep6955(x); - } - - public static boolean deep6955(boolean x) { - return deep6956(x); - } - - public static boolean deep6956(boolean x) { - return deep6957(x); - } - - public static boolean deep6957(boolean x) { - return deep6958(x); - } - - public static boolean deep6958(boolean x) { - return deep6959(x); - } - - public static boolean deep6959(boolean x) { - return deep6960(x); - } - - public static boolean deep6960(boolean x) { - return deep6961(x); - } - - public static boolean deep6961(boolean x) { - return deep6962(x); - } - - public static boolean deep6962(boolean x) { - return deep6963(x); - } - - public static boolean deep6963(boolean x) { - return deep6964(x); - } - - public static boolean deep6964(boolean x) { - return deep6965(x); - } - - public static boolean deep6965(boolean x) { - return deep6966(x); - } - - public static boolean deep6966(boolean x) { - return deep6967(x); - } - - public static boolean deep6967(boolean x) { - return deep6968(x); - } - - public static boolean deep6968(boolean x) { - return deep6969(x); - } - - public static boolean deep6969(boolean x) { - return deep6970(x); - } - - public static boolean deep6970(boolean x) { - return deep6971(x); - } - - public static boolean deep6971(boolean x) { - return deep6972(x); - } - - public static boolean deep6972(boolean x) { - return deep6973(x); - } - - public static boolean deep6973(boolean x) { - return deep6974(x); - } - - public static boolean deep6974(boolean x) { - return deep6975(x); - } - - public static boolean deep6975(boolean x) { - return deep6976(x); - } - - public static boolean deep6976(boolean x) { - return deep6977(x); - } - - public static boolean deep6977(boolean x) { - return deep6978(x); - } - - public static boolean deep6978(boolean x) { - return deep6979(x); - } - - public static boolean deep6979(boolean x) { - return deep6980(x); - } - - public static boolean deep6980(boolean x) { - return deep6981(x); - } - - public static boolean deep6981(boolean x) { - return deep6982(x); - } - - public static boolean deep6982(boolean x) { - return deep6983(x); - } - - public static boolean deep6983(boolean x) { - return deep6984(x); - } - - public static boolean deep6984(boolean x) { - return deep6985(x); - } - - public static boolean deep6985(boolean x) { - return deep6986(x); - } - - public static boolean deep6986(boolean x) { - return deep6987(x); - } - - public static boolean deep6987(boolean x) { - return deep6988(x); - } - - public static boolean deep6988(boolean x) { - return deep6989(x); - } - - public static boolean deep6989(boolean x) { - return deep6990(x); - } - - public static boolean deep6990(boolean x) { - return deep6991(x); - } - - public static boolean deep6991(boolean x) { - return deep6992(x); - } - - public static boolean deep6992(boolean x) { - return deep6993(x); - } - - public static boolean deep6993(boolean x) { - return deep6994(x); - } - - public static boolean deep6994(boolean x) { - return deep6995(x); - } - - public static boolean deep6995(boolean x) { - return deep6996(x); - } - - public static boolean deep6996(boolean x) { - return deep6997(x); - } - - public static boolean deep6997(boolean x) { - return deep6998(x); - } - - public static boolean deep6998(boolean x) { - return deep6999(x); - } - - public static boolean deep6999(boolean x) { - return deep7000(x); - } - - public static boolean deep7000(boolean x) { - return deep7001(x); - } - - public static boolean deep7001(boolean x) { - return deep7002(x); - } - - public static boolean deep7002(boolean x) { - return deep7003(x); - } - - public static boolean deep7003(boolean x) { - return deep7004(x); - } - - public static boolean deep7004(boolean x) { - return deep7005(x); - } - - public static boolean deep7005(boolean x) { - return deep7006(x); - } - - public static boolean deep7006(boolean x) { - return deep7007(x); - } - - public static boolean deep7007(boolean x) { - return deep7008(x); - } - - public static boolean deep7008(boolean x) { - return deep7009(x); - } - - public static boolean deep7009(boolean x) { - return deep7010(x); - } - - public static boolean deep7010(boolean x) { - return deep7011(x); - } - - public static boolean deep7011(boolean x) { - return deep7012(x); - } - - public static boolean deep7012(boolean x) { - return deep7013(x); - } - - public static boolean deep7013(boolean x) { - return deep7014(x); - } - - public static boolean deep7014(boolean x) { - return deep7015(x); - } - - public static boolean deep7015(boolean x) { - return deep7016(x); - } - - public static boolean deep7016(boolean x) { - return deep7017(x); - } - - public static boolean deep7017(boolean x) { - return deep7018(x); - } - - public static boolean deep7018(boolean x) { - return deep7019(x); - } - - public static boolean deep7019(boolean x) { - return deep7020(x); - } - - public static boolean deep7020(boolean x) { - return deep7021(x); - } - - public static boolean deep7021(boolean x) { - return deep7022(x); - } - - public static boolean deep7022(boolean x) { - return deep7023(x); - } - - public static boolean deep7023(boolean x) { - return deep7024(x); - } - - public static boolean deep7024(boolean x) { - return deep7025(x); - } - - public static boolean deep7025(boolean x) { - return deep7026(x); - } - - public static boolean deep7026(boolean x) { - return deep7027(x); - } - - public static boolean deep7027(boolean x) { - return deep7028(x); - } - - public static boolean deep7028(boolean x) { - return deep7029(x); - } - - public static boolean deep7029(boolean x) { - return deep7030(x); - } - - public static boolean deep7030(boolean x) { - return deep7031(x); - } - - public static boolean deep7031(boolean x) { - return deep7032(x); - } - - public static boolean deep7032(boolean x) { - return deep7033(x); - } - - public static boolean deep7033(boolean x) { - return deep7034(x); - } - - public static boolean deep7034(boolean x) { - return deep7035(x); - } - - public static boolean deep7035(boolean x) { - return deep7036(x); - } - - public static boolean deep7036(boolean x) { - return deep7037(x); - } - - public static boolean deep7037(boolean x) { - return deep7038(x); - } - - public static boolean deep7038(boolean x) { - return deep7039(x); - } - - public static boolean deep7039(boolean x) { - return deep7040(x); - } - - public static boolean deep7040(boolean x) { - return deep7041(x); - } - - public static boolean deep7041(boolean x) { - return deep7042(x); - } - - public static boolean deep7042(boolean x) { - return deep7043(x); - } - - public static boolean deep7043(boolean x) { - return deep7044(x); - } - - public static boolean deep7044(boolean x) { - return deep7045(x); - } - - public static boolean deep7045(boolean x) { - return deep7046(x); - } - - public static boolean deep7046(boolean x) { - return deep7047(x); - } - - public static boolean deep7047(boolean x) { - return deep7048(x); - } - - public static boolean deep7048(boolean x) { - return deep7049(x); - } - - public static boolean deep7049(boolean x) { - return deep7050(x); - } - - public static boolean deep7050(boolean x) { - return deep7051(x); - } - - public static boolean deep7051(boolean x) { - return deep7052(x); - } - - public static boolean deep7052(boolean x) { - return deep7053(x); - } - - public static boolean deep7053(boolean x) { - return deep7054(x); - } - - public static boolean deep7054(boolean x) { - return deep7055(x); - } - - public static boolean deep7055(boolean x) { - return deep7056(x); - } - - public static boolean deep7056(boolean x) { - return deep7057(x); - } - - public static boolean deep7057(boolean x) { - return deep7058(x); - } - - public static boolean deep7058(boolean x) { - return deep7059(x); - } - - public static boolean deep7059(boolean x) { - return deep7060(x); - } - - public static boolean deep7060(boolean x) { - return deep7061(x); - } - - public static boolean deep7061(boolean x) { - return deep7062(x); - } - - public static boolean deep7062(boolean x) { - return deep7063(x); - } - - public static boolean deep7063(boolean x) { - return deep7064(x); - } - - public static boolean deep7064(boolean x) { - return deep7065(x); - } - - public static boolean deep7065(boolean x) { - return deep7066(x); - } - - public static boolean deep7066(boolean x) { - return deep7067(x); - } - - public static boolean deep7067(boolean x) { - return deep7068(x); - } - - public static boolean deep7068(boolean x) { - return deep7069(x); - } - - public static boolean deep7069(boolean x) { - return deep7070(x); - } - - public static boolean deep7070(boolean x) { - return deep7071(x); - } - - public static boolean deep7071(boolean x) { - return deep7072(x); - } - - public static boolean deep7072(boolean x) { - return deep7073(x); - } - - public static boolean deep7073(boolean x) { - return deep7074(x); - } - - public static boolean deep7074(boolean x) { - return deep7075(x); - } - - public static boolean deep7075(boolean x) { - return deep7076(x); - } - - public static boolean deep7076(boolean x) { - return deep7077(x); - } - - public static boolean deep7077(boolean x) { - return deep7078(x); - } - - public static boolean deep7078(boolean x) { - return deep7079(x); - } - - public static boolean deep7079(boolean x) { - return deep7080(x); - } - - public static boolean deep7080(boolean x) { - return deep7081(x); - } - - public static boolean deep7081(boolean x) { - return deep7082(x); - } - - public static boolean deep7082(boolean x) { - return deep7083(x); - } - - public static boolean deep7083(boolean x) { - return deep7084(x); - } - - public static boolean deep7084(boolean x) { - return deep7085(x); - } - - public static boolean deep7085(boolean x) { - return deep7086(x); - } - - public static boolean deep7086(boolean x) { - return deep7087(x); - } - - public static boolean deep7087(boolean x) { - return deep7088(x); - } - - public static boolean deep7088(boolean x) { - return deep7089(x); - } - - public static boolean deep7089(boolean x) { - return deep7090(x); - } - - public static boolean deep7090(boolean x) { - return deep7091(x); - } - - public static boolean deep7091(boolean x) { - return deep7092(x); - } - - public static boolean deep7092(boolean x) { - return deep7093(x); - } - - public static boolean deep7093(boolean x) { - return deep7094(x); - } - - public static boolean deep7094(boolean x) { - return deep7095(x); - } - - public static boolean deep7095(boolean x) { - return deep7096(x); - } - - public static boolean deep7096(boolean x) { - return deep7097(x); - } - - public static boolean deep7097(boolean x) { - return deep7098(x); - } - - public static boolean deep7098(boolean x) { - return deep7099(x); - } - - public static boolean deep7099(boolean x) { - return deep7100(x); - } - - public static boolean deep7100(boolean x) { - return deep7101(x); - } - - public static boolean deep7101(boolean x) { - return deep7102(x); - } - - public static boolean deep7102(boolean x) { - return deep7103(x); - } - - public static boolean deep7103(boolean x) { - return deep7104(x); - } - - public static boolean deep7104(boolean x) { - return deep7105(x); - } - - public static boolean deep7105(boolean x) { - return deep7106(x); - } - - public static boolean deep7106(boolean x) { - return deep7107(x); - } - - public static boolean deep7107(boolean x) { - return deep7108(x); - } - - public static boolean deep7108(boolean x) { - return deep7109(x); - } - - public static boolean deep7109(boolean x) { - return deep7110(x); - } - - public static boolean deep7110(boolean x) { - return deep7111(x); - } - - public static boolean deep7111(boolean x) { - return deep7112(x); - } - - public static boolean deep7112(boolean x) { - return deep7113(x); - } - - public static boolean deep7113(boolean x) { - return deep7114(x); - } - - public static boolean deep7114(boolean x) { - return deep7115(x); - } - - public static boolean deep7115(boolean x) { - return deep7116(x); - } - - public static boolean deep7116(boolean x) { - return deep7117(x); - } - - public static boolean deep7117(boolean x) { - return deep7118(x); - } - - public static boolean deep7118(boolean x) { - return deep7119(x); - } - - public static boolean deep7119(boolean x) { - return deep7120(x); - } - - public static boolean deep7120(boolean x) { - return deep7121(x); - } - - public static boolean deep7121(boolean x) { - return deep7122(x); - } - - public static boolean deep7122(boolean x) { - return deep7123(x); - } - - public static boolean deep7123(boolean x) { - return deep7124(x); - } - - public static boolean deep7124(boolean x) { - return deep7125(x); - } - - public static boolean deep7125(boolean x) { - return deep7126(x); - } - - public static boolean deep7126(boolean x) { - return deep7127(x); - } - - public static boolean deep7127(boolean x) { - return deep7128(x); - } - - public static boolean deep7128(boolean x) { - return deep7129(x); - } - - public static boolean deep7129(boolean x) { - return deep7130(x); - } - - public static boolean deep7130(boolean x) { - return deep7131(x); - } - - public static boolean deep7131(boolean x) { - return deep7132(x); - } - - public static boolean deep7132(boolean x) { - return deep7133(x); - } - - public static boolean deep7133(boolean x) { - return deep7134(x); - } - - public static boolean deep7134(boolean x) { - return deep7135(x); - } - - public static boolean deep7135(boolean x) { - return deep7136(x); - } - - public static boolean deep7136(boolean x) { - return deep7137(x); - } - - public static boolean deep7137(boolean x) { - return deep7138(x); - } - - public static boolean deep7138(boolean x) { - return deep7139(x); - } - - public static boolean deep7139(boolean x) { - return deep7140(x); - } - - public static boolean deep7140(boolean x) { - return deep7141(x); - } - - public static boolean deep7141(boolean x) { - return deep7142(x); - } - - public static boolean deep7142(boolean x) { - return deep7143(x); - } - - public static boolean deep7143(boolean x) { - return deep7144(x); - } - - public static boolean deep7144(boolean x) { - return deep7145(x); - } - - public static boolean deep7145(boolean x) { - return deep7146(x); - } - - public static boolean deep7146(boolean x) { - return deep7147(x); - } - - public static boolean deep7147(boolean x) { - return deep7148(x); - } - - public static boolean deep7148(boolean x) { - return deep7149(x); - } - - public static boolean deep7149(boolean x) { - return deep7150(x); - } - - public static boolean deep7150(boolean x) { - return deep7151(x); - } - - public static boolean deep7151(boolean x) { - return deep7152(x); - } - - public static boolean deep7152(boolean x) { - return deep7153(x); - } - - public static boolean deep7153(boolean x) { - return deep7154(x); - } - - public static boolean deep7154(boolean x) { - return deep7155(x); - } - - public static boolean deep7155(boolean x) { - return deep7156(x); - } - - public static boolean deep7156(boolean x) { - return deep7157(x); - } - - public static boolean deep7157(boolean x) { - return deep7158(x); - } - - public static boolean deep7158(boolean x) { - return deep7159(x); - } - - public static boolean deep7159(boolean x) { - return deep7160(x); - } - - public static boolean deep7160(boolean x) { - return deep7161(x); - } - - public static boolean deep7161(boolean x) { - return deep7162(x); - } - - public static boolean deep7162(boolean x) { - return deep7163(x); - } - - public static boolean deep7163(boolean x) { - return deep7164(x); - } - - public static boolean deep7164(boolean x) { - return deep7165(x); - } - - public static boolean deep7165(boolean x) { - return deep7166(x); - } - - public static boolean deep7166(boolean x) { - return deep7167(x); - } - - public static boolean deep7167(boolean x) { - return deep7168(x); - } - - public static boolean deep7168(boolean x) { - return deep7169(x); - } - - public static boolean deep7169(boolean x) { - return deep7170(x); - } - - public static boolean deep7170(boolean x) { - return deep7171(x); - } - - public static boolean deep7171(boolean x) { - return deep7172(x); - } - - public static boolean deep7172(boolean x) { - return deep7173(x); - } - - public static boolean deep7173(boolean x) { - return deep7174(x); - } - - public static boolean deep7174(boolean x) { - return deep7175(x); - } - - public static boolean deep7175(boolean x) { - return deep7176(x); - } - - public static boolean deep7176(boolean x) { - return deep7177(x); - } - - public static boolean deep7177(boolean x) { - return deep7178(x); - } - - public static boolean deep7178(boolean x) { - return deep7179(x); - } - - public static boolean deep7179(boolean x) { - return deep7180(x); - } - - public static boolean deep7180(boolean x) { - return deep7181(x); - } - - public static boolean deep7181(boolean x) { - return deep7182(x); - } - - public static boolean deep7182(boolean x) { - return deep7183(x); - } - - public static boolean deep7183(boolean x) { - return deep7184(x); - } - - public static boolean deep7184(boolean x) { - return deep7185(x); - } - - public static boolean deep7185(boolean x) { - return deep7186(x); - } - - public static boolean deep7186(boolean x) { - return deep7187(x); - } - - public static boolean deep7187(boolean x) { - return deep7188(x); - } - - public static boolean deep7188(boolean x) { - return deep7189(x); - } - - public static boolean deep7189(boolean x) { - return deep7190(x); - } - - public static boolean deep7190(boolean x) { - return deep7191(x); - } - - public static boolean deep7191(boolean x) { - return deep7192(x); - } - - public static boolean deep7192(boolean x) { - return deep7193(x); - } - - public static boolean deep7193(boolean x) { - return deep7194(x); - } - - public static boolean deep7194(boolean x) { - return deep7195(x); - } - - public static boolean deep7195(boolean x) { - return deep7196(x); - } - - public static boolean deep7196(boolean x) { - return deep7197(x); - } - - public static boolean deep7197(boolean x) { - return deep7198(x); - } - - public static boolean deep7198(boolean x) { - return deep7199(x); - } - - public static boolean deep7199(boolean x) { - return deep7200(x); - } - - public static boolean deep7200(boolean x) { - return deep7201(x); - } - - public static boolean deep7201(boolean x) { - return deep7202(x); - } - - public static boolean deep7202(boolean x) { - return deep7203(x); - } - - public static boolean deep7203(boolean x) { - return deep7204(x); - } - - public static boolean deep7204(boolean x) { - return deep7205(x); - } - - public static boolean deep7205(boolean x) { - return deep7206(x); - } - - public static boolean deep7206(boolean x) { - return deep7207(x); - } - - public static boolean deep7207(boolean x) { - return deep7208(x); - } - - public static boolean deep7208(boolean x) { - return deep7209(x); - } - - public static boolean deep7209(boolean x) { - return deep7210(x); - } - - public static boolean deep7210(boolean x) { - return deep7211(x); - } - - public static boolean deep7211(boolean x) { - return deep7212(x); - } - - public static boolean deep7212(boolean x) { - return deep7213(x); - } - - public static boolean deep7213(boolean x) { - return deep7214(x); - } - - public static boolean deep7214(boolean x) { - return deep7215(x); - } - - public static boolean deep7215(boolean x) { - return deep7216(x); - } - - public static boolean deep7216(boolean x) { - return deep7217(x); - } - - public static boolean deep7217(boolean x) { - return deep7218(x); - } - - public static boolean deep7218(boolean x) { - return deep7219(x); - } - - public static boolean deep7219(boolean x) { - return deep7220(x); - } - - public static boolean deep7220(boolean x) { - return deep7221(x); - } - - public static boolean deep7221(boolean x) { - return deep7222(x); - } - - public static boolean deep7222(boolean x) { - return deep7223(x); - } - - public static boolean deep7223(boolean x) { - return deep7224(x); - } - - public static boolean deep7224(boolean x) { - return deep7225(x); - } - - public static boolean deep7225(boolean x) { - return deep7226(x); - } - - public static boolean deep7226(boolean x) { - return deep7227(x); - } - - public static boolean deep7227(boolean x) { - return deep7228(x); - } - - public static boolean deep7228(boolean x) { - return deep7229(x); - } - - public static boolean deep7229(boolean x) { - return deep7230(x); - } - - public static boolean deep7230(boolean x) { - return deep7231(x); - } - - public static boolean deep7231(boolean x) { - return deep7232(x); - } - - public static boolean deep7232(boolean x) { - return deep7233(x); - } - - public static boolean deep7233(boolean x) { - return deep7234(x); - } - - public static boolean deep7234(boolean x) { - return deep7235(x); - } - - public static boolean deep7235(boolean x) { - return deep7236(x); - } - - public static boolean deep7236(boolean x) { - return deep7237(x); - } - - public static boolean deep7237(boolean x) { - return deep7238(x); - } - - public static boolean deep7238(boolean x) { - return deep7239(x); - } - - public static boolean deep7239(boolean x) { - return deep7240(x); - } - - public static boolean deep7240(boolean x) { - return deep7241(x); - } - - public static boolean deep7241(boolean x) { - return deep7242(x); - } - - public static boolean deep7242(boolean x) { - return deep7243(x); - } - - public static boolean deep7243(boolean x) { - return deep7244(x); - } - - public static boolean deep7244(boolean x) { - return deep7245(x); - } - - public static boolean deep7245(boolean x) { - return deep7246(x); - } - - public static boolean deep7246(boolean x) { - return deep7247(x); - } - - public static boolean deep7247(boolean x) { - return deep7248(x); - } - - public static boolean deep7248(boolean x) { - return deep7249(x); - } - - public static boolean deep7249(boolean x) { - return deep7250(x); - } - - public static boolean deep7250(boolean x) { - return deep7251(x); - } - - public static boolean deep7251(boolean x) { - return deep7252(x); - } - - public static boolean deep7252(boolean x) { - return deep7253(x); - } - - public static boolean deep7253(boolean x) { - return deep7254(x); - } - - public static boolean deep7254(boolean x) { - return deep7255(x); - } - - public static boolean deep7255(boolean x) { - return deep7256(x); - } - - public static boolean deep7256(boolean x) { - return deep7257(x); - } - - public static boolean deep7257(boolean x) { - return deep7258(x); - } - - public static boolean deep7258(boolean x) { - return deep7259(x); - } - - public static boolean deep7259(boolean x) { - return deep7260(x); - } - - public static boolean deep7260(boolean x) { - return deep7261(x); - } - - public static boolean deep7261(boolean x) { - return deep7262(x); - } - - public static boolean deep7262(boolean x) { - return deep7263(x); - } - - public static boolean deep7263(boolean x) { - return deep7264(x); - } - - public static boolean deep7264(boolean x) { - return deep7265(x); - } - - public static boolean deep7265(boolean x) { - return deep7266(x); - } - - public static boolean deep7266(boolean x) { - return deep7267(x); - } - - public static boolean deep7267(boolean x) { - return deep7268(x); - } - - public static boolean deep7268(boolean x) { - return deep7269(x); - } - - public static boolean deep7269(boolean x) { - return deep7270(x); - } - - public static boolean deep7270(boolean x) { - return deep7271(x); - } - - public static boolean deep7271(boolean x) { - return deep7272(x); - } - - public static boolean deep7272(boolean x) { - return deep7273(x); - } - - public static boolean deep7273(boolean x) { - return deep7274(x); - } - - public static boolean deep7274(boolean x) { - return deep7275(x); - } - - public static boolean deep7275(boolean x) { - return deep7276(x); - } - - public static boolean deep7276(boolean x) { - return deep7277(x); - } - - public static boolean deep7277(boolean x) { - return deep7278(x); - } - - public static boolean deep7278(boolean x) { - return deep7279(x); - } - - public static boolean deep7279(boolean x) { - return deep7280(x); - } - - public static boolean deep7280(boolean x) { - return deep7281(x); - } - - public static boolean deep7281(boolean x) { - return deep7282(x); - } - - public static boolean deep7282(boolean x) { - return deep7283(x); - } - - public static boolean deep7283(boolean x) { - return deep7284(x); - } - - public static boolean deep7284(boolean x) { - return deep7285(x); - } - - public static boolean deep7285(boolean x) { - return deep7286(x); - } - - public static boolean deep7286(boolean x) { - return deep7287(x); - } - - public static boolean deep7287(boolean x) { - return deep7288(x); - } - - public static boolean deep7288(boolean x) { - return deep7289(x); - } - - public static boolean deep7289(boolean x) { - return deep7290(x); - } - - public static boolean deep7290(boolean x) { - return deep7291(x); - } - - public static boolean deep7291(boolean x) { - return deep7292(x); - } - - public static boolean deep7292(boolean x) { - return deep7293(x); - } - - public static boolean deep7293(boolean x) { - return deep7294(x); - } - - public static boolean deep7294(boolean x) { - return deep7295(x); - } - - public static boolean deep7295(boolean x) { - return deep7296(x); - } - - public static boolean deep7296(boolean x) { - return deep7297(x); - } - - public static boolean deep7297(boolean x) { - return deep7298(x); - } - - public static boolean deep7298(boolean x) { - return deep7299(x); - } - - public static boolean deep7299(boolean x) { - return deep7300(x); - } - - public static boolean deep7300(boolean x) { - return deep7301(x); - } - - public static boolean deep7301(boolean x) { - return deep7302(x); - } - - public static boolean deep7302(boolean x) { - return deep7303(x); - } - - public static boolean deep7303(boolean x) { - return deep7304(x); - } - - public static boolean deep7304(boolean x) { - return deep7305(x); - } - - public static boolean deep7305(boolean x) { - return deep7306(x); - } - - public static boolean deep7306(boolean x) { - return deep7307(x); - } - - public static boolean deep7307(boolean x) { - return deep7308(x); - } - - public static boolean deep7308(boolean x) { - return deep7309(x); - } - - public static boolean deep7309(boolean x) { - return deep7310(x); - } - - public static boolean deep7310(boolean x) { - return deep7311(x); - } - - public static boolean deep7311(boolean x) { - return deep7312(x); - } - - public static boolean deep7312(boolean x) { - return deep7313(x); - } - - public static boolean deep7313(boolean x) { - return deep7314(x); - } - - public static boolean deep7314(boolean x) { - return deep7315(x); - } - - public static boolean deep7315(boolean x) { - return deep7316(x); - } - - public static boolean deep7316(boolean x) { - return deep7317(x); - } - - public static boolean deep7317(boolean x) { - return deep7318(x); - } - - public static boolean deep7318(boolean x) { - return deep7319(x); - } - - public static boolean deep7319(boolean x) { - return deep7320(x); - } - - public static boolean deep7320(boolean x) { - return deep7321(x); - } - - public static boolean deep7321(boolean x) { - return deep7322(x); - } - - public static boolean deep7322(boolean x) { - return deep7323(x); - } - - public static boolean deep7323(boolean x) { - return deep7324(x); - } - - public static boolean deep7324(boolean x) { - return deep7325(x); - } - - public static boolean deep7325(boolean x) { - return deep7326(x); - } - - public static boolean deep7326(boolean x) { - return deep7327(x); - } - - public static boolean deep7327(boolean x) { - return deep7328(x); - } - - public static boolean deep7328(boolean x) { - return deep7329(x); - } - - public static boolean deep7329(boolean x) { - return deep7330(x); - } - - public static boolean deep7330(boolean x) { - return deep7331(x); - } - - public static boolean deep7331(boolean x) { - return deep7332(x); - } - - public static boolean deep7332(boolean x) { - return deep7333(x); - } - - public static boolean deep7333(boolean x) { - return deep7334(x); - } - - public static boolean deep7334(boolean x) { - return deep7335(x); - } - - public static boolean deep7335(boolean x) { - return deep7336(x); - } - - public static boolean deep7336(boolean x) { - return deep7337(x); - } - - public static boolean deep7337(boolean x) { - return deep7338(x); - } - - public static boolean deep7338(boolean x) { - return deep7339(x); - } - - public static boolean deep7339(boolean x) { - return deep7340(x); - } - - public static boolean deep7340(boolean x) { - return deep7341(x); - } - - public static boolean deep7341(boolean x) { - return deep7342(x); - } - - public static boolean deep7342(boolean x) { - return deep7343(x); - } - - public static boolean deep7343(boolean x) { - return deep7344(x); - } - - public static boolean deep7344(boolean x) { - return deep7345(x); - } - - public static boolean deep7345(boolean x) { - return deep7346(x); - } - - public static boolean deep7346(boolean x) { - return deep7347(x); - } - - public static boolean deep7347(boolean x) { - return deep7348(x); - } - - public static boolean deep7348(boolean x) { - return deep7349(x); - } - - public static boolean deep7349(boolean x) { - return deep7350(x); - } - - public static boolean deep7350(boolean x) { - return deep7351(x); - } - - public static boolean deep7351(boolean x) { - return deep7352(x); - } - - public static boolean deep7352(boolean x) { - return deep7353(x); - } - - public static boolean deep7353(boolean x) { - return deep7354(x); - } - - public static boolean deep7354(boolean x) { - return deep7355(x); - } - - public static boolean deep7355(boolean x) { - return deep7356(x); - } - - public static boolean deep7356(boolean x) { - return deep7357(x); - } - - public static boolean deep7357(boolean x) { - return deep7358(x); - } - - public static boolean deep7358(boolean x) { - return deep7359(x); - } - - public static boolean deep7359(boolean x) { - return deep7360(x); - } - - public static boolean deep7360(boolean x) { - return deep7361(x); - } - - public static boolean deep7361(boolean x) { - return deep7362(x); - } - - public static boolean deep7362(boolean x) { - return deep7363(x); - } - - public static boolean deep7363(boolean x) { - return deep7364(x); - } - - public static boolean deep7364(boolean x) { - return deep7365(x); - } - - public static boolean deep7365(boolean x) { - return deep7366(x); - } - - public static boolean deep7366(boolean x) { - return deep7367(x); - } - - public static boolean deep7367(boolean x) { - return deep7368(x); - } - - public static boolean deep7368(boolean x) { - return deep7369(x); - } - - public static boolean deep7369(boolean x) { - return deep7370(x); - } - - public static boolean deep7370(boolean x) { - return deep7371(x); - } - - public static boolean deep7371(boolean x) { - return deep7372(x); - } - - public static boolean deep7372(boolean x) { - return deep7373(x); - } - - public static boolean deep7373(boolean x) { - return deep7374(x); - } - - public static boolean deep7374(boolean x) { - return deep7375(x); - } - - public static boolean deep7375(boolean x) { - return deep7376(x); - } - - public static boolean deep7376(boolean x) { - return deep7377(x); - } - - public static boolean deep7377(boolean x) { - return deep7378(x); - } - - public static boolean deep7378(boolean x) { - return deep7379(x); - } - - public static boolean deep7379(boolean x) { - return deep7380(x); - } - - public static boolean deep7380(boolean x) { - return deep7381(x); - } - - public static boolean deep7381(boolean x) { - return deep7382(x); - } - - public static boolean deep7382(boolean x) { - return deep7383(x); - } - - public static boolean deep7383(boolean x) { - return deep7384(x); - } - - public static boolean deep7384(boolean x) { - return deep7385(x); - } - - public static boolean deep7385(boolean x) { - return deep7386(x); - } - - public static boolean deep7386(boolean x) { - return deep7387(x); - } - - public static boolean deep7387(boolean x) { - return deep7388(x); - } - - public static boolean deep7388(boolean x) { - return deep7389(x); - } - - public static boolean deep7389(boolean x) { - return deep7390(x); - } - - public static boolean deep7390(boolean x) { - return deep7391(x); - } - - public static boolean deep7391(boolean x) { - return deep7392(x); - } - - public static boolean deep7392(boolean x) { - return deep7393(x); - } - - public static boolean deep7393(boolean x) { - return deep7394(x); - } - - public static boolean deep7394(boolean x) { - return deep7395(x); - } - - public static boolean deep7395(boolean x) { - return deep7396(x); - } - - public static boolean deep7396(boolean x) { - return deep7397(x); - } - - public static boolean deep7397(boolean x) { - return deep7398(x); - } - - public static boolean deep7398(boolean x) { - return deep7399(x); - } - - public static boolean deep7399(boolean x) { - return deep7400(x); - } - - public static boolean deep7400(boolean x) { - return deep7401(x); - } - - public static boolean deep7401(boolean x) { - return deep7402(x); - } - - public static boolean deep7402(boolean x) { - return deep7403(x); - } - - public static boolean deep7403(boolean x) { - return deep7404(x); - } - - public static boolean deep7404(boolean x) { - return deep7405(x); - } - - public static boolean deep7405(boolean x) { - return deep7406(x); - } - - public static boolean deep7406(boolean x) { - return deep7407(x); - } - - public static boolean deep7407(boolean x) { - return deep7408(x); - } - - public static boolean deep7408(boolean x) { - return deep7409(x); - } - - public static boolean deep7409(boolean x) { - return deep7410(x); - } - - public static boolean deep7410(boolean x) { - return deep7411(x); - } - - public static boolean deep7411(boolean x) { - return deep7412(x); - } - - public static boolean deep7412(boolean x) { - return deep7413(x); - } - - public static boolean deep7413(boolean x) { - return deep7414(x); - } - - public static boolean deep7414(boolean x) { - return deep7415(x); - } - - public static boolean deep7415(boolean x) { - return deep7416(x); - } - - public static boolean deep7416(boolean x) { - return deep7417(x); - } - - public static boolean deep7417(boolean x) { - return deep7418(x); - } - - public static boolean deep7418(boolean x) { - return deep7419(x); - } - - public static boolean deep7419(boolean x) { - return deep7420(x); - } - - public static boolean deep7420(boolean x) { - return deep7421(x); - } - - public static boolean deep7421(boolean x) { - return deep7422(x); - } - - public static boolean deep7422(boolean x) { - return deep7423(x); - } - - public static boolean deep7423(boolean x) { - return deep7424(x); - } - - public static boolean deep7424(boolean x) { - return deep7425(x); - } - - public static boolean deep7425(boolean x) { - return deep7426(x); - } - - public static boolean deep7426(boolean x) { - return deep7427(x); - } - - public static boolean deep7427(boolean x) { - return deep7428(x); - } - - public static boolean deep7428(boolean x) { - return deep7429(x); - } - - public static boolean deep7429(boolean x) { - return deep7430(x); - } - - public static boolean deep7430(boolean x) { - return deep7431(x); - } - - public static boolean deep7431(boolean x) { - return deep7432(x); - } - - public static boolean deep7432(boolean x) { - return deep7433(x); - } - - public static boolean deep7433(boolean x) { - return deep7434(x); - } - - public static boolean deep7434(boolean x) { - return deep7435(x); - } - - public static boolean deep7435(boolean x) { - return deep7436(x); - } - - public static boolean deep7436(boolean x) { - return deep7437(x); - } - - public static boolean deep7437(boolean x) { - return deep7438(x); - } - - public static boolean deep7438(boolean x) { - return deep7439(x); - } - - public static boolean deep7439(boolean x) { - return deep7440(x); - } - - public static boolean deep7440(boolean x) { - return deep7441(x); - } - - public static boolean deep7441(boolean x) { - return deep7442(x); - } - - public static boolean deep7442(boolean x) { - return deep7443(x); - } - - public static boolean deep7443(boolean x) { - return deep7444(x); - } - - public static boolean deep7444(boolean x) { - return deep7445(x); - } - - public static boolean deep7445(boolean x) { - return deep7446(x); - } - - public static boolean deep7446(boolean x) { - return deep7447(x); - } - - public static boolean deep7447(boolean x) { - return deep7448(x); - } - - public static boolean deep7448(boolean x) { - return deep7449(x); - } - - public static boolean deep7449(boolean x) { - return deep7450(x); - } - - public static boolean deep7450(boolean x) { - return deep7451(x); - } - - public static boolean deep7451(boolean x) { - return deep7452(x); - } - - public static boolean deep7452(boolean x) { - return deep7453(x); - } - - public static boolean deep7453(boolean x) { - return deep7454(x); - } - - public static boolean deep7454(boolean x) { - return deep7455(x); - } - - public static boolean deep7455(boolean x) { - return deep7456(x); - } - - public static boolean deep7456(boolean x) { - return deep7457(x); - } - - public static boolean deep7457(boolean x) { - return deep7458(x); - } - - public static boolean deep7458(boolean x) { - return deep7459(x); - } - - public static boolean deep7459(boolean x) { - return deep7460(x); - } - - public static boolean deep7460(boolean x) { - return deep7461(x); - } - - public static boolean deep7461(boolean x) { - return deep7462(x); - } - - public static boolean deep7462(boolean x) { - return deep7463(x); - } - - public static boolean deep7463(boolean x) { - return deep7464(x); - } - - public static boolean deep7464(boolean x) { - return deep7465(x); - } - - public static boolean deep7465(boolean x) { - return deep7466(x); - } - - public static boolean deep7466(boolean x) { - return deep7467(x); - } - - public static boolean deep7467(boolean x) { - return deep7468(x); - } - - public static boolean deep7468(boolean x) { - return deep7469(x); - } - - public static boolean deep7469(boolean x) { - return deep7470(x); - } - - public static boolean deep7470(boolean x) { - return deep7471(x); - } - - public static boolean deep7471(boolean x) { - return deep7472(x); - } - - public static boolean deep7472(boolean x) { - return deep7473(x); - } - - public static boolean deep7473(boolean x) { - return deep7474(x); - } - - public static boolean deep7474(boolean x) { - return deep7475(x); - } - - public static boolean deep7475(boolean x) { - return deep7476(x); - } - - public static boolean deep7476(boolean x) { - return deep7477(x); - } - - public static boolean deep7477(boolean x) { - return deep7478(x); - } - - public static boolean deep7478(boolean x) { - return deep7479(x); - } - - public static boolean deep7479(boolean x) { - return deep7480(x); - } - - public static boolean deep7480(boolean x) { - return deep7481(x); - } - - public static boolean deep7481(boolean x) { - return deep7482(x); - } - - public static boolean deep7482(boolean x) { - return deep7483(x); - } - - public static boolean deep7483(boolean x) { - return deep7484(x); - } - - public static boolean deep7484(boolean x) { - return deep7485(x); - } - - public static boolean deep7485(boolean x) { - return deep7486(x); - } - - public static boolean deep7486(boolean x) { - return deep7487(x); - } - - public static boolean deep7487(boolean x) { - return deep7488(x); - } - - public static boolean deep7488(boolean x) { - return deep7489(x); - } - - public static boolean deep7489(boolean x) { - return deep7490(x); - } - - public static boolean deep7490(boolean x) { - return deep7491(x); - } - - public static boolean deep7491(boolean x) { - return deep7492(x); - } - - public static boolean deep7492(boolean x) { - return deep7493(x); - } - - public static boolean deep7493(boolean x) { - return deep7494(x); - } - - public static boolean deep7494(boolean x) { - return deep7495(x); - } - - public static boolean deep7495(boolean x) { - return deep7496(x); - } - - public static boolean deep7496(boolean x) { - return deep7497(x); - } - - public static boolean deep7497(boolean x) { - return deep7498(x); - } - - public static boolean deep7498(boolean x) { - return deep7499(x); - } - - public static boolean deep7499(boolean x) { - return deep7500(x); - } - - public static boolean deep7500(boolean x) { - return deep7501(x); - } - - public static boolean deep7501(boolean x) { - return deep7502(x); - } - - public static boolean deep7502(boolean x) { - return deep7503(x); - } - - public static boolean deep7503(boolean x) { - return deep7504(x); - } - - public static boolean deep7504(boolean x) { - return deep7505(x); - } - - public static boolean deep7505(boolean x) { - return deep7506(x); - } - - public static boolean deep7506(boolean x) { - return deep7507(x); - } - - public static boolean deep7507(boolean x) { - return deep7508(x); - } - - public static boolean deep7508(boolean x) { - return deep7509(x); - } - - public static boolean deep7509(boolean x) { - return deep7510(x); - } - - public static boolean deep7510(boolean x) { - return deep7511(x); - } - - public static boolean deep7511(boolean x) { - return deep7512(x); - } - - public static boolean deep7512(boolean x) { - return deep7513(x); - } - - public static boolean deep7513(boolean x) { - return deep7514(x); - } - - public static boolean deep7514(boolean x) { - return deep7515(x); - } - - public static boolean deep7515(boolean x) { - return deep7516(x); - } - - public static boolean deep7516(boolean x) { - return deep7517(x); - } - - public static boolean deep7517(boolean x) { - return deep7518(x); - } - - public static boolean deep7518(boolean x) { - return deep7519(x); - } - - public static boolean deep7519(boolean x) { - return deep7520(x); - } - - public static boolean deep7520(boolean x) { - return deep7521(x); - } - - public static boolean deep7521(boolean x) { - return deep7522(x); - } - - public static boolean deep7522(boolean x) { - return deep7523(x); - } - - public static boolean deep7523(boolean x) { - return deep7524(x); - } - - public static boolean deep7524(boolean x) { - return deep7525(x); - } - - public static boolean deep7525(boolean x) { - return deep7526(x); - } - - public static boolean deep7526(boolean x) { - return deep7527(x); - } - - public static boolean deep7527(boolean x) { - return deep7528(x); - } - - public static boolean deep7528(boolean x) { - return deep7529(x); - } - - public static boolean deep7529(boolean x) { - return deep7530(x); - } - - public static boolean deep7530(boolean x) { - return deep7531(x); - } - - public static boolean deep7531(boolean x) { - return deep7532(x); - } - - public static boolean deep7532(boolean x) { - return deep7533(x); - } - - public static boolean deep7533(boolean x) { - return deep7534(x); - } - - public static boolean deep7534(boolean x) { - return deep7535(x); - } - - public static boolean deep7535(boolean x) { - return deep7536(x); - } - - public static boolean deep7536(boolean x) { - return deep7537(x); - } - - public static boolean deep7537(boolean x) { - return deep7538(x); - } - - public static boolean deep7538(boolean x) { - return deep7539(x); - } - - public static boolean deep7539(boolean x) { - return deep7540(x); - } - - public static boolean deep7540(boolean x) { - return deep7541(x); - } - - public static boolean deep7541(boolean x) { - return deep7542(x); - } - - public static boolean deep7542(boolean x) { - return deep7543(x); - } - - public static boolean deep7543(boolean x) { - return deep7544(x); - } - - public static boolean deep7544(boolean x) { - return deep7545(x); - } - - public static boolean deep7545(boolean x) { - return deep7546(x); - } - - public static boolean deep7546(boolean x) { - return deep7547(x); - } - - public static boolean deep7547(boolean x) { - return deep7548(x); - } - - public static boolean deep7548(boolean x) { - return deep7549(x); - } - - public static boolean deep7549(boolean x) { - return deep7550(x); - } - - public static boolean deep7550(boolean x) { - return deep7551(x); - } - - public static boolean deep7551(boolean x) { - return deep7552(x); - } - - public static boolean deep7552(boolean x) { - return deep7553(x); - } - - public static boolean deep7553(boolean x) { - return deep7554(x); - } - - public static boolean deep7554(boolean x) { - return deep7555(x); - } - - public static boolean deep7555(boolean x) { - return deep7556(x); - } - - public static boolean deep7556(boolean x) { - return deep7557(x); - } - - public static boolean deep7557(boolean x) { - return deep7558(x); - } - - public static boolean deep7558(boolean x) { - return deep7559(x); - } - - public static boolean deep7559(boolean x) { - return deep7560(x); - } - - public static boolean deep7560(boolean x) { - return deep7561(x); - } - - public static boolean deep7561(boolean x) { - return deep7562(x); - } - - public static boolean deep7562(boolean x) { - return deep7563(x); - } - - public static boolean deep7563(boolean x) { - return deep7564(x); - } - - public static boolean deep7564(boolean x) { - return deep7565(x); - } - - public static boolean deep7565(boolean x) { - return deep7566(x); - } - - public static boolean deep7566(boolean x) { - return deep7567(x); - } - - public static boolean deep7567(boolean x) { - return deep7568(x); - } - - public static boolean deep7568(boolean x) { - return deep7569(x); - } - - public static boolean deep7569(boolean x) { - return deep7570(x); - } - - public static boolean deep7570(boolean x) { - return deep7571(x); - } - - public static boolean deep7571(boolean x) { - return deep7572(x); - } - - public static boolean deep7572(boolean x) { - return deep7573(x); - } - - public static boolean deep7573(boolean x) { - return deep7574(x); - } - - public static boolean deep7574(boolean x) { - return deep7575(x); - } - - public static boolean deep7575(boolean x) { - return deep7576(x); - } - - public static boolean deep7576(boolean x) { - return deep7577(x); - } - - public static boolean deep7577(boolean x) { - return deep7578(x); - } - - public static boolean deep7578(boolean x) { - return deep7579(x); - } - - public static boolean deep7579(boolean x) { - return deep7580(x); - } - - public static boolean deep7580(boolean x) { - return deep7581(x); - } - - public static boolean deep7581(boolean x) { - return deep7582(x); - } - - public static boolean deep7582(boolean x) { - return deep7583(x); - } - - public static boolean deep7583(boolean x) { - return deep7584(x); - } - - public static boolean deep7584(boolean x) { - return deep7585(x); - } - - public static boolean deep7585(boolean x) { - return deep7586(x); - } - - public static boolean deep7586(boolean x) { - return deep7587(x); - } - - public static boolean deep7587(boolean x) { - return deep7588(x); - } - - public static boolean deep7588(boolean x) { - return deep7589(x); - } - - public static boolean deep7589(boolean x) { - return deep7590(x); - } - - public static boolean deep7590(boolean x) { - return deep7591(x); - } - - public static boolean deep7591(boolean x) { - return deep7592(x); - } - - public static boolean deep7592(boolean x) { - return deep7593(x); - } - - public static boolean deep7593(boolean x) { - return deep7594(x); - } - - public static boolean deep7594(boolean x) { - return deep7595(x); - } - - public static boolean deep7595(boolean x) { - return deep7596(x); - } - - public static boolean deep7596(boolean x) { - return deep7597(x); - } - - public static boolean deep7597(boolean x) { - return deep7598(x); - } - - public static boolean deep7598(boolean x) { - return deep7599(x); - } - - public static boolean deep7599(boolean x) { - return deep7600(x); - } - - public static boolean deep7600(boolean x) { - return deep7601(x); - } - - public static boolean deep7601(boolean x) { - return deep7602(x); - } - - public static boolean deep7602(boolean x) { - return deep7603(x); - } - - public static boolean deep7603(boolean x) { - return deep7604(x); - } - - public static boolean deep7604(boolean x) { - return deep7605(x); - } - - public static boolean deep7605(boolean x) { - return deep7606(x); - } - - public static boolean deep7606(boolean x) { - return deep7607(x); - } - - public static boolean deep7607(boolean x) { - return deep7608(x); - } - - public static boolean deep7608(boolean x) { - return deep7609(x); - } - - public static boolean deep7609(boolean x) { - return deep7610(x); - } - - public static boolean deep7610(boolean x) { - return deep7611(x); - } - - public static boolean deep7611(boolean x) { - return deep7612(x); - } - - public static boolean deep7612(boolean x) { - return deep7613(x); - } - - public static boolean deep7613(boolean x) { - return deep7614(x); - } - - public static boolean deep7614(boolean x) { - return deep7615(x); - } - - public static boolean deep7615(boolean x) { - return deep7616(x); - } - - public static boolean deep7616(boolean x) { - return deep7617(x); - } - - public static boolean deep7617(boolean x) { - return deep7618(x); - } - - public static boolean deep7618(boolean x) { - return deep7619(x); - } - - public static boolean deep7619(boolean x) { - return deep7620(x); - } - - public static boolean deep7620(boolean x) { - return deep7621(x); - } - - public static boolean deep7621(boolean x) { - return deep7622(x); - } - - public static boolean deep7622(boolean x) { - return deep7623(x); - } - - public static boolean deep7623(boolean x) { - return deep7624(x); - } - - public static boolean deep7624(boolean x) { - return deep7625(x); - } - - public static boolean deep7625(boolean x) { - return deep7626(x); - } - - public static boolean deep7626(boolean x) { - return deep7627(x); - } - - public static boolean deep7627(boolean x) { - return deep7628(x); - } - - public static boolean deep7628(boolean x) { - return deep7629(x); - } - - public static boolean deep7629(boolean x) { - return deep7630(x); - } - - public static boolean deep7630(boolean x) { - return deep7631(x); - } - - public static boolean deep7631(boolean x) { - return deep7632(x); - } - - public static boolean deep7632(boolean x) { - return deep7633(x); - } - - public static boolean deep7633(boolean x) { - return deep7634(x); - } - - public static boolean deep7634(boolean x) { - return deep7635(x); - } - - public static boolean deep7635(boolean x) { - return deep7636(x); - } - - public static boolean deep7636(boolean x) { - return deep7637(x); - } - - public static boolean deep7637(boolean x) { - return deep7638(x); - } - - public static boolean deep7638(boolean x) { - return deep7639(x); - } - - public static boolean deep7639(boolean x) { - return deep7640(x); - } - - public static boolean deep7640(boolean x) { - return deep7641(x); - } - - public static boolean deep7641(boolean x) { - return deep7642(x); - } - - public static boolean deep7642(boolean x) { - return deep7643(x); - } - - public static boolean deep7643(boolean x) { - return deep7644(x); - } - - public static boolean deep7644(boolean x) { - return deep7645(x); - } - - public static boolean deep7645(boolean x) { - return deep7646(x); - } - - public static boolean deep7646(boolean x) { - return deep7647(x); - } - - public static boolean deep7647(boolean x) { - return deep7648(x); - } - - public static boolean deep7648(boolean x) { - return deep7649(x); - } - - public static boolean deep7649(boolean x) { - return deep7650(x); - } - - public static boolean deep7650(boolean x) { - return deep7651(x); - } - - public static boolean deep7651(boolean x) { - return deep7652(x); - } - - public static boolean deep7652(boolean x) { - return deep7653(x); - } - - public static boolean deep7653(boolean x) { - return deep7654(x); - } - - public static boolean deep7654(boolean x) { - return deep7655(x); - } - - public static boolean deep7655(boolean x) { - return deep7656(x); - } - - public static boolean deep7656(boolean x) { - return deep7657(x); - } - - public static boolean deep7657(boolean x) { - return deep7658(x); - } - - public static boolean deep7658(boolean x) { - return deep7659(x); - } - - public static boolean deep7659(boolean x) { - return deep7660(x); - } - - public static boolean deep7660(boolean x) { - return deep7661(x); - } - - public static boolean deep7661(boolean x) { - return deep7662(x); - } - - public static boolean deep7662(boolean x) { - return deep7663(x); - } - - public static boolean deep7663(boolean x) { - return deep7664(x); - } - - public static boolean deep7664(boolean x) { - return deep7665(x); - } - - public static boolean deep7665(boolean x) { - return deep7666(x); - } - - public static boolean deep7666(boolean x) { - return deep7667(x); - } - - public static boolean deep7667(boolean x) { - return deep7668(x); - } - - public static boolean deep7668(boolean x) { - return deep7669(x); - } - - public static boolean deep7669(boolean x) { - return deep7670(x); - } - - public static boolean deep7670(boolean x) { - return deep7671(x); - } - - public static boolean deep7671(boolean x) { - return deep7672(x); - } - - public static boolean deep7672(boolean x) { - return deep7673(x); - } - - public static boolean deep7673(boolean x) { - return deep7674(x); - } - - public static boolean deep7674(boolean x) { - return deep7675(x); - } - - public static boolean deep7675(boolean x) { - return deep7676(x); - } - - public static boolean deep7676(boolean x) { - return deep7677(x); - } - - public static boolean deep7677(boolean x) { - return deep7678(x); - } - - public static boolean deep7678(boolean x) { - return deep7679(x); - } - - public static boolean deep7679(boolean x) { - return deep7680(x); - } - - public static boolean deep7680(boolean x) { - return deep7681(x); - } - - public static boolean deep7681(boolean x) { - return deep7682(x); - } - - public static boolean deep7682(boolean x) { - return deep7683(x); - } - - public static boolean deep7683(boolean x) { - return deep7684(x); - } - - public static boolean deep7684(boolean x) { - return deep7685(x); - } - - public static boolean deep7685(boolean x) { - return deep7686(x); - } - - public static boolean deep7686(boolean x) { - return deep7687(x); - } - - public static boolean deep7687(boolean x) { - return deep7688(x); - } - - public static boolean deep7688(boolean x) { - return deep7689(x); - } - - public static boolean deep7689(boolean x) { - return deep7690(x); - } - - public static boolean deep7690(boolean x) { - return deep7691(x); - } - - public static boolean deep7691(boolean x) { - return deep7692(x); - } - - public static boolean deep7692(boolean x) { - return deep7693(x); - } - - public static boolean deep7693(boolean x) { - return deep7694(x); - } - - public static boolean deep7694(boolean x) { - return deep7695(x); - } - - public static boolean deep7695(boolean x) { - return deep7696(x); - } - - public static boolean deep7696(boolean x) { - return deep7697(x); - } - - public static boolean deep7697(boolean x) { - return deep7698(x); - } - - public static boolean deep7698(boolean x) { - return deep7699(x); - } - - public static boolean deep7699(boolean x) { - return deep7700(x); - } - - public static boolean deep7700(boolean x) { - return deep7701(x); - } - - public static boolean deep7701(boolean x) { - return deep7702(x); - } - - public static boolean deep7702(boolean x) { - return deep7703(x); - } - - public static boolean deep7703(boolean x) { - return deep7704(x); - } - - public static boolean deep7704(boolean x) { - return deep7705(x); - } - - public static boolean deep7705(boolean x) { - return deep7706(x); - } - - public static boolean deep7706(boolean x) { - return deep7707(x); - } - - public static boolean deep7707(boolean x) { - return deep7708(x); - } - - public static boolean deep7708(boolean x) { - return deep7709(x); - } - - public static boolean deep7709(boolean x) { - return deep7710(x); - } - - public static boolean deep7710(boolean x) { - return deep7711(x); - } - - public static boolean deep7711(boolean x) { - return deep7712(x); - } - - public static boolean deep7712(boolean x) { - return deep7713(x); - } - - public static boolean deep7713(boolean x) { - return deep7714(x); - } - - public static boolean deep7714(boolean x) { - return deep7715(x); - } - - public static boolean deep7715(boolean x) { - return deep7716(x); - } - - public static boolean deep7716(boolean x) { - return deep7717(x); - } - - public static boolean deep7717(boolean x) { - return deep7718(x); - } - - public static boolean deep7718(boolean x) { - return deep7719(x); - } - - public static boolean deep7719(boolean x) { - return deep7720(x); - } - - public static boolean deep7720(boolean x) { - return deep7721(x); - } - - public static boolean deep7721(boolean x) { - return deep7722(x); - } - - public static boolean deep7722(boolean x) { - return deep7723(x); - } - - public static boolean deep7723(boolean x) { - return deep7724(x); - } - - public static boolean deep7724(boolean x) { - return deep7725(x); - } - - public static boolean deep7725(boolean x) { - return deep7726(x); - } - - public static boolean deep7726(boolean x) { - return deep7727(x); - } - - public static boolean deep7727(boolean x) { - return deep7728(x); - } - - public static boolean deep7728(boolean x) { - return deep7729(x); - } - - public static boolean deep7729(boolean x) { - return deep7730(x); - } - - public static boolean deep7730(boolean x) { - return deep7731(x); - } - - public static boolean deep7731(boolean x) { - return deep7732(x); - } - - public static boolean deep7732(boolean x) { - return deep7733(x); - } - - public static boolean deep7733(boolean x) { - return deep7734(x); - } - - public static boolean deep7734(boolean x) { - return deep7735(x); - } - - public static boolean deep7735(boolean x) { - return deep7736(x); - } - - public static boolean deep7736(boolean x) { - return deep7737(x); - } - - public static boolean deep7737(boolean x) { - return deep7738(x); - } - - public static boolean deep7738(boolean x) { - return deep7739(x); - } - - public static boolean deep7739(boolean x) { - return deep7740(x); - } - - public static boolean deep7740(boolean x) { - return deep7741(x); - } - - public static boolean deep7741(boolean x) { - return deep7742(x); - } - - public static boolean deep7742(boolean x) { - return deep7743(x); - } - - public static boolean deep7743(boolean x) { - return deep7744(x); - } - - public static boolean deep7744(boolean x) { - return deep7745(x); - } - - public static boolean deep7745(boolean x) { - return deep7746(x); - } - - public static boolean deep7746(boolean x) { - return deep7747(x); - } - - public static boolean deep7747(boolean x) { - return deep7748(x); - } - - public static boolean deep7748(boolean x) { - return deep7749(x); - } - - public static boolean deep7749(boolean x) { - return deep7750(x); - } - - public static boolean deep7750(boolean x) { - return deep7751(x); - } - - public static boolean deep7751(boolean x) { - return deep7752(x); - } - - public static boolean deep7752(boolean x) { - return deep7753(x); - } - - public static boolean deep7753(boolean x) { - return deep7754(x); - } - - public static boolean deep7754(boolean x) { - return deep7755(x); - } - - public static boolean deep7755(boolean x) { - return deep7756(x); - } - - public static boolean deep7756(boolean x) { - return deep7757(x); - } - - public static boolean deep7757(boolean x) { - return deep7758(x); - } - - public static boolean deep7758(boolean x) { - return deep7759(x); - } - - public static boolean deep7759(boolean x) { - return deep7760(x); - } - - public static boolean deep7760(boolean x) { - return deep7761(x); - } - - public static boolean deep7761(boolean x) { - return deep7762(x); - } - - public static boolean deep7762(boolean x) { - return deep7763(x); - } - - public static boolean deep7763(boolean x) { - return deep7764(x); - } - - public static boolean deep7764(boolean x) { - return deep7765(x); - } - - public static boolean deep7765(boolean x) { - return deep7766(x); - } - - public static boolean deep7766(boolean x) { - return deep7767(x); - } - - public static boolean deep7767(boolean x) { - return deep7768(x); - } - - public static boolean deep7768(boolean x) { - return deep7769(x); - } - - public static boolean deep7769(boolean x) { - return deep7770(x); - } - - public static boolean deep7770(boolean x) { - return deep7771(x); - } - - public static boolean deep7771(boolean x) { - return deep7772(x); - } - - public static boolean deep7772(boolean x) { - return deep7773(x); - } - - public static boolean deep7773(boolean x) { - return deep7774(x); - } - - public static boolean deep7774(boolean x) { - return deep7775(x); - } - - public static boolean deep7775(boolean x) { - return deep7776(x); - } - - public static boolean deep7776(boolean x) { - return deep7777(x); - } - - public static boolean deep7777(boolean x) { - return deep7778(x); - } - - public static boolean deep7778(boolean x) { - return deep7779(x); - } - - public static boolean deep7779(boolean x) { - return deep7780(x); - } - - public static boolean deep7780(boolean x) { - return deep7781(x); - } - - public static boolean deep7781(boolean x) { - return deep7782(x); - } - - public static boolean deep7782(boolean x) { - return deep7783(x); - } - - public static boolean deep7783(boolean x) { - return deep7784(x); - } - - public static boolean deep7784(boolean x) { - return deep7785(x); - } - - public static boolean deep7785(boolean x) { - return deep7786(x); - } - - public static boolean deep7786(boolean x) { - return deep7787(x); - } - - public static boolean deep7787(boolean x) { - return deep7788(x); - } - - public static boolean deep7788(boolean x) { - return deep7789(x); - } - - public static boolean deep7789(boolean x) { - return deep7790(x); - } - - public static boolean deep7790(boolean x) { - return deep7791(x); - } - - public static boolean deep7791(boolean x) { - return deep7792(x); - } - - public static boolean deep7792(boolean x) { - return deep7793(x); - } - - public static boolean deep7793(boolean x) { - return deep7794(x); - } - - public static boolean deep7794(boolean x) { - return deep7795(x); - } - - public static boolean deep7795(boolean x) { - return deep7796(x); - } - - public static boolean deep7796(boolean x) { - return deep7797(x); - } - - public static boolean deep7797(boolean x) { - return deep7798(x); - } - - public static boolean deep7798(boolean x) { - return deep7799(x); - } - - public static boolean deep7799(boolean x) { - return deep7800(x); - } - - public static boolean deep7800(boolean x) { - return deep7801(x); - } - - public static boolean deep7801(boolean x) { - return deep7802(x); - } - - public static boolean deep7802(boolean x) { - return deep7803(x); - } - - public static boolean deep7803(boolean x) { - return deep7804(x); - } - - public static boolean deep7804(boolean x) { - return deep7805(x); - } - - public static boolean deep7805(boolean x) { - return deep7806(x); - } - - public static boolean deep7806(boolean x) { - return deep7807(x); - } - - public static boolean deep7807(boolean x) { - return deep7808(x); - } - - public static boolean deep7808(boolean x) { - return deep7809(x); - } - - public static boolean deep7809(boolean x) { - return deep7810(x); - } - - public static boolean deep7810(boolean x) { - return deep7811(x); - } - - public static boolean deep7811(boolean x) { - return deep7812(x); - } - - public static boolean deep7812(boolean x) { - return deep7813(x); - } - - public static boolean deep7813(boolean x) { - return deep7814(x); - } - - public static boolean deep7814(boolean x) { - return deep7815(x); - } - - public static boolean deep7815(boolean x) { - return deep7816(x); - } - - public static boolean deep7816(boolean x) { - return deep7817(x); - } - - public static boolean deep7817(boolean x) { - return deep7818(x); - } - - public static boolean deep7818(boolean x) { - return deep7819(x); - } - - public static boolean deep7819(boolean x) { - return deep7820(x); - } - - public static boolean deep7820(boolean x) { - return deep7821(x); - } - - public static boolean deep7821(boolean x) { - return deep7822(x); - } - - public static boolean deep7822(boolean x) { - return deep7823(x); - } - - public static boolean deep7823(boolean x) { - return deep7824(x); - } - - public static boolean deep7824(boolean x) { - return deep7825(x); - } - - public static boolean deep7825(boolean x) { - return deep7826(x); - } - - public static boolean deep7826(boolean x) { - return deep7827(x); - } - - public static boolean deep7827(boolean x) { - return deep7828(x); - } - - public static boolean deep7828(boolean x) { - return deep7829(x); - } - - public static boolean deep7829(boolean x) { - return deep7830(x); - } - - public static boolean deep7830(boolean x) { - return deep7831(x); - } - - public static boolean deep7831(boolean x) { - return deep7832(x); - } - - public static boolean deep7832(boolean x) { - return deep7833(x); - } - - public static boolean deep7833(boolean x) { - return deep7834(x); - } - - public static boolean deep7834(boolean x) { - return deep7835(x); - } - - public static boolean deep7835(boolean x) { - return deep7836(x); - } - - public static boolean deep7836(boolean x) { - return deep7837(x); - } - - public static boolean deep7837(boolean x) { - return deep7838(x); - } - - public static boolean deep7838(boolean x) { - return deep7839(x); - } - - public static boolean deep7839(boolean x) { - return deep7840(x); - } - - public static boolean deep7840(boolean x) { - return deep7841(x); - } - - public static boolean deep7841(boolean x) { - return deep7842(x); - } - - public static boolean deep7842(boolean x) { - return deep7843(x); - } - - public static boolean deep7843(boolean x) { - return deep7844(x); - } - - public static boolean deep7844(boolean x) { - return deep7845(x); - } - - public static boolean deep7845(boolean x) { - return deep7846(x); - } - - public static boolean deep7846(boolean x) { - return deep7847(x); - } - - public static boolean deep7847(boolean x) { - return deep7848(x); - } - - public static boolean deep7848(boolean x) { - return deep7849(x); - } - - public static boolean deep7849(boolean x) { - return deep7850(x); - } - - public static boolean deep7850(boolean x) { - return deep7851(x); - } - - public static boolean deep7851(boolean x) { - return deep7852(x); - } - - public static boolean deep7852(boolean x) { - return deep7853(x); - } - - public static boolean deep7853(boolean x) { - return deep7854(x); - } - - public static boolean deep7854(boolean x) { - return deep7855(x); - } - - public static boolean deep7855(boolean x) { - return deep7856(x); - } - - public static boolean deep7856(boolean x) { - return deep7857(x); - } - - public static boolean deep7857(boolean x) { - return deep7858(x); - } - - public static boolean deep7858(boolean x) { - return deep7859(x); - } - - public static boolean deep7859(boolean x) { - return deep7860(x); - } - - public static boolean deep7860(boolean x) { - return deep7861(x); - } - - public static boolean deep7861(boolean x) { - return deep7862(x); - } - - public static boolean deep7862(boolean x) { - return deep7863(x); - } - - public static boolean deep7863(boolean x) { - return deep7864(x); - } - - public static boolean deep7864(boolean x) { - return deep7865(x); - } - - public static boolean deep7865(boolean x) { - return deep7866(x); - } - - public static boolean deep7866(boolean x) { - return deep7867(x); - } - - public static boolean deep7867(boolean x) { - return deep7868(x); - } - - public static boolean deep7868(boolean x) { - return deep7869(x); - } - - public static boolean deep7869(boolean x) { - return deep7870(x); - } - - public static boolean deep7870(boolean x) { - return deep7871(x); - } - - public static boolean deep7871(boolean x) { - return deep7872(x); - } - - public static boolean deep7872(boolean x) { - return deep7873(x); - } - - public static boolean deep7873(boolean x) { - return deep7874(x); - } - - public static boolean deep7874(boolean x) { - return deep7875(x); - } - - public static boolean deep7875(boolean x) { - return deep7876(x); - } - - public static boolean deep7876(boolean x) { - return deep7877(x); - } - - public static boolean deep7877(boolean x) { - return deep7878(x); - } - - public static boolean deep7878(boolean x) { - return deep7879(x); - } - - public static boolean deep7879(boolean x) { - return deep7880(x); - } - - public static boolean deep7880(boolean x) { - return deep7881(x); - } - - public static boolean deep7881(boolean x) { - return deep7882(x); - } - - public static boolean deep7882(boolean x) { - return deep7883(x); - } - - public static boolean deep7883(boolean x) { - return deep7884(x); - } - - public static boolean deep7884(boolean x) { - return deep7885(x); - } - - public static boolean deep7885(boolean x) { - return deep7886(x); - } - - public static boolean deep7886(boolean x) { - return deep7887(x); - } - - public static boolean deep7887(boolean x) { - return deep7888(x); - } - - public static boolean deep7888(boolean x) { - return deep7889(x); - } - - public static boolean deep7889(boolean x) { - return deep7890(x); - } - - public static boolean deep7890(boolean x) { - return deep7891(x); - } - - public static boolean deep7891(boolean x) { - return deep7892(x); - } - - public static boolean deep7892(boolean x) { - return deep7893(x); - } - - public static boolean deep7893(boolean x) { - return deep7894(x); - } - - public static boolean deep7894(boolean x) { - return deep7895(x); - } - - public static boolean deep7895(boolean x) { - return deep7896(x); - } - - public static boolean deep7896(boolean x) { - return deep7897(x); - } - - public static boolean deep7897(boolean x) { - return deep7898(x); - } - - public static boolean deep7898(boolean x) { - return deep7899(x); - } - - public static boolean deep7899(boolean x) { - return deep7900(x); - } - - public static boolean deep7900(boolean x) { - return deep7901(x); - } - - public static boolean deep7901(boolean x) { - return deep7902(x); - } - - public static boolean deep7902(boolean x) { - return deep7903(x); - } - - public static boolean deep7903(boolean x) { - return deep7904(x); - } - - public static boolean deep7904(boolean x) { - return deep7905(x); - } - - public static boolean deep7905(boolean x) { - return deep7906(x); - } - - public static boolean deep7906(boolean x) { - return deep7907(x); - } - - public static boolean deep7907(boolean x) { - return deep7908(x); - } - - public static boolean deep7908(boolean x) { - return deep7909(x); - } - - public static boolean deep7909(boolean x) { - return deep7910(x); - } - - public static boolean deep7910(boolean x) { - return deep7911(x); - } - - public static boolean deep7911(boolean x) { - return deep7912(x); - } - - public static boolean deep7912(boolean x) { - return deep7913(x); - } - - public static boolean deep7913(boolean x) { - return deep7914(x); - } - - public static boolean deep7914(boolean x) { - return deep7915(x); - } - - public static boolean deep7915(boolean x) { - return deep7916(x); - } - - public static boolean deep7916(boolean x) { - return deep7917(x); - } - - public static boolean deep7917(boolean x) { - return deep7918(x); - } - - public static boolean deep7918(boolean x) { - return deep7919(x); - } - - public static boolean deep7919(boolean x) { - return deep7920(x); - } - - public static boolean deep7920(boolean x) { - return deep7921(x); - } - - public static boolean deep7921(boolean x) { - return deep7922(x); - } - - public static boolean deep7922(boolean x) { - return deep7923(x); - } - - public static boolean deep7923(boolean x) { - return deep7924(x); - } - - public static boolean deep7924(boolean x) { - return deep7925(x); - } - - public static boolean deep7925(boolean x) { - return deep7926(x); - } - - public static boolean deep7926(boolean x) { - return deep7927(x); - } - - public static boolean deep7927(boolean x) { - return deep7928(x); - } - - public static boolean deep7928(boolean x) { - return deep7929(x); - } - - public static boolean deep7929(boolean x) { - return deep7930(x); - } - - public static boolean deep7930(boolean x) { - return deep7931(x); - } - - public static boolean deep7931(boolean x) { - return deep7932(x); - } - - public static boolean deep7932(boolean x) { - return deep7933(x); - } - - public static boolean deep7933(boolean x) { - return deep7934(x); - } - - public static boolean deep7934(boolean x) { - return deep7935(x); - } - - public static boolean deep7935(boolean x) { - return deep7936(x); - } - - public static boolean deep7936(boolean x) { - return deep7937(x); - } - - public static boolean deep7937(boolean x) { - return deep7938(x); - } - - public static boolean deep7938(boolean x) { - return deep7939(x); - } - - public static boolean deep7939(boolean x) { - return deep7940(x); - } - - public static boolean deep7940(boolean x) { - return deep7941(x); - } - - public static boolean deep7941(boolean x) { - return deep7942(x); - } - - public static boolean deep7942(boolean x) { - return deep7943(x); - } - - public static boolean deep7943(boolean x) { - return deep7944(x); - } - - public static boolean deep7944(boolean x) { - return deep7945(x); - } - - public static boolean deep7945(boolean x) { - return deep7946(x); - } - - public static boolean deep7946(boolean x) { - return deep7947(x); - } - - public static boolean deep7947(boolean x) { - return deep7948(x); - } - - public static boolean deep7948(boolean x) { - return deep7949(x); - } - - public static boolean deep7949(boolean x) { - return deep7950(x); - } - - public static boolean deep7950(boolean x) { - return deep7951(x); - } - - public static boolean deep7951(boolean x) { - return deep7952(x); - } - - public static boolean deep7952(boolean x) { - return deep7953(x); - } - - public static boolean deep7953(boolean x) { - return deep7954(x); - } - - public static boolean deep7954(boolean x) { - return deep7955(x); - } - - public static boolean deep7955(boolean x) { - return deep7956(x); - } - - public static boolean deep7956(boolean x) { - return deep7957(x); - } - - public static boolean deep7957(boolean x) { - return deep7958(x); - } - - public static boolean deep7958(boolean x) { - return deep7959(x); - } - - public static boolean deep7959(boolean x) { - return deep7960(x); - } - - public static boolean deep7960(boolean x) { - return deep7961(x); - } - - public static boolean deep7961(boolean x) { - return deep7962(x); - } - - public static boolean deep7962(boolean x) { - return deep7963(x); - } - - public static boolean deep7963(boolean x) { - return deep7964(x); - } - - public static boolean deep7964(boolean x) { - return deep7965(x); - } - - public static boolean deep7965(boolean x) { - return deep7966(x); - } - - public static boolean deep7966(boolean x) { - return deep7967(x); - } - - public static boolean deep7967(boolean x) { - return deep7968(x); - } - - public static boolean deep7968(boolean x) { - return deep7969(x); - } - - public static boolean deep7969(boolean x) { - return deep7970(x); - } - - public static boolean deep7970(boolean x) { - return deep7971(x); - } - - public static boolean deep7971(boolean x) { - return deep7972(x); - } - - public static boolean deep7972(boolean x) { - return deep7973(x); - } - - public static boolean deep7973(boolean x) { - return deep7974(x); - } - - public static boolean deep7974(boolean x) { - return deep7975(x); - } - - public static boolean deep7975(boolean x) { - return deep7976(x); - } - - public static boolean deep7976(boolean x) { - return deep7977(x); - } - - public static boolean deep7977(boolean x) { - return deep7978(x); - } - - public static boolean deep7978(boolean x) { - return deep7979(x); - } - - public static boolean deep7979(boolean x) { - return deep7980(x); - } - - public static boolean deep7980(boolean x) { - return deep7981(x); - } - - public static boolean deep7981(boolean x) { - return deep7982(x); - } - - public static boolean deep7982(boolean x) { - return deep7983(x); - } - - public static boolean deep7983(boolean x) { - return deep7984(x); - } - - public static boolean deep7984(boolean x) { - return deep7985(x); - } - - public static boolean deep7985(boolean x) { - return deep7986(x); - } - - public static boolean deep7986(boolean x) { - return deep7987(x); - } - - public static boolean deep7987(boolean x) { - return deep7988(x); - } - - public static boolean deep7988(boolean x) { - return deep7989(x); - } - - public static boolean deep7989(boolean x) { - return deep7990(x); - } - - public static boolean deep7990(boolean x) { - return deep7991(x); - } - - public static boolean deep7991(boolean x) { - return deep7992(x); - } - - public static boolean deep7992(boolean x) { - return deep7993(x); - } - - public static boolean deep7993(boolean x) { - return deep7994(x); - } - - public static boolean deep7994(boolean x) { - return deep7995(x); - } - - public static boolean deep7995(boolean x) { - return deep7996(x); - } - - public static boolean deep7996(boolean x) { - return deep7997(x); - } - - public static boolean deep7997(boolean x) { - return deep7998(x); - } - - public static boolean deep7998(boolean x) { - return deep7999(x); - } - - public static boolean deep7999(boolean x) { - return deep8000(x); - } - - public static boolean deep8000(boolean x) { - return deep8001(x); - } - - public static boolean deep8001(boolean x) { - return deep8002(x); - } - - public static boolean deep8002(boolean x) { - return deep8003(x); - } - - public static boolean deep8003(boolean x) { - return deep8004(x); - } - - public static boolean deep8004(boolean x) { - return deep8005(x); - } - - public static boolean deep8005(boolean x) { - return deep8006(x); - } - - public static boolean deep8006(boolean x) { - return deep8007(x); - } - - public static boolean deep8007(boolean x) { - return deep8008(x); - } - - public static boolean deep8008(boolean x) { - return deep8009(x); - } - - public static boolean deep8009(boolean x) { - return deep8010(x); - } - - public static boolean deep8010(boolean x) { - return deep8011(x); - } - - public static boolean deep8011(boolean x) { - return deep8012(x); - } - - public static boolean deep8012(boolean x) { - return deep8013(x); - } - - public static boolean deep8013(boolean x) { - return deep8014(x); - } - - public static boolean deep8014(boolean x) { - return deep8015(x); - } - - public static boolean deep8015(boolean x) { - return deep8016(x); - } - - public static boolean deep8016(boolean x) { - return deep8017(x); - } - - public static boolean deep8017(boolean x) { - return deep8018(x); - } - - public static boolean deep8018(boolean x) { - return deep8019(x); - } - - public static boolean deep8019(boolean x) { - return deep8020(x); - } - - public static boolean deep8020(boolean x) { - return deep8021(x); - } - - public static boolean deep8021(boolean x) { - return deep8022(x); - } - - public static boolean deep8022(boolean x) { - return deep8023(x); - } - - public static boolean deep8023(boolean x) { - return deep8024(x); - } - - public static boolean deep8024(boolean x) { - return deep8025(x); - } - - public static boolean deep8025(boolean x) { - return deep8026(x); - } - - public static boolean deep8026(boolean x) { - return deep8027(x); - } - - public static boolean deep8027(boolean x) { - return deep8028(x); - } - - public static boolean deep8028(boolean x) { - return deep8029(x); - } - - public static boolean deep8029(boolean x) { - return deep8030(x); - } - - public static boolean deep8030(boolean x) { - return deep8031(x); - } - - public static boolean deep8031(boolean x) { - return deep8032(x); - } - - public static boolean deep8032(boolean x) { - return deep8033(x); - } - - public static boolean deep8033(boolean x) { - return deep8034(x); - } - - public static boolean deep8034(boolean x) { - return deep8035(x); - } - - public static boolean deep8035(boolean x) { - return deep8036(x); - } - - public static boolean deep8036(boolean x) { - return deep8037(x); - } - - public static boolean deep8037(boolean x) { - return deep8038(x); - } - - public static boolean deep8038(boolean x) { - return deep8039(x); - } - - public static boolean deep8039(boolean x) { - return deep8040(x); - } - - public static boolean deep8040(boolean x) { - return deep8041(x); - } - - public static boolean deep8041(boolean x) { - return deep8042(x); - } - - public static boolean deep8042(boolean x) { - return deep8043(x); - } - - public static boolean deep8043(boolean x) { - return deep8044(x); - } - - public static boolean deep8044(boolean x) { - return deep8045(x); - } - - public static boolean deep8045(boolean x) { - return deep8046(x); - } - - public static boolean deep8046(boolean x) { - return deep8047(x); - } - - public static boolean deep8047(boolean x) { - return deep8048(x); - } - - public static boolean deep8048(boolean x) { - return deep8049(x); - } - - public static boolean deep8049(boolean x) { - return deep8050(x); - } - - public static boolean deep8050(boolean x) { - return deep8051(x); - } - - public static boolean deep8051(boolean x) { - return deep8052(x); - } - - public static boolean deep8052(boolean x) { - return deep8053(x); - } - - public static boolean deep8053(boolean x) { - return deep8054(x); - } - - public static boolean deep8054(boolean x) { - return deep8055(x); - } - - public static boolean deep8055(boolean x) { - return deep8056(x); - } - - public static boolean deep8056(boolean x) { - return deep8057(x); - } - - public static boolean deep8057(boolean x) { - return deep8058(x); - } - - public static boolean deep8058(boolean x) { - return deep8059(x); - } - - public static boolean deep8059(boolean x) { - return deep8060(x); - } - - public static boolean deep8060(boolean x) { - return deep8061(x); - } - - public static boolean deep8061(boolean x) { - return deep8062(x); - } - - public static boolean deep8062(boolean x) { - return deep8063(x); - } - - public static boolean deep8063(boolean x) { - return deep8064(x); - } - - public static boolean deep8064(boolean x) { - return deep8065(x); - } - - public static boolean deep8065(boolean x) { - return deep8066(x); - } - - public static boolean deep8066(boolean x) { - return deep8067(x); - } - - public static boolean deep8067(boolean x) { - return deep8068(x); - } - - public static boolean deep8068(boolean x) { - return deep8069(x); - } - - public static boolean deep8069(boolean x) { - return deep8070(x); - } - - public static boolean deep8070(boolean x) { - return deep8071(x); - } - - public static boolean deep8071(boolean x) { - return deep8072(x); - } - - public static boolean deep8072(boolean x) { - return deep8073(x); - } - - public static boolean deep8073(boolean x) { - return deep8074(x); - } - - public static boolean deep8074(boolean x) { - return deep8075(x); - } - - public static boolean deep8075(boolean x) { - return deep8076(x); - } - - public static boolean deep8076(boolean x) { - return deep8077(x); - } - - public static boolean deep8077(boolean x) { - return deep8078(x); - } - - public static boolean deep8078(boolean x) { - return deep8079(x); - } - - public static boolean deep8079(boolean x) { - return deep8080(x); - } - - public static boolean deep8080(boolean x) { - return deep8081(x); - } - - public static boolean deep8081(boolean x) { - return deep8082(x); - } - - public static boolean deep8082(boolean x) { - return deep8083(x); - } - - public static boolean deep8083(boolean x) { - return deep8084(x); - } - - public static boolean deep8084(boolean x) { - return deep8085(x); - } - - public static boolean deep8085(boolean x) { - return deep8086(x); - } - - public static boolean deep8086(boolean x) { - return deep8087(x); - } - - public static boolean deep8087(boolean x) { - return deep8088(x); - } - - public static boolean deep8088(boolean x) { - return deep8089(x); - } - - public static boolean deep8089(boolean x) { - return deep8090(x); - } - - public static boolean deep8090(boolean x) { - return deep8091(x); - } - - public static boolean deep8091(boolean x) { - return deep8092(x); - } - - public static boolean deep8092(boolean x) { - return deep8093(x); - } - - public static boolean deep8093(boolean x) { - return deep8094(x); - } - - public static boolean deep8094(boolean x) { - return deep8095(x); - } - - public static boolean deep8095(boolean x) { - return deep8096(x); - } - - public static boolean deep8096(boolean x) { - return deep8097(x); - } - - public static boolean deep8097(boolean x) { - return deep8098(x); - } - - public static boolean deep8098(boolean x) { - return deep8099(x); - } - - public static boolean deep8099(boolean x) { - return deep8100(x); - } - - public static boolean deep8100(boolean x) { - return deep8101(x); - } - - public static boolean deep8101(boolean x) { - return deep8102(x); - } - - public static boolean deep8102(boolean x) { - return deep8103(x); - } - - public static boolean deep8103(boolean x) { - return deep8104(x); - } - - public static boolean deep8104(boolean x) { - return deep8105(x); - } - - public static boolean deep8105(boolean x) { - return deep8106(x); - } - - public static boolean deep8106(boolean x) { - return deep8107(x); - } - - public static boolean deep8107(boolean x) { - return deep8108(x); - } - - public static boolean deep8108(boolean x) { - return deep8109(x); - } - - public static boolean deep8109(boolean x) { - return deep8110(x); - } - - public static boolean deep8110(boolean x) { - return deep8111(x); - } - - public static boolean deep8111(boolean x) { - return deep8112(x); - } - - public static boolean deep8112(boolean x) { - return deep8113(x); - } - - public static boolean deep8113(boolean x) { - return deep8114(x); - } - - public static boolean deep8114(boolean x) { - return deep8115(x); - } - - public static boolean deep8115(boolean x) { - return deep8116(x); - } - - public static boolean deep8116(boolean x) { - return deep8117(x); - } - - public static boolean deep8117(boolean x) { - return deep8118(x); - } - - public static boolean deep8118(boolean x) { - return deep8119(x); - } - - public static boolean deep8119(boolean x) { - return deep8120(x); - } - - public static boolean deep8120(boolean x) { - return deep8121(x); - } - - public static boolean deep8121(boolean x) { - return deep8122(x); - } - - public static boolean deep8122(boolean x) { - return deep8123(x); - } - - public static boolean deep8123(boolean x) { - return deep8124(x); - } - - public static boolean deep8124(boolean x) { - return deep8125(x); - } - - public static boolean deep8125(boolean x) { - return deep8126(x); - } - - public static boolean deep8126(boolean x) { - return deep8127(x); - } - - public static boolean deep8127(boolean x) { - return deep8128(x); - } - - public static boolean deep8128(boolean x) { - return deep8129(x); - } - - public static boolean deep8129(boolean x) { - return deep8130(x); - } - - public static boolean deep8130(boolean x) { - return deep8131(x); - } - - public static boolean deep8131(boolean x) { - return deep8132(x); - } - - public static boolean deep8132(boolean x) { - return deep8133(x); - } - - public static boolean deep8133(boolean x) { - return deep8134(x); - } - - public static boolean deep8134(boolean x) { - return deep8135(x); - } - - public static boolean deep8135(boolean x) { - return deep8136(x); - } - - public static boolean deep8136(boolean x) { - return deep8137(x); - } - - public static boolean deep8137(boolean x) { - return deep8138(x); - } - - public static boolean deep8138(boolean x) { - return deep8139(x); - } - - public static boolean deep8139(boolean x) { - return deep8140(x); - } - - public static boolean deep8140(boolean x) { - return deep8141(x); - } - - public static boolean deep8141(boolean x) { - return deep8142(x); - } - - public static boolean deep8142(boolean x) { - return deep8143(x); - } - - public static boolean deep8143(boolean x) { - return deep8144(x); - } - - public static boolean deep8144(boolean x) { - return deep8145(x); - } - - public static boolean deep8145(boolean x) { - return deep8146(x); - } - - public static boolean deep8146(boolean x) { - return deep8147(x); - } - - public static boolean deep8147(boolean x) { - return deep8148(x); - } - - public static boolean deep8148(boolean x) { - return deep8149(x); - } - - public static boolean deep8149(boolean x) { - return deep8150(x); - } - - public static boolean deep8150(boolean x) { - return deep8151(x); - } - - public static boolean deep8151(boolean x) { - return deep8152(x); - } - - public static boolean deep8152(boolean x) { - return deep8153(x); - } - - public static boolean deep8153(boolean x) { - return deep8154(x); - } - - public static boolean deep8154(boolean x) { - return deep8155(x); - } - - public static boolean deep8155(boolean x) { - return deep8156(x); - } - - public static boolean deep8156(boolean x) { - return deep8157(x); - } - - public static boolean deep8157(boolean x) { - return deep8158(x); - } - - public static boolean deep8158(boolean x) { - return deep8159(x); - } - - public static boolean deep8159(boolean x) { - return deep8160(x); - } - - public static boolean deep8160(boolean x) { - return deep8161(x); - } - - public static boolean deep8161(boolean x) { - return deep8162(x); - } - - public static boolean deep8162(boolean x) { - return deep8163(x); - } - - public static boolean deep8163(boolean x) { - return deep8164(x); - } - - public static boolean deep8164(boolean x) { - return deep8165(x); - } - - public static boolean deep8165(boolean x) { - return deep8166(x); - } - - public static boolean deep8166(boolean x) { - return deep8167(x); - } - - public static boolean deep8167(boolean x) { - return deep8168(x); - } - - public static boolean deep8168(boolean x) { - return deep8169(x); - } - - public static boolean deep8169(boolean x) { - return deep8170(x); - } - - public static boolean deep8170(boolean x) { - return deep8171(x); - } - - public static boolean deep8171(boolean x) { - return deep8172(x); - } - - public static boolean deep8172(boolean x) { - return deep8173(x); - } - - public static boolean deep8173(boolean x) { - return deep8174(x); - } - - public static boolean deep8174(boolean x) { - return deep8175(x); - } - - public static boolean deep8175(boolean x) { - return deep8176(x); - } - - public static boolean deep8176(boolean x) { - return deep8177(x); - } - - public static boolean deep8177(boolean x) { - return deep8178(x); - } - - public static boolean deep8178(boolean x) { - return deep8179(x); - } - - public static boolean deep8179(boolean x) { - return deep8180(x); - } - - public static boolean deep8180(boolean x) { - return deep8181(x); - } - - public static boolean deep8181(boolean x) { - return deep8182(x); - } - - public static boolean deep8182(boolean x) { - return deep8183(x); - } - - public static boolean deep8183(boolean x) { - return deep8184(x); - } - - public static boolean deep8184(boolean x) { - return deep8185(x); - } - - public static boolean deep8185(boolean x) { - return deep8186(x); - } - - public static boolean deep8186(boolean x) { - return deep8187(x); - } - - public static boolean deep8187(boolean x) { - return deep8188(x); - } - - public static boolean deep8188(boolean x) { - return deep8189(x); - } - - public static boolean deep8189(boolean x) { - return deep8190(x); - } - - public static boolean deep8190(boolean x) { - return deep8191(x); - } - - public static boolean deep8191(boolean x) { - return deep8192(x); - } - - public static boolean deep8192(boolean x) { - return deep8193(x); - } - - public static boolean deep8193(boolean x) { - return deep8194(x); - } - - public static boolean deep8194(boolean x) { - return deep8195(x); - } - - public static boolean deep8195(boolean x) { - return deep8196(x); - } - - public static boolean deep8196(boolean x) { - return deep8197(x); - } - - public static boolean deep8197(boolean x) { - return deep8198(x); - } - - public static boolean deep8198(boolean x) { - return deep8199(x); - } - - public static boolean deep8199(boolean x) { - return deep8200(x); - } - - public static boolean deep8200(boolean x) { - return deep8201(x); - } - - public static boolean deep8201(boolean x) { - return deep8202(x); - } - - public static boolean deep8202(boolean x) { - return deep8203(x); - } - - public static boolean deep8203(boolean x) { - return deep8204(x); - } - - public static boolean deep8204(boolean x) { - return deep8205(x); - } - - public static boolean deep8205(boolean x) { - return deep8206(x); - } - - public static boolean deep8206(boolean x) { - return deep8207(x); - } - - public static boolean deep8207(boolean x) { - return deep8208(x); - } - - public static boolean deep8208(boolean x) { - return deep8209(x); - } - - public static boolean deep8209(boolean x) { - return deep8210(x); - } - - public static boolean deep8210(boolean x) { - return deep8211(x); - } - - public static boolean deep8211(boolean x) { - return deep8212(x); - } - - public static boolean deep8212(boolean x) { - return deep8213(x); - } - - public static boolean deep8213(boolean x) { - return deep8214(x); - } - - public static boolean deep8214(boolean x) { - return deep8215(x); - } - - public static boolean deep8215(boolean x) { - return deep8216(x); - } - - public static boolean deep8216(boolean x) { - return deep8217(x); - } - - public static boolean deep8217(boolean x) { - return deep8218(x); - } - - public static boolean deep8218(boolean x) { - return deep8219(x); - } - - public static boolean deep8219(boolean x) { - return deep8220(x); - } - - public static boolean deep8220(boolean x) { - return deep8221(x); - } - - public static boolean deep8221(boolean x) { - return deep8222(x); - } - - public static boolean deep8222(boolean x) { - return deep8223(x); - } - - public static boolean deep8223(boolean x) { - return deep8224(x); - } - - public static boolean deep8224(boolean x) { - return deep8225(x); - } - - public static boolean deep8225(boolean x) { - return deep8226(x); - } - - public static boolean deep8226(boolean x) { - return deep8227(x); - } - - public static boolean deep8227(boolean x) { - return deep8228(x); - } - - public static boolean deep8228(boolean x) { - return deep8229(x); - } - - public static boolean deep8229(boolean x) { - return deep8230(x); - } - - public static boolean deep8230(boolean x) { - return deep8231(x); - } - - public static boolean deep8231(boolean x) { - return deep8232(x); - } - - public static boolean deep8232(boolean x) { - return deep8233(x); - } - - public static boolean deep8233(boolean x) { - return deep8234(x); - } - - public static boolean deep8234(boolean x) { - return deep8235(x); - } - - public static boolean deep8235(boolean x) { - return deep8236(x); - } - - public static boolean deep8236(boolean x) { - return deep8237(x); - } - - public static boolean deep8237(boolean x) { - return deep8238(x); - } - - public static boolean deep8238(boolean x) { - return deep8239(x); - } - - public static boolean deep8239(boolean x) { - return deep8240(x); - } - - public static boolean deep8240(boolean x) { - return deep8241(x); - } - - public static boolean deep8241(boolean x) { - return deep8242(x); - } - - public static boolean deep8242(boolean x) { - return deep8243(x); - } - - public static boolean deep8243(boolean x) { - return deep8244(x); - } - - public static boolean deep8244(boolean x) { - return deep8245(x); - } - - public static boolean deep8245(boolean x) { - return deep8246(x); - } - - public static boolean deep8246(boolean x) { - return deep8247(x); - } - - public static boolean deep8247(boolean x) { - return deep8248(x); - } - - public static boolean deep8248(boolean x) { - return deep8249(x); - } - - public static boolean deep8249(boolean x) { - return deep8250(x); - } - - public static boolean deep8250(boolean x) { - return deep8251(x); - } - - public static boolean deep8251(boolean x) { - return deep8252(x); - } - - public static boolean deep8252(boolean x) { - return deep8253(x); - } - - public static boolean deep8253(boolean x) { - return deep8254(x); - } - - public static boolean deep8254(boolean x) { - return deep8255(x); - } - - public static boolean deep8255(boolean x) { - return deep8256(x); - } - - public static boolean deep8256(boolean x) { - return deep8257(x); - } - - public static boolean deep8257(boolean x) { - return deep8258(x); - } - - public static boolean deep8258(boolean x) { - return deep8259(x); - } - - public static boolean deep8259(boolean x) { - return deep8260(x); - } - - public static boolean deep8260(boolean x) { - return deep8261(x); - } - - public static boolean deep8261(boolean x) { - return deep8262(x); - } - - public static boolean deep8262(boolean x) { - return deep8263(x); - } - - public static boolean deep8263(boolean x) { - return deep8264(x); - } - - public static boolean deep8264(boolean x) { - return deep8265(x); - } - - public static boolean deep8265(boolean x) { - return deep8266(x); - } - - public static boolean deep8266(boolean x) { - return deep8267(x); - } - - public static boolean deep8267(boolean x) { - return deep8268(x); - } - - public static boolean deep8268(boolean x) { - return deep8269(x); - } - - public static boolean deep8269(boolean x) { - return deep8270(x); - } - - public static boolean deep8270(boolean x) { - return deep8271(x); - } - - public static boolean deep8271(boolean x) { - return deep8272(x); - } - - public static boolean deep8272(boolean x) { - return deep8273(x); - } - - public static boolean deep8273(boolean x) { - return deep8274(x); - } - - public static boolean deep8274(boolean x) { - return deep8275(x); - } - - public static boolean deep8275(boolean x) { - return deep8276(x); - } - - public static boolean deep8276(boolean x) { - return deep8277(x); - } - - public static boolean deep8277(boolean x) { - return deep8278(x); - } - - public static boolean deep8278(boolean x) { - return deep8279(x); - } - - public static boolean deep8279(boolean x) { - return deep8280(x); - } - - public static boolean deep8280(boolean x) { - return deep8281(x); - } - - public static boolean deep8281(boolean x) { - return deep8282(x); - } - - public static boolean deep8282(boolean x) { - return deep8283(x); - } - - public static boolean deep8283(boolean x) { - return deep8284(x); - } - - public static boolean deep8284(boolean x) { - return deep8285(x); - } - - public static boolean deep8285(boolean x) { - return deep8286(x); - } - - public static boolean deep8286(boolean x) { - return deep8287(x); - } - - public static boolean deep8287(boolean x) { - return deep8288(x); - } - - public static boolean deep8288(boolean x) { - return deep8289(x); - } - - public static boolean deep8289(boolean x) { - return deep8290(x); - } - - public static boolean deep8290(boolean x) { - return deep8291(x); - } - - public static boolean deep8291(boolean x) { - return deep8292(x); - } - - public static boolean deep8292(boolean x) { - return deep8293(x); - } - - public static boolean deep8293(boolean x) { - return deep8294(x); - } - - public static boolean deep8294(boolean x) { - return deep8295(x); - } - - public static boolean deep8295(boolean x) { - return deep8296(x); - } - - public static boolean deep8296(boolean x) { - return deep8297(x); - } - - public static boolean deep8297(boolean x) { - return deep8298(x); - } - - public static boolean deep8298(boolean x) { - return deep8299(x); - } - - public static boolean deep8299(boolean x) { - return deep8300(x); - } - - public static boolean deep8300(boolean x) { - return deep8301(x); - } - - public static boolean deep8301(boolean x) { - return deep8302(x); - } - - public static boolean deep8302(boolean x) { - return deep8303(x); - } - - public static boolean deep8303(boolean x) { - return deep8304(x); - } - - public static boolean deep8304(boolean x) { - return deep8305(x); - } - - public static boolean deep8305(boolean x) { - return deep8306(x); - } - - public static boolean deep8306(boolean x) { - return deep8307(x); - } - - public static boolean deep8307(boolean x) { - return deep8308(x); - } - - public static boolean deep8308(boolean x) { - return deep8309(x); - } - - public static boolean deep8309(boolean x) { - return deep8310(x); - } - - public static boolean deep8310(boolean x) { - return deep8311(x); - } - - public static boolean deep8311(boolean x) { - return deep8312(x); - } - - public static boolean deep8312(boolean x) { - return deep8313(x); - } - - public static boolean deep8313(boolean x) { - return deep8314(x); - } - - public static boolean deep8314(boolean x) { - return deep8315(x); - } - - public static boolean deep8315(boolean x) { - return deep8316(x); - } - - public static boolean deep8316(boolean x) { - return deep8317(x); - } - - public static boolean deep8317(boolean x) { - return deep8318(x); - } - - public static boolean deep8318(boolean x) { - return deep8319(x); - } - - public static boolean deep8319(boolean x) { - return deep8320(x); - } - - public static boolean deep8320(boolean x) { - return deep8321(x); - } - - public static boolean deep8321(boolean x) { - return deep8322(x); - } - - public static boolean deep8322(boolean x) { - return deep8323(x); - } - - public static boolean deep8323(boolean x) { - return deep8324(x); - } - - public static boolean deep8324(boolean x) { - return deep8325(x); - } - - public static boolean deep8325(boolean x) { - return deep8326(x); - } - - public static boolean deep8326(boolean x) { - return deep8327(x); - } - - public static boolean deep8327(boolean x) { - return deep8328(x); - } - - public static boolean deep8328(boolean x) { - return deep8329(x); - } - - public static boolean deep8329(boolean x) { - return deep8330(x); - } - - public static boolean deep8330(boolean x) { - return deep8331(x); - } - - public static boolean deep8331(boolean x) { - return deep8332(x); - } - - public static boolean deep8332(boolean x) { - return deep8333(x); - } - - public static boolean deep8333(boolean x) { - return deep8334(x); - } - - public static boolean deep8334(boolean x) { - return deep8335(x); - } - - public static boolean deep8335(boolean x) { - return deep8336(x); - } - - public static boolean deep8336(boolean x) { - return deep8337(x); - } - - public static boolean deep8337(boolean x) { - return deep8338(x); - } - - public static boolean deep8338(boolean x) { - return deep8339(x); - } - - public static boolean deep8339(boolean x) { - return deep8340(x); - } - - public static boolean deep8340(boolean x) { - return deep8341(x); - } - - public static boolean deep8341(boolean x) { - return deep8342(x); - } - - public static boolean deep8342(boolean x) { - return deep8343(x); - } - - public static boolean deep8343(boolean x) { - return deep8344(x); - } - - public static boolean deep8344(boolean x) { - return deep8345(x); - } - - public static boolean deep8345(boolean x) { - return deep8346(x); - } - - public static boolean deep8346(boolean x) { - return deep8347(x); - } - - public static boolean deep8347(boolean x) { - return deep8348(x); - } - - public static boolean deep8348(boolean x) { - return deep8349(x); - } - - public static boolean deep8349(boolean x) { - return deep8350(x); - } - - public static boolean deep8350(boolean x) { - return deep8351(x); - } - - public static boolean deep8351(boolean x) { - return deep8352(x); - } - - public static boolean deep8352(boolean x) { - return deep8353(x); - } - - public static boolean deep8353(boolean x) { - return deep8354(x); - } - - public static boolean deep8354(boolean x) { - return deep8355(x); - } - - public static boolean deep8355(boolean x) { - return deep8356(x); - } - - public static boolean deep8356(boolean x) { - return deep8357(x); - } - - public static boolean deep8357(boolean x) { - return deep8358(x); - } - - public static boolean deep8358(boolean x) { - return deep8359(x); - } - - public static boolean deep8359(boolean x) { - return deep8360(x); - } - - public static boolean deep8360(boolean x) { - return deep8361(x); - } - - public static boolean deep8361(boolean x) { - return deep8362(x); - } - - public static boolean deep8362(boolean x) { - return deep8363(x); - } - - public static boolean deep8363(boolean x) { - return deep8364(x); - } - - public static boolean deep8364(boolean x) { - return deep8365(x); - } - - public static boolean deep8365(boolean x) { - return deep8366(x); - } - - public static boolean deep8366(boolean x) { - return deep8367(x); - } - - public static boolean deep8367(boolean x) { - return deep8368(x); - } - - public static boolean deep8368(boolean x) { - return deep8369(x); - } - - public static boolean deep8369(boolean x) { - return deep8370(x); - } - - public static boolean deep8370(boolean x) { - return deep8371(x); - } - - public static boolean deep8371(boolean x) { - return deep8372(x); - } - - public static boolean deep8372(boolean x) { - return deep8373(x); - } - - public static boolean deep8373(boolean x) { - return deep8374(x); - } - - public static boolean deep8374(boolean x) { - return deep8375(x); - } - - public static boolean deep8375(boolean x) { - return deep8376(x); - } - - public static boolean deep8376(boolean x) { - return deep8377(x); - } - - public static boolean deep8377(boolean x) { - return deep8378(x); - } - - public static boolean deep8378(boolean x) { - return deep8379(x); - } - - public static boolean deep8379(boolean x) { - return deep8380(x); - } - - public static boolean deep8380(boolean x) { - return deep8381(x); - } - - public static boolean deep8381(boolean x) { - return deep8382(x); - } - - public static boolean deep8382(boolean x) { - return deep8383(x); - } - - public static boolean deep8383(boolean x) { - return deep8384(x); - } - - public static boolean deep8384(boolean x) { - return deep8385(x); - } - - public static boolean deep8385(boolean x) { - return deep8386(x); - } - - public static boolean deep8386(boolean x) { - return deep8387(x); - } - - public static boolean deep8387(boolean x) { - return deep8388(x); - } - - public static boolean deep8388(boolean x) { - return deep8389(x); - } - - public static boolean deep8389(boolean x) { - return deep8390(x); - } - - public static boolean deep8390(boolean x) { - return deep8391(x); - } - - public static boolean deep8391(boolean x) { - return deep8392(x); - } - - public static boolean deep8392(boolean x) { - return deep8393(x); - } - - public static boolean deep8393(boolean x) { - return deep8394(x); - } - - public static boolean deep8394(boolean x) { - return deep8395(x); - } - - public static boolean deep8395(boolean x) { - return deep8396(x); - } - - public static boolean deep8396(boolean x) { - return deep8397(x); - } - - public static boolean deep8397(boolean x) { - return deep8398(x); - } - - public static boolean deep8398(boolean x) { - return deep8399(x); - } - - public static boolean deep8399(boolean x) { - return deep8400(x); - } - - public static boolean deep8400(boolean x) { - return deep8401(x); - } - - public static boolean deep8401(boolean x) { - return deep8402(x); - } - - public static boolean deep8402(boolean x) { - return deep8403(x); - } - - public static boolean deep8403(boolean x) { - return deep8404(x); - } - - public static boolean deep8404(boolean x) { - return deep8405(x); - } - - public static boolean deep8405(boolean x) { - return deep8406(x); - } - - public static boolean deep8406(boolean x) { - return deep8407(x); - } - - public static boolean deep8407(boolean x) { - return deep8408(x); - } - - public static boolean deep8408(boolean x) { - return deep8409(x); - } - - public static boolean deep8409(boolean x) { - return deep8410(x); - } - - public static boolean deep8410(boolean x) { - return deep8411(x); - } - - public static boolean deep8411(boolean x) { - return deep8412(x); - } - - public static boolean deep8412(boolean x) { - return deep8413(x); - } - - public static boolean deep8413(boolean x) { - return deep8414(x); - } - - public static boolean deep8414(boolean x) { - return deep8415(x); - } - - public static boolean deep8415(boolean x) { - return deep8416(x); - } - - public static boolean deep8416(boolean x) { - return deep8417(x); - } - - public static boolean deep8417(boolean x) { - return deep8418(x); - } - - public static boolean deep8418(boolean x) { - return deep8419(x); - } - - public static boolean deep8419(boolean x) { - return deep8420(x); - } - - public static boolean deep8420(boolean x) { - return deep8421(x); - } - - public static boolean deep8421(boolean x) { - return deep8422(x); - } - - public static boolean deep8422(boolean x) { - return deep8423(x); - } - - public static boolean deep8423(boolean x) { - return deep8424(x); - } - - public static boolean deep8424(boolean x) { - return deep8425(x); - } - - public static boolean deep8425(boolean x) { - return deep8426(x); - } - - public static boolean deep8426(boolean x) { - return deep8427(x); - } - - public static boolean deep8427(boolean x) { - return deep8428(x); - } - - public static boolean deep8428(boolean x) { - return deep8429(x); - } - - public static boolean deep8429(boolean x) { - return deep8430(x); - } - - public static boolean deep8430(boolean x) { - return deep8431(x); - } - - public static boolean deep8431(boolean x) { - return deep8432(x); - } - - public static boolean deep8432(boolean x) { - return deep8433(x); - } - - public static boolean deep8433(boolean x) { - return deep8434(x); - } - - public static boolean deep8434(boolean x) { - return deep8435(x); - } - - public static boolean deep8435(boolean x) { - return deep8436(x); - } - - public static boolean deep8436(boolean x) { - return deep8437(x); - } - - public static boolean deep8437(boolean x) { - return deep8438(x); - } - - public static boolean deep8438(boolean x) { - return deep8439(x); - } - - public static boolean deep8439(boolean x) { - return deep8440(x); - } - - public static boolean deep8440(boolean x) { - return deep8441(x); - } - - public static boolean deep8441(boolean x) { - return deep8442(x); - } - - public static boolean deep8442(boolean x) { - return deep8443(x); - } - - public static boolean deep8443(boolean x) { - return deep8444(x); - } - - public static boolean deep8444(boolean x) { - return deep8445(x); - } - - public static boolean deep8445(boolean x) { - return deep8446(x); - } - - public static boolean deep8446(boolean x) { - return deep8447(x); - } - - public static boolean deep8447(boolean x) { - return deep8448(x); - } - - public static boolean deep8448(boolean x) { - return deep8449(x); - } - - public static boolean deep8449(boolean x) { - return deep8450(x); - } - - public static boolean deep8450(boolean x) { - return deep8451(x); - } - - public static boolean deep8451(boolean x) { - return deep8452(x); - } - - public static boolean deep8452(boolean x) { - return deep8453(x); - } - - public static boolean deep8453(boolean x) { - return deep8454(x); - } - - public static boolean deep8454(boolean x) { - return deep8455(x); - } - - public static boolean deep8455(boolean x) { - return deep8456(x); - } - - public static boolean deep8456(boolean x) { - return deep8457(x); - } - - public static boolean deep8457(boolean x) { - return deep8458(x); - } - - public static boolean deep8458(boolean x) { - return deep8459(x); - } - - public static boolean deep8459(boolean x) { - return deep8460(x); - } - - public static boolean deep8460(boolean x) { - return deep8461(x); - } - - public static boolean deep8461(boolean x) { - return deep8462(x); - } - - public static boolean deep8462(boolean x) { - return deep8463(x); - } - - public static boolean deep8463(boolean x) { - return deep8464(x); - } - - public static boolean deep8464(boolean x) { - return deep8465(x); - } - - public static boolean deep8465(boolean x) { - return deep8466(x); - } - - public static boolean deep8466(boolean x) { - return deep8467(x); - } - - public static boolean deep8467(boolean x) { - return deep8468(x); - } - - public static boolean deep8468(boolean x) { - return deep8469(x); - } - - public static boolean deep8469(boolean x) { - return deep8470(x); - } - - public static boolean deep8470(boolean x) { - return deep8471(x); - } - - public static boolean deep8471(boolean x) { - return deep8472(x); - } - - public static boolean deep8472(boolean x) { - return deep8473(x); - } - - public static boolean deep8473(boolean x) { - return deep8474(x); - } - - public static boolean deep8474(boolean x) { - return deep8475(x); - } - - public static boolean deep8475(boolean x) { - return deep8476(x); - } - - public static boolean deep8476(boolean x) { - return deep8477(x); - } - - public static boolean deep8477(boolean x) { - return deep8478(x); - } - - public static boolean deep8478(boolean x) { - return deep8479(x); - } - - public static boolean deep8479(boolean x) { - return deep8480(x); - } - - public static boolean deep8480(boolean x) { - return deep8481(x); - } - - public static boolean deep8481(boolean x) { - return deep8482(x); - } - - public static boolean deep8482(boolean x) { - return deep8483(x); - } - - public static boolean deep8483(boolean x) { - return deep8484(x); - } - - public static boolean deep8484(boolean x) { - return deep8485(x); - } - - public static boolean deep8485(boolean x) { - return deep8486(x); - } - - public static boolean deep8486(boolean x) { - return deep8487(x); - } - - public static boolean deep8487(boolean x) { - return deep8488(x); - } - - public static boolean deep8488(boolean x) { - return deep8489(x); - } - - public static boolean deep8489(boolean x) { - return deep8490(x); - } - - public static boolean deep8490(boolean x) { - return deep8491(x); - } - - public static boolean deep8491(boolean x) { - return deep8492(x); - } - - public static boolean deep8492(boolean x) { - return deep8493(x); - } - - public static boolean deep8493(boolean x) { - return deep8494(x); - } - - public static boolean deep8494(boolean x) { - return deep8495(x); - } - - public static boolean deep8495(boolean x) { - return deep8496(x); - } - - public static boolean deep8496(boolean x) { - return deep8497(x); - } - - public static boolean deep8497(boolean x) { - return deep8498(x); - } - - public static boolean deep8498(boolean x) { - return deep8499(x); - } - - public static boolean deep8499(boolean x) { - return deep8500(x); - } - - public static boolean deep8500(boolean x) { - return deep8501(x); - } - - public static boolean deep8501(boolean x) { - return deep8502(x); - } - - public static boolean deep8502(boolean x) { - return deep8503(x); - } - - public static boolean deep8503(boolean x) { - return deep8504(x); - } - - public static boolean deep8504(boolean x) { - return deep8505(x); - } - - public static boolean deep8505(boolean x) { - return deep8506(x); - } - - public static boolean deep8506(boolean x) { - return deep8507(x); - } - - public static boolean deep8507(boolean x) { - return deep8508(x); - } - - public static boolean deep8508(boolean x) { - return deep8509(x); - } - - public static boolean deep8509(boolean x) { - return deep8510(x); - } - - public static boolean deep8510(boolean x) { - return deep8511(x); - } - - public static boolean deep8511(boolean x) { - return deep8512(x); - } - - public static boolean deep8512(boolean x) { - return deep8513(x); - } - - public static boolean deep8513(boolean x) { - return deep8514(x); - } - - public static boolean deep8514(boolean x) { - return deep8515(x); - } - - public static boolean deep8515(boolean x) { - return deep8516(x); - } - - public static boolean deep8516(boolean x) { - return deep8517(x); - } - - public static boolean deep8517(boolean x) { - return deep8518(x); - } - - public static boolean deep8518(boolean x) { - return deep8519(x); - } - - public static boolean deep8519(boolean x) { - return deep8520(x); - } - - public static boolean deep8520(boolean x) { - return deep8521(x); - } - - public static boolean deep8521(boolean x) { - return deep8522(x); - } - - public static boolean deep8522(boolean x) { - return deep8523(x); - } - - public static boolean deep8523(boolean x) { - return deep8524(x); - } - - public static boolean deep8524(boolean x) { - return deep8525(x); - } - - public static boolean deep8525(boolean x) { - return deep8526(x); - } - - public static boolean deep8526(boolean x) { - return deep8527(x); - } - - public static boolean deep8527(boolean x) { - return deep8528(x); - } - - public static boolean deep8528(boolean x) { - return deep8529(x); - } - - public static boolean deep8529(boolean x) { - return deep8530(x); - } - - public static boolean deep8530(boolean x) { - return deep8531(x); - } - - public static boolean deep8531(boolean x) { - return deep8532(x); - } - - public static boolean deep8532(boolean x) { - return deep8533(x); - } - - public static boolean deep8533(boolean x) { - return deep8534(x); - } - - public static boolean deep8534(boolean x) { - return deep8535(x); - } - - public static boolean deep8535(boolean x) { - return deep8536(x); - } - - public static boolean deep8536(boolean x) { - return deep8537(x); - } - - public static boolean deep8537(boolean x) { - return deep8538(x); - } - - public static boolean deep8538(boolean x) { - return deep8539(x); - } - - public static boolean deep8539(boolean x) { - return deep8540(x); - } - - public static boolean deep8540(boolean x) { - return deep8541(x); - } - - public static boolean deep8541(boolean x) { - return deep8542(x); - } - - public static boolean deep8542(boolean x) { - return deep8543(x); - } - - public static boolean deep8543(boolean x) { - return deep8544(x); - } - - public static boolean deep8544(boolean x) { - return deep8545(x); - } - - public static boolean deep8545(boolean x) { - return deep8546(x); - } - - public static boolean deep8546(boolean x) { - return deep8547(x); - } - - public static boolean deep8547(boolean x) { - return deep8548(x); - } - - public static boolean deep8548(boolean x) { - return deep8549(x); - } - - public static boolean deep8549(boolean x) { - return deep8550(x); - } - - public static boolean deep8550(boolean x) { - return deep8551(x); - } - - public static boolean deep8551(boolean x) { - return deep8552(x); - } - - public static boolean deep8552(boolean x) { - return deep8553(x); - } - - public static boolean deep8553(boolean x) { - return deep8554(x); - } - - public static boolean deep8554(boolean x) { - return deep8555(x); - } - - public static boolean deep8555(boolean x) { - return deep8556(x); - } - - public static boolean deep8556(boolean x) { - return deep8557(x); - } - - public static boolean deep8557(boolean x) { - return deep8558(x); - } - - public static boolean deep8558(boolean x) { - return deep8559(x); - } - - public static boolean deep8559(boolean x) { - return deep8560(x); - } - - public static boolean deep8560(boolean x) { - return deep8561(x); - } - - public static boolean deep8561(boolean x) { - return deep8562(x); - } - - public static boolean deep8562(boolean x) { - return deep8563(x); - } - - public static boolean deep8563(boolean x) { - return deep8564(x); - } - - public static boolean deep8564(boolean x) { - return deep8565(x); - } - - public static boolean deep8565(boolean x) { - return deep8566(x); - } - - public static boolean deep8566(boolean x) { - return deep8567(x); - } - - public static boolean deep8567(boolean x) { - return deep8568(x); - } - - public static boolean deep8568(boolean x) { - return deep8569(x); - } - - public static boolean deep8569(boolean x) { - return deep8570(x); - } - - public static boolean deep8570(boolean x) { - return deep8571(x); - } - - public static boolean deep8571(boolean x) { - return deep8572(x); - } - - public static boolean deep8572(boolean x) { - return deep8573(x); - } - - public static boolean deep8573(boolean x) { - return deep8574(x); - } - - public static boolean deep8574(boolean x) { - return deep8575(x); - } - - public static boolean deep8575(boolean x) { - return deep8576(x); - } - - public static boolean deep8576(boolean x) { - return deep8577(x); - } - - public static boolean deep8577(boolean x) { - return deep8578(x); - } - - public static boolean deep8578(boolean x) { - return deep8579(x); - } - - public static boolean deep8579(boolean x) { - return deep8580(x); - } - - public static boolean deep8580(boolean x) { - return deep8581(x); - } - - public static boolean deep8581(boolean x) { - return deep8582(x); - } - - public static boolean deep8582(boolean x) { - return deep8583(x); - } - - public static boolean deep8583(boolean x) { - return deep8584(x); - } - - public static boolean deep8584(boolean x) { - return deep8585(x); - } - - public static boolean deep8585(boolean x) { - return deep8586(x); - } - - public static boolean deep8586(boolean x) { - return deep8587(x); - } - - public static boolean deep8587(boolean x) { - return deep8588(x); - } - - public static boolean deep8588(boolean x) { - return deep8589(x); - } - - public static boolean deep8589(boolean x) { - return deep8590(x); - } - - public static boolean deep8590(boolean x) { - return deep8591(x); - } - - public static boolean deep8591(boolean x) { - return deep8592(x); - } - - public static boolean deep8592(boolean x) { - return deep8593(x); - } - - public static boolean deep8593(boolean x) { - return deep8594(x); - } - - public static boolean deep8594(boolean x) { - return deep8595(x); - } - - public static boolean deep8595(boolean x) { - return deep8596(x); - } - - public static boolean deep8596(boolean x) { - return deep8597(x); - } - - public static boolean deep8597(boolean x) { - return deep8598(x); - } - - public static boolean deep8598(boolean x) { - return deep8599(x); - } - - public static boolean deep8599(boolean x) { - return deep8600(x); - } - - public static boolean deep8600(boolean x) { - return deep8601(x); - } - - public static boolean deep8601(boolean x) { - return deep8602(x); - } - - public static boolean deep8602(boolean x) { - return deep8603(x); - } - - public static boolean deep8603(boolean x) { - return deep8604(x); - } - - public static boolean deep8604(boolean x) { - return deep8605(x); - } - - public static boolean deep8605(boolean x) { - return deep8606(x); - } - - public static boolean deep8606(boolean x) { - return deep8607(x); - } - - public static boolean deep8607(boolean x) { - return deep8608(x); - } - - public static boolean deep8608(boolean x) { - return deep8609(x); - } - - public static boolean deep8609(boolean x) { - return deep8610(x); - } - - public static boolean deep8610(boolean x) { - return deep8611(x); - } - - public static boolean deep8611(boolean x) { - return deep8612(x); - } - - public static boolean deep8612(boolean x) { - return deep8613(x); - } - - public static boolean deep8613(boolean x) { - return deep8614(x); - } - - public static boolean deep8614(boolean x) { - return deep8615(x); - } - - public static boolean deep8615(boolean x) { - return deep8616(x); - } - - public static boolean deep8616(boolean x) { - return deep8617(x); - } - - public static boolean deep8617(boolean x) { - return deep8618(x); - } - - public static boolean deep8618(boolean x) { - return deep8619(x); - } - - public static boolean deep8619(boolean x) { - return deep8620(x); - } - - public static boolean deep8620(boolean x) { - return deep8621(x); - } - - public static boolean deep8621(boolean x) { - return deep8622(x); - } - - public static boolean deep8622(boolean x) { - return deep8623(x); - } - - public static boolean deep8623(boolean x) { - return deep8624(x); - } - - public static boolean deep8624(boolean x) { - return deep8625(x); - } - - public static boolean deep8625(boolean x) { - return deep8626(x); - } - - public static boolean deep8626(boolean x) { - return deep8627(x); - } - - public static boolean deep8627(boolean x) { - return deep8628(x); - } - - public static boolean deep8628(boolean x) { - return deep8629(x); - } - - public static boolean deep8629(boolean x) { - return deep8630(x); - } - - public static boolean deep8630(boolean x) { - return deep8631(x); - } - - public static boolean deep8631(boolean x) { - return deep8632(x); - } - - public static boolean deep8632(boolean x) { - return deep8633(x); - } - - public static boolean deep8633(boolean x) { - return deep8634(x); - } - - public static boolean deep8634(boolean x) { - return deep8635(x); - } - - public static boolean deep8635(boolean x) { - return deep8636(x); - } - - public static boolean deep8636(boolean x) { - return deep8637(x); - } - - public static boolean deep8637(boolean x) { - return deep8638(x); - } - - public static boolean deep8638(boolean x) { - return deep8639(x); - } - - public static boolean deep8639(boolean x) { - return deep8640(x); - } - - public static boolean deep8640(boolean x) { - return deep8641(x); - } - - public static boolean deep8641(boolean x) { - return deep8642(x); - } - - public static boolean deep8642(boolean x) { - return deep8643(x); - } - - public static boolean deep8643(boolean x) { - return deep8644(x); - } - - public static boolean deep8644(boolean x) { - return deep8645(x); - } - - public static boolean deep8645(boolean x) { - return deep8646(x); - } - - public static boolean deep8646(boolean x) { - return deep8647(x); - } - - public static boolean deep8647(boolean x) { - return deep8648(x); - } - - public static boolean deep8648(boolean x) { - return deep8649(x); - } - - public static boolean deep8649(boolean x) { - return deep8650(x); - } - - public static boolean deep8650(boolean x) { - return deep8651(x); - } - - public static boolean deep8651(boolean x) { - return deep8652(x); - } - - public static boolean deep8652(boolean x) { - return deep8653(x); - } - - public static boolean deep8653(boolean x) { - return deep8654(x); - } - - public static boolean deep8654(boolean x) { - return deep8655(x); - } - - public static boolean deep8655(boolean x) { - return deep8656(x); - } - - public static boolean deep8656(boolean x) { - return deep8657(x); - } - - public static boolean deep8657(boolean x) { - return deep8658(x); - } - - public static boolean deep8658(boolean x) { - return deep8659(x); - } - - public static boolean deep8659(boolean x) { - return deep8660(x); - } - - public static boolean deep8660(boolean x) { - return deep8661(x); - } - - public static boolean deep8661(boolean x) { - return deep8662(x); - } - - public static boolean deep8662(boolean x) { - return deep8663(x); - } - - public static boolean deep8663(boolean x) { - return deep8664(x); - } - - public static boolean deep8664(boolean x) { - return deep8665(x); - } - - public static boolean deep8665(boolean x) { - return deep8666(x); - } - - public static boolean deep8666(boolean x) { - return deep8667(x); - } - - public static boolean deep8667(boolean x) { - return deep8668(x); - } - - public static boolean deep8668(boolean x) { - return deep8669(x); - } - - public static boolean deep8669(boolean x) { - return deep8670(x); - } - - public static boolean deep8670(boolean x) { - return deep8671(x); - } - - public static boolean deep8671(boolean x) { - return deep8672(x); - } - - public static boolean deep8672(boolean x) { - return deep8673(x); - } - - public static boolean deep8673(boolean x) { - return deep8674(x); - } - - public static boolean deep8674(boolean x) { - return deep8675(x); - } - - public static boolean deep8675(boolean x) { - return deep8676(x); - } - - public static boolean deep8676(boolean x) { - return deep8677(x); - } - - public static boolean deep8677(boolean x) { - return deep8678(x); - } - - public static boolean deep8678(boolean x) { - return deep8679(x); - } - - public static boolean deep8679(boolean x) { - return deep8680(x); - } - - public static boolean deep8680(boolean x) { - return deep8681(x); - } - - public static boolean deep8681(boolean x) { - return deep8682(x); - } - - public static boolean deep8682(boolean x) { - return deep8683(x); - } - - public static boolean deep8683(boolean x) { - return deep8684(x); - } - - public static boolean deep8684(boolean x) { - return deep8685(x); - } - - public static boolean deep8685(boolean x) { - return deep8686(x); - } - - public static boolean deep8686(boolean x) { - return deep8687(x); - } - - public static boolean deep8687(boolean x) { - return deep8688(x); - } - - public static boolean deep8688(boolean x) { - return deep8689(x); - } - - public static boolean deep8689(boolean x) { - return deep8690(x); - } - - public static boolean deep8690(boolean x) { - return deep8691(x); - } - - public static boolean deep8691(boolean x) { - return deep8692(x); - } - - public static boolean deep8692(boolean x) { - return deep8693(x); - } - - public static boolean deep8693(boolean x) { - return deep8694(x); - } - - public static boolean deep8694(boolean x) { - return deep8695(x); - } - - public static boolean deep8695(boolean x) { - return deep8696(x); - } - - public static boolean deep8696(boolean x) { - return deep8697(x); - } - - public static boolean deep8697(boolean x) { - return deep8698(x); - } - - public static boolean deep8698(boolean x) { - return deep8699(x); - } - - public static boolean deep8699(boolean x) { - return deep8700(x); - } - - public static boolean deep8700(boolean x) { - return deep8701(x); - } - - public static boolean deep8701(boolean x) { - return deep8702(x); - } - - public static boolean deep8702(boolean x) { - return deep8703(x); - } - - public static boolean deep8703(boolean x) { - return deep8704(x); - } - - public static boolean deep8704(boolean x) { - return deep8705(x); - } - - public static boolean deep8705(boolean x) { - return deep8706(x); - } - - public static boolean deep8706(boolean x) { - return deep8707(x); - } - - public static boolean deep8707(boolean x) { - return deep8708(x); - } - - public static boolean deep8708(boolean x) { - return deep8709(x); - } - - public static boolean deep8709(boolean x) { - return deep8710(x); - } - - public static boolean deep8710(boolean x) { - return deep8711(x); - } - - public static boolean deep8711(boolean x) { - return deep8712(x); - } - - public static boolean deep8712(boolean x) { - return deep8713(x); - } - - public static boolean deep8713(boolean x) { - return deep8714(x); - } - - public static boolean deep8714(boolean x) { - return deep8715(x); - } - - public static boolean deep8715(boolean x) { - return deep8716(x); - } - - public static boolean deep8716(boolean x) { - return deep8717(x); - } - - public static boolean deep8717(boolean x) { - return deep8718(x); - } - - public static boolean deep8718(boolean x) { - return deep8719(x); - } - - public static boolean deep8719(boolean x) { - return deep8720(x); - } - - public static boolean deep8720(boolean x) { - return deep8721(x); - } - - public static boolean deep8721(boolean x) { - return deep8722(x); - } - - public static boolean deep8722(boolean x) { - return deep8723(x); - } - - public static boolean deep8723(boolean x) { - return deep8724(x); - } - - public static boolean deep8724(boolean x) { - return deep8725(x); - } - - public static boolean deep8725(boolean x) { - return deep8726(x); - } - - public static boolean deep8726(boolean x) { - return deep8727(x); - } - - public static boolean deep8727(boolean x) { - return deep8728(x); - } - - public static boolean deep8728(boolean x) { - return deep8729(x); - } - - public static boolean deep8729(boolean x) { - return deep8730(x); - } - - public static boolean deep8730(boolean x) { - return deep8731(x); - } - - public static boolean deep8731(boolean x) { - return deep8732(x); - } - - public static boolean deep8732(boolean x) { - return deep8733(x); - } - - public static boolean deep8733(boolean x) { - return deep8734(x); - } - - public static boolean deep8734(boolean x) { - return deep8735(x); - } - - public static boolean deep8735(boolean x) { - return deep8736(x); - } - - public static boolean deep8736(boolean x) { - return deep8737(x); - } - - public static boolean deep8737(boolean x) { - return deep8738(x); - } - - public static boolean deep8738(boolean x) { - return deep8739(x); - } - - public static boolean deep8739(boolean x) { - return deep8740(x); - } - - public static boolean deep8740(boolean x) { - return deep8741(x); - } - - public static boolean deep8741(boolean x) { - return deep8742(x); - } - - public static boolean deep8742(boolean x) { - return deep8743(x); - } - - public static boolean deep8743(boolean x) { - return deep8744(x); - } - - public static boolean deep8744(boolean x) { - return deep8745(x); - } - - public static boolean deep8745(boolean x) { - return deep8746(x); - } - - public static boolean deep8746(boolean x) { - return deep8747(x); - } - - public static boolean deep8747(boolean x) { - return deep8748(x); - } - - public static boolean deep8748(boolean x) { - return deep8749(x); - } - - public static boolean deep8749(boolean x) { - return deep8750(x); - } - - public static boolean deep8750(boolean x) { - return deep8751(x); - } - - public static boolean deep8751(boolean x) { - return deep8752(x); - } - - public static boolean deep8752(boolean x) { - return deep8753(x); - } - - public static boolean deep8753(boolean x) { - return deep8754(x); - } - - public static boolean deep8754(boolean x) { - return deep8755(x); - } - - public static boolean deep8755(boolean x) { - return deep8756(x); - } - - public static boolean deep8756(boolean x) { - return deep8757(x); - } - - public static boolean deep8757(boolean x) { - return deep8758(x); - } - - public static boolean deep8758(boolean x) { - return deep8759(x); - } - - public static boolean deep8759(boolean x) { - return deep8760(x); - } - - public static boolean deep8760(boolean x) { - return deep8761(x); - } - - public static boolean deep8761(boolean x) { - return deep8762(x); - } - - public static boolean deep8762(boolean x) { - return deep8763(x); - } - - public static boolean deep8763(boolean x) { - return deep8764(x); - } - - public static boolean deep8764(boolean x) { - return deep8765(x); - } - - public static boolean deep8765(boolean x) { - return deep8766(x); - } - - public static boolean deep8766(boolean x) { - return deep8767(x); - } - - public static boolean deep8767(boolean x) { - return deep8768(x); - } - - public static boolean deep8768(boolean x) { - return deep8769(x); - } - - public static boolean deep8769(boolean x) { - return deep8770(x); - } - - public static boolean deep8770(boolean x) { - return deep8771(x); - } - - public static boolean deep8771(boolean x) { - return deep8772(x); - } - - public static boolean deep8772(boolean x) { - return deep8773(x); - } - - public static boolean deep8773(boolean x) { - return deep8774(x); - } - - public static boolean deep8774(boolean x) { - return deep8775(x); - } - - public static boolean deep8775(boolean x) { - return deep8776(x); - } - - public static boolean deep8776(boolean x) { - return deep8777(x); - } - - public static boolean deep8777(boolean x) { - return deep8778(x); - } - - public static boolean deep8778(boolean x) { - return deep8779(x); - } - - public static boolean deep8779(boolean x) { - return deep8780(x); - } - - public static boolean deep8780(boolean x) { - return deep8781(x); - } - - public static boolean deep8781(boolean x) { - return deep8782(x); - } - - public static boolean deep8782(boolean x) { - return deep8783(x); - } - - public static boolean deep8783(boolean x) { - return deep8784(x); - } - - public static boolean deep8784(boolean x) { - return deep8785(x); - } - - public static boolean deep8785(boolean x) { - return deep8786(x); - } - - public static boolean deep8786(boolean x) { - return deep8787(x); - } - - public static boolean deep8787(boolean x) { - return deep8788(x); - } - - public static boolean deep8788(boolean x) { - return deep8789(x); - } - - public static boolean deep8789(boolean x) { - return deep8790(x); - } - - public static boolean deep8790(boolean x) { - return deep8791(x); - } - - public static boolean deep8791(boolean x) { - return deep8792(x); - } - - public static boolean deep8792(boolean x) { - return deep8793(x); - } - - public static boolean deep8793(boolean x) { - return deep8794(x); - } - - public static boolean deep8794(boolean x) { - return deep8795(x); - } - - public static boolean deep8795(boolean x) { - return deep8796(x); - } - - public static boolean deep8796(boolean x) { - return deep8797(x); - } - - public static boolean deep8797(boolean x) { - return deep8798(x); - } - - public static boolean deep8798(boolean x) { - return deep8799(x); - } - - public static boolean deep8799(boolean x) { - return deep8800(x); - } - - public static boolean deep8800(boolean x) { - return deep8801(x); - } - - public static boolean deep8801(boolean x) { - return deep8802(x); - } - - public static boolean deep8802(boolean x) { - return deep8803(x); - } - - public static boolean deep8803(boolean x) { - return deep8804(x); - } - - public static boolean deep8804(boolean x) { - return deep8805(x); - } - - public static boolean deep8805(boolean x) { - return deep8806(x); - } - - public static boolean deep8806(boolean x) { - return deep8807(x); - } - - public static boolean deep8807(boolean x) { - return deep8808(x); - } - - public static boolean deep8808(boolean x) { - return deep8809(x); - } - - public static boolean deep8809(boolean x) { - return deep8810(x); - } - - public static boolean deep8810(boolean x) { - return deep8811(x); - } - - public static boolean deep8811(boolean x) { - return deep8812(x); - } - - public static boolean deep8812(boolean x) { - return deep8813(x); - } - - public static boolean deep8813(boolean x) { - return deep8814(x); - } - - public static boolean deep8814(boolean x) { - return deep8815(x); - } - - public static boolean deep8815(boolean x) { - return deep8816(x); - } - - public static boolean deep8816(boolean x) { - return deep8817(x); - } - - public static boolean deep8817(boolean x) { - return deep8818(x); - } - - public static boolean deep8818(boolean x) { - return deep8819(x); - } - - public static boolean deep8819(boolean x) { - return deep8820(x); - } - - public static boolean deep8820(boolean x) { - return deep8821(x); - } - - public static boolean deep8821(boolean x) { - return deep8822(x); - } - - public static boolean deep8822(boolean x) { - return deep8823(x); - } - - public static boolean deep8823(boolean x) { - return deep8824(x); - } - - public static boolean deep8824(boolean x) { - return deep8825(x); - } - - public static boolean deep8825(boolean x) { - return deep8826(x); - } - - public static boolean deep8826(boolean x) { - return deep8827(x); - } - - public static boolean deep8827(boolean x) { - return deep8828(x); - } - - public static boolean deep8828(boolean x) { - return deep8829(x); - } - - public static boolean deep8829(boolean x) { - return deep8830(x); - } - - public static boolean deep8830(boolean x) { - return deep8831(x); - } - - public static boolean deep8831(boolean x) { - return deep8832(x); - } - - public static boolean deep8832(boolean x) { - return deep8833(x); - } - - public static boolean deep8833(boolean x) { - return deep8834(x); - } - - public static boolean deep8834(boolean x) { - return deep8835(x); - } - - public static boolean deep8835(boolean x) { - return deep8836(x); - } - - public static boolean deep8836(boolean x) { - return deep8837(x); - } - - public static boolean deep8837(boolean x) { - return deep8838(x); - } - - public static boolean deep8838(boolean x) { - return deep8839(x); - } - - public static boolean deep8839(boolean x) { - return deep8840(x); - } - - public static boolean deep8840(boolean x) { - return deep8841(x); - } - - public static boolean deep8841(boolean x) { - return deep8842(x); - } - - public static boolean deep8842(boolean x) { - return deep8843(x); - } - - public static boolean deep8843(boolean x) { - return deep8844(x); - } - - public static boolean deep8844(boolean x) { - return deep8845(x); - } - - public static boolean deep8845(boolean x) { - return deep8846(x); - } - - public static boolean deep8846(boolean x) { - return deep8847(x); - } - - public static boolean deep8847(boolean x) { - return deep8848(x); - } - - public static boolean deep8848(boolean x) { - return deep8849(x); - } - - public static boolean deep8849(boolean x) { - return deep8850(x); - } - - public static boolean deep8850(boolean x) { - return deep8851(x); - } - - public static boolean deep8851(boolean x) { - return deep8852(x); - } - - public static boolean deep8852(boolean x) { - return deep8853(x); - } - - public static boolean deep8853(boolean x) { - return deep8854(x); - } - - public static boolean deep8854(boolean x) { - return deep8855(x); - } - - public static boolean deep8855(boolean x) { - return deep8856(x); - } - - public static boolean deep8856(boolean x) { - return deep8857(x); - } - - public static boolean deep8857(boolean x) { - return deep8858(x); - } - - public static boolean deep8858(boolean x) { - return deep8859(x); - } - - public static boolean deep8859(boolean x) { - return deep8860(x); - } - - public static boolean deep8860(boolean x) { - return deep8861(x); - } - - public static boolean deep8861(boolean x) { - return deep8862(x); - } - - public static boolean deep8862(boolean x) { - return deep8863(x); - } - - public static boolean deep8863(boolean x) { - return deep8864(x); - } - - public static boolean deep8864(boolean x) { - return deep8865(x); - } - - public static boolean deep8865(boolean x) { - return deep8866(x); - } - - public static boolean deep8866(boolean x) { - return deep8867(x); - } - - public static boolean deep8867(boolean x) { - return deep8868(x); - } - - public static boolean deep8868(boolean x) { - return deep8869(x); - } - - public static boolean deep8869(boolean x) { - return deep8870(x); - } - - public static boolean deep8870(boolean x) { - return deep8871(x); - } - - public static boolean deep8871(boolean x) { - return deep8872(x); - } - - public static boolean deep8872(boolean x) { - return deep8873(x); - } - - public static boolean deep8873(boolean x) { - return deep8874(x); - } - - public static boolean deep8874(boolean x) { - return deep8875(x); - } - - public static boolean deep8875(boolean x) { - return deep8876(x); - } - - public static boolean deep8876(boolean x) { - return deep8877(x); - } - - public static boolean deep8877(boolean x) { - return deep8878(x); - } - - public static boolean deep8878(boolean x) { - return deep8879(x); - } - - public static boolean deep8879(boolean x) { - return deep8880(x); - } - - public static boolean deep8880(boolean x) { - return deep8881(x); - } - - public static boolean deep8881(boolean x) { - return deep8882(x); - } - - public static boolean deep8882(boolean x) { - return deep8883(x); - } - - public static boolean deep8883(boolean x) { - return deep8884(x); - } - - public static boolean deep8884(boolean x) { - return deep8885(x); - } - - public static boolean deep8885(boolean x) { - return deep8886(x); - } - - public static boolean deep8886(boolean x) { - return deep8887(x); - } - - public static boolean deep8887(boolean x) { - return deep8888(x); - } - - public static boolean deep8888(boolean x) { - return deep8889(x); - } - - public static boolean deep8889(boolean x) { - return deep8890(x); - } - - public static boolean deep8890(boolean x) { - return deep8891(x); - } - - public static boolean deep8891(boolean x) { - return deep8892(x); - } - - public static boolean deep8892(boolean x) { - return deep8893(x); - } - - public static boolean deep8893(boolean x) { - return deep8894(x); - } - - public static boolean deep8894(boolean x) { - return deep8895(x); - } - - public static boolean deep8895(boolean x) { - return deep8896(x); - } - - public static boolean deep8896(boolean x) { - return deep8897(x); - } - - public static boolean deep8897(boolean x) { - return deep8898(x); - } - - public static boolean deep8898(boolean x) { - return deep8899(x); - } - - public static boolean deep8899(boolean x) { - return deep8900(x); - } - - public static boolean deep8900(boolean x) { - return deep8901(x); - } - - public static boolean deep8901(boolean x) { - return deep8902(x); - } - - public static boolean deep8902(boolean x) { - return deep8903(x); - } - - public static boolean deep8903(boolean x) { - return deep8904(x); - } - - public static boolean deep8904(boolean x) { - return deep8905(x); - } - - public static boolean deep8905(boolean x) { - return deep8906(x); - } - - public static boolean deep8906(boolean x) { - return deep8907(x); - } - - public static boolean deep8907(boolean x) { - return deep8908(x); - } - - public static boolean deep8908(boolean x) { - return deep8909(x); - } - - public static boolean deep8909(boolean x) { - return deep8910(x); - } - - public static boolean deep8910(boolean x) { - return deep8911(x); - } - - public static boolean deep8911(boolean x) { - return deep8912(x); - } - - public static boolean deep8912(boolean x) { - return deep8913(x); - } - - public static boolean deep8913(boolean x) { - return deep8914(x); - } - - public static boolean deep8914(boolean x) { - return deep8915(x); - } - - public static boolean deep8915(boolean x) { - return deep8916(x); - } - - public static boolean deep8916(boolean x) { - return deep8917(x); - } - - public static boolean deep8917(boolean x) { - return deep8918(x); - } - - public static boolean deep8918(boolean x) { - return deep8919(x); - } - - public static boolean deep8919(boolean x) { - return deep8920(x); - } - - public static boolean deep8920(boolean x) { - return deep8921(x); - } - - public static boolean deep8921(boolean x) { - return deep8922(x); - } - - public static boolean deep8922(boolean x) { - return deep8923(x); - } - - public static boolean deep8923(boolean x) { - return deep8924(x); - } - - public static boolean deep8924(boolean x) { - return deep8925(x); - } - - public static boolean deep8925(boolean x) { - return deep8926(x); - } - - public static boolean deep8926(boolean x) { - return deep8927(x); - } - - public static boolean deep8927(boolean x) { - return deep8928(x); - } - - public static boolean deep8928(boolean x) { - return deep8929(x); - } - - public static boolean deep8929(boolean x) { - return deep8930(x); - } - - public static boolean deep8930(boolean x) { - return deep8931(x); - } - - public static boolean deep8931(boolean x) { - return deep8932(x); - } - - public static boolean deep8932(boolean x) { - return deep8933(x); - } - - public static boolean deep8933(boolean x) { - return deep8934(x); - } - - public static boolean deep8934(boolean x) { - return deep8935(x); - } - - public static boolean deep8935(boolean x) { - return deep8936(x); - } - - public static boolean deep8936(boolean x) { - return deep8937(x); - } - - public static boolean deep8937(boolean x) { - return deep8938(x); - } - - public static boolean deep8938(boolean x) { - return deep8939(x); - } - - public static boolean deep8939(boolean x) { - return deep8940(x); - } - - public static boolean deep8940(boolean x) { - return deep8941(x); - } - - public static boolean deep8941(boolean x) { - return deep8942(x); - } - - public static boolean deep8942(boolean x) { - return deep8943(x); - } - - public static boolean deep8943(boolean x) { - return deep8944(x); - } - - public static boolean deep8944(boolean x) { - return deep8945(x); - } - - public static boolean deep8945(boolean x) { - return deep8946(x); - } - - public static boolean deep8946(boolean x) { - return deep8947(x); - } - - public static boolean deep8947(boolean x) { - return deep8948(x); - } - - public static boolean deep8948(boolean x) { - return deep8949(x); - } - - public static boolean deep8949(boolean x) { - return deep8950(x); - } - - public static boolean deep8950(boolean x) { - return deep8951(x); - } - - public static boolean deep8951(boolean x) { - return deep8952(x); - } - - public static boolean deep8952(boolean x) { - return deep8953(x); - } - - public static boolean deep8953(boolean x) { - return deep8954(x); - } - - public static boolean deep8954(boolean x) { - return deep8955(x); - } - - public static boolean deep8955(boolean x) { - return deep8956(x); - } - - public static boolean deep8956(boolean x) { - return deep8957(x); - } - - public static boolean deep8957(boolean x) { - return deep8958(x); - } - - public static boolean deep8958(boolean x) { - return deep8959(x); - } - - public static boolean deep8959(boolean x) { - return deep8960(x); - } - - public static boolean deep8960(boolean x) { - return deep8961(x); - } - - public static boolean deep8961(boolean x) { - return deep8962(x); - } - - public static boolean deep8962(boolean x) { - return deep8963(x); - } - - public static boolean deep8963(boolean x) { - return deep8964(x); - } - - public static boolean deep8964(boolean x) { - return deep8965(x); - } - - public static boolean deep8965(boolean x) { - return deep8966(x); - } - - public static boolean deep8966(boolean x) { - return deep8967(x); - } - - public static boolean deep8967(boolean x) { - return deep8968(x); - } - - public static boolean deep8968(boolean x) { - return deep8969(x); - } - - public static boolean deep8969(boolean x) { - return deep8970(x); - } - - public static boolean deep8970(boolean x) { - return deep8971(x); - } - - public static boolean deep8971(boolean x) { - return deep8972(x); - } - - public static boolean deep8972(boolean x) { - return deep8973(x); - } - - public static boolean deep8973(boolean x) { - return deep8974(x); - } - - public static boolean deep8974(boolean x) { - return deep8975(x); - } - - public static boolean deep8975(boolean x) { - return deep8976(x); - } - - public static boolean deep8976(boolean x) { - return deep8977(x); - } - - public static boolean deep8977(boolean x) { - return deep8978(x); - } - - public static boolean deep8978(boolean x) { - return deep8979(x); - } - - public static boolean deep8979(boolean x) { - return deep8980(x); - } - - public static boolean deep8980(boolean x) { - return deep8981(x); - } - - public static boolean deep8981(boolean x) { - return deep8982(x); - } - - public static boolean deep8982(boolean x) { - return deep8983(x); - } - - public static boolean deep8983(boolean x) { - return deep8984(x); - } - - public static boolean deep8984(boolean x) { - return deep8985(x); - } - - public static boolean deep8985(boolean x) { - return deep8986(x); - } - - public static boolean deep8986(boolean x) { - return deep8987(x); - } - - public static boolean deep8987(boolean x) { - return deep8988(x); - } - - public static boolean deep8988(boolean x) { - return deep8989(x); - } - - public static boolean deep8989(boolean x) { - return deep8990(x); - } - - public static boolean deep8990(boolean x) { - return deep8991(x); - } - - public static boolean deep8991(boolean x) { - return deep8992(x); - } - - public static boolean deep8992(boolean x) { - return deep8993(x); - } - - public static boolean deep8993(boolean x) { - return deep8994(x); - } - - public static boolean deep8994(boolean x) { - return deep8995(x); - } - - public static boolean deep8995(boolean x) { - return deep8996(x); - } - - public static boolean deep8996(boolean x) { - return deep8997(x); - } - - public static boolean deep8997(boolean x) { - return deep8998(x); - } - - public static boolean deep8998(boolean x) { - return deep8999(x); - } - - public static boolean deep8999(boolean x) { - return deep9000(x); - } - - public static boolean deep9000(boolean x) { - return deep9001(x); - } - - public static boolean deep9001(boolean x) { - return deep9002(x); - } - - public static boolean deep9002(boolean x) { - return deep9003(x); - } - - public static boolean deep9003(boolean x) { - return deep9004(x); - } - - public static boolean deep9004(boolean x) { - return deep9005(x); - } - - public static boolean deep9005(boolean x) { - return deep9006(x); - } - - public static boolean deep9006(boolean x) { - return deep9007(x); - } - - public static boolean deep9007(boolean x) { - return deep9008(x); - } - - public static boolean deep9008(boolean x) { - return deep9009(x); - } - - public static boolean deep9009(boolean x) { - return deep9010(x); - } - - public static boolean deep9010(boolean x) { - return deep9011(x); - } - - public static boolean deep9011(boolean x) { - return deep9012(x); - } - - public static boolean deep9012(boolean x) { - return deep9013(x); - } - - public static boolean deep9013(boolean x) { - return deep9014(x); - } - - public static boolean deep9014(boolean x) { - return deep9015(x); - } - - public static boolean deep9015(boolean x) { - return deep9016(x); - } - - public static boolean deep9016(boolean x) { - return deep9017(x); - } - - public static boolean deep9017(boolean x) { - return deep9018(x); - } - - public static boolean deep9018(boolean x) { - return deep9019(x); - } - - public static boolean deep9019(boolean x) { - return deep9020(x); - } - - public static boolean deep9020(boolean x) { - return deep9021(x); - } - - public static boolean deep9021(boolean x) { - return deep9022(x); - } - - public static boolean deep9022(boolean x) { - return deep9023(x); - } - - public static boolean deep9023(boolean x) { - return deep9024(x); - } - - public static boolean deep9024(boolean x) { - return deep9025(x); - } - - public static boolean deep9025(boolean x) { - return deep9026(x); - } - - public static boolean deep9026(boolean x) { - return deep9027(x); - } - - public static boolean deep9027(boolean x) { - return deep9028(x); - } - - public static boolean deep9028(boolean x) { - return deep9029(x); - } - - public static boolean deep9029(boolean x) { - return deep9030(x); - } - - public static boolean deep9030(boolean x) { - return deep9031(x); - } - - public static boolean deep9031(boolean x) { - return deep9032(x); - } - - public static boolean deep9032(boolean x) { - return deep9033(x); - } - - public static boolean deep9033(boolean x) { - return deep9034(x); - } - - public static boolean deep9034(boolean x) { - return deep9035(x); - } - - public static boolean deep9035(boolean x) { - return deep9036(x); - } - - public static boolean deep9036(boolean x) { - return deep9037(x); - } - - public static boolean deep9037(boolean x) { - return deep9038(x); - } - - public static boolean deep9038(boolean x) { - return deep9039(x); - } - - public static boolean deep9039(boolean x) { - return deep9040(x); - } - - public static boolean deep9040(boolean x) { - return deep9041(x); - } - - public static boolean deep9041(boolean x) { - return deep9042(x); - } - - public static boolean deep9042(boolean x) { - return deep9043(x); - } - - public static boolean deep9043(boolean x) { - return deep9044(x); - } - - public static boolean deep9044(boolean x) { - return deep9045(x); - } - - public static boolean deep9045(boolean x) { - return deep9046(x); - } - - public static boolean deep9046(boolean x) { - return deep9047(x); - } - - public static boolean deep9047(boolean x) { - return deep9048(x); - } - - public static boolean deep9048(boolean x) { - return deep9049(x); - } - - public static boolean deep9049(boolean x) { - return deep9050(x); - } - - public static boolean deep9050(boolean x) { - return deep9051(x); - } - - public static boolean deep9051(boolean x) { - return deep9052(x); - } - - public static boolean deep9052(boolean x) { - return deep9053(x); - } - - public static boolean deep9053(boolean x) { - return deep9054(x); - } - - public static boolean deep9054(boolean x) { - return deep9055(x); - } - - public static boolean deep9055(boolean x) { - return deep9056(x); - } - - public static boolean deep9056(boolean x) { - return deep9057(x); - } - - public static boolean deep9057(boolean x) { - return deep9058(x); - } - - public static boolean deep9058(boolean x) { - return deep9059(x); - } - - public static boolean deep9059(boolean x) { - return deep9060(x); - } - - public static boolean deep9060(boolean x) { - return deep9061(x); - } - - public static boolean deep9061(boolean x) { - return deep9062(x); - } - - public static boolean deep9062(boolean x) { - return deep9063(x); - } - - public static boolean deep9063(boolean x) { - return deep9064(x); - } - - public static boolean deep9064(boolean x) { - return deep9065(x); - } - - public static boolean deep9065(boolean x) { - return deep9066(x); - } - - public static boolean deep9066(boolean x) { - return deep9067(x); - } - - public static boolean deep9067(boolean x) { - return deep9068(x); - } - - public static boolean deep9068(boolean x) { - return deep9069(x); - } - - public static boolean deep9069(boolean x) { - return deep9070(x); - } - - public static boolean deep9070(boolean x) { - return deep9071(x); - } - - public static boolean deep9071(boolean x) { - return deep9072(x); - } - - public static boolean deep9072(boolean x) { - return deep9073(x); - } - - public static boolean deep9073(boolean x) { - return deep9074(x); - } - - public static boolean deep9074(boolean x) { - return deep9075(x); - } - - public static boolean deep9075(boolean x) { - return deep9076(x); - } - - public static boolean deep9076(boolean x) { - return deep9077(x); - } - - public static boolean deep9077(boolean x) { - return deep9078(x); - } - - public static boolean deep9078(boolean x) { - return deep9079(x); - } - - public static boolean deep9079(boolean x) { - return deep9080(x); - } - - public static boolean deep9080(boolean x) { - return deep9081(x); - } - - public static boolean deep9081(boolean x) { - return deep9082(x); - } - - public static boolean deep9082(boolean x) { - return deep9083(x); - } - - public static boolean deep9083(boolean x) { - return deep9084(x); - } - - public static boolean deep9084(boolean x) { - return deep9085(x); - } - - public static boolean deep9085(boolean x) { - return deep9086(x); - } - - public static boolean deep9086(boolean x) { - return deep9087(x); - } - - public static boolean deep9087(boolean x) { - return deep9088(x); - } - - public static boolean deep9088(boolean x) { - return deep9089(x); - } - - public static boolean deep9089(boolean x) { - return deep9090(x); - } - - public static boolean deep9090(boolean x) { - return deep9091(x); - } - - public static boolean deep9091(boolean x) { - return deep9092(x); - } - - public static boolean deep9092(boolean x) { - return deep9093(x); - } - - public static boolean deep9093(boolean x) { - return deep9094(x); - } - - public static boolean deep9094(boolean x) { - return deep9095(x); - } - - public static boolean deep9095(boolean x) { - return deep9096(x); - } - - public static boolean deep9096(boolean x) { - return deep9097(x); - } - - public static boolean deep9097(boolean x) { - return deep9098(x); - } - - public static boolean deep9098(boolean x) { - return deep9099(x); - } - - public static boolean deep9099(boolean x) { - return deep9100(x); - } - - public static boolean deep9100(boolean x) { - return deep9101(x); - } - - public static boolean deep9101(boolean x) { - return deep9102(x); - } - - public static boolean deep9102(boolean x) { - return deep9103(x); - } - - public static boolean deep9103(boolean x) { - return deep9104(x); - } - - public static boolean deep9104(boolean x) { - return deep9105(x); - } - - public static boolean deep9105(boolean x) { - return deep9106(x); - } - - public static boolean deep9106(boolean x) { - return deep9107(x); - } - - public static boolean deep9107(boolean x) { - return deep9108(x); - } - - public static boolean deep9108(boolean x) { - return deep9109(x); - } - - public static boolean deep9109(boolean x) { - return deep9110(x); - } - - public static boolean deep9110(boolean x) { - return deep9111(x); - } - - public static boolean deep9111(boolean x) { - return deep9112(x); - } - - public static boolean deep9112(boolean x) { - return deep9113(x); - } - - public static boolean deep9113(boolean x) { - return deep9114(x); - } - - public static boolean deep9114(boolean x) { - return deep9115(x); - } - - public static boolean deep9115(boolean x) { - return deep9116(x); - } - - public static boolean deep9116(boolean x) { - return deep9117(x); - } - - public static boolean deep9117(boolean x) { - return deep9118(x); - } - - public static boolean deep9118(boolean x) { - return deep9119(x); - } - - public static boolean deep9119(boolean x) { - return deep9120(x); - } - - public static boolean deep9120(boolean x) { - return deep9121(x); - } - - public static boolean deep9121(boolean x) { - return deep9122(x); - } - - public static boolean deep9122(boolean x) { - return deep9123(x); - } - - public static boolean deep9123(boolean x) { - return deep9124(x); - } - - public static boolean deep9124(boolean x) { - return deep9125(x); - } - - public static boolean deep9125(boolean x) { - return deep9126(x); - } - - public static boolean deep9126(boolean x) { - return deep9127(x); - } - - public static boolean deep9127(boolean x) { - return deep9128(x); - } - - public static boolean deep9128(boolean x) { - return deep9129(x); - } - - public static boolean deep9129(boolean x) { - return deep9130(x); - } - - public static boolean deep9130(boolean x) { - return deep9131(x); - } - - public static boolean deep9131(boolean x) { - return deep9132(x); - } - - public static boolean deep9132(boolean x) { - return deep9133(x); - } - - public static boolean deep9133(boolean x) { - return deep9134(x); - } - - public static boolean deep9134(boolean x) { - return deep9135(x); - } - - public static boolean deep9135(boolean x) { - return deep9136(x); - } - - public static boolean deep9136(boolean x) { - return deep9137(x); - } - - public static boolean deep9137(boolean x) { - return deep9138(x); - } - - public static boolean deep9138(boolean x) { - return deep9139(x); - } - - public static boolean deep9139(boolean x) { - return deep9140(x); - } - - public static boolean deep9140(boolean x) { - return deep9141(x); - } - - public static boolean deep9141(boolean x) { - return deep9142(x); - } - - public static boolean deep9142(boolean x) { - return deep9143(x); - } - - public static boolean deep9143(boolean x) { - return deep9144(x); - } - - public static boolean deep9144(boolean x) { - return deep9145(x); - } - - public static boolean deep9145(boolean x) { - return deep9146(x); - } - - public static boolean deep9146(boolean x) { - return deep9147(x); - } - - public static boolean deep9147(boolean x) { - return deep9148(x); - } - - public static boolean deep9148(boolean x) { - return deep9149(x); - } - - public static boolean deep9149(boolean x) { - return deep9150(x); - } - - public static boolean deep9150(boolean x) { - return deep9151(x); - } - - public static boolean deep9151(boolean x) { - return deep9152(x); - } - - public static boolean deep9152(boolean x) { - return deep9153(x); - } - - public static boolean deep9153(boolean x) { - return deep9154(x); - } - - public static boolean deep9154(boolean x) { - return deep9155(x); - } - - public static boolean deep9155(boolean x) { - return deep9156(x); - } - - public static boolean deep9156(boolean x) { - return deep9157(x); - } - - public static boolean deep9157(boolean x) { - return deep9158(x); - } - - public static boolean deep9158(boolean x) { - return deep9159(x); - } - - public static boolean deep9159(boolean x) { - return deep9160(x); - } - - public static boolean deep9160(boolean x) { - return deep9161(x); - } - - public static boolean deep9161(boolean x) { - return deep9162(x); - } - - public static boolean deep9162(boolean x) { - return deep9163(x); - } - - public static boolean deep9163(boolean x) { - return deep9164(x); - } - - public static boolean deep9164(boolean x) { - return deep9165(x); - } - - public static boolean deep9165(boolean x) { - return deep9166(x); - } - - public static boolean deep9166(boolean x) { - return deep9167(x); - } - - public static boolean deep9167(boolean x) { - return deep9168(x); - } - - public static boolean deep9168(boolean x) { - return deep9169(x); - } - - public static boolean deep9169(boolean x) { - return deep9170(x); - } - - public static boolean deep9170(boolean x) { - return deep9171(x); - } - - public static boolean deep9171(boolean x) { - return deep9172(x); - } - - public static boolean deep9172(boolean x) { - return deep9173(x); - } - - public static boolean deep9173(boolean x) { - return deep9174(x); - } - - public static boolean deep9174(boolean x) { - return deep9175(x); - } - - public static boolean deep9175(boolean x) { - return deep9176(x); - } - - public static boolean deep9176(boolean x) { - return deep9177(x); - } - - public static boolean deep9177(boolean x) { - return deep9178(x); - } - - public static boolean deep9178(boolean x) { - return deep9179(x); - } - - public static boolean deep9179(boolean x) { - return deep9180(x); - } - - public static boolean deep9180(boolean x) { - return deep9181(x); - } - - public static boolean deep9181(boolean x) { - return deep9182(x); - } - - public static boolean deep9182(boolean x) { - return deep9183(x); - } - - public static boolean deep9183(boolean x) { - return deep9184(x); - } - - public static boolean deep9184(boolean x) { - return deep9185(x); - } - - public static boolean deep9185(boolean x) { - return deep9186(x); - } - - public static boolean deep9186(boolean x) { - return deep9187(x); - } - - public static boolean deep9187(boolean x) { - return deep9188(x); - } - - public static boolean deep9188(boolean x) { - return deep9189(x); - } - - public static boolean deep9189(boolean x) { - return deep9190(x); - } - - public static boolean deep9190(boolean x) { - return deep9191(x); - } - - public static boolean deep9191(boolean x) { - return deep9192(x); - } - - public static boolean deep9192(boolean x) { - return deep9193(x); - } - - public static boolean deep9193(boolean x) { - return deep9194(x); - } - - public static boolean deep9194(boolean x) { - return deep9195(x); - } - - public static boolean deep9195(boolean x) { - return deep9196(x); - } - - public static boolean deep9196(boolean x) { - return deep9197(x); - } - - public static boolean deep9197(boolean x) { - return deep9198(x); - } - - public static boolean deep9198(boolean x) { - return deep9199(x); - } - - public static boolean deep9199(boolean x) { - return deep9200(x); - } - - public static boolean deep9200(boolean x) { - return deep9201(x); - } - - public static boolean deep9201(boolean x) { - return deep9202(x); - } - - public static boolean deep9202(boolean x) { - return deep9203(x); - } - - public static boolean deep9203(boolean x) { - return deep9204(x); - } - - public static boolean deep9204(boolean x) { - return deep9205(x); - } - - public static boolean deep9205(boolean x) { - return deep9206(x); - } - - public static boolean deep9206(boolean x) { - return deep9207(x); - } - - public static boolean deep9207(boolean x) { - return deep9208(x); - } - - public static boolean deep9208(boolean x) { - return deep9209(x); - } - - public static boolean deep9209(boolean x) { - return deep9210(x); - } - - public static boolean deep9210(boolean x) { - return deep9211(x); - } - - public static boolean deep9211(boolean x) { - return deep9212(x); - } - - public static boolean deep9212(boolean x) { - return deep9213(x); - } - - public static boolean deep9213(boolean x) { - return deep9214(x); - } - - public static boolean deep9214(boolean x) { - return deep9215(x); - } - - public static boolean deep9215(boolean x) { - return deep9216(x); - } - - public static boolean deep9216(boolean x) { - return deep9217(x); - } - - public static boolean deep9217(boolean x) { - return deep9218(x); - } - - public static boolean deep9218(boolean x) { - return deep9219(x); - } - - public static boolean deep9219(boolean x) { - return deep9220(x); - } - - public static boolean deep9220(boolean x) { - return deep9221(x); - } - - public static boolean deep9221(boolean x) { - return deep9222(x); - } - - public static boolean deep9222(boolean x) { - return deep9223(x); - } - - public static boolean deep9223(boolean x) { - return deep9224(x); - } - - public static boolean deep9224(boolean x) { - return deep9225(x); - } - - public static boolean deep9225(boolean x) { - return deep9226(x); - } - - public static boolean deep9226(boolean x) { - return deep9227(x); - } - - public static boolean deep9227(boolean x) { - return deep9228(x); - } - - public static boolean deep9228(boolean x) { - return deep9229(x); - } - - public static boolean deep9229(boolean x) { - return deep9230(x); - } - - public static boolean deep9230(boolean x) { - return deep9231(x); - } - - public static boolean deep9231(boolean x) { - return deep9232(x); - } - - public static boolean deep9232(boolean x) { - return deep9233(x); - } - - public static boolean deep9233(boolean x) { - return deep9234(x); - } - - public static boolean deep9234(boolean x) { - return deep9235(x); - } - - public static boolean deep9235(boolean x) { - return deep9236(x); - } - - public static boolean deep9236(boolean x) { - return deep9237(x); - } - - public static boolean deep9237(boolean x) { - return deep9238(x); - } - - public static boolean deep9238(boolean x) { - return deep9239(x); - } - - public static boolean deep9239(boolean x) { - return deep9240(x); - } - - public static boolean deep9240(boolean x) { - return deep9241(x); - } - - public static boolean deep9241(boolean x) { - return deep9242(x); - } - - public static boolean deep9242(boolean x) { - return deep9243(x); - } - - public static boolean deep9243(boolean x) { - return deep9244(x); - } - - public static boolean deep9244(boolean x) { - return deep9245(x); - } - - public static boolean deep9245(boolean x) { - return deep9246(x); - } - - public static boolean deep9246(boolean x) { - return deep9247(x); - } - - public static boolean deep9247(boolean x) { - return deep9248(x); - } - - public static boolean deep9248(boolean x) { - return deep9249(x); - } - - public static boolean deep9249(boolean x) { - return deep9250(x); - } - - public static boolean deep9250(boolean x) { - return deep9251(x); - } - - public static boolean deep9251(boolean x) { - return deep9252(x); - } - - public static boolean deep9252(boolean x) { - return deep9253(x); - } - - public static boolean deep9253(boolean x) { - return deep9254(x); - } - - public static boolean deep9254(boolean x) { - return deep9255(x); - } - - public static boolean deep9255(boolean x) { - return deep9256(x); - } - - public static boolean deep9256(boolean x) { - return deep9257(x); - } - - public static boolean deep9257(boolean x) { - return deep9258(x); - } - - public static boolean deep9258(boolean x) { - return deep9259(x); - } - - public static boolean deep9259(boolean x) { - return deep9260(x); - } - - public static boolean deep9260(boolean x) { - return deep9261(x); - } - - public static boolean deep9261(boolean x) { - return deep9262(x); - } - - public static boolean deep9262(boolean x) { - return deep9263(x); - } - - public static boolean deep9263(boolean x) { - return deep9264(x); - } - - public static boolean deep9264(boolean x) { - return deep9265(x); - } - - public static boolean deep9265(boolean x) { - return deep9266(x); - } - - public static boolean deep9266(boolean x) { - return deep9267(x); - } - - public static boolean deep9267(boolean x) { - return deep9268(x); - } - - public static boolean deep9268(boolean x) { - return deep9269(x); - } - - public static boolean deep9269(boolean x) { - return deep9270(x); - } - - public static boolean deep9270(boolean x) { - return deep9271(x); - } - - public static boolean deep9271(boolean x) { - return deep9272(x); - } - - public static boolean deep9272(boolean x) { - return deep9273(x); - } - - public static boolean deep9273(boolean x) { - return deep9274(x); - } - - public static boolean deep9274(boolean x) { - return deep9275(x); - } - - public static boolean deep9275(boolean x) { - return deep9276(x); - } - - public static boolean deep9276(boolean x) { - return deep9277(x); - } - - public static boolean deep9277(boolean x) { - return deep9278(x); - } - - public static boolean deep9278(boolean x) { - return deep9279(x); - } - - public static boolean deep9279(boolean x) { - return deep9280(x); - } - - public static boolean deep9280(boolean x) { - return deep9281(x); - } - - public static boolean deep9281(boolean x) { - return deep9282(x); - } - - public static boolean deep9282(boolean x) { - return deep9283(x); - } - - public static boolean deep9283(boolean x) { - return deep9284(x); - } - - public static boolean deep9284(boolean x) { - return deep9285(x); - } - - public static boolean deep9285(boolean x) { - return deep9286(x); - } - - public static boolean deep9286(boolean x) { - return deep9287(x); - } - - public static boolean deep9287(boolean x) { - return deep9288(x); - } - - public static boolean deep9288(boolean x) { - return deep9289(x); - } - - public static boolean deep9289(boolean x) { - return deep9290(x); - } - - public static boolean deep9290(boolean x) { - return deep9291(x); - } - - public static boolean deep9291(boolean x) { - return deep9292(x); - } - - public static boolean deep9292(boolean x) { - return deep9293(x); - } - - public static boolean deep9293(boolean x) { - return deep9294(x); - } - - public static boolean deep9294(boolean x) { - return deep9295(x); - } - - public static boolean deep9295(boolean x) { - return deep9296(x); - } - - public static boolean deep9296(boolean x) { - return deep9297(x); - } - - public static boolean deep9297(boolean x) { - return deep9298(x); - } - - public static boolean deep9298(boolean x) { - return deep9299(x); - } - - public static boolean deep9299(boolean x) { - return deep9300(x); - } - - public static boolean deep9300(boolean x) { - return deep9301(x); - } - - public static boolean deep9301(boolean x) { - return deep9302(x); - } - - public static boolean deep9302(boolean x) { - return deep9303(x); - } - - public static boolean deep9303(boolean x) { - return deep9304(x); - } - - public static boolean deep9304(boolean x) { - return deep9305(x); - } - - public static boolean deep9305(boolean x) { - return deep9306(x); - } - - public static boolean deep9306(boolean x) { - return deep9307(x); - } - - public static boolean deep9307(boolean x) { - return deep9308(x); - } - - public static boolean deep9308(boolean x) { - return deep9309(x); - } - - public static boolean deep9309(boolean x) { - return deep9310(x); - } - - public static boolean deep9310(boolean x) { - return deep9311(x); - } - - public static boolean deep9311(boolean x) { - return deep9312(x); - } - - public static boolean deep9312(boolean x) { - return deep9313(x); - } - - public static boolean deep9313(boolean x) { - return deep9314(x); - } - - public static boolean deep9314(boolean x) { - return deep9315(x); - } - - public static boolean deep9315(boolean x) { - return deep9316(x); - } - - public static boolean deep9316(boolean x) { - return deep9317(x); - } - - public static boolean deep9317(boolean x) { - return deep9318(x); - } - - public static boolean deep9318(boolean x) { - return deep9319(x); - } - - public static boolean deep9319(boolean x) { - return deep9320(x); - } - - public static boolean deep9320(boolean x) { - return deep9321(x); - } - - public static boolean deep9321(boolean x) { - return deep9322(x); - } - - public static boolean deep9322(boolean x) { - return deep9323(x); - } - - public static boolean deep9323(boolean x) { - return deep9324(x); - } - - public static boolean deep9324(boolean x) { - return deep9325(x); - } - - public static boolean deep9325(boolean x) { - return deep9326(x); - } - - public static boolean deep9326(boolean x) { - return deep9327(x); - } - - public static boolean deep9327(boolean x) { - return deep9328(x); - } - - public static boolean deep9328(boolean x) { - return deep9329(x); - } - - public static boolean deep9329(boolean x) { - return deep9330(x); - } - - public static boolean deep9330(boolean x) { - return deep9331(x); - } - - public static boolean deep9331(boolean x) { - return deep9332(x); - } - - public static boolean deep9332(boolean x) { - return deep9333(x); - } - - public static boolean deep9333(boolean x) { - return deep9334(x); - } - - public static boolean deep9334(boolean x) { - return deep9335(x); - } - - public static boolean deep9335(boolean x) { - return deep9336(x); - } - - public static boolean deep9336(boolean x) { - return deep9337(x); - } - - public static boolean deep9337(boolean x) { - return deep9338(x); - } - - public static boolean deep9338(boolean x) { - return deep9339(x); - } - - public static boolean deep9339(boolean x) { - return deep9340(x); - } - - public static boolean deep9340(boolean x) { - return deep9341(x); - } - - public static boolean deep9341(boolean x) { - return deep9342(x); - } - - public static boolean deep9342(boolean x) { - return deep9343(x); - } - - public static boolean deep9343(boolean x) { - return deep9344(x); - } - - public static boolean deep9344(boolean x) { - return deep9345(x); - } - - public static boolean deep9345(boolean x) { - return deep9346(x); - } - - public static boolean deep9346(boolean x) { - return deep9347(x); - } - - public static boolean deep9347(boolean x) { - return deep9348(x); - } - - public static boolean deep9348(boolean x) { - return deep9349(x); - } - - public static boolean deep9349(boolean x) { - return deep9350(x); - } - - public static boolean deep9350(boolean x) { - return deep9351(x); - } - - public static boolean deep9351(boolean x) { - return deep9352(x); - } - - public static boolean deep9352(boolean x) { - return deep9353(x); - } - - public static boolean deep9353(boolean x) { - return deep9354(x); - } - - public static boolean deep9354(boolean x) { - return deep9355(x); - } - - public static boolean deep9355(boolean x) { - return deep9356(x); - } - - public static boolean deep9356(boolean x) { - return deep9357(x); - } - - public static boolean deep9357(boolean x) { - return deep9358(x); - } - - public static boolean deep9358(boolean x) { - return deep9359(x); - } - - public static boolean deep9359(boolean x) { - return deep9360(x); - } - - public static boolean deep9360(boolean x) { - return deep9361(x); - } - - public static boolean deep9361(boolean x) { - return deep9362(x); - } - - public static boolean deep9362(boolean x) { - return deep9363(x); - } - - public static boolean deep9363(boolean x) { - return deep9364(x); - } - - public static boolean deep9364(boolean x) { - return deep9365(x); - } - - public static boolean deep9365(boolean x) { - return deep9366(x); - } - - public static boolean deep9366(boolean x) { - return deep9367(x); - } - - public static boolean deep9367(boolean x) { - return deep9368(x); - } - - public static boolean deep9368(boolean x) { - return deep9369(x); - } - - public static boolean deep9369(boolean x) { - return deep9370(x); - } - - public static boolean deep9370(boolean x) { - return deep9371(x); - } - - public static boolean deep9371(boolean x) { - return deep9372(x); - } - - public static boolean deep9372(boolean x) { - return deep9373(x); - } - - public static boolean deep9373(boolean x) { - return deep9374(x); - } - - public static boolean deep9374(boolean x) { - return deep9375(x); - } - - public static boolean deep9375(boolean x) { - return deep9376(x); - } - - public static boolean deep9376(boolean x) { - return deep9377(x); - } - - public static boolean deep9377(boolean x) { - return deep9378(x); - } - - public static boolean deep9378(boolean x) { - return deep9379(x); - } - - public static boolean deep9379(boolean x) { - return deep9380(x); - } - - public static boolean deep9380(boolean x) { - return deep9381(x); - } - - public static boolean deep9381(boolean x) { - return deep9382(x); - } - - public static boolean deep9382(boolean x) { - return deep9383(x); - } - - public static boolean deep9383(boolean x) { - return deep9384(x); - } - - public static boolean deep9384(boolean x) { - return deep9385(x); - } - - public static boolean deep9385(boolean x) { - return deep9386(x); - } - - public static boolean deep9386(boolean x) { - return deep9387(x); - } - - public static boolean deep9387(boolean x) { - return deep9388(x); - } - - public static boolean deep9388(boolean x) { - return deep9389(x); - } - - public static boolean deep9389(boolean x) { - return deep9390(x); - } - - public static boolean deep9390(boolean x) { - return deep9391(x); - } - - public static boolean deep9391(boolean x) { - return deep9392(x); - } - - public static boolean deep9392(boolean x) { - return deep9393(x); - } - - public static boolean deep9393(boolean x) { - return deep9394(x); - } - - public static boolean deep9394(boolean x) { - return deep9395(x); - } - - public static boolean deep9395(boolean x) { - return deep9396(x); - } - - public static boolean deep9396(boolean x) { - return deep9397(x); - } - - public static boolean deep9397(boolean x) { - return deep9398(x); - } - - public static boolean deep9398(boolean x) { - return deep9399(x); - } - - public static boolean deep9399(boolean x) { - return deep9400(x); - } - - public static boolean deep9400(boolean x) { - return deep9401(x); - } - - public static boolean deep9401(boolean x) { - return deep9402(x); - } - - public static boolean deep9402(boolean x) { - return deep9403(x); - } - - public static boolean deep9403(boolean x) { - return deep9404(x); - } - - public static boolean deep9404(boolean x) { - return deep9405(x); - } - - public static boolean deep9405(boolean x) { - return deep9406(x); - } - - public static boolean deep9406(boolean x) { - return deep9407(x); - } - - public static boolean deep9407(boolean x) { - return deep9408(x); - } - - public static boolean deep9408(boolean x) { - return deep9409(x); - } - - public static boolean deep9409(boolean x) { - return deep9410(x); - } - - public static boolean deep9410(boolean x) { - return deep9411(x); - } - - public static boolean deep9411(boolean x) { - return deep9412(x); - } - - public static boolean deep9412(boolean x) { - return deep9413(x); - } - - public static boolean deep9413(boolean x) { - return deep9414(x); - } - - public static boolean deep9414(boolean x) { - return deep9415(x); - } - - public static boolean deep9415(boolean x) { - return deep9416(x); - } - - public static boolean deep9416(boolean x) { - return deep9417(x); - } - - public static boolean deep9417(boolean x) { - return deep9418(x); - } - - public static boolean deep9418(boolean x) { - return deep9419(x); - } - - public static boolean deep9419(boolean x) { - return deep9420(x); - } - - public static boolean deep9420(boolean x) { - return deep9421(x); - } - - public static boolean deep9421(boolean x) { - return deep9422(x); - } - - public static boolean deep9422(boolean x) { - return deep9423(x); - } - - public static boolean deep9423(boolean x) { - return deep9424(x); - } - - public static boolean deep9424(boolean x) { - return deep9425(x); - } - - public static boolean deep9425(boolean x) { - return deep9426(x); - } - - public static boolean deep9426(boolean x) { - return deep9427(x); - } - - public static boolean deep9427(boolean x) { - return deep9428(x); - } - - public static boolean deep9428(boolean x) { - return deep9429(x); - } - - public static boolean deep9429(boolean x) { - return deep9430(x); - } - - public static boolean deep9430(boolean x) { - return deep9431(x); - } - - public static boolean deep9431(boolean x) { - return deep9432(x); - } - - public static boolean deep9432(boolean x) { - return deep9433(x); - } - - public static boolean deep9433(boolean x) { - return deep9434(x); - } - - public static boolean deep9434(boolean x) { - return deep9435(x); - } - - public static boolean deep9435(boolean x) { - return deep9436(x); - } - - public static boolean deep9436(boolean x) { - return deep9437(x); - } - - public static boolean deep9437(boolean x) { - return deep9438(x); - } - - public static boolean deep9438(boolean x) { - return deep9439(x); - } - - public static boolean deep9439(boolean x) { - return deep9440(x); - } - - public static boolean deep9440(boolean x) { - return deep9441(x); - } - - public static boolean deep9441(boolean x) { - return deep9442(x); - } - - public static boolean deep9442(boolean x) { - return deep9443(x); - } - - public static boolean deep9443(boolean x) { - return deep9444(x); - } - - public static boolean deep9444(boolean x) { - return deep9445(x); - } - - public static boolean deep9445(boolean x) { - return deep9446(x); - } - - public static boolean deep9446(boolean x) { - return deep9447(x); - } - - public static boolean deep9447(boolean x) { - return deep9448(x); - } - - public static boolean deep9448(boolean x) { - return deep9449(x); - } - - public static boolean deep9449(boolean x) { - return deep9450(x); - } - - public static boolean deep9450(boolean x) { - return deep9451(x); - } - - public static boolean deep9451(boolean x) { - return deep9452(x); - } - - public static boolean deep9452(boolean x) { - return deep9453(x); - } - - public static boolean deep9453(boolean x) { - return deep9454(x); - } - - public static boolean deep9454(boolean x) { - return deep9455(x); - } - - public static boolean deep9455(boolean x) { - return deep9456(x); - } - - public static boolean deep9456(boolean x) { - return deep9457(x); - } - - public static boolean deep9457(boolean x) { - return deep9458(x); - } - - public static boolean deep9458(boolean x) { - return deep9459(x); - } - - public static boolean deep9459(boolean x) { - return deep9460(x); - } - - public static boolean deep9460(boolean x) { - return deep9461(x); - } - - public static boolean deep9461(boolean x) { - return deep9462(x); - } - - public static boolean deep9462(boolean x) { - return deep9463(x); - } - - public static boolean deep9463(boolean x) { - return deep9464(x); - } - - public static boolean deep9464(boolean x) { - return deep9465(x); - } - - public static boolean deep9465(boolean x) { - return deep9466(x); - } - - public static boolean deep9466(boolean x) { - return deep9467(x); - } - - public static boolean deep9467(boolean x) { - return deep9468(x); - } - - public static boolean deep9468(boolean x) { - return deep9469(x); - } - - public static boolean deep9469(boolean x) { - return deep9470(x); - } - - public static boolean deep9470(boolean x) { - return deep9471(x); - } - - public static boolean deep9471(boolean x) { - return deep9472(x); - } - - public static boolean deep9472(boolean x) { - return deep9473(x); - } - - public static boolean deep9473(boolean x) { - return deep9474(x); - } - - public static boolean deep9474(boolean x) { - return deep9475(x); - } - - public static boolean deep9475(boolean x) { - return deep9476(x); - } - - public static boolean deep9476(boolean x) { - return deep9477(x); - } - - public static boolean deep9477(boolean x) { - return deep9478(x); - } - - public static boolean deep9478(boolean x) { - return deep9479(x); - } - - public static boolean deep9479(boolean x) { - return deep9480(x); - } - - public static boolean deep9480(boolean x) { - return deep9481(x); - } - - public static boolean deep9481(boolean x) { - return deep9482(x); - } - - public static boolean deep9482(boolean x) { - return deep9483(x); - } - - public static boolean deep9483(boolean x) { - return deep9484(x); - } - - public static boolean deep9484(boolean x) { - return deep9485(x); - } - - public static boolean deep9485(boolean x) { - return deep9486(x); - } - - public static boolean deep9486(boolean x) { - return deep9487(x); - } - - public static boolean deep9487(boolean x) { - return deep9488(x); - } - - public static boolean deep9488(boolean x) { - return deep9489(x); - } - - public static boolean deep9489(boolean x) { - return deep9490(x); - } - - public static boolean deep9490(boolean x) { - return deep9491(x); - } - - public static boolean deep9491(boolean x) { - return deep9492(x); - } - - public static boolean deep9492(boolean x) { - return deep9493(x); - } - - public static boolean deep9493(boolean x) { - return deep9494(x); - } - - public static boolean deep9494(boolean x) { - return deep9495(x); - } - - public static boolean deep9495(boolean x) { - return deep9496(x); - } - - public static boolean deep9496(boolean x) { - return deep9497(x); - } - - public static boolean deep9497(boolean x) { - return deep9498(x); - } - - public static boolean deep9498(boolean x) { - return deep9499(x); - } - - public static boolean deep9499(boolean x) { - return deep9500(x); - } - - public static boolean deep9500(boolean x) { - return deep9501(x); - } - - public static boolean deep9501(boolean x) { - return deep9502(x); - } - - public static boolean deep9502(boolean x) { - return deep9503(x); - } - - public static boolean deep9503(boolean x) { - return deep9504(x); - } - - public static boolean deep9504(boolean x) { - return deep9505(x); - } - - public static boolean deep9505(boolean x) { - return deep9506(x); - } - - public static boolean deep9506(boolean x) { - return deep9507(x); - } - - public static boolean deep9507(boolean x) { - return deep9508(x); - } - - public static boolean deep9508(boolean x) { - return deep9509(x); - } - - public static boolean deep9509(boolean x) { - return deep9510(x); - } - - public static boolean deep9510(boolean x) { - return deep9511(x); - } - - public static boolean deep9511(boolean x) { - return deep9512(x); - } - - public static boolean deep9512(boolean x) { - return deep9513(x); - } - - public static boolean deep9513(boolean x) { - return deep9514(x); - } - - public static boolean deep9514(boolean x) { - return deep9515(x); - } - - public static boolean deep9515(boolean x) { - return deep9516(x); - } - - public static boolean deep9516(boolean x) { - return deep9517(x); - } - - public static boolean deep9517(boolean x) { - return deep9518(x); - } - - public static boolean deep9518(boolean x) { - return deep9519(x); - } - - public static boolean deep9519(boolean x) { - return deep9520(x); - } - - public static boolean deep9520(boolean x) { - return deep9521(x); - } - - public static boolean deep9521(boolean x) { - return deep9522(x); - } - - public static boolean deep9522(boolean x) { - return deep9523(x); - } - - public static boolean deep9523(boolean x) { - return deep9524(x); - } - - public static boolean deep9524(boolean x) { - return deep9525(x); - } - - public static boolean deep9525(boolean x) { - return deep9526(x); - } - - public static boolean deep9526(boolean x) { - return deep9527(x); - } - - public static boolean deep9527(boolean x) { - return deep9528(x); - } - - public static boolean deep9528(boolean x) { - return deep9529(x); - } - - public static boolean deep9529(boolean x) { - return deep9530(x); - } - - public static boolean deep9530(boolean x) { - return deep9531(x); - } - - public static boolean deep9531(boolean x) { - return deep9532(x); - } - - public static boolean deep9532(boolean x) { - return deep9533(x); - } - - public static boolean deep9533(boolean x) { - return deep9534(x); - } - - public static boolean deep9534(boolean x) { - return deep9535(x); - } - - public static boolean deep9535(boolean x) { - return deep9536(x); - } - - public static boolean deep9536(boolean x) { - return deep9537(x); - } - - public static boolean deep9537(boolean x) { - return deep9538(x); - } - - public static boolean deep9538(boolean x) { - return deep9539(x); - } - - public static boolean deep9539(boolean x) { - return deep9540(x); - } - - public static boolean deep9540(boolean x) { - return deep9541(x); - } - - public static boolean deep9541(boolean x) { - return deep9542(x); - } - - public static boolean deep9542(boolean x) { - return deep9543(x); - } - - public static boolean deep9543(boolean x) { - return deep9544(x); - } - - public static boolean deep9544(boolean x) { - return deep9545(x); - } - - public static boolean deep9545(boolean x) { - return deep9546(x); - } - - public static boolean deep9546(boolean x) { - return deep9547(x); - } - - public static boolean deep9547(boolean x) { - return deep9548(x); - } - - public static boolean deep9548(boolean x) { - return deep9549(x); - } - - public static boolean deep9549(boolean x) { - return deep9550(x); - } - - public static boolean deep9550(boolean x) { - return deep9551(x); - } - - public static boolean deep9551(boolean x) { - return deep9552(x); - } - - public static boolean deep9552(boolean x) { - return deep9553(x); - } - - public static boolean deep9553(boolean x) { - return deep9554(x); - } - - public static boolean deep9554(boolean x) { - return deep9555(x); - } - - public static boolean deep9555(boolean x) { - return deep9556(x); - } - - public static boolean deep9556(boolean x) { - return deep9557(x); - } - - public static boolean deep9557(boolean x) { - return deep9558(x); - } - - public static boolean deep9558(boolean x) { - return deep9559(x); - } - - public static boolean deep9559(boolean x) { - return deep9560(x); - } - - public static boolean deep9560(boolean x) { - return deep9561(x); - } - - public static boolean deep9561(boolean x) { - return deep9562(x); - } - - public static boolean deep9562(boolean x) { - return deep9563(x); - } - - public static boolean deep9563(boolean x) { - return deep9564(x); - } - - public static boolean deep9564(boolean x) { - return deep9565(x); - } - - public static boolean deep9565(boolean x) { - return deep9566(x); - } - - public static boolean deep9566(boolean x) { - return deep9567(x); - } - - public static boolean deep9567(boolean x) { - return deep9568(x); - } - - public static boolean deep9568(boolean x) { - return deep9569(x); - } - - public static boolean deep9569(boolean x) { - return deep9570(x); - } - - public static boolean deep9570(boolean x) { - return deep9571(x); - } - - public static boolean deep9571(boolean x) { - return deep9572(x); - } - - public static boolean deep9572(boolean x) { - return deep9573(x); - } - - public static boolean deep9573(boolean x) { - return deep9574(x); - } - - public static boolean deep9574(boolean x) { - return deep9575(x); - } - - public static boolean deep9575(boolean x) { - return deep9576(x); - } - - public static boolean deep9576(boolean x) { - return deep9577(x); - } - - public static boolean deep9577(boolean x) { - return deep9578(x); - } - - public static boolean deep9578(boolean x) { - return deep9579(x); - } - - public static boolean deep9579(boolean x) { - return deep9580(x); - } - - public static boolean deep9580(boolean x) { - return deep9581(x); - } - - public static boolean deep9581(boolean x) { - return deep9582(x); - } - - public static boolean deep9582(boolean x) { - return deep9583(x); - } - - public static boolean deep9583(boolean x) { - return deep9584(x); - } - - public static boolean deep9584(boolean x) { - return deep9585(x); - } - - public static boolean deep9585(boolean x) { - return deep9586(x); - } - - public static boolean deep9586(boolean x) { - return deep9587(x); - } - - public static boolean deep9587(boolean x) { - return deep9588(x); - } - - public static boolean deep9588(boolean x) { - return deep9589(x); - } - - public static boolean deep9589(boolean x) { - return deep9590(x); - } - - public static boolean deep9590(boolean x) { - return deep9591(x); - } - - public static boolean deep9591(boolean x) { - return deep9592(x); - } - - public static boolean deep9592(boolean x) { - return deep9593(x); - } - - public static boolean deep9593(boolean x) { - return deep9594(x); - } - - public static boolean deep9594(boolean x) { - return deep9595(x); - } - - public static boolean deep9595(boolean x) { - return deep9596(x); - } - - public static boolean deep9596(boolean x) { - return deep9597(x); - } - - public static boolean deep9597(boolean x) { - return deep9598(x); - } - - public static boolean deep9598(boolean x) { - return deep9599(x); - } - - public static boolean deep9599(boolean x) { - return deep9600(x); - } - - public static boolean deep9600(boolean x) { - return deep9601(x); - } - - public static boolean deep9601(boolean x) { - return deep9602(x); - } - - public static boolean deep9602(boolean x) { - return deep9603(x); - } - - public static boolean deep9603(boolean x) { - return deep9604(x); - } - - public static boolean deep9604(boolean x) { - return deep9605(x); - } - - public static boolean deep9605(boolean x) { - return deep9606(x); - } - - public static boolean deep9606(boolean x) { - return deep9607(x); - } - - public static boolean deep9607(boolean x) { - return deep9608(x); - } - - public static boolean deep9608(boolean x) { - return deep9609(x); - } - - public static boolean deep9609(boolean x) { - return deep9610(x); - } - - public static boolean deep9610(boolean x) { - return deep9611(x); - } - - public static boolean deep9611(boolean x) { - return deep9612(x); - } - - public static boolean deep9612(boolean x) { - return deep9613(x); - } - - public static boolean deep9613(boolean x) { - return deep9614(x); - } - - public static boolean deep9614(boolean x) { - return deep9615(x); - } - - public static boolean deep9615(boolean x) { - return deep9616(x); - } - - public static boolean deep9616(boolean x) { - return deep9617(x); - } - - public static boolean deep9617(boolean x) { - return deep9618(x); - } - - public static boolean deep9618(boolean x) { - return deep9619(x); - } - - public static boolean deep9619(boolean x) { - return deep9620(x); - } - - public static boolean deep9620(boolean x) { - return deep9621(x); - } - - public static boolean deep9621(boolean x) { - return deep9622(x); - } - - public static boolean deep9622(boolean x) { - return deep9623(x); - } - - public static boolean deep9623(boolean x) { - return deep9624(x); - } - - public static boolean deep9624(boolean x) { - return deep9625(x); - } - - public static boolean deep9625(boolean x) { - return deep9626(x); - } - - public static boolean deep9626(boolean x) { - return deep9627(x); - } - - public static boolean deep9627(boolean x) { - return deep9628(x); - } - - public static boolean deep9628(boolean x) { - return deep9629(x); - } - - public static boolean deep9629(boolean x) { - return deep9630(x); - } - - public static boolean deep9630(boolean x) { - return deep9631(x); - } - - public static boolean deep9631(boolean x) { - return deep9632(x); - } - - public static boolean deep9632(boolean x) { - return deep9633(x); - } - - public static boolean deep9633(boolean x) { - return deep9634(x); - } - - public static boolean deep9634(boolean x) { - return deep9635(x); - } - - public static boolean deep9635(boolean x) { - return deep9636(x); - } - - public static boolean deep9636(boolean x) { - return deep9637(x); - } - - public static boolean deep9637(boolean x) { - return deep9638(x); - } - - public static boolean deep9638(boolean x) { - return deep9639(x); - } - - public static boolean deep9639(boolean x) { - return deep9640(x); - } - - public static boolean deep9640(boolean x) { - return deep9641(x); - } - - public static boolean deep9641(boolean x) { - return deep9642(x); - } - - public static boolean deep9642(boolean x) { - return deep9643(x); - } - - public static boolean deep9643(boolean x) { - return deep9644(x); - } - - public static boolean deep9644(boolean x) { - return deep9645(x); - } - - public static boolean deep9645(boolean x) { - return deep9646(x); - } - - public static boolean deep9646(boolean x) { - return deep9647(x); - } - - public static boolean deep9647(boolean x) { - return deep9648(x); - } - - public static boolean deep9648(boolean x) { - return deep9649(x); - } - - public static boolean deep9649(boolean x) { - return deep9650(x); - } - - public static boolean deep9650(boolean x) { - return deep9651(x); - } - - public static boolean deep9651(boolean x) { - return deep9652(x); - } - - public static boolean deep9652(boolean x) { - return deep9653(x); - } - - public static boolean deep9653(boolean x) { - return deep9654(x); - } - - public static boolean deep9654(boolean x) { - return deep9655(x); - } - - public static boolean deep9655(boolean x) { - return deep9656(x); - } - - public static boolean deep9656(boolean x) { - return deep9657(x); - } - - public static boolean deep9657(boolean x) { - return deep9658(x); - } - - public static boolean deep9658(boolean x) { - return deep9659(x); - } - - public static boolean deep9659(boolean x) { - return deep9660(x); - } - - public static boolean deep9660(boolean x) { - return deep9661(x); - } - - public static boolean deep9661(boolean x) { - return deep9662(x); - } - - public static boolean deep9662(boolean x) { - return deep9663(x); - } - - public static boolean deep9663(boolean x) { - return deep9664(x); - } - - public static boolean deep9664(boolean x) { - return deep9665(x); - } - - public static boolean deep9665(boolean x) { - return deep9666(x); - } - - public static boolean deep9666(boolean x) { - return deep9667(x); - } - - public static boolean deep9667(boolean x) { - return deep9668(x); - } - - public static boolean deep9668(boolean x) { - return deep9669(x); - } - - public static boolean deep9669(boolean x) { - return deep9670(x); - } - - public static boolean deep9670(boolean x) { - return deep9671(x); - } - - public static boolean deep9671(boolean x) { - return deep9672(x); - } - - public static boolean deep9672(boolean x) { - return deep9673(x); - } - - public static boolean deep9673(boolean x) { - return deep9674(x); - } - - public static boolean deep9674(boolean x) { - return deep9675(x); - } - - public static boolean deep9675(boolean x) { - return deep9676(x); - } - - public static boolean deep9676(boolean x) { - return deep9677(x); - } - - public static boolean deep9677(boolean x) { - return deep9678(x); - } - - public static boolean deep9678(boolean x) { - return deep9679(x); - } - - public static boolean deep9679(boolean x) { - return deep9680(x); - } - - public static boolean deep9680(boolean x) { - return deep9681(x); - } - - public static boolean deep9681(boolean x) { - return deep9682(x); - } - - public static boolean deep9682(boolean x) { - return deep9683(x); - } - - public static boolean deep9683(boolean x) { - return deep9684(x); - } - - public static boolean deep9684(boolean x) { - return deep9685(x); - } - - public static boolean deep9685(boolean x) { - return deep9686(x); - } - - public static boolean deep9686(boolean x) { - return deep9687(x); - } - - public static boolean deep9687(boolean x) { - return deep9688(x); - } - - public static boolean deep9688(boolean x) { - return deep9689(x); - } - - public static boolean deep9689(boolean x) { - return deep9690(x); - } - - public static boolean deep9690(boolean x) { - return deep9691(x); - } - - public static boolean deep9691(boolean x) { - return deep9692(x); - } - - public static boolean deep9692(boolean x) { - return deep9693(x); - } - - public static boolean deep9693(boolean x) { - return deep9694(x); - } - - public static boolean deep9694(boolean x) { - return deep9695(x); - } - - public static boolean deep9695(boolean x) { - return deep9696(x); - } - - public static boolean deep9696(boolean x) { - return deep9697(x); - } - - public static boolean deep9697(boolean x) { - return deep9698(x); - } - - public static boolean deep9698(boolean x) { - return deep9699(x); - } - - public static boolean deep9699(boolean x) { - return deep9700(x); - } - - public static boolean deep9700(boolean x) { - return deep9701(x); - } - - public static boolean deep9701(boolean x) { - return deep9702(x); - } - - public static boolean deep9702(boolean x) { - return deep9703(x); - } - - public static boolean deep9703(boolean x) { - return deep9704(x); - } - - public static boolean deep9704(boolean x) { - return deep9705(x); - } - - public static boolean deep9705(boolean x) { - return deep9706(x); - } - - public static boolean deep9706(boolean x) { - return deep9707(x); - } - - public static boolean deep9707(boolean x) { - return deep9708(x); - } - - public static boolean deep9708(boolean x) { - return deep9709(x); - } - - public static boolean deep9709(boolean x) { - return deep9710(x); - } - - public static boolean deep9710(boolean x) { - return deep9711(x); - } - - public static boolean deep9711(boolean x) { - return deep9712(x); - } - - public static boolean deep9712(boolean x) { - return deep9713(x); - } - - public static boolean deep9713(boolean x) { - return deep9714(x); - } - - public static boolean deep9714(boolean x) { - return deep9715(x); - } - - public static boolean deep9715(boolean x) { - return deep9716(x); - } - - public static boolean deep9716(boolean x) { - return deep9717(x); - } - - public static boolean deep9717(boolean x) { - return deep9718(x); - } - - public static boolean deep9718(boolean x) { - return deep9719(x); - } - - public static boolean deep9719(boolean x) { - return deep9720(x); - } - - public static boolean deep9720(boolean x) { - return deep9721(x); - } - - public static boolean deep9721(boolean x) { - return deep9722(x); - } - - public static boolean deep9722(boolean x) { - return deep9723(x); - } - - public static boolean deep9723(boolean x) { - return deep9724(x); - } - - public static boolean deep9724(boolean x) { - return deep9725(x); - } - - public static boolean deep9725(boolean x) { - return deep9726(x); - } - - public static boolean deep9726(boolean x) { - return deep9727(x); - } - - public static boolean deep9727(boolean x) { - return deep9728(x); - } - - public static boolean deep9728(boolean x) { - return deep9729(x); - } - - public static boolean deep9729(boolean x) { - return deep9730(x); - } - - public static boolean deep9730(boolean x) { - return deep9731(x); - } - - public static boolean deep9731(boolean x) { - return deep9732(x); - } - - public static boolean deep9732(boolean x) { - return deep9733(x); - } - - public static boolean deep9733(boolean x) { - return deep9734(x); - } - - public static boolean deep9734(boolean x) { - return deep9735(x); - } - - public static boolean deep9735(boolean x) { - return deep9736(x); - } - - public static boolean deep9736(boolean x) { - return deep9737(x); - } - - public static boolean deep9737(boolean x) { - return deep9738(x); - } - - public static boolean deep9738(boolean x) { - return deep9739(x); - } - - public static boolean deep9739(boolean x) { - return deep9740(x); - } - - public static boolean deep9740(boolean x) { - return deep9741(x); - } - - public static boolean deep9741(boolean x) { - return deep9742(x); - } - - public static boolean deep9742(boolean x) { - return deep9743(x); - } - - public static boolean deep9743(boolean x) { - return deep9744(x); - } - - public static boolean deep9744(boolean x) { - return deep9745(x); - } - - public static boolean deep9745(boolean x) { - return deep9746(x); - } - - public static boolean deep9746(boolean x) { - return deep9747(x); - } - - public static boolean deep9747(boolean x) { - return deep9748(x); - } - - public static boolean deep9748(boolean x) { - return deep9749(x); - } - - public static boolean deep9749(boolean x) { - return deep9750(x); - } - - public static boolean deep9750(boolean x) { - return deep9751(x); - } - - public static boolean deep9751(boolean x) { - return deep9752(x); - } - - public static boolean deep9752(boolean x) { - return deep9753(x); - } - - public static boolean deep9753(boolean x) { - return deep9754(x); - } - - public static boolean deep9754(boolean x) { - return deep9755(x); - } - - public static boolean deep9755(boolean x) { - return deep9756(x); - } - - public static boolean deep9756(boolean x) { - return deep9757(x); - } - - public static boolean deep9757(boolean x) { - return deep9758(x); - } - - public static boolean deep9758(boolean x) { - return deep9759(x); - } - - public static boolean deep9759(boolean x) { - return deep9760(x); - } - - public static boolean deep9760(boolean x) { - return deep9761(x); - } - - public static boolean deep9761(boolean x) { - return deep9762(x); - } - - public static boolean deep9762(boolean x) { - return deep9763(x); - } - - public static boolean deep9763(boolean x) { - return deep9764(x); - } - - public static boolean deep9764(boolean x) { - return deep9765(x); - } - - public static boolean deep9765(boolean x) { - return deep9766(x); - } - - public static boolean deep9766(boolean x) { - return deep9767(x); - } - - public static boolean deep9767(boolean x) { - return deep9768(x); - } - - public static boolean deep9768(boolean x) { - return deep9769(x); - } - - public static boolean deep9769(boolean x) { - return deep9770(x); - } - - public static boolean deep9770(boolean x) { - return deep9771(x); - } - - public static boolean deep9771(boolean x) { - return deep9772(x); - } - - public static boolean deep9772(boolean x) { - return deep9773(x); - } - - public static boolean deep9773(boolean x) { - return deep9774(x); - } - - public static boolean deep9774(boolean x) { - return deep9775(x); - } - - public static boolean deep9775(boolean x) { - return deep9776(x); - } - - public static boolean deep9776(boolean x) { - return deep9777(x); - } - - public static boolean deep9777(boolean x) { - return deep9778(x); - } - - public static boolean deep9778(boolean x) { - return deep9779(x); - } - - public static boolean deep9779(boolean x) { - return deep9780(x); - } - - public static boolean deep9780(boolean x) { - return deep9781(x); - } - - public static boolean deep9781(boolean x) { - return deep9782(x); - } - - public static boolean deep9782(boolean x) { - return deep9783(x); - } - - public static boolean deep9783(boolean x) { - return deep9784(x); - } - - public static boolean deep9784(boolean x) { - return deep9785(x); - } - - public static boolean deep9785(boolean x) { - return deep9786(x); - } - - public static boolean deep9786(boolean x) { - return deep9787(x); - } - - public static boolean deep9787(boolean x) { - return deep9788(x); - } - - public static boolean deep9788(boolean x) { - return deep9789(x); - } - - public static boolean deep9789(boolean x) { - return deep9790(x); - } - - public static boolean deep9790(boolean x) { - return deep9791(x); - } - - public static boolean deep9791(boolean x) { - return deep9792(x); - } - - public static boolean deep9792(boolean x) { - return deep9793(x); - } - - public static boolean deep9793(boolean x) { - return deep9794(x); - } - - public static boolean deep9794(boolean x) { - return deep9795(x); - } - - public static boolean deep9795(boolean x) { - return deep9796(x); - } - - public static boolean deep9796(boolean x) { - return deep9797(x); - } - - public static boolean deep9797(boolean x) { - return deep9798(x); - } - - public static boolean deep9798(boolean x) { - return deep9799(x); - } - - public static boolean deep9799(boolean x) { - return deep9800(x); - } - - public static boolean deep9800(boolean x) { - return deep9801(x); - } - - public static boolean deep9801(boolean x) { - return deep9802(x); - } - - public static boolean deep9802(boolean x) { - return deep9803(x); - } - - public static boolean deep9803(boolean x) { - return deep9804(x); - } - - public static boolean deep9804(boolean x) { - return deep9805(x); - } - - public static boolean deep9805(boolean x) { - return deep9806(x); - } - - public static boolean deep9806(boolean x) { - return deep9807(x); - } - - public static boolean deep9807(boolean x) { - return deep9808(x); - } - - public static boolean deep9808(boolean x) { - return deep9809(x); - } - - public static boolean deep9809(boolean x) { - return deep9810(x); - } - - public static boolean deep9810(boolean x) { - return deep9811(x); - } - - public static boolean deep9811(boolean x) { - return deep9812(x); - } - - public static boolean deep9812(boolean x) { - return deep9813(x); - } - - public static boolean deep9813(boolean x) { - return deep9814(x); - } - - public static boolean deep9814(boolean x) { - return deep9815(x); - } - - public static boolean deep9815(boolean x) { - return deep9816(x); - } - - public static boolean deep9816(boolean x) { - return deep9817(x); - } - - public static boolean deep9817(boolean x) { - return deep9818(x); - } - - public static boolean deep9818(boolean x) { - return deep9819(x); - } - - public static boolean deep9819(boolean x) { - return deep9820(x); - } - - public static boolean deep9820(boolean x) { - return deep9821(x); - } - - public static boolean deep9821(boolean x) { - return deep9822(x); - } - - public static boolean deep9822(boolean x) { - return deep9823(x); - } - - public static boolean deep9823(boolean x) { - return deep9824(x); - } - - public static boolean deep9824(boolean x) { - return deep9825(x); - } - - public static boolean deep9825(boolean x) { - return deep9826(x); - } - - public static boolean deep9826(boolean x) { - return deep9827(x); - } - - public static boolean deep9827(boolean x) { - return deep9828(x); - } - - public static boolean deep9828(boolean x) { - return deep9829(x); - } - - public static boolean deep9829(boolean x) { - return deep9830(x); - } - - public static boolean deep9830(boolean x) { - return deep9831(x); - } - - public static boolean deep9831(boolean x) { - return deep9832(x); - } - - public static boolean deep9832(boolean x) { - return deep9833(x); - } - - public static boolean deep9833(boolean x) { - return deep9834(x); - } - - public static boolean deep9834(boolean x) { - return deep9835(x); - } - - public static boolean deep9835(boolean x) { - return deep9836(x); - } - - public static boolean deep9836(boolean x) { - return deep9837(x); - } - - public static boolean deep9837(boolean x) { - return deep9838(x); - } - - public static boolean deep9838(boolean x) { - return deep9839(x); - } - - public static boolean deep9839(boolean x) { - return deep9840(x); - } - - public static boolean deep9840(boolean x) { - return deep9841(x); - } - - public static boolean deep9841(boolean x) { - return deep9842(x); - } - - public static boolean deep9842(boolean x) { - return deep9843(x); - } - - public static boolean deep9843(boolean x) { - return deep9844(x); - } - - public static boolean deep9844(boolean x) { - return deep9845(x); - } - - public static boolean deep9845(boolean x) { - return deep9846(x); - } - - public static boolean deep9846(boolean x) { - return deep9847(x); - } - - public static boolean deep9847(boolean x) { - return deep9848(x); - } - - public static boolean deep9848(boolean x) { - return deep9849(x); - } - - public static boolean deep9849(boolean x) { - return deep9850(x); - } - - public static boolean deep9850(boolean x) { - return deep9851(x); - } - - public static boolean deep9851(boolean x) { - return deep9852(x); - } - - public static boolean deep9852(boolean x) { - return deep9853(x); - } - - public static boolean deep9853(boolean x) { - return deep9854(x); - } - - public static boolean deep9854(boolean x) { - return deep9855(x); - } - - public static boolean deep9855(boolean x) { - return deep9856(x); - } - - public static boolean deep9856(boolean x) { - return deep9857(x); - } - - public static boolean deep9857(boolean x) { - return deep9858(x); - } - - public static boolean deep9858(boolean x) { - return deep9859(x); - } - - public static boolean deep9859(boolean x) { - return deep9860(x); - } - - public static boolean deep9860(boolean x) { - return deep9861(x); - } - - public static boolean deep9861(boolean x) { - return deep9862(x); - } - - public static boolean deep9862(boolean x) { - return deep9863(x); - } - - public static boolean deep9863(boolean x) { - return deep9864(x); - } - - public static boolean deep9864(boolean x) { - return deep9865(x); - } - - public static boolean deep9865(boolean x) { - return deep9866(x); - } - - public static boolean deep9866(boolean x) { - return deep9867(x); - } - - public static boolean deep9867(boolean x) { - return deep9868(x); - } - - public static boolean deep9868(boolean x) { - return deep9869(x); - } - - public static boolean deep9869(boolean x) { - return deep9870(x); - } - - public static boolean deep9870(boolean x) { - return deep9871(x); - } - - public static boolean deep9871(boolean x) { - return deep9872(x); - } - - public static boolean deep9872(boolean x) { - return deep9873(x); - } - - public static boolean deep9873(boolean x) { - return deep9874(x); - } - - public static boolean deep9874(boolean x) { - return deep9875(x); - } - - public static boolean deep9875(boolean x) { - return deep9876(x); - } - - public static boolean deep9876(boolean x) { - return deep9877(x); - } - - public static boolean deep9877(boolean x) { - return deep9878(x); - } - - public static boolean deep9878(boolean x) { - return deep9879(x); - } - - public static boolean deep9879(boolean x) { - return deep9880(x); - } - - public static boolean deep9880(boolean x) { - return deep9881(x); - } - - public static boolean deep9881(boolean x) { - return deep9882(x); - } - - public static boolean deep9882(boolean x) { - return deep9883(x); - } - - public static boolean deep9883(boolean x) { - return deep9884(x); - } - - public static boolean deep9884(boolean x) { - return deep9885(x); - } - - public static boolean deep9885(boolean x) { - return deep9886(x); - } - - public static boolean deep9886(boolean x) { - return deep9887(x); - } - - public static boolean deep9887(boolean x) { - return deep9888(x); - } - - public static boolean deep9888(boolean x) { - return deep9889(x); - } - - public static boolean deep9889(boolean x) { - return deep9890(x); - } - - public static boolean deep9890(boolean x) { - return deep9891(x); - } - - public static boolean deep9891(boolean x) { - return deep9892(x); - } - - public static boolean deep9892(boolean x) { - return deep9893(x); - } - - public static boolean deep9893(boolean x) { - return deep9894(x); - } - - public static boolean deep9894(boolean x) { - return deep9895(x); - } - - public static boolean deep9895(boolean x) { - return deep9896(x); - } - - public static boolean deep9896(boolean x) { - return deep9897(x); - } - - public static boolean deep9897(boolean x) { - return deep9898(x); - } - - public static boolean deep9898(boolean x) { - return deep9899(x); - } - - public static boolean deep9899(boolean x) { - return deep9900(x); - } - - public static boolean deep9900(boolean x) { - return deep9901(x); - } - - public static boolean deep9901(boolean x) { - return deep9902(x); - } - - public static boolean deep9902(boolean x) { - return deep9903(x); - } - - public static boolean deep9903(boolean x) { - return deep9904(x); - } - - public static boolean deep9904(boolean x) { - return deep9905(x); - } - - public static boolean deep9905(boolean x) { - return deep9906(x); - } - - public static boolean deep9906(boolean x) { - return deep9907(x); - } - - public static boolean deep9907(boolean x) { - return deep9908(x); - } - - public static boolean deep9908(boolean x) { - return deep9909(x); - } - - public static boolean deep9909(boolean x) { - return deep9910(x); - } - - public static boolean deep9910(boolean x) { - return deep9911(x); - } - - public static boolean deep9911(boolean x) { - return deep9912(x); - } - - public static boolean deep9912(boolean x) { - return deep9913(x); - } - - public static boolean deep9913(boolean x) { - return deep9914(x); - } - - public static boolean deep9914(boolean x) { - return deep9915(x); - } - - public static boolean deep9915(boolean x) { - return deep9916(x); - } - - public static boolean deep9916(boolean x) { - return deep9917(x); - } - - public static boolean deep9917(boolean x) { - return deep9918(x); - } - - public static boolean deep9918(boolean x) { - return deep9919(x); - } - - public static boolean deep9919(boolean x) { - return deep9920(x); - } - - public static boolean deep9920(boolean x) { - return deep9921(x); - } - - public static boolean deep9921(boolean x) { - return deep9922(x); - } - - public static boolean deep9922(boolean x) { - return deep9923(x); - } - - public static boolean deep9923(boolean x) { - return deep9924(x); - } - - public static boolean deep9924(boolean x) { - return deep9925(x); - } - - public static boolean deep9925(boolean x) { - return deep9926(x); - } - - public static boolean deep9926(boolean x) { - return deep9927(x); - } - - public static boolean deep9927(boolean x) { - return deep9928(x); - } - - public static boolean deep9928(boolean x) { - return deep9929(x); - } - - public static boolean deep9929(boolean x) { - return deep9930(x); - } - - public static boolean deep9930(boolean x) { - return deep9931(x); - } - - public static boolean deep9931(boolean x) { - return deep9932(x); - } - - public static boolean deep9932(boolean x) { - return deep9933(x); - } - - public static boolean deep9933(boolean x) { - return deep9934(x); - } - - public static boolean deep9934(boolean x) { - return deep9935(x); - } - - public static boolean deep9935(boolean x) { - return deep9936(x); - } - - public static boolean deep9936(boolean x) { - return deep9937(x); - } - - public static boolean deep9937(boolean x) { - return deep9938(x); - } - - public static boolean deep9938(boolean x) { - return deep9939(x); - } - - public static boolean deep9939(boolean x) { - return deep9940(x); - } - - public static boolean deep9940(boolean x) { - return deep9941(x); - } - - public static boolean deep9941(boolean x) { - return deep9942(x); - } - - public static boolean deep9942(boolean x) { - return deep9943(x); - } - - public static boolean deep9943(boolean x) { - return deep9944(x); - } - - public static boolean deep9944(boolean x) { - return deep9945(x); - } - - public static boolean deep9945(boolean x) { - return deep9946(x); - } - - public static boolean deep9946(boolean x) { - return deep9947(x); - } - - public static boolean deep9947(boolean x) { - return deep9948(x); - } - - public static boolean deep9948(boolean x) { - return deep9949(x); - } - - public static boolean deep9949(boolean x) { - return deep9950(x); - } - - public static boolean deep9950(boolean x) { - return deep9951(x); - } - - public static boolean deep9951(boolean x) { - return deep9952(x); - } - - public static boolean deep9952(boolean x) { - return deep9953(x); - } - - public static boolean deep9953(boolean x) { - return deep9954(x); - } - - public static boolean deep9954(boolean x) { - return deep9955(x); - } - - public static boolean deep9955(boolean x) { - return deep9956(x); - } - - public static boolean deep9956(boolean x) { - return deep9957(x); - } - - public static boolean deep9957(boolean x) { - return deep9958(x); - } - - public static boolean deep9958(boolean x) { - return deep9959(x); - } - - public static boolean deep9959(boolean x) { - return deep9960(x); - } - - public static boolean deep9960(boolean x) { - return deep9961(x); - } - - public static boolean deep9961(boolean x) { - return deep9962(x); - } - - public static boolean deep9962(boolean x) { - return deep9963(x); - } - - public static boolean deep9963(boolean x) { - return deep9964(x); - } - - public static boolean deep9964(boolean x) { - return deep9965(x); - } - - public static boolean deep9965(boolean x) { - return deep9966(x); - } - - public static boolean deep9966(boolean x) { - return deep9967(x); - } - - public static boolean deep9967(boolean x) { - return deep9968(x); - } - - public static boolean deep9968(boolean x) { - return deep9969(x); - } - - public static boolean deep9969(boolean x) { - return deep9970(x); - } - - public static boolean deep9970(boolean x) { - return deep9971(x); - } - - public static boolean deep9971(boolean x) { - return deep9972(x); - } - - public static boolean deep9972(boolean x) { - return deep9973(x); - } - - public static boolean deep9973(boolean x) { - return deep9974(x); - } - - public static boolean deep9974(boolean x) { - return deep9975(x); - } - - public static boolean deep9975(boolean x) { - return deep9976(x); - } - - public static boolean deep9976(boolean x) { - return deep9977(x); - } - - public static boolean deep9977(boolean x) { - return deep9978(x); - } - - public static boolean deep9978(boolean x) { - return deep9979(x); - } - - public static boolean deep9979(boolean x) { - return deep9980(x); - } - - public static boolean deep9980(boolean x) { - return deep9981(x); - } - - public static boolean deep9981(boolean x) { - return deep9982(x); - } - - public static boolean deep9982(boolean x) { - return deep9983(x); - } - - public static boolean deep9983(boolean x) { - return deep9984(x); - } - - public static boolean deep9984(boolean x) { - return deep9985(x); - } - - public static boolean deep9985(boolean x) { - return deep9986(x); - } - - public static boolean deep9986(boolean x) { - return deep9987(x); - } - - public static boolean deep9987(boolean x) { - return deep9988(x); - } - - public static boolean deep9988(boolean x) { - return deep9989(x); - } - - public static boolean deep9989(boolean x) { - return deep9990(x); - } - - public static boolean deep9990(boolean x) { - return deep9991(x); - } - - public static boolean deep9991(boolean x) { - return deep9992(x); - } - - public static boolean deep9992(boolean x) { - return deep9993(x); - } - - public static boolean deep9993(boolean x) { - return deep9994(x); - } - - public static boolean deep9994(boolean x) { - return deep9995(x); - } - - public static boolean deep9995(boolean x) { - return deep9996(x); - } - - public static boolean deep9996(boolean x) { - return deep9997(x); - } - - public static boolean deep9997(boolean x) { - return deep9998(x); - } - - public static boolean deep9998(boolean x) { - return deep9999(x); - } - - public static boolean deep9999(boolean x) { - return deep10000(x); - } - - public static boolean deep10000(boolean x) { - return x; - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** Helper methot to obtain a random integer */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple5.class b/benchmarks/src/test/resources/ifspec/simple/Simple5.class deleted file mode 100644 index 0f4b7df6345f..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple5.java b/benchmarks/src/test/resources/ifspec/simple/Simple5.java deleted file mode 100755 index 1cf0b67cc6e4..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple5.java +++ /dev/null @@ -1,40021 +0,0 @@ - -class Simple5 { - public static boolean foo(boolean h) { - return deep1(h); - } - - public static boolean deep1(boolean x) { - return deep2(x); - } - - public static boolean deep2(boolean x) { - return deep3(x); - } - - public static boolean deep3(boolean x) { - return deep4(x); - } - - public static boolean deep4(boolean x) { - return deep5(x); - } - - public static boolean deep5(boolean x) { - return deep6(x); - } - - public static boolean deep6(boolean x) { - return deep7(x); - } - - public static boolean deep7(boolean x) { - return deep8(x); - } - - public static boolean deep8(boolean x) { - return deep9(x); - } - - public static boolean deep9(boolean x) { - return deep10(x); - } - - public static boolean deep10(boolean x) { - return deep11(x); - } - - public static boolean deep11(boolean x) { - return deep12(x); - } - - public static boolean deep12(boolean x) { - return deep13(x); - } - - public static boolean deep13(boolean x) { - return deep14(x); - } - - public static boolean deep14(boolean x) { - return deep15(x); - } - - public static boolean deep15(boolean x) { - return deep16(x); - } - - public static boolean deep16(boolean x) { - return deep17(x); - } - - public static boolean deep17(boolean x) { - return deep18(x); - } - - public static boolean deep18(boolean x) { - return deep19(x); - } - - public static boolean deep19(boolean x) { - return deep20(x); - } - - public static boolean deep20(boolean x) { - return deep21(x); - } - - public static boolean deep21(boolean x) { - return deep22(x); - } - - public static boolean deep22(boolean x) { - return deep23(x); - } - - public static boolean deep23(boolean x) { - return deep24(x); - } - - public static boolean deep24(boolean x) { - return deep25(x); - } - - public static boolean deep25(boolean x) { - return deep26(x); - } - - public static boolean deep26(boolean x) { - return deep27(x); - } - - public static boolean deep27(boolean x) { - return deep28(x); - } - - public static boolean deep28(boolean x) { - return deep29(x); - } - - public static boolean deep29(boolean x) { - return deep30(x); - } - - public static boolean deep30(boolean x) { - return deep31(x); - } - - public static boolean deep31(boolean x) { - return deep32(x); - } - - public static boolean deep32(boolean x) { - return deep33(x); - } - - public static boolean deep33(boolean x) { - return deep34(x); - } - - public static boolean deep34(boolean x) { - return deep35(x); - } - - public static boolean deep35(boolean x) { - return deep36(x); - } - - public static boolean deep36(boolean x) { - return deep37(x); - } - - public static boolean deep37(boolean x) { - return deep38(x); - } - - public static boolean deep38(boolean x) { - return deep39(x); - } - - public static boolean deep39(boolean x) { - return deep40(x); - } - - public static boolean deep40(boolean x) { - return deep41(x); - } - - public static boolean deep41(boolean x) { - return deep42(x); - } - - public static boolean deep42(boolean x) { - return deep43(x); - } - - public static boolean deep43(boolean x) { - return deep44(x); - } - - public static boolean deep44(boolean x) { - return deep45(x); - } - - public static boolean deep45(boolean x) { - return deep46(x); - } - - public static boolean deep46(boolean x) { - return deep47(x); - } - - public static boolean deep47(boolean x) { - return deep48(x); - } - - public static boolean deep48(boolean x) { - return deep49(x); - } - - public static boolean deep49(boolean x) { - return deep50(x); - } - - public static boolean deep50(boolean x) { - return deep51(x); - } - - public static boolean deep51(boolean x) { - return deep52(x); - } - - public static boolean deep52(boolean x) { - return deep53(x); - } - - public static boolean deep53(boolean x) { - return deep54(x); - } - - public static boolean deep54(boolean x) { - return deep55(x); - } - - public static boolean deep55(boolean x) { - return deep56(x); - } - - public static boolean deep56(boolean x) { - return deep57(x); - } - - public static boolean deep57(boolean x) { - return deep58(x); - } - - public static boolean deep58(boolean x) { - return deep59(x); - } - - public static boolean deep59(boolean x) { - return deep60(x); - } - - public static boolean deep60(boolean x) { - return deep61(x); - } - - public static boolean deep61(boolean x) { - return deep62(x); - } - - public static boolean deep62(boolean x) { - return deep63(x); - } - - public static boolean deep63(boolean x) { - return deep64(x); - } - - public static boolean deep64(boolean x) { - return deep65(x); - } - - public static boolean deep65(boolean x) { - return deep66(x); - } - - public static boolean deep66(boolean x) { - return deep67(x); - } - - public static boolean deep67(boolean x) { - return deep68(x); - } - - public static boolean deep68(boolean x) { - return deep69(x); - } - - public static boolean deep69(boolean x) { - return deep70(x); - } - - public static boolean deep70(boolean x) { - return deep71(x); - } - - public static boolean deep71(boolean x) { - return deep72(x); - } - - public static boolean deep72(boolean x) { - return deep73(x); - } - - public static boolean deep73(boolean x) { - return deep74(x); - } - - public static boolean deep74(boolean x) { - return deep75(x); - } - - public static boolean deep75(boolean x) { - return deep76(x); - } - - public static boolean deep76(boolean x) { - return deep77(x); - } - - public static boolean deep77(boolean x) { - return deep78(x); - } - - public static boolean deep78(boolean x) { - return deep79(x); - } - - public static boolean deep79(boolean x) { - return deep80(x); - } - - public static boolean deep80(boolean x) { - return deep81(x); - } - - public static boolean deep81(boolean x) { - return deep82(x); - } - - public static boolean deep82(boolean x) { - return deep83(x); - } - - public static boolean deep83(boolean x) { - return deep84(x); - } - - public static boolean deep84(boolean x) { - return deep85(x); - } - - public static boolean deep85(boolean x) { - return deep86(x); - } - - public static boolean deep86(boolean x) { - return deep87(x); - } - - public static boolean deep87(boolean x) { - return deep88(x); - } - - public static boolean deep88(boolean x) { - return deep89(x); - } - - public static boolean deep89(boolean x) { - return deep90(x); - } - - public static boolean deep90(boolean x) { - return deep91(x); - } - - public static boolean deep91(boolean x) { - return deep92(x); - } - - public static boolean deep92(boolean x) { - return deep93(x); - } - - public static boolean deep93(boolean x) { - return deep94(x); - } - - public static boolean deep94(boolean x) { - return deep95(x); - } - - public static boolean deep95(boolean x) { - return deep96(x); - } - - public static boolean deep96(boolean x) { - return deep97(x); - } - - public static boolean deep97(boolean x) { - return deep98(x); - } - - public static boolean deep98(boolean x) { - return deep99(x); - } - - public static boolean deep99(boolean x) { - return deep100(x); - } - - public static boolean deep100(boolean x) { - return deep101(x); - } - - public static boolean deep101(boolean x) { - return deep102(x); - } - - public static boolean deep102(boolean x) { - return deep103(x); - } - - public static boolean deep103(boolean x) { - return deep104(x); - } - - public static boolean deep104(boolean x) { - return deep105(x); - } - - public static boolean deep105(boolean x) { - return deep106(x); - } - - public static boolean deep106(boolean x) { - return deep107(x); - } - - public static boolean deep107(boolean x) { - return deep108(x); - } - - public static boolean deep108(boolean x) { - return deep109(x); - } - - public static boolean deep109(boolean x) { - return deep110(x); - } - - public static boolean deep110(boolean x) { - return deep111(x); - } - - public static boolean deep111(boolean x) { - return deep112(x); - } - - public static boolean deep112(boolean x) { - return deep113(x); - } - - public static boolean deep113(boolean x) { - return deep114(x); - } - - public static boolean deep114(boolean x) { - return deep115(x); - } - - public static boolean deep115(boolean x) { - return deep116(x); - } - - public static boolean deep116(boolean x) { - return deep117(x); - } - - public static boolean deep117(boolean x) { - return deep118(x); - } - - public static boolean deep118(boolean x) { - return deep119(x); - } - - public static boolean deep119(boolean x) { - return deep120(x); - } - - public static boolean deep120(boolean x) { - return deep121(x); - } - - public static boolean deep121(boolean x) { - return deep122(x); - } - - public static boolean deep122(boolean x) { - return deep123(x); - } - - public static boolean deep123(boolean x) { - return deep124(x); - } - - public static boolean deep124(boolean x) { - return deep125(x); - } - - public static boolean deep125(boolean x) { - return deep126(x); - } - - public static boolean deep126(boolean x) { - return deep127(x); - } - - public static boolean deep127(boolean x) { - return deep128(x); - } - - public static boolean deep128(boolean x) { - return deep129(x); - } - - public static boolean deep129(boolean x) { - return deep130(x); - } - - public static boolean deep130(boolean x) { - return deep131(x); - } - - public static boolean deep131(boolean x) { - return deep132(x); - } - - public static boolean deep132(boolean x) { - return deep133(x); - } - - public static boolean deep133(boolean x) { - return deep134(x); - } - - public static boolean deep134(boolean x) { - return deep135(x); - } - - public static boolean deep135(boolean x) { - return deep136(x); - } - - public static boolean deep136(boolean x) { - return deep137(x); - } - - public static boolean deep137(boolean x) { - return deep138(x); - } - - public static boolean deep138(boolean x) { - return deep139(x); - } - - public static boolean deep139(boolean x) { - return deep140(x); - } - - public static boolean deep140(boolean x) { - return deep141(x); - } - - public static boolean deep141(boolean x) { - return deep142(x); - } - - public static boolean deep142(boolean x) { - return deep143(x); - } - - public static boolean deep143(boolean x) { - return deep144(x); - } - - public static boolean deep144(boolean x) { - return deep145(x); - } - - public static boolean deep145(boolean x) { - return deep146(x); - } - - public static boolean deep146(boolean x) { - return deep147(x); - } - - public static boolean deep147(boolean x) { - return deep148(x); - } - - public static boolean deep148(boolean x) { - return deep149(x); - } - - public static boolean deep149(boolean x) { - return deep150(x); - } - - public static boolean deep150(boolean x) { - return deep151(x); - } - - public static boolean deep151(boolean x) { - return deep152(x); - } - - public static boolean deep152(boolean x) { - return deep153(x); - } - - public static boolean deep153(boolean x) { - return deep154(x); - } - - public static boolean deep154(boolean x) { - return deep155(x); - } - - public static boolean deep155(boolean x) { - return deep156(x); - } - - public static boolean deep156(boolean x) { - return deep157(x); - } - - public static boolean deep157(boolean x) { - return deep158(x); - } - - public static boolean deep158(boolean x) { - return deep159(x); - } - - public static boolean deep159(boolean x) { - return deep160(x); - } - - public static boolean deep160(boolean x) { - return deep161(x); - } - - public static boolean deep161(boolean x) { - return deep162(x); - } - - public static boolean deep162(boolean x) { - return deep163(x); - } - - public static boolean deep163(boolean x) { - return deep164(x); - } - - public static boolean deep164(boolean x) { - return deep165(x); - } - - public static boolean deep165(boolean x) { - return deep166(x); - } - - public static boolean deep166(boolean x) { - return deep167(x); - } - - public static boolean deep167(boolean x) { - return deep168(x); - } - - public static boolean deep168(boolean x) { - return deep169(x); - } - - public static boolean deep169(boolean x) { - return deep170(x); - } - - public static boolean deep170(boolean x) { - return deep171(x); - } - - public static boolean deep171(boolean x) { - return deep172(x); - } - - public static boolean deep172(boolean x) { - return deep173(x); - } - - public static boolean deep173(boolean x) { - return deep174(x); - } - - public static boolean deep174(boolean x) { - return deep175(x); - } - - public static boolean deep175(boolean x) { - return deep176(x); - } - - public static boolean deep176(boolean x) { - return deep177(x); - } - - public static boolean deep177(boolean x) { - return deep178(x); - } - - public static boolean deep178(boolean x) { - return deep179(x); - } - - public static boolean deep179(boolean x) { - return deep180(x); - } - - public static boolean deep180(boolean x) { - return deep181(x); - } - - public static boolean deep181(boolean x) { - return deep182(x); - } - - public static boolean deep182(boolean x) { - return deep183(x); - } - - public static boolean deep183(boolean x) { - return deep184(x); - } - - public static boolean deep184(boolean x) { - return deep185(x); - } - - public static boolean deep185(boolean x) { - return deep186(x); - } - - public static boolean deep186(boolean x) { - return deep187(x); - } - - public static boolean deep187(boolean x) { - return deep188(x); - } - - public static boolean deep188(boolean x) { - return deep189(x); - } - - public static boolean deep189(boolean x) { - return deep190(x); - } - - public static boolean deep190(boolean x) { - return deep191(x); - } - - public static boolean deep191(boolean x) { - return deep192(x); - } - - public static boolean deep192(boolean x) { - return deep193(x); - } - - public static boolean deep193(boolean x) { - return deep194(x); - } - - public static boolean deep194(boolean x) { - return deep195(x); - } - - public static boolean deep195(boolean x) { - return deep196(x); - } - - public static boolean deep196(boolean x) { - return deep197(x); - } - - public static boolean deep197(boolean x) { - return deep198(x); - } - - public static boolean deep198(boolean x) { - return deep199(x); - } - - public static boolean deep199(boolean x) { - return deep200(x); - } - - public static boolean deep200(boolean x) { - return deep201(x); - } - - public static boolean deep201(boolean x) { - return deep202(x); - } - - public static boolean deep202(boolean x) { - return deep203(x); - } - - public static boolean deep203(boolean x) { - return deep204(x); - } - - public static boolean deep204(boolean x) { - return deep205(x); - } - - public static boolean deep205(boolean x) { - return deep206(x); - } - - public static boolean deep206(boolean x) { - return deep207(x); - } - - public static boolean deep207(boolean x) { - return deep208(x); - } - - public static boolean deep208(boolean x) { - return deep209(x); - } - - public static boolean deep209(boolean x) { - return deep210(x); - } - - public static boolean deep210(boolean x) { - return deep211(x); - } - - public static boolean deep211(boolean x) { - return deep212(x); - } - - public static boolean deep212(boolean x) { - return deep213(x); - } - - public static boolean deep213(boolean x) { - return deep214(x); - } - - public static boolean deep214(boolean x) { - return deep215(x); - } - - public static boolean deep215(boolean x) { - return deep216(x); - } - - public static boolean deep216(boolean x) { - return deep217(x); - } - - public static boolean deep217(boolean x) { - return deep218(x); - } - - public static boolean deep218(boolean x) { - return deep219(x); - } - - public static boolean deep219(boolean x) { - return deep220(x); - } - - public static boolean deep220(boolean x) { - return deep221(x); - } - - public static boolean deep221(boolean x) { - return deep222(x); - } - - public static boolean deep222(boolean x) { - return deep223(x); - } - - public static boolean deep223(boolean x) { - return deep224(x); - } - - public static boolean deep224(boolean x) { - return deep225(x); - } - - public static boolean deep225(boolean x) { - return deep226(x); - } - - public static boolean deep226(boolean x) { - return deep227(x); - } - - public static boolean deep227(boolean x) { - return deep228(x); - } - - public static boolean deep228(boolean x) { - return deep229(x); - } - - public static boolean deep229(boolean x) { - return deep230(x); - } - - public static boolean deep230(boolean x) { - return deep231(x); - } - - public static boolean deep231(boolean x) { - return deep232(x); - } - - public static boolean deep232(boolean x) { - return deep233(x); - } - - public static boolean deep233(boolean x) { - return deep234(x); - } - - public static boolean deep234(boolean x) { - return deep235(x); - } - - public static boolean deep235(boolean x) { - return deep236(x); - } - - public static boolean deep236(boolean x) { - return deep237(x); - } - - public static boolean deep237(boolean x) { - return deep238(x); - } - - public static boolean deep238(boolean x) { - return deep239(x); - } - - public static boolean deep239(boolean x) { - return deep240(x); - } - - public static boolean deep240(boolean x) { - return deep241(x); - } - - public static boolean deep241(boolean x) { - return deep242(x); - } - - public static boolean deep242(boolean x) { - return deep243(x); - } - - public static boolean deep243(boolean x) { - return deep244(x); - } - - public static boolean deep244(boolean x) { - return deep245(x); - } - - public static boolean deep245(boolean x) { - return deep246(x); - } - - public static boolean deep246(boolean x) { - return deep247(x); - } - - public static boolean deep247(boolean x) { - return deep248(x); - } - - public static boolean deep248(boolean x) { - return deep249(x); - } - - public static boolean deep249(boolean x) { - return deep250(x); - } - - public static boolean deep250(boolean x) { - return deep251(x); - } - - public static boolean deep251(boolean x) { - return deep252(x); - } - - public static boolean deep252(boolean x) { - return deep253(x); - } - - public static boolean deep253(boolean x) { - return deep254(x); - } - - public static boolean deep254(boolean x) { - return deep255(x); - } - - public static boolean deep255(boolean x) { - return deep256(x); - } - - public static boolean deep256(boolean x) { - return deep257(x); - } - - public static boolean deep257(boolean x) { - return deep258(x); - } - - public static boolean deep258(boolean x) { - return deep259(x); - } - - public static boolean deep259(boolean x) { - return deep260(x); - } - - public static boolean deep260(boolean x) { - return deep261(x); - } - - public static boolean deep261(boolean x) { - return deep262(x); - } - - public static boolean deep262(boolean x) { - return deep263(x); - } - - public static boolean deep263(boolean x) { - return deep264(x); - } - - public static boolean deep264(boolean x) { - return deep265(x); - } - - public static boolean deep265(boolean x) { - return deep266(x); - } - - public static boolean deep266(boolean x) { - return deep267(x); - } - - public static boolean deep267(boolean x) { - return deep268(x); - } - - public static boolean deep268(boolean x) { - return deep269(x); - } - - public static boolean deep269(boolean x) { - return deep270(x); - } - - public static boolean deep270(boolean x) { - return deep271(x); - } - - public static boolean deep271(boolean x) { - return deep272(x); - } - - public static boolean deep272(boolean x) { - return deep273(x); - } - - public static boolean deep273(boolean x) { - return deep274(x); - } - - public static boolean deep274(boolean x) { - return deep275(x); - } - - public static boolean deep275(boolean x) { - return deep276(x); - } - - public static boolean deep276(boolean x) { - return deep277(x); - } - - public static boolean deep277(boolean x) { - return deep278(x); - } - - public static boolean deep278(boolean x) { - return deep279(x); - } - - public static boolean deep279(boolean x) { - return deep280(x); - } - - public static boolean deep280(boolean x) { - return deep281(x); - } - - public static boolean deep281(boolean x) { - return deep282(x); - } - - public static boolean deep282(boolean x) { - return deep283(x); - } - - public static boolean deep283(boolean x) { - return deep284(x); - } - - public static boolean deep284(boolean x) { - return deep285(x); - } - - public static boolean deep285(boolean x) { - return deep286(x); - } - - public static boolean deep286(boolean x) { - return deep287(x); - } - - public static boolean deep287(boolean x) { - return deep288(x); - } - - public static boolean deep288(boolean x) { - return deep289(x); - } - - public static boolean deep289(boolean x) { - return deep290(x); - } - - public static boolean deep290(boolean x) { - return deep291(x); - } - - public static boolean deep291(boolean x) { - return deep292(x); - } - - public static boolean deep292(boolean x) { - return deep293(x); - } - - public static boolean deep293(boolean x) { - return deep294(x); - } - - public static boolean deep294(boolean x) { - return deep295(x); - } - - public static boolean deep295(boolean x) { - return deep296(x); - } - - public static boolean deep296(boolean x) { - return deep297(x); - } - - public static boolean deep297(boolean x) { - return deep298(x); - } - - public static boolean deep298(boolean x) { - return deep299(x); - } - - public static boolean deep299(boolean x) { - return deep300(x); - } - - public static boolean deep300(boolean x) { - return deep301(x); - } - - public static boolean deep301(boolean x) { - return deep302(x); - } - - public static boolean deep302(boolean x) { - return deep303(x); - } - - public static boolean deep303(boolean x) { - return deep304(x); - } - - public static boolean deep304(boolean x) { - return deep305(x); - } - - public static boolean deep305(boolean x) { - return deep306(x); - } - - public static boolean deep306(boolean x) { - return deep307(x); - } - - public static boolean deep307(boolean x) { - return deep308(x); - } - - public static boolean deep308(boolean x) { - return deep309(x); - } - - public static boolean deep309(boolean x) { - return deep310(x); - } - - public static boolean deep310(boolean x) { - return deep311(x); - } - - public static boolean deep311(boolean x) { - return deep312(x); - } - - public static boolean deep312(boolean x) { - return deep313(x); - } - - public static boolean deep313(boolean x) { - return deep314(x); - } - - public static boolean deep314(boolean x) { - return deep315(x); - } - - public static boolean deep315(boolean x) { - return deep316(x); - } - - public static boolean deep316(boolean x) { - return deep317(x); - } - - public static boolean deep317(boolean x) { - return deep318(x); - } - - public static boolean deep318(boolean x) { - return deep319(x); - } - - public static boolean deep319(boolean x) { - return deep320(x); - } - - public static boolean deep320(boolean x) { - return deep321(x); - } - - public static boolean deep321(boolean x) { - return deep322(x); - } - - public static boolean deep322(boolean x) { - return deep323(x); - } - - public static boolean deep323(boolean x) { - return deep324(x); - } - - public static boolean deep324(boolean x) { - return deep325(x); - } - - public static boolean deep325(boolean x) { - return deep326(x); - } - - public static boolean deep326(boolean x) { - return deep327(x); - } - - public static boolean deep327(boolean x) { - return deep328(x); - } - - public static boolean deep328(boolean x) { - return deep329(x); - } - - public static boolean deep329(boolean x) { - return deep330(x); - } - - public static boolean deep330(boolean x) { - return deep331(x); - } - - public static boolean deep331(boolean x) { - return deep332(x); - } - - public static boolean deep332(boolean x) { - return deep333(x); - } - - public static boolean deep333(boolean x) { - return deep334(x); - } - - public static boolean deep334(boolean x) { - return deep335(x); - } - - public static boolean deep335(boolean x) { - return deep336(x); - } - - public static boolean deep336(boolean x) { - return deep337(x); - } - - public static boolean deep337(boolean x) { - return deep338(x); - } - - public static boolean deep338(boolean x) { - return deep339(x); - } - - public static boolean deep339(boolean x) { - return deep340(x); - } - - public static boolean deep340(boolean x) { - return deep341(x); - } - - public static boolean deep341(boolean x) { - return deep342(x); - } - - public static boolean deep342(boolean x) { - return deep343(x); - } - - public static boolean deep343(boolean x) { - return deep344(x); - } - - public static boolean deep344(boolean x) { - return deep345(x); - } - - public static boolean deep345(boolean x) { - return deep346(x); - } - - public static boolean deep346(boolean x) { - return deep347(x); - } - - public static boolean deep347(boolean x) { - return deep348(x); - } - - public static boolean deep348(boolean x) { - return deep349(x); - } - - public static boolean deep349(boolean x) { - return deep350(x); - } - - public static boolean deep350(boolean x) { - return deep351(x); - } - - public static boolean deep351(boolean x) { - return deep352(x); - } - - public static boolean deep352(boolean x) { - return deep353(x); - } - - public static boolean deep353(boolean x) { - return deep354(x); - } - - public static boolean deep354(boolean x) { - return deep355(x); - } - - public static boolean deep355(boolean x) { - return deep356(x); - } - - public static boolean deep356(boolean x) { - return deep357(x); - } - - public static boolean deep357(boolean x) { - return deep358(x); - } - - public static boolean deep358(boolean x) { - return deep359(x); - } - - public static boolean deep359(boolean x) { - return deep360(x); - } - - public static boolean deep360(boolean x) { - return deep361(x); - } - - public static boolean deep361(boolean x) { - return deep362(x); - } - - public static boolean deep362(boolean x) { - return deep363(x); - } - - public static boolean deep363(boolean x) { - return deep364(x); - } - - public static boolean deep364(boolean x) { - return deep365(x); - } - - public static boolean deep365(boolean x) { - return deep366(x); - } - - public static boolean deep366(boolean x) { - return deep367(x); - } - - public static boolean deep367(boolean x) { - return deep368(x); - } - - public static boolean deep368(boolean x) { - return deep369(x); - } - - public static boolean deep369(boolean x) { - return deep370(x); - } - - public static boolean deep370(boolean x) { - return deep371(x); - } - - public static boolean deep371(boolean x) { - return deep372(x); - } - - public static boolean deep372(boolean x) { - return deep373(x); - } - - public static boolean deep373(boolean x) { - return deep374(x); - } - - public static boolean deep374(boolean x) { - return deep375(x); - } - - public static boolean deep375(boolean x) { - return deep376(x); - } - - public static boolean deep376(boolean x) { - return deep377(x); - } - - public static boolean deep377(boolean x) { - return deep378(x); - } - - public static boolean deep378(boolean x) { - return deep379(x); - } - - public static boolean deep379(boolean x) { - return deep380(x); - } - - public static boolean deep380(boolean x) { - return deep381(x); - } - - public static boolean deep381(boolean x) { - return deep382(x); - } - - public static boolean deep382(boolean x) { - return deep383(x); - } - - public static boolean deep383(boolean x) { - return deep384(x); - } - - public static boolean deep384(boolean x) { - return deep385(x); - } - - public static boolean deep385(boolean x) { - return deep386(x); - } - - public static boolean deep386(boolean x) { - return deep387(x); - } - - public static boolean deep387(boolean x) { - return deep388(x); - } - - public static boolean deep388(boolean x) { - return deep389(x); - } - - public static boolean deep389(boolean x) { - return deep390(x); - } - - public static boolean deep390(boolean x) { - return deep391(x); - } - - public static boolean deep391(boolean x) { - return deep392(x); - } - - public static boolean deep392(boolean x) { - return deep393(x); - } - - public static boolean deep393(boolean x) { - return deep394(x); - } - - public static boolean deep394(boolean x) { - return deep395(x); - } - - public static boolean deep395(boolean x) { - return deep396(x); - } - - public static boolean deep396(boolean x) { - return deep397(x); - } - - public static boolean deep397(boolean x) { - return deep398(x); - } - - public static boolean deep398(boolean x) { - return deep399(x); - } - - public static boolean deep399(boolean x) { - return deep400(x); - } - - public static boolean deep400(boolean x) { - return deep401(x); - } - - public static boolean deep401(boolean x) { - return deep402(x); - } - - public static boolean deep402(boolean x) { - return deep403(x); - } - - public static boolean deep403(boolean x) { - return deep404(x); - } - - public static boolean deep404(boolean x) { - return deep405(x); - } - - public static boolean deep405(boolean x) { - return deep406(x); - } - - public static boolean deep406(boolean x) { - return deep407(x); - } - - public static boolean deep407(boolean x) { - return deep408(x); - } - - public static boolean deep408(boolean x) { - return deep409(x); - } - - public static boolean deep409(boolean x) { - return deep410(x); - } - - public static boolean deep410(boolean x) { - return deep411(x); - } - - public static boolean deep411(boolean x) { - return deep412(x); - } - - public static boolean deep412(boolean x) { - return deep413(x); - } - - public static boolean deep413(boolean x) { - return deep414(x); - } - - public static boolean deep414(boolean x) { - return deep415(x); - } - - public static boolean deep415(boolean x) { - return deep416(x); - } - - public static boolean deep416(boolean x) { - return deep417(x); - } - - public static boolean deep417(boolean x) { - return deep418(x); - } - - public static boolean deep418(boolean x) { - return deep419(x); - } - - public static boolean deep419(boolean x) { - return deep420(x); - } - - public static boolean deep420(boolean x) { - return deep421(x); - } - - public static boolean deep421(boolean x) { - return deep422(x); - } - - public static boolean deep422(boolean x) { - return deep423(x); - } - - public static boolean deep423(boolean x) { - return deep424(x); - } - - public static boolean deep424(boolean x) { - return deep425(x); - } - - public static boolean deep425(boolean x) { - return deep426(x); - } - - public static boolean deep426(boolean x) { - return deep427(x); - } - - public static boolean deep427(boolean x) { - return deep428(x); - } - - public static boolean deep428(boolean x) { - return deep429(x); - } - - public static boolean deep429(boolean x) { - return deep430(x); - } - - public static boolean deep430(boolean x) { - return deep431(x); - } - - public static boolean deep431(boolean x) { - return deep432(x); - } - - public static boolean deep432(boolean x) { - return deep433(x); - } - - public static boolean deep433(boolean x) { - return deep434(x); - } - - public static boolean deep434(boolean x) { - return deep435(x); - } - - public static boolean deep435(boolean x) { - return deep436(x); - } - - public static boolean deep436(boolean x) { - return deep437(x); - } - - public static boolean deep437(boolean x) { - return deep438(x); - } - - public static boolean deep438(boolean x) { - return deep439(x); - } - - public static boolean deep439(boolean x) { - return deep440(x); - } - - public static boolean deep440(boolean x) { - return deep441(x); - } - - public static boolean deep441(boolean x) { - return deep442(x); - } - - public static boolean deep442(boolean x) { - return deep443(x); - } - - public static boolean deep443(boolean x) { - return deep444(x); - } - - public static boolean deep444(boolean x) { - return deep445(x); - } - - public static boolean deep445(boolean x) { - return deep446(x); - } - - public static boolean deep446(boolean x) { - return deep447(x); - } - - public static boolean deep447(boolean x) { - return deep448(x); - } - - public static boolean deep448(boolean x) { - return deep449(x); - } - - public static boolean deep449(boolean x) { - return deep450(x); - } - - public static boolean deep450(boolean x) { - return deep451(x); - } - - public static boolean deep451(boolean x) { - return deep452(x); - } - - public static boolean deep452(boolean x) { - return deep453(x); - } - - public static boolean deep453(boolean x) { - return deep454(x); - } - - public static boolean deep454(boolean x) { - return deep455(x); - } - - public static boolean deep455(boolean x) { - return deep456(x); - } - - public static boolean deep456(boolean x) { - return deep457(x); - } - - public static boolean deep457(boolean x) { - return deep458(x); - } - - public static boolean deep458(boolean x) { - return deep459(x); - } - - public static boolean deep459(boolean x) { - return deep460(x); - } - - public static boolean deep460(boolean x) { - return deep461(x); - } - - public static boolean deep461(boolean x) { - return deep462(x); - } - - public static boolean deep462(boolean x) { - return deep463(x); - } - - public static boolean deep463(boolean x) { - return deep464(x); - } - - public static boolean deep464(boolean x) { - return deep465(x); - } - - public static boolean deep465(boolean x) { - return deep466(x); - } - - public static boolean deep466(boolean x) { - return deep467(x); - } - - public static boolean deep467(boolean x) { - return deep468(x); - } - - public static boolean deep468(boolean x) { - return deep469(x); - } - - public static boolean deep469(boolean x) { - return deep470(x); - } - - public static boolean deep470(boolean x) { - return deep471(x); - } - - public static boolean deep471(boolean x) { - return deep472(x); - } - - public static boolean deep472(boolean x) { - return deep473(x); - } - - public static boolean deep473(boolean x) { - return deep474(x); - } - - public static boolean deep474(boolean x) { - return deep475(x); - } - - public static boolean deep475(boolean x) { - return deep476(x); - } - - public static boolean deep476(boolean x) { - return deep477(x); - } - - public static boolean deep477(boolean x) { - return deep478(x); - } - - public static boolean deep478(boolean x) { - return deep479(x); - } - - public static boolean deep479(boolean x) { - return deep480(x); - } - - public static boolean deep480(boolean x) { - return deep481(x); - } - - public static boolean deep481(boolean x) { - return deep482(x); - } - - public static boolean deep482(boolean x) { - return deep483(x); - } - - public static boolean deep483(boolean x) { - return deep484(x); - } - - public static boolean deep484(boolean x) { - return deep485(x); - } - - public static boolean deep485(boolean x) { - return deep486(x); - } - - public static boolean deep486(boolean x) { - return deep487(x); - } - - public static boolean deep487(boolean x) { - return deep488(x); - } - - public static boolean deep488(boolean x) { - return deep489(x); - } - - public static boolean deep489(boolean x) { - return deep490(x); - } - - public static boolean deep490(boolean x) { - return deep491(x); - } - - public static boolean deep491(boolean x) { - return deep492(x); - } - - public static boolean deep492(boolean x) { - return deep493(x); - } - - public static boolean deep493(boolean x) { - return deep494(x); - } - - public static boolean deep494(boolean x) { - return deep495(x); - } - - public static boolean deep495(boolean x) { - return deep496(x); - } - - public static boolean deep496(boolean x) { - return deep497(x); - } - - public static boolean deep497(boolean x) { - return deep498(x); - } - - public static boolean deep498(boolean x) { - return deep499(x); - } - - public static boolean deep499(boolean x) { - return deep500(x); - } - - public static boolean deep500(boolean x) { - return deep501(x); - } - - public static boolean deep501(boolean x) { - return deep502(x); - } - - public static boolean deep502(boolean x) { - return deep503(x); - } - - public static boolean deep503(boolean x) { - return deep504(x); - } - - public static boolean deep504(boolean x) { - return deep505(x); - } - - public static boolean deep505(boolean x) { - return deep506(x); - } - - public static boolean deep506(boolean x) { - return deep507(x); - } - - public static boolean deep507(boolean x) { - return deep508(x); - } - - public static boolean deep508(boolean x) { - return deep509(x); - } - - public static boolean deep509(boolean x) { - return deep510(x); - } - - public static boolean deep510(boolean x) { - return deep511(x); - } - - public static boolean deep511(boolean x) { - return deep512(x); - } - - public static boolean deep512(boolean x) { - return deep513(x); - } - - public static boolean deep513(boolean x) { - return deep514(x); - } - - public static boolean deep514(boolean x) { - return deep515(x); - } - - public static boolean deep515(boolean x) { - return deep516(x); - } - - public static boolean deep516(boolean x) { - return deep517(x); - } - - public static boolean deep517(boolean x) { - return deep518(x); - } - - public static boolean deep518(boolean x) { - return deep519(x); - } - - public static boolean deep519(boolean x) { - return deep520(x); - } - - public static boolean deep520(boolean x) { - return deep521(x); - } - - public static boolean deep521(boolean x) { - return deep522(x); - } - - public static boolean deep522(boolean x) { - return deep523(x); - } - - public static boolean deep523(boolean x) { - return deep524(x); - } - - public static boolean deep524(boolean x) { - return deep525(x); - } - - public static boolean deep525(boolean x) { - return deep526(x); - } - - public static boolean deep526(boolean x) { - return deep527(x); - } - - public static boolean deep527(boolean x) { - return deep528(x); - } - - public static boolean deep528(boolean x) { - return deep529(x); - } - - public static boolean deep529(boolean x) { - return deep530(x); - } - - public static boolean deep530(boolean x) { - return deep531(x); - } - - public static boolean deep531(boolean x) { - return deep532(x); - } - - public static boolean deep532(boolean x) { - return deep533(x); - } - - public static boolean deep533(boolean x) { - return deep534(x); - } - - public static boolean deep534(boolean x) { - return deep535(x); - } - - public static boolean deep535(boolean x) { - return deep536(x); - } - - public static boolean deep536(boolean x) { - return deep537(x); - } - - public static boolean deep537(boolean x) { - return deep538(x); - } - - public static boolean deep538(boolean x) { - return deep539(x); - } - - public static boolean deep539(boolean x) { - return deep540(x); - } - - public static boolean deep540(boolean x) { - return deep541(x); - } - - public static boolean deep541(boolean x) { - return deep542(x); - } - - public static boolean deep542(boolean x) { - return deep543(x); - } - - public static boolean deep543(boolean x) { - return deep544(x); - } - - public static boolean deep544(boolean x) { - return deep545(x); - } - - public static boolean deep545(boolean x) { - return deep546(x); - } - - public static boolean deep546(boolean x) { - return deep547(x); - } - - public static boolean deep547(boolean x) { - return deep548(x); - } - - public static boolean deep548(boolean x) { - return deep549(x); - } - - public static boolean deep549(boolean x) { - return deep550(x); - } - - public static boolean deep550(boolean x) { - return deep551(x); - } - - public static boolean deep551(boolean x) { - return deep552(x); - } - - public static boolean deep552(boolean x) { - return deep553(x); - } - - public static boolean deep553(boolean x) { - return deep554(x); - } - - public static boolean deep554(boolean x) { - return deep555(x); - } - - public static boolean deep555(boolean x) { - return deep556(x); - } - - public static boolean deep556(boolean x) { - return deep557(x); - } - - public static boolean deep557(boolean x) { - return deep558(x); - } - - public static boolean deep558(boolean x) { - return deep559(x); - } - - public static boolean deep559(boolean x) { - return deep560(x); - } - - public static boolean deep560(boolean x) { - return deep561(x); - } - - public static boolean deep561(boolean x) { - return deep562(x); - } - - public static boolean deep562(boolean x) { - return deep563(x); - } - - public static boolean deep563(boolean x) { - return deep564(x); - } - - public static boolean deep564(boolean x) { - return deep565(x); - } - - public static boolean deep565(boolean x) { - return deep566(x); - } - - public static boolean deep566(boolean x) { - return deep567(x); - } - - public static boolean deep567(boolean x) { - return deep568(x); - } - - public static boolean deep568(boolean x) { - return deep569(x); - } - - public static boolean deep569(boolean x) { - return deep570(x); - } - - public static boolean deep570(boolean x) { - return deep571(x); - } - - public static boolean deep571(boolean x) { - return deep572(x); - } - - public static boolean deep572(boolean x) { - return deep573(x); - } - - public static boolean deep573(boolean x) { - return deep574(x); - } - - public static boolean deep574(boolean x) { - return deep575(x); - } - - public static boolean deep575(boolean x) { - return deep576(x); - } - - public static boolean deep576(boolean x) { - return deep577(x); - } - - public static boolean deep577(boolean x) { - return deep578(x); - } - - public static boolean deep578(boolean x) { - return deep579(x); - } - - public static boolean deep579(boolean x) { - return deep580(x); - } - - public static boolean deep580(boolean x) { - return deep581(x); - } - - public static boolean deep581(boolean x) { - return deep582(x); - } - - public static boolean deep582(boolean x) { - return deep583(x); - } - - public static boolean deep583(boolean x) { - return deep584(x); - } - - public static boolean deep584(boolean x) { - return deep585(x); - } - - public static boolean deep585(boolean x) { - return deep586(x); - } - - public static boolean deep586(boolean x) { - return deep587(x); - } - - public static boolean deep587(boolean x) { - return deep588(x); - } - - public static boolean deep588(boolean x) { - return deep589(x); - } - - public static boolean deep589(boolean x) { - return deep590(x); - } - - public static boolean deep590(boolean x) { - return deep591(x); - } - - public static boolean deep591(boolean x) { - return deep592(x); - } - - public static boolean deep592(boolean x) { - return deep593(x); - } - - public static boolean deep593(boolean x) { - return deep594(x); - } - - public static boolean deep594(boolean x) { - return deep595(x); - } - - public static boolean deep595(boolean x) { - return deep596(x); - } - - public static boolean deep596(boolean x) { - return deep597(x); - } - - public static boolean deep597(boolean x) { - return deep598(x); - } - - public static boolean deep598(boolean x) { - return deep599(x); - } - - public static boolean deep599(boolean x) { - return deep600(x); - } - - public static boolean deep600(boolean x) { - return deep601(x); - } - - public static boolean deep601(boolean x) { - return deep602(x); - } - - public static boolean deep602(boolean x) { - return deep603(x); - } - - public static boolean deep603(boolean x) { - return deep604(x); - } - - public static boolean deep604(boolean x) { - return deep605(x); - } - - public static boolean deep605(boolean x) { - return deep606(x); - } - - public static boolean deep606(boolean x) { - return deep607(x); - } - - public static boolean deep607(boolean x) { - return deep608(x); - } - - public static boolean deep608(boolean x) { - return deep609(x); - } - - public static boolean deep609(boolean x) { - return deep610(x); - } - - public static boolean deep610(boolean x) { - return deep611(x); - } - - public static boolean deep611(boolean x) { - return deep612(x); - } - - public static boolean deep612(boolean x) { - return deep613(x); - } - - public static boolean deep613(boolean x) { - return deep614(x); - } - - public static boolean deep614(boolean x) { - return deep615(x); - } - - public static boolean deep615(boolean x) { - return deep616(x); - } - - public static boolean deep616(boolean x) { - return deep617(x); - } - - public static boolean deep617(boolean x) { - return deep618(x); - } - - public static boolean deep618(boolean x) { - return deep619(x); - } - - public static boolean deep619(boolean x) { - return deep620(x); - } - - public static boolean deep620(boolean x) { - return deep621(x); - } - - public static boolean deep621(boolean x) { - return deep622(x); - } - - public static boolean deep622(boolean x) { - return deep623(x); - } - - public static boolean deep623(boolean x) { - return deep624(x); - } - - public static boolean deep624(boolean x) { - return deep625(x); - } - - public static boolean deep625(boolean x) { - return deep626(x); - } - - public static boolean deep626(boolean x) { - return deep627(x); - } - - public static boolean deep627(boolean x) { - return deep628(x); - } - - public static boolean deep628(boolean x) { - return deep629(x); - } - - public static boolean deep629(boolean x) { - return deep630(x); - } - - public static boolean deep630(boolean x) { - return deep631(x); - } - - public static boolean deep631(boolean x) { - return deep632(x); - } - - public static boolean deep632(boolean x) { - return deep633(x); - } - - public static boolean deep633(boolean x) { - return deep634(x); - } - - public static boolean deep634(boolean x) { - return deep635(x); - } - - public static boolean deep635(boolean x) { - return deep636(x); - } - - public static boolean deep636(boolean x) { - return deep637(x); - } - - public static boolean deep637(boolean x) { - return deep638(x); - } - - public static boolean deep638(boolean x) { - return deep639(x); - } - - public static boolean deep639(boolean x) { - return deep640(x); - } - - public static boolean deep640(boolean x) { - return deep641(x); - } - - public static boolean deep641(boolean x) { - return deep642(x); - } - - public static boolean deep642(boolean x) { - return deep643(x); - } - - public static boolean deep643(boolean x) { - return deep644(x); - } - - public static boolean deep644(boolean x) { - return deep645(x); - } - - public static boolean deep645(boolean x) { - return deep646(x); - } - - public static boolean deep646(boolean x) { - return deep647(x); - } - - public static boolean deep647(boolean x) { - return deep648(x); - } - - public static boolean deep648(boolean x) { - return deep649(x); - } - - public static boolean deep649(boolean x) { - return deep650(x); - } - - public static boolean deep650(boolean x) { - return deep651(x); - } - - public static boolean deep651(boolean x) { - return deep652(x); - } - - public static boolean deep652(boolean x) { - return deep653(x); - } - - public static boolean deep653(boolean x) { - return deep654(x); - } - - public static boolean deep654(boolean x) { - return deep655(x); - } - - public static boolean deep655(boolean x) { - return deep656(x); - } - - public static boolean deep656(boolean x) { - return deep657(x); - } - - public static boolean deep657(boolean x) { - return deep658(x); - } - - public static boolean deep658(boolean x) { - return deep659(x); - } - - public static boolean deep659(boolean x) { - return deep660(x); - } - - public static boolean deep660(boolean x) { - return deep661(x); - } - - public static boolean deep661(boolean x) { - return deep662(x); - } - - public static boolean deep662(boolean x) { - return deep663(x); - } - - public static boolean deep663(boolean x) { - return deep664(x); - } - - public static boolean deep664(boolean x) { - return deep665(x); - } - - public static boolean deep665(boolean x) { - return deep666(x); - } - - public static boolean deep666(boolean x) { - return deep667(x); - } - - public static boolean deep667(boolean x) { - return deep668(x); - } - - public static boolean deep668(boolean x) { - return deep669(x); - } - - public static boolean deep669(boolean x) { - return deep670(x); - } - - public static boolean deep670(boolean x) { - return deep671(x); - } - - public static boolean deep671(boolean x) { - return deep672(x); - } - - public static boolean deep672(boolean x) { - return deep673(x); - } - - public static boolean deep673(boolean x) { - return deep674(x); - } - - public static boolean deep674(boolean x) { - return deep675(x); - } - - public static boolean deep675(boolean x) { - return deep676(x); - } - - public static boolean deep676(boolean x) { - return deep677(x); - } - - public static boolean deep677(boolean x) { - return deep678(x); - } - - public static boolean deep678(boolean x) { - return deep679(x); - } - - public static boolean deep679(boolean x) { - return deep680(x); - } - - public static boolean deep680(boolean x) { - return deep681(x); - } - - public static boolean deep681(boolean x) { - return deep682(x); - } - - public static boolean deep682(boolean x) { - return deep683(x); - } - - public static boolean deep683(boolean x) { - return deep684(x); - } - - public static boolean deep684(boolean x) { - return deep685(x); - } - - public static boolean deep685(boolean x) { - return deep686(x); - } - - public static boolean deep686(boolean x) { - return deep687(x); - } - - public static boolean deep687(boolean x) { - return deep688(x); - } - - public static boolean deep688(boolean x) { - return deep689(x); - } - - public static boolean deep689(boolean x) { - return deep690(x); - } - - public static boolean deep690(boolean x) { - return deep691(x); - } - - public static boolean deep691(boolean x) { - return deep692(x); - } - - public static boolean deep692(boolean x) { - return deep693(x); - } - - public static boolean deep693(boolean x) { - return deep694(x); - } - - public static boolean deep694(boolean x) { - return deep695(x); - } - - public static boolean deep695(boolean x) { - return deep696(x); - } - - public static boolean deep696(boolean x) { - return deep697(x); - } - - public static boolean deep697(boolean x) { - return deep698(x); - } - - public static boolean deep698(boolean x) { - return deep699(x); - } - - public static boolean deep699(boolean x) { - return deep700(x); - } - - public static boolean deep700(boolean x) { - return deep701(x); - } - - public static boolean deep701(boolean x) { - return deep702(x); - } - - public static boolean deep702(boolean x) { - return deep703(x); - } - - public static boolean deep703(boolean x) { - return deep704(x); - } - - public static boolean deep704(boolean x) { - return deep705(x); - } - - public static boolean deep705(boolean x) { - return deep706(x); - } - - public static boolean deep706(boolean x) { - return deep707(x); - } - - public static boolean deep707(boolean x) { - return deep708(x); - } - - public static boolean deep708(boolean x) { - return deep709(x); - } - - public static boolean deep709(boolean x) { - return deep710(x); - } - - public static boolean deep710(boolean x) { - return deep711(x); - } - - public static boolean deep711(boolean x) { - return deep712(x); - } - - public static boolean deep712(boolean x) { - return deep713(x); - } - - public static boolean deep713(boolean x) { - return deep714(x); - } - - public static boolean deep714(boolean x) { - return deep715(x); - } - - public static boolean deep715(boolean x) { - return deep716(x); - } - - public static boolean deep716(boolean x) { - return deep717(x); - } - - public static boolean deep717(boolean x) { - return deep718(x); - } - - public static boolean deep718(boolean x) { - return deep719(x); - } - - public static boolean deep719(boolean x) { - return deep720(x); - } - - public static boolean deep720(boolean x) { - return deep721(x); - } - - public static boolean deep721(boolean x) { - return deep722(x); - } - - public static boolean deep722(boolean x) { - return deep723(x); - } - - public static boolean deep723(boolean x) { - return deep724(x); - } - - public static boolean deep724(boolean x) { - return deep725(x); - } - - public static boolean deep725(boolean x) { - return deep726(x); - } - - public static boolean deep726(boolean x) { - return deep727(x); - } - - public static boolean deep727(boolean x) { - return deep728(x); - } - - public static boolean deep728(boolean x) { - return deep729(x); - } - - public static boolean deep729(boolean x) { - return deep730(x); - } - - public static boolean deep730(boolean x) { - return deep731(x); - } - - public static boolean deep731(boolean x) { - return deep732(x); - } - - public static boolean deep732(boolean x) { - return deep733(x); - } - - public static boolean deep733(boolean x) { - return deep734(x); - } - - public static boolean deep734(boolean x) { - return deep735(x); - } - - public static boolean deep735(boolean x) { - return deep736(x); - } - - public static boolean deep736(boolean x) { - return deep737(x); - } - - public static boolean deep737(boolean x) { - return deep738(x); - } - - public static boolean deep738(boolean x) { - return deep739(x); - } - - public static boolean deep739(boolean x) { - return deep740(x); - } - - public static boolean deep740(boolean x) { - return deep741(x); - } - - public static boolean deep741(boolean x) { - return deep742(x); - } - - public static boolean deep742(boolean x) { - return deep743(x); - } - - public static boolean deep743(boolean x) { - return deep744(x); - } - - public static boolean deep744(boolean x) { - return deep745(x); - } - - public static boolean deep745(boolean x) { - return deep746(x); - } - - public static boolean deep746(boolean x) { - return deep747(x); - } - - public static boolean deep747(boolean x) { - return deep748(x); - } - - public static boolean deep748(boolean x) { - return deep749(x); - } - - public static boolean deep749(boolean x) { - return deep750(x); - } - - public static boolean deep750(boolean x) { - return deep751(x); - } - - public static boolean deep751(boolean x) { - return deep752(x); - } - - public static boolean deep752(boolean x) { - return deep753(x); - } - - public static boolean deep753(boolean x) { - return deep754(x); - } - - public static boolean deep754(boolean x) { - return deep755(x); - } - - public static boolean deep755(boolean x) { - return deep756(x); - } - - public static boolean deep756(boolean x) { - return deep757(x); - } - - public static boolean deep757(boolean x) { - return deep758(x); - } - - public static boolean deep758(boolean x) { - return deep759(x); - } - - public static boolean deep759(boolean x) { - return deep760(x); - } - - public static boolean deep760(boolean x) { - return deep761(x); - } - - public static boolean deep761(boolean x) { - return deep762(x); - } - - public static boolean deep762(boolean x) { - return deep763(x); - } - - public static boolean deep763(boolean x) { - return deep764(x); - } - - public static boolean deep764(boolean x) { - return deep765(x); - } - - public static boolean deep765(boolean x) { - return deep766(x); - } - - public static boolean deep766(boolean x) { - return deep767(x); - } - - public static boolean deep767(boolean x) { - return deep768(x); - } - - public static boolean deep768(boolean x) { - return deep769(x); - } - - public static boolean deep769(boolean x) { - return deep770(x); - } - - public static boolean deep770(boolean x) { - return deep771(x); - } - - public static boolean deep771(boolean x) { - return deep772(x); - } - - public static boolean deep772(boolean x) { - return deep773(x); - } - - public static boolean deep773(boolean x) { - return deep774(x); - } - - public static boolean deep774(boolean x) { - return deep775(x); - } - - public static boolean deep775(boolean x) { - return deep776(x); - } - - public static boolean deep776(boolean x) { - return deep777(x); - } - - public static boolean deep777(boolean x) { - return deep778(x); - } - - public static boolean deep778(boolean x) { - return deep779(x); - } - - public static boolean deep779(boolean x) { - return deep780(x); - } - - public static boolean deep780(boolean x) { - return deep781(x); - } - - public static boolean deep781(boolean x) { - return deep782(x); - } - - public static boolean deep782(boolean x) { - return deep783(x); - } - - public static boolean deep783(boolean x) { - return deep784(x); - } - - public static boolean deep784(boolean x) { - return deep785(x); - } - - public static boolean deep785(boolean x) { - return deep786(x); - } - - public static boolean deep786(boolean x) { - return deep787(x); - } - - public static boolean deep787(boolean x) { - return deep788(x); - } - - public static boolean deep788(boolean x) { - return deep789(x); - } - - public static boolean deep789(boolean x) { - return deep790(x); - } - - public static boolean deep790(boolean x) { - return deep791(x); - } - - public static boolean deep791(boolean x) { - return deep792(x); - } - - public static boolean deep792(boolean x) { - return deep793(x); - } - - public static boolean deep793(boolean x) { - return deep794(x); - } - - public static boolean deep794(boolean x) { - return deep795(x); - } - - public static boolean deep795(boolean x) { - return deep796(x); - } - - public static boolean deep796(boolean x) { - return deep797(x); - } - - public static boolean deep797(boolean x) { - return deep798(x); - } - - public static boolean deep798(boolean x) { - return deep799(x); - } - - public static boolean deep799(boolean x) { - return deep800(x); - } - - public static boolean deep800(boolean x) { - return deep801(x); - } - - public static boolean deep801(boolean x) { - return deep802(x); - } - - public static boolean deep802(boolean x) { - return deep803(x); - } - - public static boolean deep803(boolean x) { - return deep804(x); - } - - public static boolean deep804(boolean x) { - return deep805(x); - } - - public static boolean deep805(boolean x) { - return deep806(x); - } - - public static boolean deep806(boolean x) { - return deep807(x); - } - - public static boolean deep807(boolean x) { - return deep808(x); - } - - public static boolean deep808(boolean x) { - return deep809(x); - } - - public static boolean deep809(boolean x) { - return deep810(x); - } - - public static boolean deep810(boolean x) { - return deep811(x); - } - - public static boolean deep811(boolean x) { - return deep812(x); - } - - public static boolean deep812(boolean x) { - return deep813(x); - } - - public static boolean deep813(boolean x) { - return deep814(x); - } - - public static boolean deep814(boolean x) { - return deep815(x); - } - - public static boolean deep815(boolean x) { - return deep816(x); - } - - public static boolean deep816(boolean x) { - return deep817(x); - } - - public static boolean deep817(boolean x) { - return deep818(x); - } - - public static boolean deep818(boolean x) { - return deep819(x); - } - - public static boolean deep819(boolean x) { - return deep820(x); - } - - public static boolean deep820(boolean x) { - return deep821(x); - } - - public static boolean deep821(boolean x) { - return deep822(x); - } - - public static boolean deep822(boolean x) { - return deep823(x); - } - - public static boolean deep823(boolean x) { - return deep824(x); - } - - public static boolean deep824(boolean x) { - return deep825(x); - } - - public static boolean deep825(boolean x) { - return deep826(x); - } - - public static boolean deep826(boolean x) { - return deep827(x); - } - - public static boolean deep827(boolean x) { - return deep828(x); - } - - public static boolean deep828(boolean x) { - return deep829(x); - } - - public static boolean deep829(boolean x) { - return deep830(x); - } - - public static boolean deep830(boolean x) { - return deep831(x); - } - - public static boolean deep831(boolean x) { - return deep832(x); - } - - public static boolean deep832(boolean x) { - return deep833(x); - } - - public static boolean deep833(boolean x) { - return deep834(x); - } - - public static boolean deep834(boolean x) { - return deep835(x); - } - - public static boolean deep835(boolean x) { - return deep836(x); - } - - public static boolean deep836(boolean x) { - return deep837(x); - } - - public static boolean deep837(boolean x) { - return deep838(x); - } - - public static boolean deep838(boolean x) { - return deep839(x); - } - - public static boolean deep839(boolean x) { - return deep840(x); - } - - public static boolean deep840(boolean x) { - return deep841(x); - } - - public static boolean deep841(boolean x) { - return deep842(x); - } - - public static boolean deep842(boolean x) { - return deep843(x); - } - - public static boolean deep843(boolean x) { - return deep844(x); - } - - public static boolean deep844(boolean x) { - return deep845(x); - } - - public static boolean deep845(boolean x) { - return deep846(x); - } - - public static boolean deep846(boolean x) { - return deep847(x); - } - - public static boolean deep847(boolean x) { - return deep848(x); - } - - public static boolean deep848(boolean x) { - return deep849(x); - } - - public static boolean deep849(boolean x) { - return deep850(x); - } - - public static boolean deep850(boolean x) { - return deep851(x); - } - - public static boolean deep851(boolean x) { - return deep852(x); - } - - public static boolean deep852(boolean x) { - return deep853(x); - } - - public static boolean deep853(boolean x) { - return deep854(x); - } - - public static boolean deep854(boolean x) { - return deep855(x); - } - - public static boolean deep855(boolean x) { - return deep856(x); - } - - public static boolean deep856(boolean x) { - return deep857(x); - } - - public static boolean deep857(boolean x) { - return deep858(x); - } - - public static boolean deep858(boolean x) { - return deep859(x); - } - - public static boolean deep859(boolean x) { - return deep860(x); - } - - public static boolean deep860(boolean x) { - return deep861(x); - } - - public static boolean deep861(boolean x) { - return deep862(x); - } - - public static boolean deep862(boolean x) { - return deep863(x); - } - - public static boolean deep863(boolean x) { - return deep864(x); - } - - public static boolean deep864(boolean x) { - return deep865(x); - } - - public static boolean deep865(boolean x) { - return deep866(x); - } - - public static boolean deep866(boolean x) { - return deep867(x); - } - - public static boolean deep867(boolean x) { - return deep868(x); - } - - public static boolean deep868(boolean x) { - return deep869(x); - } - - public static boolean deep869(boolean x) { - return deep870(x); - } - - public static boolean deep870(boolean x) { - return deep871(x); - } - - public static boolean deep871(boolean x) { - return deep872(x); - } - - public static boolean deep872(boolean x) { - return deep873(x); - } - - public static boolean deep873(boolean x) { - return deep874(x); - } - - public static boolean deep874(boolean x) { - return deep875(x); - } - - public static boolean deep875(boolean x) { - return deep876(x); - } - - public static boolean deep876(boolean x) { - return deep877(x); - } - - public static boolean deep877(boolean x) { - return deep878(x); - } - - public static boolean deep878(boolean x) { - return deep879(x); - } - - public static boolean deep879(boolean x) { - return deep880(x); - } - - public static boolean deep880(boolean x) { - return deep881(x); - } - - public static boolean deep881(boolean x) { - return deep882(x); - } - - public static boolean deep882(boolean x) { - return deep883(x); - } - - public static boolean deep883(boolean x) { - return deep884(x); - } - - public static boolean deep884(boolean x) { - return deep885(x); - } - - public static boolean deep885(boolean x) { - return deep886(x); - } - - public static boolean deep886(boolean x) { - return deep887(x); - } - - public static boolean deep887(boolean x) { - return deep888(x); - } - - public static boolean deep888(boolean x) { - return deep889(x); - } - - public static boolean deep889(boolean x) { - return deep890(x); - } - - public static boolean deep890(boolean x) { - return deep891(x); - } - - public static boolean deep891(boolean x) { - return deep892(x); - } - - public static boolean deep892(boolean x) { - return deep893(x); - } - - public static boolean deep893(boolean x) { - return deep894(x); - } - - public static boolean deep894(boolean x) { - return deep895(x); - } - - public static boolean deep895(boolean x) { - return deep896(x); - } - - public static boolean deep896(boolean x) { - return deep897(x); - } - - public static boolean deep897(boolean x) { - return deep898(x); - } - - public static boolean deep898(boolean x) { - return deep899(x); - } - - public static boolean deep899(boolean x) { - return deep900(x); - } - - public static boolean deep900(boolean x) { - return deep901(x); - } - - public static boolean deep901(boolean x) { - return deep902(x); - } - - public static boolean deep902(boolean x) { - return deep903(x); - } - - public static boolean deep903(boolean x) { - return deep904(x); - } - - public static boolean deep904(boolean x) { - return deep905(x); - } - - public static boolean deep905(boolean x) { - return deep906(x); - } - - public static boolean deep906(boolean x) { - return deep907(x); - } - - public static boolean deep907(boolean x) { - return deep908(x); - } - - public static boolean deep908(boolean x) { - return deep909(x); - } - - public static boolean deep909(boolean x) { - return deep910(x); - } - - public static boolean deep910(boolean x) { - return deep911(x); - } - - public static boolean deep911(boolean x) { - return deep912(x); - } - - public static boolean deep912(boolean x) { - return deep913(x); - } - - public static boolean deep913(boolean x) { - return deep914(x); - } - - public static boolean deep914(boolean x) { - return deep915(x); - } - - public static boolean deep915(boolean x) { - return deep916(x); - } - - public static boolean deep916(boolean x) { - return deep917(x); - } - - public static boolean deep917(boolean x) { - return deep918(x); - } - - public static boolean deep918(boolean x) { - return deep919(x); - } - - public static boolean deep919(boolean x) { - return deep920(x); - } - - public static boolean deep920(boolean x) { - return deep921(x); - } - - public static boolean deep921(boolean x) { - return deep922(x); - } - - public static boolean deep922(boolean x) { - return deep923(x); - } - - public static boolean deep923(boolean x) { - return deep924(x); - } - - public static boolean deep924(boolean x) { - return deep925(x); - } - - public static boolean deep925(boolean x) { - return deep926(x); - } - - public static boolean deep926(boolean x) { - return deep927(x); - } - - public static boolean deep927(boolean x) { - return deep928(x); - } - - public static boolean deep928(boolean x) { - return deep929(x); - } - - public static boolean deep929(boolean x) { - return deep930(x); - } - - public static boolean deep930(boolean x) { - return deep931(x); - } - - public static boolean deep931(boolean x) { - return deep932(x); - } - - public static boolean deep932(boolean x) { - return deep933(x); - } - - public static boolean deep933(boolean x) { - return deep934(x); - } - - public static boolean deep934(boolean x) { - return deep935(x); - } - - public static boolean deep935(boolean x) { - return deep936(x); - } - - public static boolean deep936(boolean x) { - return deep937(x); - } - - public static boolean deep937(boolean x) { - return deep938(x); - } - - public static boolean deep938(boolean x) { - return deep939(x); - } - - public static boolean deep939(boolean x) { - return deep940(x); - } - - public static boolean deep940(boolean x) { - return deep941(x); - } - - public static boolean deep941(boolean x) { - return deep942(x); - } - - public static boolean deep942(boolean x) { - return deep943(x); - } - - public static boolean deep943(boolean x) { - return deep944(x); - } - - public static boolean deep944(boolean x) { - return deep945(x); - } - - public static boolean deep945(boolean x) { - return deep946(x); - } - - public static boolean deep946(boolean x) { - return deep947(x); - } - - public static boolean deep947(boolean x) { - return deep948(x); - } - - public static boolean deep948(boolean x) { - return deep949(x); - } - - public static boolean deep949(boolean x) { - return deep950(x); - } - - public static boolean deep950(boolean x) { - return deep951(x); - } - - public static boolean deep951(boolean x) { - return deep952(x); - } - - public static boolean deep952(boolean x) { - return deep953(x); - } - - public static boolean deep953(boolean x) { - return deep954(x); - } - - public static boolean deep954(boolean x) { - return deep955(x); - } - - public static boolean deep955(boolean x) { - return deep956(x); - } - - public static boolean deep956(boolean x) { - return deep957(x); - } - - public static boolean deep957(boolean x) { - return deep958(x); - } - - public static boolean deep958(boolean x) { - return deep959(x); - } - - public static boolean deep959(boolean x) { - return deep960(x); - } - - public static boolean deep960(boolean x) { - return deep961(x); - } - - public static boolean deep961(boolean x) { - return deep962(x); - } - - public static boolean deep962(boolean x) { - return deep963(x); - } - - public static boolean deep963(boolean x) { - return deep964(x); - } - - public static boolean deep964(boolean x) { - return deep965(x); - } - - public static boolean deep965(boolean x) { - return deep966(x); - } - - public static boolean deep966(boolean x) { - return deep967(x); - } - - public static boolean deep967(boolean x) { - return deep968(x); - } - - public static boolean deep968(boolean x) { - return deep969(x); - } - - public static boolean deep969(boolean x) { - return deep970(x); - } - - public static boolean deep970(boolean x) { - return deep971(x); - } - - public static boolean deep971(boolean x) { - return deep972(x); - } - - public static boolean deep972(boolean x) { - return deep973(x); - } - - public static boolean deep973(boolean x) { - return deep974(x); - } - - public static boolean deep974(boolean x) { - return deep975(x); - } - - public static boolean deep975(boolean x) { - return deep976(x); - } - - public static boolean deep976(boolean x) { - return deep977(x); - } - - public static boolean deep977(boolean x) { - return deep978(x); - } - - public static boolean deep978(boolean x) { - return deep979(x); - } - - public static boolean deep979(boolean x) { - return deep980(x); - } - - public static boolean deep980(boolean x) { - return deep981(x); - } - - public static boolean deep981(boolean x) { - return deep982(x); - } - - public static boolean deep982(boolean x) { - return deep983(x); - } - - public static boolean deep983(boolean x) { - return deep984(x); - } - - public static boolean deep984(boolean x) { - return deep985(x); - } - - public static boolean deep985(boolean x) { - return deep986(x); - } - - public static boolean deep986(boolean x) { - return deep987(x); - } - - public static boolean deep987(boolean x) { - return deep988(x); - } - - public static boolean deep988(boolean x) { - return deep989(x); - } - - public static boolean deep989(boolean x) { - return deep990(x); - } - - public static boolean deep990(boolean x) { - return deep991(x); - } - - public static boolean deep991(boolean x) { - return deep992(x); - } - - public static boolean deep992(boolean x) { - return deep993(x); - } - - public static boolean deep993(boolean x) { - return deep994(x); - } - - public static boolean deep994(boolean x) { - return deep995(x); - } - - public static boolean deep995(boolean x) { - return deep996(x); - } - - public static boolean deep996(boolean x) { - return deep997(x); - } - - public static boolean deep997(boolean x) { - return deep998(x); - } - - public static boolean deep998(boolean x) { - return deep999(x); - } - - public static boolean deep999(boolean x) { - return deep1000(x); - } - - public static boolean deep1000(boolean x) { - return deep1001(x); - } - - public static boolean deep1001(boolean x) { - return deep1002(x); - } - - public static boolean deep1002(boolean x) { - return deep1003(x); - } - - public static boolean deep1003(boolean x) { - return deep1004(x); - } - - public static boolean deep1004(boolean x) { - return deep1005(x); - } - - public static boolean deep1005(boolean x) { - return deep1006(x); - } - - public static boolean deep1006(boolean x) { - return deep1007(x); - } - - public static boolean deep1007(boolean x) { - return deep1008(x); - } - - public static boolean deep1008(boolean x) { - return deep1009(x); - } - - public static boolean deep1009(boolean x) { - return deep1010(x); - } - - public static boolean deep1010(boolean x) { - return deep1011(x); - } - - public static boolean deep1011(boolean x) { - return deep1012(x); - } - - public static boolean deep1012(boolean x) { - return deep1013(x); - } - - public static boolean deep1013(boolean x) { - return deep1014(x); - } - - public static boolean deep1014(boolean x) { - return deep1015(x); - } - - public static boolean deep1015(boolean x) { - return deep1016(x); - } - - public static boolean deep1016(boolean x) { - return deep1017(x); - } - - public static boolean deep1017(boolean x) { - return deep1018(x); - } - - public static boolean deep1018(boolean x) { - return deep1019(x); - } - - public static boolean deep1019(boolean x) { - return deep1020(x); - } - - public static boolean deep1020(boolean x) { - return deep1021(x); - } - - public static boolean deep1021(boolean x) { - return deep1022(x); - } - - public static boolean deep1022(boolean x) { - return deep1023(x); - } - - public static boolean deep1023(boolean x) { - return deep1024(x); - } - - public static boolean deep1024(boolean x) { - return deep1025(x); - } - - public static boolean deep1025(boolean x) { - return deep1026(x); - } - - public static boolean deep1026(boolean x) { - return deep1027(x); - } - - public static boolean deep1027(boolean x) { - return deep1028(x); - } - - public static boolean deep1028(boolean x) { - return deep1029(x); - } - - public static boolean deep1029(boolean x) { - return deep1030(x); - } - - public static boolean deep1030(boolean x) { - return deep1031(x); - } - - public static boolean deep1031(boolean x) { - return deep1032(x); - } - - public static boolean deep1032(boolean x) { - return deep1033(x); - } - - public static boolean deep1033(boolean x) { - return deep1034(x); - } - - public static boolean deep1034(boolean x) { - return deep1035(x); - } - - public static boolean deep1035(boolean x) { - return deep1036(x); - } - - public static boolean deep1036(boolean x) { - return deep1037(x); - } - - public static boolean deep1037(boolean x) { - return deep1038(x); - } - - public static boolean deep1038(boolean x) { - return deep1039(x); - } - - public static boolean deep1039(boolean x) { - return deep1040(x); - } - - public static boolean deep1040(boolean x) { - return deep1041(x); - } - - public static boolean deep1041(boolean x) { - return deep1042(x); - } - - public static boolean deep1042(boolean x) { - return deep1043(x); - } - - public static boolean deep1043(boolean x) { - return deep1044(x); - } - - public static boolean deep1044(boolean x) { - return deep1045(x); - } - - public static boolean deep1045(boolean x) { - return deep1046(x); - } - - public static boolean deep1046(boolean x) { - return deep1047(x); - } - - public static boolean deep1047(boolean x) { - return deep1048(x); - } - - public static boolean deep1048(boolean x) { - return deep1049(x); - } - - public static boolean deep1049(boolean x) { - return deep1050(x); - } - - public static boolean deep1050(boolean x) { - return deep1051(x); - } - - public static boolean deep1051(boolean x) { - return deep1052(x); - } - - public static boolean deep1052(boolean x) { - return deep1053(x); - } - - public static boolean deep1053(boolean x) { - return deep1054(x); - } - - public static boolean deep1054(boolean x) { - return deep1055(x); - } - - public static boolean deep1055(boolean x) { - return deep1056(x); - } - - public static boolean deep1056(boolean x) { - return deep1057(x); - } - - public static boolean deep1057(boolean x) { - return deep1058(x); - } - - public static boolean deep1058(boolean x) { - return deep1059(x); - } - - public static boolean deep1059(boolean x) { - return deep1060(x); - } - - public static boolean deep1060(boolean x) { - return deep1061(x); - } - - public static boolean deep1061(boolean x) { - return deep1062(x); - } - - public static boolean deep1062(boolean x) { - return deep1063(x); - } - - public static boolean deep1063(boolean x) { - return deep1064(x); - } - - public static boolean deep1064(boolean x) { - return deep1065(x); - } - - public static boolean deep1065(boolean x) { - return deep1066(x); - } - - public static boolean deep1066(boolean x) { - return deep1067(x); - } - - public static boolean deep1067(boolean x) { - return deep1068(x); - } - - public static boolean deep1068(boolean x) { - return deep1069(x); - } - - public static boolean deep1069(boolean x) { - return deep1070(x); - } - - public static boolean deep1070(boolean x) { - return deep1071(x); - } - - public static boolean deep1071(boolean x) { - return deep1072(x); - } - - public static boolean deep1072(boolean x) { - return deep1073(x); - } - - public static boolean deep1073(boolean x) { - return deep1074(x); - } - - public static boolean deep1074(boolean x) { - return deep1075(x); - } - - public static boolean deep1075(boolean x) { - return deep1076(x); - } - - public static boolean deep1076(boolean x) { - return deep1077(x); - } - - public static boolean deep1077(boolean x) { - return deep1078(x); - } - - public static boolean deep1078(boolean x) { - return deep1079(x); - } - - public static boolean deep1079(boolean x) { - return deep1080(x); - } - - public static boolean deep1080(boolean x) { - return deep1081(x); - } - - public static boolean deep1081(boolean x) { - return deep1082(x); - } - - public static boolean deep1082(boolean x) { - return deep1083(x); - } - - public static boolean deep1083(boolean x) { - return deep1084(x); - } - - public static boolean deep1084(boolean x) { - return deep1085(x); - } - - public static boolean deep1085(boolean x) { - return deep1086(x); - } - - public static boolean deep1086(boolean x) { - return deep1087(x); - } - - public static boolean deep1087(boolean x) { - return deep1088(x); - } - - public static boolean deep1088(boolean x) { - return deep1089(x); - } - - public static boolean deep1089(boolean x) { - return deep1090(x); - } - - public static boolean deep1090(boolean x) { - return deep1091(x); - } - - public static boolean deep1091(boolean x) { - return deep1092(x); - } - - public static boolean deep1092(boolean x) { - return deep1093(x); - } - - public static boolean deep1093(boolean x) { - return deep1094(x); - } - - public static boolean deep1094(boolean x) { - return deep1095(x); - } - - public static boolean deep1095(boolean x) { - return deep1096(x); - } - - public static boolean deep1096(boolean x) { - return deep1097(x); - } - - public static boolean deep1097(boolean x) { - return deep1098(x); - } - - public static boolean deep1098(boolean x) { - return deep1099(x); - } - - public static boolean deep1099(boolean x) { - return deep1100(x); - } - - public static boolean deep1100(boolean x) { - return deep1101(x); - } - - public static boolean deep1101(boolean x) { - return deep1102(x); - } - - public static boolean deep1102(boolean x) { - return deep1103(x); - } - - public static boolean deep1103(boolean x) { - return deep1104(x); - } - - public static boolean deep1104(boolean x) { - return deep1105(x); - } - - public static boolean deep1105(boolean x) { - return deep1106(x); - } - - public static boolean deep1106(boolean x) { - return deep1107(x); - } - - public static boolean deep1107(boolean x) { - return deep1108(x); - } - - public static boolean deep1108(boolean x) { - return deep1109(x); - } - - public static boolean deep1109(boolean x) { - return deep1110(x); - } - - public static boolean deep1110(boolean x) { - return deep1111(x); - } - - public static boolean deep1111(boolean x) { - return deep1112(x); - } - - public static boolean deep1112(boolean x) { - return deep1113(x); - } - - public static boolean deep1113(boolean x) { - return deep1114(x); - } - - public static boolean deep1114(boolean x) { - return deep1115(x); - } - - public static boolean deep1115(boolean x) { - return deep1116(x); - } - - public static boolean deep1116(boolean x) { - return deep1117(x); - } - - public static boolean deep1117(boolean x) { - return deep1118(x); - } - - public static boolean deep1118(boolean x) { - return deep1119(x); - } - - public static boolean deep1119(boolean x) { - return deep1120(x); - } - - public static boolean deep1120(boolean x) { - return deep1121(x); - } - - public static boolean deep1121(boolean x) { - return deep1122(x); - } - - public static boolean deep1122(boolean x) { - return deep1123(x); - } - - public static boolean deep1123(boolean x) { - return deep1124(x); - } - - public static boolean deep1124(boolean x) { - return deep1125(x); - } - - public static boolean deep1125(boolean x) { - return deep1126(x); - } - - public static boolean deep1126(boolean x) { - return deep1127(x); - } - - public static boolean deep1127(boolean x) { - return deep1128(x); - } - - public static boolean deep1128(boolean x) { - return deep1129(x); - } - - public static boolean deep1129(boolean x) { - return deep1130(x); - } - - public static boolean deep1130(boolean x) { - return deep1131(x); - } - - public static boolean deep1131(boolean x) { - return deep1132(x); - } - - public static boolean deep1132(boolean x) { - return deep1133(x); - } - - public static boolean deep1133(boolean x) { - return deep1134(x); - } - - public static boolean deep1134(boolean x) { - return deep1135(x); - } - - public static boolean deep1135(boolean x) { - return deep1136(x); - } - - public static boolean deep1136(boolean x) { - return deep1137(x); - } - - public static boolean deep1137(boolean x) { - return deep1138(x); - } - - public static boolean deep1138(boolean x) { - return deep1139(x); - } - - public static boolean deep1139(boolean x) { - return deep1140(x); - } - - public static boolean deep1140(boolean x) { - return deep1141(x); - } - - public static boolean deep1141(boolean x) { - return deep1142(x); - } - - public static boolean deep1142(boolean x) { - return deep1143(x); - } - - public static boolean deep1143(boolean x) { - return deep1144(x); - } - - public static boolean deep1144(boolean x) { - return deep1145(x); - } - - public static boolean deep1145(boolean x) { - return deep1146(x); - } - - public static boolean deep1146(boolean x) { - return deep1147(x); - } - - public static boolean deep1147(boolean x) { - return deep1148(x); - } - - public static boolean deep1148(boolean x) { - return deep1149(x); - } - - public static boolean deep1149(boolean x) { - return deep1150(x); - } - - public static boolean deep1150(boolean x) { - return deep1151(x); - } - - public static boolean deep1151(boolean x) { - return deep1152(x); - } - - public static boolean deep1152(boolean x) { - return deep1153(x); - } - - public static boolean deep1153(boolean x) { - return deep1154(x); - } - - public static boolean deep1154(boolean x) { - return deep1155(x); - } - - public static boolean deep1155(boolean x) { - return deep1156(x); - } - - public static boolean deep1156(boolean x) { - return deep1157(x); - } - - public static boolean deep1157(boolean x) { - return deep1158(x); - } - - public static boolean deep1158(boolean x) { - return deep1159(x); - } - - public static boolean deep1159(boolean x) { - return deep1160(x); - } - - public static boolean deep1160(boolean x) { - return deep1161(x); - } - - public static boolean deep1161(boolean x) { - return deep1162(x); - } - - public static boolean deep1162(boolean x) { - return deep1163(x); - } - - public static boolean deep1163(boolean x) { - return deep1164(x); - } - - public static boolean deep1164(boolean x) { - return deep1165(x); - } - - public static boolean deep1165(boolean x) { - return deep1166(x); - } - - public static boolean deep1166(boolean x) { - return deep1167(x); - } - - public static boolean deep1167(boolean x) { - return deep1168(x); - } - - public static boolean deep1168(boolean x) { - return deep1169(x); - } - - public static boolean deep1169(boolean x) { - return deep1170(x); - } - - public static boolean deep1170(boolean x) { - return deep1171(x); - } - - public static boolean deep1171(boolean x) { - return deep1172(x); - } - - public static boolean deep1172(boolean x) { - return deep1173(x); - } - - public static boolean deep1173(boolean x) { - return deep1174(x); - } - - public static boolean deep1174(boolean x) { - return deep1175(x); - } - - public static boolean deep1175(boolean x) { - return deep1176(x); - } - - public static boolean deep1176(boolean x) { - return deep1177(x); - } - - public static boolean deep1177(boolean x) { - return deep1178(x); - } - - public static boolean deep1178(boolean x) { - return deep1179(x); - } - - public static boolean deep1179(boolean x) { - return deep1180(x); - } - - public static boolean deep1180(boolean x) { - return deep1181(x); - } - - public static boolean deep1181(boolean x) { - return deep1182(x); - } - - public static boolean deep1182(boolean x) { - return deep1183(x); - } - - public static boolean deep1183(boolean x) { - return deep1184(x); - } - - public static boolean deep1184(boolean x) { - return deep1185(x); - } - - public static boolean deep1185(boolean x) { - return deep1186(x); - } - - public static boolean deep1186(boolean x) { - return deep1187(x); - } - - public static boolean deep1187(boolean x) { - return deep1188(x); - } - - public static boolean deep1188(boolean x) { - return deep1189(x); - } - - public static boolean deep1189(boolean x) { - return deep1190(x); - } - - public static boolean deep1190(boolean x) { - return deep1191(x); - } - - public static boolean deep1191(boolean x) { - return deep1192(x); - } - - public static boolean deep1192(boolean x) { - return deep1193(x); - } - - public static boolean deep1193(boolean x) { - return deep1194(x); - } - - public static boolean deep1194(boolean x) { - return deep1195(x); - } - - public static boolean deep1195(boolean x) { - return deep1196(x); - } - - public static boolean deep1196(boolean x) { - return deep1197(x); - } - - public static boolean deep1197(boolean x) { - return deep1198(x); - } - - public static boolean deep1198(boolean x) { - return deep1199(x); - } - - public static boolean deep1199(boolean x) { - return deep1200(x); - } - - public static boolean deep1200(boolean x) { - return deep1201(x); - } - - public static boolean deep1201(boolean x) { - return deep1202(x); - } - - public static boolean deep1202(boolean x) { - return deep1203(x); - } - - public static boolean deep1203(boolean x) { - return deep1204(x); - } - - public static boolean deep1204(boolean x) { - return deep1205(x); - } - - public static boolean deep1205(boolean x) { - return deep1206(x); - } - - public static boolean deep1206(boolean x) { - return deep1207(x); - } - - public static boolean deep1207(boolean x) { - return deep1208(x); - } - - public static boolean deep1208(boolean x) { - return deep1209(x); - } - - public static boolean deep1209(boolean x) { - return deep1210(x); - } - - public static boolean deep1210(boolean x) { - return deep1211(x); - } - - public static boolean deep1211(boolean x) { - return deep1212(x); - } - - public static boolean deep1212(boolean x) { - return deep1213(x); - } - - public static boolean deep1213(boolean x) { - return deep1214(x); - } - - public static boolean deep1214(boolean x) { - return deep1215(x); - } - - public static boolean deep1215(boolean x) { - return deep1216(x); - } - - public static boolean deep1216(boolean x) { - return deep1217(x); - } - - public static boolean deep1217(boolean x) { - return deep1218(x); - } - - public static boolean deep1218(boolean x) { - return deep1219(x); - } - - public static boolean deep1219(boolean x) { - return deep1220(x); - } - - public static boolean deep1220(boolean x) { - return deep1221(x); - } - - public static boolean deep1221(boolean x) { - return deep1222(x); - } - - public static boolean deep1222(boolean x) { - return deep1223(x); - } - - public static boolean deep1223(boolean x) { - return deep1224(x); - } - - public static boolean deep1224(boolean x) { - return deep1225(x); - } - - public static boolean deep1225(boolean x) { - return deep1226(x); - } - - public static boolean deep1226(boolean x) { - return deep1227(x); - } - - public static boolean deep1227(boolean x) { - return deep1228(x); - } - - public static boolean deep1228(boolean x) { - return deep1229(x); - } - - public static boolean deep1229(boolean x) { - return deep1230(x); - } - - public static boolean deep1230(boolean x) { - return deep1231(x); - } - - public static boolean deep1231(boolean x) { - return deep1232(x); - } - - public static boolean deep1232(boolean x) { - return deep1233(x); - } - - public static boolean deep1233(boolean x) { - return deep1234(x); - } - - public static boolean deep1234(boolean x) { - return deep1235(x); - } - - public static boolean deep1235(boolean x) { - return deep1236(x); - } - - public static boolean deep1236(boolean x) { - return deep1237(x); - } - - public static boolean deep1237(boolean x) { - return deep1238(x); - } - - public static boolean deep1238(boolean x) { - return deep1239(x); - } - - public static boolean deep1239(boolean x) { - return deep1240(x); - } - - public static boolean deep1240(boolean x) { - return deep1241(x); - } - - public static boolean deep1241(boolean x) { - return deep1242(x); - } - - public static boolean deep1242(boolean x) { - return deep1243(x); - } - - public static boolean deep1243(boolean x) { - return deep1244(x); - } - - public static boolean deep1244(boolean x) { - return deep1245(x); - } - - public static boolean deep1245(boolean x) { - return deep1246(x); - } - - public static boolean deep1246(boolean x) { - return deep1247(x); - } - - public static boolean deep1247(boolean x) { - return deep1248(x); - } - - public static boolean deep1248(boolean x) { - return deep1249(x); - } - - public static boolean deep1249(boolean x) { - return deep1250(x); - } - - public static boolean deep1250(boolean x) { - return deep1251(x); - } - - public static boolean deep1251(boolean x) { - return deep1252(x); - } - - public static boolean deep1252(boolean x) { - return deep1253(x); - } - - public static boolean deep1253(boolean x) { - return deep1254(x); - } - - public static boolean deep1254(boolean x) { - return deep1255(x); - } - - public static boolean deep1255(boolean x) { - return deep1256(x); - } - - public static boolean deep1256(boolean x) { - return deep1257(x); - } - - public static boolean deep1257(boolean x) { - return deep1258(x); - } - - public static boolean deep1258(boolean x) { - return deep1259(x); - } - - public static boolean deep1259(boolean x) { - return deep1260(x); - } - - public static boolean deep1260(boolean x) { - return deep1261(x); - } - - public static boolean deep1261(boolean x) { - return deep1262(x); - } - - public static boolean deep1262(boolean x) { - return deep1263(x); - } - - public static boolean deep1263(boolean x) { - return deep1264(x); - } - - public static boolean deep1264(boolean x) { - return deep1265(x); - } - - public static boolean deep1265(boolean x) { - return deep1266(x); - } - - public static boolean deep1266(boolean x) { - return deep1267(x); - } - - public static boolean deep1267(boolean x) { - return deep1268(x); - } - - public static boolean deep1268(boolean x) { - return deep1269(x); - } - - public static boolean deep1269(boolean x) { - return deep1270(x); - } - - public static boolean deep1270(boolean x) { - return deep1271(x); - } - - public static boolean deep1271(boolean x) { - return deep1272(x); - } - - public static boolean deep1272(boolean x) { - return deep1273(x); - } - - public static boolean deep1273(boolean x) { - return deep1274(x); - } - - public static boolean deep1274(boolean x) { - return deep1275(x); - } - - public static boolean deep1275(boolean x) { - return deep1276(x); - } - - public static boolean deep1276(boolean x) { - return deep1277(x); - } - - public static boolean deep1277(boolean x) { - return deep1278(x); - } - - public static boolean deep1278(boolean x) { - return deep1279(x); - } - - public static boolean deep1279(boolean x) { - return deep1280(x); - } - - public static boolean deep1280(boolean x) { - return deep1281(x); - } - - public static boolean deep1281(boolean x) { - return deep1282(x); - } - - public static boolean deep1282(boolean x) { - return deep1283(x); - } - - public static boolean deep1283(boolean x) { - return deep1284(x); - } - - public static boolean deep1284(boolean x) { - return deep1285(x); - } - - public static boolean deep1285(boolean x) { - return deep1286(x); - } - - public static boolean deep1286(boolean x) { - return deep1287(x); - } - - public static boolean deep1287(boolean x) { - return deep1288(x); - } - - public static boolean deep1288(boolean x) { - return deep1289(x); - } - - public static boolean deep1289(boolean x) { - return deep1290(x); - } - - public static boolean deep1290(boolean x) { - return deep1291(x); - } - - public static boolean deep1291(boolean x) { - return deep1292(x); - } - - public static boolean deep1292(boolean x) { - return deep1293(x); - } - - public static boolean deep1293(boolean x) { - return deep1294(x); - } - - public static boolean deep1294(boolean x) { - return deep1295(x); - } - - public static boolean deep1295(boolean x) { - return deep1296(x); - } - - public static boolean deep1296(boolean x) { - return deep1297(x); - } - - public static boolean deep1297(boolean x) { - return deep1298(x); - } - - public static boolean deep1298(boolean x) { - return deep1299(x); - } - - public static boolean deep1299(boolean x) { - return deep1300(x); - } - - public static boolean deep1300(boolean x) { - return deep1301(x); - } - - public static boolean deep1301(boolean x) { - return deep1302(x); - } - - public static boolean deep1302(boolean x) { - return deep1303(x); - } - - public static boolean deep1303(boolean x) { - return deep1304(x); - } - - public static boolean deep1304(boolean x) { - return deep1305(x); - } - - public static boolean deep1305(boolean x) { - return deep1306(x); - } - - public static boolean deep1306(boolean x) { - return deep1307(x); - } - - public static boolean deep1307(boolean x) { - return deep1308(x); - } - - public static boolean deep1308(boolean x) { - return deep1309(x); - } - - public static boolean deep1309(boolean x) { - return deep1310(x); - } - - public static boolean deep1310(boolean x) { - return deep1311(x); - } - - public static boolean deep1311(boolean x) { - return deep1312(x); - } - - public static boolean deep1312(boolean x) { - return deep1313(x); - } - - public static boolean deep1313(boolean x) { - return deep1314(x); - } - - public static boolean deep1314(boolean x) { - return deep1315(x); - } - - public static boolean deep1315(boolean x) { - return deep1316(x); - } - - public static boolean deep1316(boolean x) { - return deep1317(x); - } - - public static boolean deep1317(boolean x) { - return deep1318(x); - } - - public static boolean deep1318(boolean x) { - return deep1319(x); - } - - public static boolean deep1319(boolean x) { - return deep1320(x); - } - - public static boolean deep1320(boolean x) { - return deep1321(x); - } - - public static boolean deep1321(boolean x) { - return deep1322(x); - } - - public static boolean deep1322(boolean x) { - return deep1323(x); - } - - public static boolean deep1323(boolean x) { - return deep1324(x); - } - - public static boolean deep1324(boolean x) { - return deep1325(x); - } - - public static boolean deep1325(boolean x) { - return deep1326(x); - } - - public static boolean deep1326(boolean x) { - return deep1327(x); - } - - public static boolean deep1327(boolean x) { - return deep1328(x); - } - - public static boolean deep1328(boolean x) { - return deep1329(x); - } - - public static boolean deep1329(boolean x) { - return deep1330(x); - } - - public static boolean deep1330(boolean x) { - return deep1331(x); - } - - public static boolean deep1331(boolean x) { - return deep1332(x); - } - - public static boolean deep1332(boolean x) { - return deep1333(x); - } - - public static boolean deep1333(boolean x) { - return deep1334(x); - } - - public static boolean deep1334(boolean x) { - return deep1335(x); - } - - public static boolean deep1335(boolean x) { - return deep1336(x); - } - - public static boolean deep1336(boolean x) { - return deep1337(x); - } - - public static boolean deep1337(boolean x) { - return deep1338(x); - } - - public static boolean deep1338(boolean x) { - return deep1339(x); - } - - public static boolean deep1339(boolean x) { - return deep1340(x); - } - - public static boolean deep1340(boolean x) { - return deep1341(x); - } - - public static boolean deep1341(boolean x) { - return deep1342(x); - } - - public static boolean deep1342(boolean x) { - return deep1343(x); - } - - public static boolean deep1343(boolean x) { - return deep1344(x); - } - - public static boolean deep1344(boolean x) { - return deep1345(x); - } - - public static boolean deep1345(boolean x) { - return deep1346(x); - } - - public static boolean deep1346(boolean x) { - return deep1347(x); - } - - public static boolean deep1347(boolean x) { - return deep1348(x); - } - - public static boolean deep1348(boolean x) { - return deep1349(x); - } - - public static boolean deep1349(boolean x) { - return deep1350(x); - } - - public static boolean deep1350(boolean x) { - return deep1351(x); - } - - public static boolean deep1351(boolean x) { - return deep1352(x); - } - - public static boolean deep1352(boolean x) { - return deep1353(x); - } - - public static boolean deep1353(boolean x) { - return deep1354(x); - } - - public static boolean deep1354(boolean x) { - return deep1355(x); - } - - public static boolean deep1355(boolean x) { - return deep1356(x); - } - - public static boolean deep1356(boolean x) { - return deep1357(x); - } - - public static boolean deep1357(boolean x) { - return deep1358(x); - } - - public static boolean deep1358(boolean x) { - return deep1359(x); - } - - public static boolean deep1359(boolean x) { - return deep1360(x); - } - - public static boolean deep1360(boolean x) { - return deep1361(x); - } - - public static boolean deep1361(boolean x) { - return deep1362(x); - } - - public static boolean deep1362(boolean x) { - return deep1363(x); - } - - public static boolean deep1363(boolean x) { - return deep1364(x); - } - - public static boolean deep1364(boolean x) { - return deep1365(x); - } - - public static boolean deep1365(boolean x) { - return deep1366(x); - } - - public static boolean deep1366(boolean x) { - return deep1367(x); - } - - public static boolean deep1367(boolean x) { - return deep1368(x); - } - - public static boolean deep1368(boolean x) { - return deep1369(x); - } - - public static boolean deep1369(boolean x) { - return deep1370(x); - } - - public static boolean deep1370(boolean x) { - return deep1371(x); - } - - public static boolean deep1371(boolean x) { - return deep1372(x); - } - - public static boolean deep1372(boolean x) { - return deep1373(x); - } - - public static boolean deep1373(boolean x) { - return deep1374(x); - } - - public static boolean deep1374(boolean x) { - return deep1375(x); - } - - public static boolean deep1375(boolean x) { - return deep1376(x); - } - - public static boolean deep1376(boolean x) { - return deep1377(x); - } - - public static boolean deep1377(boolean x) { - return deep1378(x); - } - - public static boolean deep1378(boolean x) { - return deep1379(x); - } - - public static boolean deep1379(boolean x) { - return deep1380(x); - } - - public static boolean deep1380(boolean x) { - return deep1381(x); - } - - public static boolean deep1381(boolean x) { - return deep1382(x); - } - - public static boolean deep1382(boolean x) { - return deep1383(x); - } - - public static boolean deep1383(boolean x) { - return deep1384(x); - } - - public static boolean deep1384(boolean x) { - return deep1385(x); - } - - public static boolean deep1385(boolean x) { - return deep1386(x); - } - - public static boolean deep1386(boolean x) { - return deep1387(x); - } - - public static boolean deep1387(boolean x) { - return deep1388(x); - } - - public static boolean deep1388(boolean x) { - return deep1389(x); - } - - public static boolean deep1389(boolean x) { - return deep1390(x); - } - - public static boolean deep1390(boolean x) { - return deep1391(x); - } - - public static boolean deep1391(boolean x) { - return deep1392(x); - } - - public static boolean deep1392(boolean x) { - return deep1393(x); - } - - public static boolean deep1393(boolean x) { - return deep1394(x); - } - - public static boolean deep1394(boolean x) { - return deep1395(x); - } - - public static boolean deep1395(boolean x) { - return deep1396(x); - } - - public static boolean deep1396(boolean x) { - return deep1397(x); - } - - public static boolean deep1397(boolean x) { - return deep1398(x); - } - - public static boolean deep1398(boolean x) { - return deep1399(x); - } - - public static boolean deep1399(boolean x) { - return deep1400(x); - } - - public static boolean deep1400(boolean x) { - return deep1401(x); - } - - public static boolean deep1401(boolean x) { - return deep1402(x); - } - - public static boolean deep1402(boolean x) { - return deep1403(x); - } - - public static boolean deep1403(boolean x) { - return deep1404(x); - } - - public static boolean deep1404(boolean x) { - return deep1405(x); - } - - public static boolean deep1405(boolean x) { - return deep1406(x); - } - - public static boolean deep1406(boolean x) { - return deep1407(x); - } - - public static boolean deep1407(boolean x) { - return deep1408(x); - } - - public static boolean deep1408(boolean x) { - return deep1409(x); - } - - public static boolean deep1409(boolean x) { - return deep1410(x); - } - - public static boolean deep1410(boolean x) { - return deep1411(x); - } - - public static boolean deep1411(boolean x) { - return deep1412(x); - } - - public static boolean deep1412(boolean x) { - return deep1413(x); - } - - public static boolean deep1413(boolean x) { - return deep1414(x); - } - - public static boolean deep1414(boolean x) { - return deep1415(x); - } - - public static boolean deep1415(boolean x) { - return deep1416(x); - } - - public static boolean deep1416(boolean x) { - return deep1417(x); - } - - public static boolean deep1417(boolean x) { - return deep1418(x); - } - - public static boolean deep1418(boolean x) { - return deep1419(x); - } - - public static boolean deep1419(boolean x) { - return deep1420(x); - } - - public static boolean deep1420(boolean x) { - return deep1421(x); - } - - public static boolean deep1421(boolean x) { - return deep1422(x); - } - - public static boolean deep1422(boolean x) { - return deep1423(x); - } - - public static boolean deep1423(boolean x) { - return deep1424(x); - } - - public static boolean deep1424(boolean x) { - return deep1425(x); - } - - public static boolean deep1425(boolean x) { - return deep1426(x); - } - - public static boolean deep1426(boolean x) { - return deep1427(x); - } - - public static boolean deep1427(boolean x) { - return deep1428(x); - } - - public static boolean deep1428(boolean x) { - return deep1429(x); - } - - public static boolean deep1429(boolean x) { - return deep1430(x); - } - - public static boolean deep1430(boolean x) { - return deep1431(x); - } - - public static boolean deep1431(boolean x) { - return deep1432(x); - } - - public static boolean deep1432(boolean x) { - return deep1433(x); - } - - public static boolean deep1433(boolean x) { - return deep1434(x); - } - - public static boolean deep1434(boolean x) { - return deep1435(x); - } - - public static boolean deep1435(boolean x) { - return deep1436(x); - } - - public static boolean deep1436(boolean x) { - return deep1437(x); - } - - public static boolean deep1437(boolean x) { - return deep1438(x); - } - - public static boolean deep1438(boolean x) { - return deep1439(x); - } - - public static boolean deep1439(boolean x) { - return deep1440(x); - } - - public static boolean deep1440(boolean x) { - return deep1441(x); - } - - public static boolean deep1441(boolean x) { - return deep1442(x); - } - - public static boolean deep1442(boolean x) { - return deep1443(x); - } - - public static boolean deep1443(boolean x) { - return deep1444(x); - } - - public static boolean deep1444(boolean x) { - return deep1445(x); - } - - public static boolean deep1445(boolean x) { - return deep1446(x); - } - - public static boolean deep1446(boolean x) { - return deep1447(x); - } - - public static boolean deep1447(boolean x) { - return deep1448(x); - } - - public static boolean deep1448(boolean x) { - return deep1449(x); - } - - public static boolean deep1449(boolean x) { - return deep1450(x); - } - - public static boolean deep1450(boolean x) { - return deep1451(x); - } - - public static boolean deep1451(boolean x) { - return deep1452(x); - } - - public static boolean deep1452(boolean x) { - return deep1453(x); - } - - public static boolean deep1453(boolean x) { - return deep1454(x); - } - - public static boolean deep1454(boolean x) { - return deep1455(x); - } - - public static boolean deep1455(boolean x) { - return deep1456(x); - } - - public static boolean deep1456(boolean x) { - return deep1457(x); - } - - public static boolean deep1457(boolean x) { - return deep1458(x); - } - - public static boolean deep1458(boolean x) { - return deep1459(x); - } - - public static boolean deep1459(boolean x) { - return deep1460(x); - } - - public static boolean deep1460(boolean x) { - return deep1461(x); - } - - public static boolean deep1461(boolean x) { - return deep1462(x); - } - - public static boolean deep1462(boolean x) { - return deep1463(x); - } - - public static boolean deep1463(boolean x) { - return deep1464(x); - } - - public static boolean deep1464(boolean x) { - return deep1465(x); - } - - public static boolean deep1465(boolean x) { - return deep1466(x); - } - - public static boolean deep1466(boolean x) { - return deep1467(x); - } - - public static boolean deep1467(boolean x) { - return deep1468(x); - } - - public static boolean deep1468(boolean x) { - return deep1469(x); - } - - public static boolean deep1469(boolean x) { - return deep1470(x); - } - - public static boolean deep1470(boolean x) { - return deep1471(x); - } - - public static boolean deep1471(boolean x) { - return deep1472(x); - } - - public static boolean deep1472(boolean x) { - return deep1473(x); - } - - public static boolean deep1473(boolean x) { - return deep1474(x); - } - - public static boolean deep1474(boolean x) { - return deep1475(x); - } - - public static boolean deep1475(boolean x) { - return deep1476(x); - } - - public static boolean deep1476(boolean x) { - return deep1477(x); - } - - public static boolean deep1477(boolean x) { - return deep1478(x); - } - - public static boolean deep1478(boolean x) { - return deep1479(x); - } - - public static boolean deep1479(boolean x) { - return deep1480(x); - } - - public static boolean deep1480(boolean x) { - return deep1481(x); - } - - public static boolean deep1481(boolean x) { - return deep1482(x); - } - - public static boolean deep1482(boolean x) { - return deep1483(x); - } - - public static boolean deep1483(boolean x) { - return deep1484(x); - } - - public static boolean deep1484(boolean x) { - return deep1485(x); - } - - public static boolean deep1485(boolean x) { - return deep1486(x); - } - - public static boolean deep1486(boolean x) { - return deep1487(x); - } - - public static boolean deep1487(boolean x) { - return deep1488(x); - } - - public static boolean deep1488(boolean x) { - return deep1489(x); - } - - public static boolean deep1489(boolean x) { - return deep1490(x); - } - - public static boolean deep1490(boolean x) { - return deep1491(x); - } - - public static boolean deep1491(boolean x) { - return deep1492(x); - } - - public static boolean deep1492(boolean x) { - return deep1493(x); - } - - public static boolean deep1493(boolean x) { - return deep1494(x); - } - - public static boolean deep1494(boolean x) { - return deep1495(x); - } - - public static boolean deep1495(boolean x) { - return deep1496(x); - } - - public static boolean deep1496(boolean x) { - return deep1497(x); - } - - public static boolean deep1497(boolean x) { - return deep1498(x); - } - - public static boolean deep1498(boolean x) { - return deep1499(x); - } - - public static boolean deep1499(boolean x) { - return deep1500(x); - } - - public static boolean deep1500(boolean x) { - return deep1501(x); - } - - public static boolean deep1501(boolean x) { - return deep1502(x); - } - - public static boolean deep1502(boolean x) { - return deep1503(x); - } - - public static boolean deep1503(boolean x) { - return deep1504(x); - } - - public static boolean deep1504(boolean x) { - return deep1505(x); - } - - public static boolean deep1505(boolean x) { - return deep1506(x); - } - - public static boolean deep1506(boolean x) { - return deep1507(x); - } - - public static boolean deep1507(boolean x) { - return deep1508(x); - } - - public static boolean deep1508(boolean x) { - return deep1509(x); - } - - public static boolean deep1509(boolean x) { - return deep1510(x); - } - - public static boolean deep1510(boolean x) { - return deep1511(x); - } - - public static boolean deep1511(boolean x) { - return deep1512(x); - } - - public static boolean deep1512(boolean x) { - return deep1513(x); - } - - public static boolean deep1513(boolean x) { - return deep1514(x); - } - - public static boolean deep1514(boolean x) { - return deep1515(x); - } - - public static boolean deep1515(boolean x) { - return deep1516(x); - } - - public static boolean deep1516(boolean x) { - return deep1517(x); - } - - public static boolean deep1517(boolean x) { - return deep1518(x); - } - - public static boolean deep1518(boolean x) { - return deep1519(x); - } - - public static boolean deep1519(boolean x) { - return deep1520(x); - } - - public static boolean deep1520(boolean x) { - return deep1521(x); - } - - public static boolean deep1521(boolean x) { - return deep1522(x); - } - - public static boolean deep1522(boolean x) { - return deep1523(x); - } - - public static boolean deep1523(boolean x) { - return deep1524(x); - } - - public static boolean deep1524(boolean x) { - return deep1525(x); - } - - public static boolean deep1525(boolean x) { - return deep1526(x); - } - - public static boolean deep1526(boolean x) { - return deep1527(x); - } - - public static boolean deep1527(boolean x) { - return deep1528(x); - } - - public static boolean deep1528(boolean x) { - return deep1529(x); - } - - public static boolean deep1529(boolean x) { - return deep1530(x); - } - - public static boolean deep1530(boolean x) { - return deep1531(x); - } - - public static boolean deep1531(boolean x) { - return deep1532(x); - } - - public static boolean deep1532(boolean x) { - return deep1533(x); - } - - public static boolean deep1533(boolean x) { - return deep1534(x); - } - - public static boolean deep1534(boolean x) { - return deep1535(x); - } - - public static boolean deep1535(boolean x) { - return deep1536(x); - } - - public static boolean deep1536(boolean x) { - return deep1537(x); - } - - public static boolean deep1537(boolean x) { - return deep1538(x); - } - - public static boolean deep1538(boolean x) { - return deep1539(x); - } - - public static boolean deep1539(boolean x) { - return deep1540(x); - } - - public static boolean deep1540(boolean x) { - return deep1541(x); - } - - public static boolean deep1541(boolean x) { - return deep1542(x); - } - - public static boolean deep1542(boolean x) { - return deep1543(x); - } - - public static boolean deep1543(boolean x) { - return deep1544(x); - } - - public static boolean deep1544(boolean x) { - return deep1545(x); - } - - public static boolean deep1545(boolean x) { - return deep1546(x); - } - - public static boolean deep1546(boolean x) { - return deep1547(x); - } - - public static boolean deep1547(boolean x) { - return deep1548(x); - } - - public static boolean deep1548(boolean x) { - return deep1549(x); - } - - public static boolean deep1549(boolean x) { - return deep1550(x); - } - - public static boolean deep1550(boolean x) { - return deep1551(x); - } - - public static boolean deep1551(boolean x) { - return deep1552(x); - } - - public static boolean deep1552(boolean x) { - return deep1553(x); - } - - public static boolean deep1553(boolean x) { - return deep1554(x); - } - - public static boolean deep1554(boolean x) { - return deep1555(x); - } - - public static boolean deep1555(boolean x) { - return deep1556(x); - } - - public static boolean deep1556(boolean x) { - return deep1557(x); - } - - public static boolean deep1557(boolean x) { - return deep1558(x); - } - - public static boolean deep1558(boolean x) { - return deep1559(x); - } - - public static boolean deep1559(boolean x) { - return deep1560(x); - } - - public static boolean deep1560(boolean x) { - return deep1561(x); - } - - public static boolean deep1561(boolean x) { - return deep1562(x); - } - - public static boolean deep1562(boolean x) { - return deep1563(x); - } - - public static boolean deep1563(boolean x) { - return deep1564(x); - } - - public static boolean deep1564(boolean x) { - return deep1565(x); - } - - public static boolean deep1565(boolean x) { - return deep1566(x); - } - - public static boolean deep1566(boolean x) { - return deep1567(x); - } - - public static boolean deep1567(boolean x) { - return deep1568(x); - } - - public static boolean deep1568(boolean x) { - return deep1569(x); - } - - public static boolean deep1569(boolean x) { - return deep1570(x); - } - - public static boolean deep1570(boolean x) { - return deep1571(x); - } - - public static boolean deep1571(boolean x) { - return deep1572(x); - } - - public static boolean deep1572(boolean x) { - return deep1573(x); - } - - public static boolean deep1573(boolean x) { - return deep1574(x); - } - - public static boolean deep1574(boolean x) { - return deep1575(x); - } - - public static boolean deep1575(boolean x) { - return deep1576(x); - } - - public static boolean deep1576(boolean x) { - return deep1577(x); - } - - public static boolean deep1577(boolean x) { - return deep1578(x); - } - - public static boolean deep1578(boolean x) { - return deep1579(x); - } - - public static boolean deep1579(boolean x) { - return deep1580(x); - } - - public static boolean deep1580(boolean x) { - return deep1581(x); - } - - public static boolean deep1581(boolean x) { - return deep1582(x); - } - - public static boolean deep1582(boolean x) { - return deep1583(x); - } - - public static boolean deep1583(boolean x) { - return deep1584(x); - } - - public static boolean deep1584(boolean x) { - return deep1585(x); - } - - public static boolean deep1585(boolean x) { - return deep1586(x); - } - - public static boolean deep1586(boolean x) { - return deep1587(x); - } - - public static boolean deep1587(boolean x) { - return deep1588(x); - } - - public static boolean deep1588(boolean x) { - return deep1589(x); - } - - public static boolean deep1589(boolean x) { - return deep1590(x); - } - - public static boolean deep1590(boolean x) { - return deep1591(x); - } - - public static boolean deep1591(boolean x) { - return deep1592(x); - } - - public static boolean deep1592(boolean x) { - return deep1593(x); - } - - public static boolean deep1593(boolean x) { - return deep1594(x); - } - - public static boolean deep1594(boolean x) { - return deep1595(x); - } - - public static boolean deep1595(boolean x) { - return deep1596(x); - } - - public static boolean deep1596(boolean x) { - return deep1597(x); - } - - public static boolean deep1597(boolean x) { - return deep1598(x); - } - - public static boolean deep1598(boolean x) { - return deep1599(x); - } - - public static boolean deep1599(boolean x) { - return deep1600(x); - } - - public static boolean deep1600(boolean x) { - return deep1601(x); - } - - public static boolean deep1601(boolean x) { - return deep1602(x); - } - - public static boolean deep1602(boolean x) { - return deep1603(x); - } - - public static boolean deep1603(boolean x) { - return deep1604(x); - } - - public static boolean deep1604(boolean x) { - return deep1605(x); - } - - public static boolean deep1605(boolean x) { - return deep1606(x); - } - - public static boolean deep1606(boolean x) { - return deep1607(x); - } - - public static boolean deep1607(boolean x) { - return deep1608(x); - } - - public static boolean deep1608(boolean x) { - return deep1609(x); - } - - public static boolean deep1609(boolean x) { - return deep1610(x); - } - - public static boolean deep1610(boolean x) { - return deep1611(x); - } - - public static boolean deep1611(boolean x) { - return deep1612(x); - } - - public static boolean deep1612(boolean x) { - return deep1613(x); - } - - public static boolean deep1613(boolean x) { - return deep1614(x); - } - - public static boolean deep1614(boolean x) { - return deep1615(x); - } - - public static boolean deep1615(boolean x) { - return deep1616(x); - } - - public static boolean deep1616(boolean x) { - return deep1617(x); - } - - public static boolean deep1617(boolean x) { - return deep1618(x); - } - - public static boolean deep1618(boolean x) { - return deep1619(x); - } - - public static boolean deep1619(boolean x) { - return deep1620(x); - } - - public static boolean deep1620(boolean x) { - return deep1621(x); - } - - public static boolean deep1621(boolean x) { - return deep1622(x); - } - - public static boolean deep1622(boolean x) { - return deep1623(x); - } - - public static boolean deep1623(boolean x) { - return deep1624(x); - } - - public static boolean deep1624(boolean x) { - return deep1625(x); - } - - public static boolean deep1625(boolean x) { - return deep1626(x); - } - - public static boolean deep1626(boolean x) { - return deep1627(x); - } - - public static boolean deep1627(boolean x) { - return deep1628(x); - } - - public static boolean deep1628(boolean x) { - return deep1629(x); - } - - public static boolean deep1629(boolean x) { - return deep1630(x); - } - - public static boolean deep1630(boolean x) { - return deep1631(x); - } - - public static boolean deep1631(boolean x) { - return deep1632(x); - } - - public static boolean deep1632(boolean x) { - return deep1633(x); - } - - public static boolean deep1633(boolean x) { - return deep1634(x); - } - - public static boolean deep1634(boolean x) { - return deep1635(x); - } - - public static boolean deep1635(boolean x) { - return deep1636(x); - } - - public static boolean deep1636(boolean x) { - return deep1637(x); - } - - public static boolean deep1637(boolean x) { - return deep1638(x); - } - - public static boolean deep1638(boolean x) { - return deep1639(x); - } - - public static boolean deep1639(boolean x) { - return deep1640(x); - } - - public static boolean deep1640(boolean x) { - return deep1641(x); - } - - public static boolean deep1641(boolean x) { - return deep1642(x); - } - - public static boolean deep1642(boolean x) { - return deep1643(x); - } - - public static boolean deep1643(boolean x) { - return deep1644(x); - } - - public static boolean deep1644(boolean x) { - return deep1645(x); - } - - public static boolean deep1645(boolean x) { - return deep1646(x); - } - - public static boolean deep1646(boolean x) { - return deep1647(x); - } - - public static boolean deep1647(boolean x) { - return deep1648(x); - } - - public static boolean deep1648(boolean x) { - return deep1649(x); - } - - public static boolean deep1649(boolean x) { - return deep1650(x); - } - - public static boolean deep1650(boolean x) { - return deep1651(x); - } - - public static boolean deep1651(boolean x) { - return deep1652(x); - } - - public static boolean deep1652(boolean x) { - return deep1653(x); - } - - public static boolean deep1653(boolean x) { - return deep1654(x); - } - - public static boolean deep1654(boolean x) { - return deep1655(x); - } - - public static boolean deep1655(boolean x) { - return deep1656(x); - } - - public static boolean deep1656(boolean x) { - return deep1657(x); - } - - public static boolean deep1657(boolean x) { - return deep1658(x); - } - - public static boolean deep1658(boolean x) { - return deep1659(x); - } - - public static boolean deep1659(boolean x) { - return deep1660(x); - } - - public static boolean deep1660(boolean x) { - return deep1661(x); - } - - public static boolean deep1661(boolean x) { - return deep1662(x); - } - - public static boolean deep1662(boolean x) { - return deep1663(x); - } - - public static boolean deep1663(boolean x) { - return deep1664(x); - } - - public static boolean deep1664(boolean x) { - return deep1665(x); - } - - public static boolean deep1665(boolean x) { - return deep1666(x); - } - - public static boolean deep1666(boolean x) { - return deep1667(x); - } - - public static boolean deep1667(boolean x) { - return deep1668(x); - } - - public static boolean deep1668(boolean x) { - return deep1669(x); - } - - public static boolean deep1669(boolean x) { - return deep1670(x); - } - - public static boolean deep1670(boolean x) { - return deep1671(x); - } - - public static boolean deep1671(boolean x) { - return deep1672(x); - } - - public static boolean deep1672(boolean x) { - return deep1673(x); - } - - public static boolean deep1673(boolean x) { - return deep1674(x); - } - - public static boolean deep1674(boolean x) { - return deep1675(x); - } - - public static boolean deep1675(boolean x) { - return deep1676(x); - } - - public static boolean deep1676(boolean x) { - return deep1677(x); - } - - public static boolean deep1677(boolean x) { - return deep1678(x); - } - - public static boolean deep1678(boolean x) { - return deep1679(x); - } - - public static boolean deep1679(boolean x) { - return deep1680(x); - } - - public static boolean deep1680(boolean x) { - return deep1681(x); - } - - public static boolean deep1681(boolean x) { - return deep1682(x); - } - - public static boolean deep1682(boolean x) { - return deep1683(x); - } - - public static boolean deep1683(boolean x) { - return deep1684(x); - } - - public static boolean deep1684(boolean x) { - return deep1685(x); - } - - public static boolean deep1685(boolean x) { - return deep1686(x); - } - - public static boolean deep1686(boolean x) { - return deep1687(x); - } - - public static boolean deep1687(boolean x) { - return deep1688(x); - } - - public static boolean deep1688(boolean x) { - return deep1689(x); - } - - public static boolean deep1689(boolean x) { - return deep1690(x); - } - - public static boolean deep1690(boolean x) { - return deep1691(x); - } - - public static boolean deep1691(boolean x) { - return deep1692(x); - } - - public static boolean deep1692(boolean x) { - return deep1693(x); - } - - public static boolean deep1693(boolean x) { - return deep1694(x); - } - - public static boolean deep1694(boolean x) { - return deep1695(x); - } - - public static boolean deep1695(boolean x) { - return deep1696(x); - } - - public static boolean deep1696(boolean x) { - return deep1697(x); - } - - public static boolean deep1697(boolean x) { - return deep1698(x); - } - - public static boolean deep1698(boolean x) { - return deep1699(x); - } - - public static boolean deep1699(boolean x) { - return deep1700(x); - } - - public static boolean deep1700(boolean x) { - return deep1701(x); - } - - public static boolean deep1701(boolean x) { - return deep1702(x); - } - - public static boolean deep1702(boolean x) { - return deep1703(x); - } - - public static boolean deep1703(boolean x) { - return deep1704(x); - } - - public static boolean deep1704(boolean x) { - return deep1705(x); - } - - public static boolean deep1705(boolean x) { - return deep1706(x); - } - - public static boolean deep1706(boolean x) { - return deep1707(x); - } - - public static boolean deep1707(boolean x) { - return deep1708(x); - } - - public static boolean deep1708(boolean x) { - return deep1709(x); - } - - public static boolean deep1709(boolean x) { - return deep1710(x); - } - - public static boolean deep1710(boolean x) { - return deep1711(x); - } - - public static boolean deep1711(boolean x) { - return deep1712(x); - } - - public static boolean deep1712(boolean x) { - return deep1713(x); - } - - public static boolean deep1713(boolean x) { - return deep1714(x); - } - - public static boolean deep1714(boolean x) { - return deep1715(x); - } - - public static boolean deep1715(boolean x) { - return deep1716(x); - } - - public static boolean deep1716(boolean x) { - return deep1717(x); - } - - public static boolean deep1717(boolean x) { - return deep1718(x); - } - - public static boolean deep1718(boolean x) { - return deep1719(x); - } - - public static boolean deep1719(boolean x) { - return deep1720(x); - } - - public static boolean deep1720(boolean x) { - return deep1721(x); - } - - public static boolean deep1721(boolean x) { - return deep1722(x); - } - - public static boolean deep1722(boolean x) { - return deep1723(x); - } - - public static boolean deep1723(boolean x) { - return deep1724(x); - } - - public static boolean deep1724(boolean x) { - return deep1725(x); - } - - public static boolean deep1725(boolean x) { - return deep1726(x); - } - - public static boolean deep1726(boolean x) { - return deep1727(x); - } - - public static boolean deep1727(boolean x) { - return deep1728(x); - } - - public static boolean deep1728(boolean x) { - return deep1729(x); - } - - public static boolean deep1729(boolean x) { - return deep1730(x); - } - - public static boolean deep1730(boolean x) { - return deep1731(x); - } - - public static boolean deep1731(boolean x) { - return deep1732(x); - } - - public static boolean deep1732(boolean x) { - return deep1733(x); - } - - public static boolean deep1733(boolean x) { - return deep1734(x); - } - - public static boolean deep1734(boolean x) { - return deep1735(x); - } - - public static boolean deep1735(boolean x) { - return deep1736(x); - } - - public static boolean deep1736(boolean x) { - return deep1737(x); - } - - public static boolean deep1737(boolean x) { - return deep1738(x); - } - - public static boolean deep1738(boolean x) { - return deep1739(x); - } - - public static boolean deep1739(boolean x) { - return deep1740(x); - } - - public static boolean deep1740(boolean x) { - return deep1741(x); - } - - public static boolean deep1741(boolean x) { - return deep1742(x); - } - - public static boolean deep1742(boolean x) { - return deep1743(x); - } - - public static boolean deep1743(boolean x) { - return deep1744(x); - } - - public static boolean deep1744(boolean x) { - return deep1745(x); - } - - public static boolean deep1745(boolean x) { - return deep1746(x); - } - - public static boolean deep1746(boolean x) { - return deep1747(x); - } - - public static boolean deep1747(boolean x) { - return deep1748(x); - } - - public static boolean deep1748(boolean x) { - return deep1749(x); - } - - public static boolean deep1749(boolean x) { - return deep1750(x); - } - - public static boolean deep1750(boolean x) { - return deep1751(x); - } - - public static boolean deep1751(boolean x) { - return deep1752(x); - } - - public static boolean deep1752(boolean x) { - return deep1753(x); - } - - public static boolean deep1753(boolean x) { - return deep1754(x); - } - - public static boolean deep1754(boolean x) { - return deep1755(x); - } - - public static boolean deep1755(boolean x) { - return deep1756(x); - } - - public static boolean deep1756(boolean x) { - return deep1757(x); - } - - public static boolean deep1757(boolean x) { - return deep1758(x); - } - - public static boolean deep1758(boolean x) { - return deep1759(x); - } - - public static boolean deep1759(boolean x) { - return deep1760(x); - } - - public static boolean deep1760(boolean x) { - return deep1761(x); - } - - public static boolean deep1761(boolean x) { - return deep1762(x); - } - - public static boolean deep1762(boolean x) { - return deep1763(x); - } - - public static boolean deep1763(boolean x) { - return deep1764(x); - } - - public static boolean deep1764(boolean x) { - return deep1765(x); - } - - public static boolean deep1765(boolean x) { - return deep1766(x); - } - - public static boolean deep1766(boolean x) { - return deep1767(x); - } - - public static boolean deep1767(boolean x) { - return deep1768(x); - } - - public static boolean deep1768(boolean x) { - return deep1769(x); - } - - public static boolean deep1769(boolean x) { - return deep1770(x); - } - - public static boolean deep1770(boolean x) { - return deep1771(x); - } - - public static boolean deep1771(boolean x) { - return deep1772(x); - } - - public static boolean deep1772(boolean x) { - return deep1773(x); - } - - public static boolean deep1773(boolean x) { - return deep1774(x); - } - - public static boolean deep1774(boolean x) { - return deep1775(x); - } - - public static boolean deep1775(boolean x) { - return deep1776(x); - } - - public static boolean deep1776(boolean x) { - return deep1777(x); - } - - public static boolean deep1777(boolean x) { - return deep1778(x); - } - - public static boolean deep1778(boolean x) { - return deep1779(x); - } - - public static boolean deep1779(boolean x) { - return deep1780(x); - } - - public static boolean deep1780(boolean x) { - return deep1781(x); - } - - public static boolean deep1781(boolean x) { - return deep1782(x); - } - - public static boolean deep1782(boolean x) { - return deep1783(x); - } - - public static boolean deep1783(boolean x) { - return deep1784(x); - } - - public static boolean deep1784(boolean x) { - return deep1785(x); - } - - public static boolean deep1785(boolean x) { - return deep1786(x); - } - - public static boolean deep1786(boolean x) { - return deep1787(x); - } - - public static boolean deep1787(boolean x) { - return deep1788(x); - } - - public static boolean deep1788(boolean x) { - return deep1789(x); - } - - public static boolean deep1789(boolean x) { - return deep1790(x); - } - - public static boolean deep1790(boolean x) { - return deep1791(x); - } - - public static boolean deep1791(boolean x) { - return deep1792(x); - } - - public static boolean deep1792(boolean x) { - return deep1793(x); - } - - public static boolean deep1793(boolean x) { - return deep1794(x); - } - - public static boolean deep1794(boolean x) { - return deep1795(x); - } - - public static boolean deep1795(boolean x) { - return deep1796(x); - } - - public static boolean deep1796(boolean x) { - return deep1797(x); - } - - public static boolean deep1797(boolean x) { - return deep1798(x); - } - - public static boolean deep1798(boolean x) { - return deep1799(x); - } - - public static boolean deep1799(boolean x) { - return deep1800(x); - } - - public static boolean deep1800(boolean x) { - return deep1801(x); - } - - public static boolean deep1801(boolean x) { - return deep1802(x); - } - - public static boolean deep1802(boolean x) { - return deep1803(x); - } - - public static boolean deep1803(boolean x) { - return deep1804(x); - } - - public static boolean deep1804(boolean x) { - return deep1805(x); - } - - public static boolean deep1805(boolean x) { - return deep1806(x); - } - - public static boolean deep1806(boolean x) { - return deep1807(x); - } - - public static boolean deep1807(boolean x) { - return deep1808(x); - } - - public static boolean deep1808(boolean x) { - return deep1809(x); - } - - public static boolean deep1809(boolean x) { - return deep1810(x); - } - - public static boolean deep1810(boolean x) { - return deep1811(x); - } - - public static boolean deep1811(boolean x) { - return deep1812(x); - } - - public static boolean deep1812(boolean x) { - return deep1813(x); - } - - public static boolean deep1813(boolean x) { - return deep1814(x); - } - - public static boolean deep1814(boolean x) { - return deep1815(x); - } - - public static boolean deep1815(boolean x) { - return deep1816(x); - } - - public static boolean deep1816(boolean x) { - return deep1817(x); - } - - public static boolean deep1817(boolean x) { - return deep1818(x); - } - - public static boolean deep1818(boolean x) { - return deep1819(x); - } - - public static boolean deep1819(boolean x) { - return deep1820(x); - } - - public static boolean deep1820(boolean x) { - return deep1821(x); - } - - public static boolean deep1821(boolean x) { - return deep1822(x); - } - - public static boolean deep1822(boolean x) { - return deep1823(x); - } - - public static boolean deep1823(boolean x) { - return deep1824(x); - } - - public static boolean deep1824(boolean x) { - return deep1825(x); - } - - public static boolean deep1825(boolean x) { - return deep1826(x); - } - - public static boolean deep1826(boolean x) { - return deep1827(x); - } - - public static boolean deep1827(boolean x) { - return deep1828(x); - } - - public static boolean deep1828(boolean x) { - return deep1829(x); - } - - public static boolean deep1829(boolean x) { - return deep1830(x); - } - - public static boolean deep1830(boolean x) { - return deep1831(x); - } - - public static boolean deep1831(boolean x) { - return deep1832(x); - } - - public static boolean deep1832(boolean x) { - return deep1833(x); - } - - public static boolean deep1833(boolean x) { - return deep1834(x); - } - - public static boolean deep1834(boolean x) { - return deep1835(x); - } - - public static boolean deep1835(boolean x) { - return deep1836(x); - } - - public static boolean deep1836(boolean x) { - return deep1837(x); - } - - public static boolean deep1837(boolean x) { - return deep1838(x); - } - - public static boolean deep1838(boolean x) { - return deep1839(x); - } - - public static boolean deep1839(boolean x) { - return deep1840(x); - } - - public static boolean deep1840(boolean x) { - return deep1841(x); - } - - public static boolean deep1841(boolean x) { - return deep1842(x); - } - - public static boolean deep1842(boolean x) { - return deep1843(x); - } - - public static boolean deep1843(boolean x) { - return deep1844(x); - } - - public static boolean deep1844(boolean x) { - return deep1845(x); - } - - public static boolean deep1845(boolean x) { - return deep1846(x); - } - - public static boolean deep1846(boolean x) { - return deep1847(x); - } - - public static boolean deep1847(boolean x) { - return deep1848(x); - } - - public static boolean deep1848(boolean x) { - return deep1849(x); - } - - public static boolean deep1849(boolean x) { - return deep1850(x); - } - - public static boolean deep1850(boolean x) { - return deep1851(x); - } - - public static boolean deep1851(boolean x) { - return deep1852(x); - } - - public static boolean deep1852(boolean x) { - return deep1853(x); - } - - public static boolean deep1853(boolean x) { - return deep1854(x); - } - - public static boolean deep1854(boolean x) { - return deep1855(x); - } - - public static boolean deep1855(boolean x) { - return deep1856(x); - } - - public static boolean deep1856(boolean x) { - return deep1857(x); - } - - public static boolean deep1857(boolean x) { - return deep1858(x); - } - - public static boolean deep1858(boolean x) { - return deep1859(x); - } - - public static boolean deep1859(boolean x) { - return deep1860(x); - } - - public static boolean deep1860(boolean x) { - return deep1861(x); - } - - public static boolean deep1861(boolean x) { - return deep1862(x); - } - - public static boolean deep1862(boolean x) { - return deep1863(x); - } - - public static boolean deep1863(boolean x) { - return deep1864(x); - } - - public static boolean deep1864(boolean x) { - return deep1865(x); - } - - public static boolean deep1865(boolean x) { - return deep1866(x); - } - - public static boolean deep1866(boolean x) { - return deep1867(x); - } - - public static boolean deep1867(boolean x) { - return deep1868(x); - } - - public static boolean deep1868(boolean x) { - return deep1869(x); - } - - public static boolean deep1869(boolean x) { - return deep1870(x); - } - - public static boolean deep1870(boolean x) { - return deep1871(x); - } - - public static boolean deep1871(boolean x) { - return deep1872(x); - } - - public static boolean deep1872(boolean x) { - return deep1873(x); - } - - public static boolean deep1873(boolean x) { - return deep1874(x); - } - - public static boolean deep1874(boolean x) { - return deep1875(x); - } - - public static boolean deep1875(boolean x) { - return deep1876(x); - } - - public static boolean deep1876(boolean x) { - return deep1877(x); - } - - public static boolean deep1877(boolean x) { - return deep1878(x); - } - - public static boolean deep1878(boolean x) { - return deep1879(x); - } - - public static boolean deep1879(boolean x) { - return deep1880(x); - } - - public static boolean deep1880(boolean x) { - return deep1881(x); - } - - public static boolean deep1881(boolean x) { - return deep1882(x); - } - - public static boolean deep1882(boolean x) { - return deep1883(x); - } - - public static boolean deep1883(boolean x) { - return deep1884(x); - } - - public static boolean deep1884(boolean x) { - return deep1885(x); - } - - public static boolean deep1885(boolean x) { - return deep1886(x); - } - - public static boolean deep1886(boolean x) { - return deep1887(x); - } - - public static boolean deep1887(boolean x) { - return deep1888(x); - } - - public static boolean deep1888(boolean x) { - return deep1889(x); - } - - public static boolean deep1889(boolean x) { - return deep1890(x); - } - - public static boolean deep1890(boolean x) { - return deep1891(x); - } - - public static boolean deep1891(boolean x) { - return deep1892(x); - } - - public static boolean deep1892(boolean x) { - return deep1893(x); - } - - public static boolean deep1893(boolean x) { - return deep1894(x); - } - - public static boolean deep1894(boolean x) { - return deep1895(x); - } - - public static boolean deep1895(boolean x) { - return deep1896(x); - } - - public static boolean deep1896(boolean x) { - return deep1897(x); - } - - public static boolean deep1897(boolean x) { - return deep1898(x); - } - - public static boolean deep1898(boolean x) { - return deep1899(x); - } - - public static boolean deep1899(boolean x) { - return deep1900(x); - } - - public static boolean deep1900(boolean x) { - return deep1901(x); - } - - public static boolean deep1901(boolean x) { - return deep1902(x); - } - - public static boolean deep1902(boolean x) { - return deep1903(x); - } - - public static boolean deep1903(boolean x) { - return deep1904(x); - } - - public static boolean deep1904(boolean x) { - return deep1905(x); - } - - public static boolean deep1905(boolean x) { - return deep1906(x); - } - - public static boolean deep1906(boolean x) { - return deep1907(x); - } - - public static boolean deep1907(boolean x) { - return deep1908(x); - } - - public static boolean deep1908(boolean x) { - return deep1909(x); - } - - public static boolean deep1909(boolean x) { - return deep1910(x); - } - - public static boolean deep1910(boolean x) { - return deep1911(x); - } - - public static boolean deep1911(boolean x) { - return deep1912(x); - } - - public static boolean deep1912(boolean x) { - return deep1913(x); - } - - public static boolean deep1913(boolean x) { - return deep1914(x); - } - - public static boolean deep1914(boolean x) { - return deep1915(x); - } - - public static boolean deep1915(boolean x) { - return deep1916(x); - } - - public static boolean deep1916(boolean x) { - return deep1917(x); - } - - public static boolean deep1917(boolean x) { - return deep1918(x); - } - - public static boolean deep1918(boolean x) { - return deep1919(x); - } - - public static boolean deep1919(boolean x) { - return deep1920(x); - } - - public static boolean deep1920(boolean x) { - return deep1921(x); - } - - public static boolean deep1921(boolean x) { - return deep1922(x); - } - - public static boolean deep1922(boolean x) { - return deep1923(x); - } - - public static boolean deep1923(boolean x) { - return deep1924(x); - } - - public static boolean deep1924(boolean x) { - return deep1925(x); - } - - public static boolean deep1925(boolean x) { - return deep1926(x); - } - - public static boolean deep1926(boolean x) { - return deep1927(x); - } - - public static boolean deep1927(boolean x) { - return deep1928(x); - } - - public static boolean deep1928(boolean x) { - return deep1929(x); - } - - public static boolean deep1929(boolean x) { - return deep1930(x); - } - - public static boolean deep1930(boolean x) { - return deep1931(x); - } - - public static boolean deep1931(boolean x) { - return deep1932(x); - } - - public static boolean deep1932(boolean x) { - return deep1933(x); - } - - public static boolean deep1933(boolean x) { - return deep1934(x); - } - - public static boolean deep1934(boolean x) { - return deep1935(x); - } - - public static boolean deep1935(boolean x) { - return deep1936(x); - } - - public static boolean deep1936(boolean x) { - return deep1937(x); - } - - public static boolean deep1937(boolean x) { - return deep1938(x); - } - - public static boolean deep1938(boolean x) { - return deep1939(x); - } - - public static boolean deep1939(boolean x) { - return deep1940(x); - } - - public static boolean deep1940(boolean x) { - return deep1941(x); - } - - public static boolean deep1941(boolean x) { - return deep1942(x); - } - - public static boolean deep1942(boolean x) { - return deep1943(x); - } - - public static boolean deep1943(boolean x) { - return deep1944(x); - } - - public static boolean deep1944(boolean x) { - return deep1945(x); - } - - public static boolean deep1945(boolean x) { - return deep1946(x); - } - - public static boolean deep1946(boolean x) { - return deep1947(x); - } - - public static boolean deep1947(boolean x) { - return deep1948(x); - } - - public static boolean deep1948(boolean x) { - return deep1949(x); - } - - public static boolean deep1949(boolean x) { - return deep1950(x); - } - - public static boolean deep1950(boolean x) { - return deep1951(x); - } - - public static boolean deep1951(boolean x) { - return deep1952(x); - } - - public static boolean deep1952(boolean x) { - return deep1953(x); - } - - public static boolean deep1953(boolean x) { - return deep1954(x); - } - - public static boolean deep1954(boolean x) { - return deep1955(x); - } - - public static boolean deep1955(boolean x) { - return deep1956(x); - } - - public static boolean deep1956(boolean x) { - return deep1957(x); - } - - public static boolean deep1957(boolean x) { - return deep1958(x); - } - - public static boolean deep1958(boolean x) { - return deep1959(x); - } - - public static boolean deep1959(boolean x) { - return deep1960(x); - } - - public static boolean deep1960(boolean x) { - return deep1961(x); - } - - public static boolean deep1961(boolean x) { - return deep1962(x); - } - - public static boolean deep1962(boolean x) { - return deep1963(x); - } - - public static boolean deep1963(boolean x) { - return deep1964(x); - } - - public static boolean deep1964(boolean x) { - return deep1965(x); - } - - public static boolean deep1965(boolean x) { - return deep1966(x); - } - - public static boolean deep1966(boolean x) { - return deep1967(x); - } - - public static boolean deep1967(boolean x) { - return deep1968(x); - } - - public static boolean deep1968(boolean x) { - return deep1969(x); - } - - public static boolean deep1969(boolean x) { - return deep1970(x); - } - - public static boolean deep1970(boolean x) { - return deep1971(x); - } - - public static boolean deep1971(boolean x) { - return deep1972(x); - } - - public static boolean deep1972(boolean x) { - return deep1973(x); - } - - public static boolean deep1973(boolean x) { - return deep1974(x); - } - - public static boolean deep1974(boolean x) { - return deep1975(x); - } - - public static boolean deep1975(boolean x) { - return deep1976(x); - } - - public static boolean deep1976(boolean x) { - return deep1977(x); - } - - public static boolean deep1977(boolean x) { - return deep1978(x); - } - - public static boolean deep1978(boolean x) { - return deep1979(x); - } - - public static boolean deep1979(boolean x) { - return deep1980(x); - } - - public static boolean deep1980(boolean x) { - return deep1981(x); - } - - public static boolean deep1981(boolean x) { - return deep1982(x); - } - - public static boolean deep1982(boolean x) { - return deep1983(x); - } - - public static boolean deep1983(boolean x) { - return deep1984(x); - } - - public static boolean deep1984(boolean x) { - return deep1985(x); - } - - public static boolean deep1985(boolean x) { - return deep1986(x); - } - - public static boolean deep1986(boolean x) { - return deep1987(x); - } - - public static boolean deep1987(boolean x) { - return deep1988(x); - } - - public static boolean deep1988(boolean x) { - return deep1989(x); - } - - public static boolean deep1989(boolean x) { - return deep1990(x); - } - - public static boolean deep1990(boolean x) { - return deep1991(x); - } - - public static boolean deep1991(boolean x) { - return deep1992(x); - } - - public static boolean deep1992(boolean x) { - return deep1993(x); - } - - public static boolean deep1993(boolean x) { - return deep1994(x); - } - - public static boolean deep1994(boolean x) { - return deep1995(x); - } - - public static boolean deep1995(boolean x) { - return deep1996(x); - } - - public static boolean deep1996(boolean x) { - return deep1997(x); - } - - public static boolean deep1997(boolean x) { - return deep1998(x); - } - - public static boolean deep1998(boolean x) { - return deep1999(x); - } - - public static boolean deep1999(boolean x) { - return deep2000(x); - } - - public static boolean deep2000(boolean x) { - return deep2001(x); - } - - public static boolean deep2001(boolean x) { - return deep2002(x); - } - - public static boolean deep2002(boolean x) { - return deep2003(x); - } - - public static boolean deep2003(boolean x) { - return deep2004(x); - } - - public static boolean deep2004(boolean x) { - return deep2005(x); - } - - public static boolean deep2005(boolean x) { - return deep2006(x); - } - - public static boolean deep2006(boolean x) { - return deep2007(x); - } - - public static boolean deep2007(boolean x) { - return deep2008(x); - } - - public static boolean deep2008(boolean x) { - return deep2009(x); - } - - public static boolean deep2009(boolean x) { - return deep2010(x); - } - - public static boolean deep2010(boolean x) { - return deep2011(x); - } - - public static boolean deep2011(boolean x) { - return deep2012(x); - } - - public static boolean deep2012(boolean x) { - return deep2013(x); - } - - public static boolean deep2013(boolean x) { - return deep2014(x); - } - - public static boolean deep2014(boolean x) { - return deep2015(x); - } - - public static boolean deep2015(boolean x) { - return deep2016(x); - } - - public static boolean deep2016(boolean x) { - return deep2017(x); - } - - public static boolean deep2017(boolean x) { - return deep2018(x); - } - - public static boolean deep2018(boolean x) { - return deep2019(x); - } - - public static boolean deep2019(boolean x) { - return deep2020(x); - } - - public static boolean deep2020(boolean x) { - return deep2021(x); - } - - public static boolean deep2021(boolean x) { - return deep2022(x); - } - - public static boolean deep2022(boolean x) { - return deep2023(x); - } - - public static boolean deep2023(boolean x) { - return deep2024(x); - } - - public static boolean deep2024(boolean x) { - return deep2025(x); - } - - public static boolean deep2025(boolean x) { - return deep2026(x); - } - - public static boolean deep2026(boolean x) { - return deep2027(x); - } - - public static boolean deep2027(boolean x) { - return deep2028(x); - } - - public static boolean deep2028(boolean x) { - return deep2029(x); - } - - public static boolean deep2029(boolean x) { - return deep2030(x); - } - - public static boolean deep2030(boolean x) { - return deep2031(x); - } - - public static boolean deep2031(boolean x) { - return deep2032(x); - } - - public static boolean deep2032(boolean x) { - return deep2033(x); - } - - public static boolean deep2033(boolean x) { - return deep2034(x); - } - - public static boolean deep2034(boolean x) { - return deep2035(x); - } - - public static boolean deep2035(boolean x) { - return deep2036(x); - } - - public static boolean deep2036(boolean x) { - return deep2037(x); - } - - public static boolean deep2037(boolean x) { - return deep2038(x); - } - - public static boolean deep2038(boolean x) { - return deep2039(x); - } - - public static boolean deep2039(boolean x) { - return deep2040(x); - } - - public static boolean deep2040(boolean x) { - return deep2041(x); - } - - public static boolean deep2041(boolean x) { - return deep2042(x); - } - - public static boolean deep2042(boolean x) { - return deep2043(x); - } - - public static boolean deep2043(boolean x) { - return deep2044(x); - } - - public static boolean deep2044(boolean x) { - return deep2045(x); - } - - public static boolean deep2045(boolean x) { - return deep2046(x); - } - - public static boolean deep2046(boolean x) { - return deep2047(x); - } - - public static boolean deep2047(boolean x) { - return deep2048(x); - } - - public static boolean deep2048(boolean x) { - return deep2049(x); - } - - public static boolean deep2049(boolean x) { - return deep2050(x); - } - - public static boolean deep2050(boolean x) { - return deep2051(x); - } - - public static boolean deep2051(boolean x) { - return deep2052(x); - } - - public static boolean deep2052(boolean x) { - return deep2053(x); - } - - public static boolean deep2053(boolean x) { - return deep2054(x); - } - - public static boolean deep2054(boolean x) { - return deep2055(x); - } - - public static boolean deep2055(boolean x) { - return deep2056(x); - } - - public static boolean deep2056(boolean x) { - return deep2057(x); - } - - public static boolean deep2057(boolean x) { - return deep2058(x); - } - - public static boolean deep2058(boolean x) { - return deep2059(x); - } - - public static boolean deep2059(boolean x) { - return deep2060(x); - } - - public static boolean deep2060(boolean x) { - return deep2061(x); - } - - public static boolean deep2061(boolean x) { - return deep2062(x); - } - - public static boolean deep2062(boolean x) { - return deep2063(x); - } - - public static boolean deep2063(boolean x) { - return deep2064(x); - } - - public static boolean deep2064(boolean x) { - return deep2065(x); - } - - public static boolean deep2065(boolean x) { - return deep2066(x); - } - - public static boolean deep2066(boolean x) { - return deep2067(x); - } - - public static boolean deep2067(boolean x) { - return deep2068(x); - } - - public static boolean deep2068(boolean x) { - return deep2069(x); - } - - public static boolean deep2069(boolean x) { - return deep2070(x); - } - - public static boolean deep2070(boolean x) { - return deep2071(x); - } - - public static boolean deep2071(boolean x) { - return deep2072(x); - } - - public static boolean deep2072(boolean x) { - return deep2073(x); - } - - public static boolean deep2073(boolean x) { - return deep2074(x); - } - - public static boolean deep2074(boolean x) { - return deep2075(x); - } - - public static boolean deep2075(boolean x) { - return deep2076(x); - } - - public static boolean deep2076(boolean x) { - return deep2077(x); - } - - public static boolean deep2077(boolean x) { - return deep2078(x); - } - - public static boolean deep2078(boolean x) { - return deep2079(x); - } - - public static boolean deep2079(boolean x) { - return deep2080(x); - } - - public static boolean deep2080(boolean x) { - return deep2081(x); - } - - public static boolean deep2081(boolean x) { - return deep2082(x); - } - - public static boolean deep2082(boolean x) { - return deep2083(x); - } - - public static boolean deep2083(boolean x) { - return deep2084(x); - } - - public static boolean deep2084(boolean x) { - return deep2085(x); - } - - public static boolean deep2085(boolean x) { - return deep2086(x); - } - - public static boolean deep2086(boolean x) { - return deep2087(x); - } - - public static boolean deep2087(boolean x) { - return deep2088(x); - } - - public static boolean deep2088(boolean x) { - return deep2089(x); - } - - public static boolean deep2089(boolean x) { - return deep2090(x); - } - - public static boolean deep2090(boolean x) { - return deep2091(x); - } - - public static boolean deep2091(boolean x) { - return deep2092(x); - } - - public static boolean deep2092(boolean x) { - return deep2093(x); - } - - public static boolean deep2093(boolean x) { - return deep2094(x); - } - - public static boolean deep2094(boolean x) { - return deep2095(x); - } - - public static boolean deep2095(boolean x) { - return deep2096(x); - } - - public static boolean deep2096(boolean x) { - return deep2097(x); - } - - public static boolean deep2097(boolean x) { - return deep2098(x); - } - - public static boolean deep2098(boolean x) { - return deep2099(x); - } - - public static boolean deep2099(boolean x) { - return deep2100(x); - } - - public static boolean deep2100(boolean x) { - return deep2101(x); - } - - public static boolean deep2101(boolean x) { - return deep2102(x); - } - - public static boolean deep2102(boolean x) { - return deep2103(x); - } - - public static boolean deep2103(boolean x) { - return deep2104(x); - } - - public static boolean deep2104(boolean x) { - return deep2105(x); - } - - public static boolean deep2105(boolean x) { - return deep2106(x); - } - - public static boolean deep2106(boolean x) { - return deep2107(x); - } - - public static boolean deep2107(boolean x) { - return deep2108(x); - } - - public static boolean deep2108(boolean x) { - return deep2109(x); - } - - public static boolean deep2109(boolean x) { - return deep2110(x); - } - - public static boolean deep2110(boolean x) { - return deep2111(x); - } - - public static boolean deep2111(boolean x) { - return deep2112(x); - } - - public static boolean deep2112(boolean x) { - return deep2113(x); - } - - public static boolean deep2113(boolean x) { - return deep2114(x); - } - - public static boolean deep2114(boolean x) { - return deep2115(x); - } - - public static boolean deep2115(boolean x) { - return deep2116(x); - } - - public static boolean deep2116(boolean x) { - return deep2117(x); - } - - public static boolean deep2117(boolean x) { - return deep2118(x); - } - - public static boolean deep2118(boolean x) { - return deep2119(x); - } - - public static boolean deep2119(boolean x) { - return deep2120(x); - } - - public static boolean deep2120(boolean x) { - return deep2121(x); - } - - public static boolean deep2121(boolean x) { - return deep2122(x); - } - - public static boolean deep2122(boolean x) { - return deep2123(x); - } - - public static boolean deep2123(boolean x) { - return deep2124(x); - } - - public static boolean deep2124(boolean x) { - return deep2125(x); - } - - public static boolean deep2125(boolean x) { - return deep2126(x); - } - - public static boolean deep2126(boolean x) { - return deep2127(x); - } - - public static boolean deep2127(boolean x) { - return deep2128(x); - } - - public static boolean deep2128(boolean x) { - return deep2129(x); - } - - public static boolean deep2129(boolean x) { - return deep2130(x); - } - - public static boolean deep2130(boolean x) { - return deep2131(x); - } - - public static boolean deep2131(boolean x) { - return deep2132(x); - } - - public static boolean deep2132(boolean x) { - return deep2133(x); - } - - public static boolean deep2133(boolean x) { - return deep2134(x); - } - - public static boolean deep2134(boolean x) { - return deep2135(x); - } - - public static boolean deep2135(boolean x) { - return deep2136(x); - } - - public static boolean deep2136(boolean x) { - return deep2137(x); - } - - public static boolean deep2137(boolean x) { - return deep2138(x); - } - - public static boolean deep2138(boolean x) { - return deep2139(x); - } - - public static boolean deep2139(boolean x) { - return deep2140(x); - } - - public static boolean deep2140(boolean x) { - return deep2141(x); - } - - public static boolean deep2141(boolean x) { - return deep2142(x); - } - - public static boolean deep2142(boolean x) { - return deep2143(x); - } - - public static boolean deep2143(boolean x) { - return deep2144(x); - } - - public static boolean deep2144(boolean x) { - return deep2145(x); - } - - public static boolean deep2145(boolean x) { - return deep2146(x); - } - - public static boolean deep2146(boolean x) { - return deep2147(x); - } - - public static boolean deep2147(boolean x) { - return deep2148(x); - } - - public static boolean deep2148(boolean x) { - return deep2149(x); - } - - public static boolean deep2149(boolean x) { - return deep2150(x); - } - - public static boolean deep2150(boolean x) { - return deep2151(x); - } - - public static boolean deep2151(boolean x) { - return deep2152(x); - } - - public static boolean deep2152(boolean x) { - return deep2153(x); - } - - public static boolean deep2153(boolean x) { - return deep2154(x); - } - - public static boolean deep2154(boolean x) { - return deep2155(x); - } - - public static boolean deep2155(boolean x) { - return deep2156(x); - } - - public static boolean deep2156(boolean x) { - return deep2157(x); - } - - public static boolean deep2157(boolean x) { - return deep2158(x); - } - - public static boolean deep2158(boolean x) { - return deep2159(x); - } - - public static boolean deep2159(boolean x) { - return deep2160(x); - } - - public static boolean deep2160(boolean x) { - return deep2161(x); - } - - public static boolean deep2161(boolean x) { - return deep2162(x); - } - - public static boolean deep2162(boolean x) { - return deep2163(x); - } - - public static boolean deep2163(boolean x) { - return deep2164(x); - } - - public static boolean deep2164(boolean x) { - return deep2165(x); - } - - public static boolean deep2165(boolean x) { - return deep2166(x); - } - - public static boolean deep2166(boolean x) { - return deep2167(x); - } - - public static boolean deep2167(boolean x) { - return deep2168(x); - } - - public static boolean deep2168(boolean x) { - return deep2169(x); - } - - public static boolean deep2169(boolean x) { - return deep2170(x); - } - - public static boolean deep2170(boolean x) { - return deep2171(x); - } - - public static boolean deep2171(boolean x) { - return deep2172(x); - } - - public static boolean deep2172(boolean x) { - return deep2173(x); - } - - public static boolean deep2173(boolean x) { - return deep2174(x); - } - - public static boolean deep2174(boolean x) { - return deep2175(x); - } - - public static boolean deep2175(boolean x) { - return deep2176(x); - } - - public static boolean deep2176(boolean x) { - return deep2177(x); - } - - public static boolean deep2177(boolean x) { - return deep2178(x); - } - - public static boolean deep2178(boolean x) { - return deep2179(x); - } - - public static boolean deep2179(boolean x) { - return deep2180(x); - } - - public static boolean deep2180(boolean x) { - return deep2181(x); - } - - public static boolean deep2181(boolean x) { - return deep2182(x); - } - - public static boolean deep2182(boolean x) { - return deep2183(x); - } - - public static boolean deep2183(boolean x) { - return deep2184(x); - } - - public static boolean deep2184(boolean x) { - return deep2185(x); - } - - public static boolean deep2185(boolean x) { - return deep2186(x); - } - - public static boolean deep2186(boolean x) { - return deep2187(x); - } - - public static boolean deep2187(boolean x) { - return deep2188(x); - } - - public static boolean deep2188(boolean x) { - return deep2189(x); - } - - public static boolean deep2189(boolean x) { - return deep2190(x); - } - - public static boolean deep2190(boolean x) { - return deep2191(x); - } - - public static boolean deep2191(boolean x) { - return deep2192(x); - } - - public static boolean deep2192(boolean x) { - return deep2193(x); - } - - public static boolean deep2193(boolean x) { - return deep2194(x); - } - - public static boolean deep2194(boolean x) { - return deep2195(x); - } - - public static boolean deep2195(boolean x) { - return deep2196(x); - } - - public static boolean deep2196(boolean x) { - return deep2197(x); - } - - public static boolean deep2197(boolean x) { - return deep2198(x); - } - - public static boolean deep2198(boolean x) { - return deep2199(x); - } - - public static boolean deep2199(boolean x) { - return deep2200(x); - } - - public static boolean deep2200(boolean x) { - return deep2201(x); - } - - public static boolean deep2201(boolean x) { - return deep2202(x); - } - - public static boolean deep2202(boolean x) { - return deep2203(x); - } - - public static boolean deep2203(boolean x) { - return deep2204(x); - } - - public static boolean deep2204(boolean x) { - return deep2205(x); - } - - public static boolean deep2205(boolean x) { - return deep2206(x); - } - - public static boolean deep2206(boolean x) { - return deep2207(x); - } - - public static boolean deep2207(boolean x) { - return deep2208(x); - } - - public static boolean deep2208(boolean x) { - return deep2209(x); - } - - public static boolean deep2209(boolean x) { - return deep2210(x); - } - - public static boolean deep2210(boolean x) { - return deep2211(x); - } - - public static boolean deep2211(boolean x) { - return deep2212(x); - } - - public static boolean deep2212(boolean x) { - return deep2213(x); - } - - public static boolean deep2213(boolean x) { - return deep2214(x); - } - - public static boolean deep2214(boolean x) { - return deep2215(x); - } - - public static boolean deep2215(boolean x) { - return deep2216(x); - } - - public static boolean deep2216(boolean x) { - return deep2217(x); - } - - public static boolean deep2217(boolean x) { - return deep2218(x); - } - - public static boolean deep2218(boolean x) { - return deep2219(x); - } - - public static boolean deep2219(boolean x) { - return deep2220(x); - } - - public static boolean deep2220(boolean x) { - return deep2221(x); - } - - public static boolean deep2221(boolean x) { - return deep2222(x); - } - - public static boolean deep2222(boolean x) { - return deep2223(x); - } - - public static boolean deep2223(boolean x) { - return deep2224(x); - } - - public static boolean deep2224(boolean x) { - return deep2225(x); - } - - public static boolean deep2225(boolean x) { - return deep2226(x); - } - - public static boolean deep2226(boolean x) { - return deep2227(x); - } - - public static boolean deep2227(boolean x) { - return deep2228(x); - } - - public static boolean deep2228(boolean x) { - return deep2229(x); - } - - public static boolean deep2229(boolean x) { - return deep2230(x); - } - - public static boolean deep2230(boolean x) { - return deep2231(x); - } - - public static boolean deep2231(boolean x) { - return deep2232(x); - } - - public static boolean deep2232(boolean x) { - return deep2233(x); - } - - public static boolean deep2233(boolean x) { - return deep2234(x); - } - - public static boolean deep2234(boolean x) { - return deep2235(x); - } - - public static boolean deep2235(boolean x) { - return deep2236(x); - } - - public static boolean deep2236(boolean x) { - return deep2237(x); - } - - public static boolean deep2237(boolean x) { - return deep2238(x); - } - - public static boolean deep2238(boolean x) { - return deep2239(x); - } - - public static boolean deep2239(boolean x) { - return deep2240(x); - } - - public static boolean deep2240(boolean x) { - return deep2241(x); - } - - public static boolean deep2241(boolean x) { - return deep2242(x); - } - - public static boolean deep2242(boolean x) { - return deep2243(x); - } - - public static boolean deep2243(boolean x) { - return deep2244(x); - } - - public static boolean deep2244(boolean x) { - return deep2245(x); - } - - public static boolean deep2245(boolean x) { - return deep2246(x); - } - - public static boolean deep2246(boolean x) { - return deep2247(x); - } - - public static boolean deep2247(boolean x) { - return deep2248(x); - } - - public static boolean deep2248(boolean x) { - return deep2249(x); - } - - public static boolean deep2249(boolean x) { - return deep2250(x); - } - - public static boolean deep2250(boolean x) { - return deep2251(x); - } - - public static boolean deep2251(boolean x) { - return deep2252(x); - } - - public static boolean deep2252(boolean x) { - return deep2253(x); - } - - public static boolean deep2253(boolean x) { - return deep2254(x); - } - - public static boolean deep2254(boolean x) { - return deep2255(x); - } - - public static boolean deep2255(boolean x) { - return deep2256(x); - } - - public static boolean deep2256(boolean x) { - return deep2257(x); - } - - public static boolean deep2257(boolean x) { - return deep2258(x); - } - - public static boolean deep2258(boolean x) { - return deep2259(x); - } - - public static boolean deep2259(boolean x) { - return deep2260(x); - } - - public static boolean deep2260(boolean x) { - return deep2261(x); - } - - public static boolean deep2261(boolean x) { - return deep2262(x); - } - - public static boolean deep2262(boolean x) { - return deep2263(x); - } - - public static boolean deep2263(boolean x) { - return deep2264(x); - } - - public static boolean deep2264(boolean x) { - return deep2265(x); - } - - public static boolean deep2265(boolean x) { - return deep2266(x); - } - - public static boolean deep2266(boolean x) { - return deep2267(x); - } - - public static boolean deep2267(boolean x) { - return deep2268(x); - } - - public static boolean deep2268(boolean x) { - return deep2269(x); - } - - public static boolean deep2269(boolean x) { - return deep2270(x); - } - - public static boolean deep2270(boolean x) { - return deep2271(x); - } - - public static boolean deep2271(boolean x) { - return deep2272(x); - } - - public static boolean deep2272(boolean x) { - return deep2273(x); - } - - public static boolean deep2273(boolean x) { - return deep2274(x); - } - - public static boolean deep2274(boolean x) { - return deep2275(x); - } - - public static boolean deep2275(boolean x) { - return deep2276(x); - } - - public static boolean deep2276(boolean x) { - return deep2277(x); - } - - public static boolean deep2277(boolean x) { - return deep2278(x); - } - - public static boolean deep2278(boolean x) { - return deep2279(x); - } - - public static boolean deep2279(boolean x) { - return deep2280(x); - } - - public static boolean deep2280(boolean x) { - return deep2281(x); - } - - public static boolean deep2281(boolean x) { - return deep2282(x); - } - - public static boolean deep2282(boolean x) { - return deep2283(x); - } - - public static boolean deep2283(boolean x) { - return deep2284(x); - } - - public static boolean deep2284(boolean x) { - return deep2285(x); - } - - public static boolean deep2285(boolean x) { - return deep2286(x); - } - - public static boolean deep2286(boolean x) { - return deep2287(x); - } - - public static boolean deep2287(boolean x) { - return deep2288(x); - } - - public static boolean deep2288(boolean x) { - return deep2289(x); - } - - public static boolean deep2289(boolean x) { - return deep2290(x); - } - - public static boolean deep2290(boolean x) { - return deep2291(x); - } - - public static boolean deep2291(boolean x) { - return deep2292(x); - } - - public static boolean deep2292(boolean x) { - return deep2293(x); - } - - public static boolean deep2293(boolean x) { - return deep2294(x); - } - - public static boolean deep2294(boolean x) { - return deep2295(x); - } - - public static boolean deep2295(boolean x) { - return deep2296(x); - } - - public static boolean deep2296(boolean x) { - return deep2297(x); - } - - public static boolean deep2297(boolean x) { - return deep2298(x); - } - - public static boolean deep2298(boolean x) { - return deep2299(x); - } - - public static boolean deep2299(boolean x) { - return deep2300(x); - } - - public static boolean deep2300(boolean x) { - return deep2301(x); - } - - public static boolean deep2301(boolean x) { - return deep2302(x); - } - - public static boolean deep2302(boolean x) { - return deep2303(x); - } - - public static boolean deep2303(boolean x) { - return deep2304(x); - } - - public static boolean deep2304(boolean x) { - return deep2305(x); - } - - public static boolean deep2305(boolean x) { - return deep2306(x); - } - - public static boolean deep2306(boolean x) { - return deep2307(x); - } - - public static boolean deep2307(boolean x) { - return deep2308(x); - } - - public static boolean deep2308(boolean x) { - return deep2309(x); - } - - public static boolean deep2309(boolean x) { - return deep2310(x); - } - - public static boolean deep2310(boolean x) { - return deep2311(x); - } - - public static boolean deep2311(boolean x) { - return deep2312(x); - } - - public static boolean deep2312(boolean x) { - return deep2313(x); - } - - public static boolean deep2313(boolean x) { - return deep2314(x); - } - - public static boolean deep2314(boolean x) { - return deep2315(x); - } - - public static boolean deep2315(boolean x) { - return deep2316(x); - } - - public static boolean deep2316(boolean x) { - return deep2317(x); - } - - public static boolean deep2317(boolean x) { - return deep2318(x); - } - - public static boolean deep2318(boolean x) { - return deep2319(x); - } - - public static boolean deep2319(boolean x) { - return deep2320(x); - } - - public static boolean deep2320(boolean x) { - return deep2321(x); - } - - public static boolean deep2321(boolean x) { - return deep2322(x); - } - - public static boolean deep2322(boolean x) { - return deep2323(x); - } - - public static boolean deep2323(boolean x) { - return deep2324(x); - } - - public static boolean deep2324(boolean x) { - return deep2325(x); - } - - public static boolean deep2325(boolean x) { - return deep2326(x); - } - - public static boolean deep2326(boolean x) { - return deep2327(x); - } - - public static boolean deep2327(boolean x) { - return deep2328(x); - } - - public static boolean deep2328(boolean x) { - return deep2329(x); - } - - public static boolean deep2329(boolean x) { - return deep2330(x); - } - - public static boolean deep2330(boolean x) { - return deep2331(x); - } - - public static boolean deep2331(boolean x) { - return deep2332(x); - } - - public static boolean deep2332(boolean x) { - return deep2333(x); - } - - public static boolean deep2333(boolean x) { - return deep2334(x); - } - - public static boolean deep2334(boolean x) { - return deep2335(x); - } - - public static boolean deep2335(boolean x) { - return deep2336(x); - } - - public static boolean deep2336(boolean x) { - return deep2337(x); - } - - public static boolean deep2337(boolean x) { - return deep2338(x); - } - - public static boolean deep2338(boolean x) { - return deep2339(x); - } - - public static boolean deep2339(boolean x) { - return deep2340(x); - } - - public static boolean deep2340(boolean x) { - return deep2341(x); - } - - public static boolean deep2341(boolean x) { - return deep2342(x); - } - - public static boolean deep2342(boolean x) { - return deep2343(x); - } - - public static boolean deep2343(boolean x) { - return deep2344(x); - } - - public static boolean deep2344(boolean x) { - return deep2345(x); - } - - public static boolean deep2345(boolean x) { - return deep2346(x); - } - - public static boolean deep2346(boolean x) { - return deep2347(x); - } - - public static boolean deep2347(boolean x) { - return deep2348(x); - } - - public static boolean deep2348(boolean x) { - return deep2349(x); - } - - public static boolean deep2349(boolean x) { - return deep2350(x); - } - - public static boolean deep2350(boolean x) { - return deep2351(x); - } - - public static boolean deep2351(boolean x) { - return deep2352(x); - } - - public static boolean deep2352(boolean x) { - return deep2353(x); - } - - public static boolean deep2353(boolean x) { - return deep2354(x); - } - - public static boolean deep2354(boolean x) { - return deep2355(x); - } - - public static boolean deep2355(boolean x) { - return deep2356(x); - } - - public static boolean deep2356(boolean x) { - return deep2357(x); - } - - public static boolean deep2357(boolean x) { - return deep2358(x); - } - - public static boolean deep2358(boolean x) { - return deep2359(x); - } - - public static boolean deep2359(boolean x) { - return deep2360(x); - } - - public static boolean deep2360(boolean x) { - return deep2361(x); - } - - public static boolean deep2361(boolean x) { - return deep2362(x); - } - - public static boolean deep2362(boolean x) { - return deep2363(x); - } - - public static boolean deep2363(boolean x) { - return deep2364(x); - } - - public static boolean deep2364(boolean x) { - return deep2365(x); - } - - public static boolean deep2365(boolean x) { - return deep2366(x); - } - - public static boolean deep2366(boolean x) { - return deep2367(x); - } - - public static boolean deep2367(boolean x) { - return deep2368(x); - } - - public static boolean deep2368(boolean x) { - return deep2369(x); - } - - public static boolean deep2369(boolean x) { - return deep2370(x); - } - - public static boolean deep2370(boolean x) { - return deep2371(x); - } - - public static boolean deep2371(boolean x) { - return deep2372(x); - } - - public static boolean deep2372(boolean x) { - return deep2373(x); - } - - public static boolean deep2373(boolean x) { - return deep2374(x); - } - - public static boolean deep2374(boolean x) { - return deep2375(x); - } - - public static boolean deep2375(boolean x) { - return deep2376(x); - } - - public static boolean deep2376(boolean x) { - return deep2377(x); - } - - public static boolean deep2377(boolean x) { - return deep2378(x); - } - - public static boolean deep2378(boolean x) { - return deep2379(x); - } - - public static boolean deep2379(boolean x) { - return deep2380(x); - } - - public static boolean deep2380(boolean x) { - return deep2381(x); - } - - public static boolean deep2381(boolean x) { - return deep2382(x); - } - - public static boolean deep2382(boolean x) { - return deep2383(x); - } - - public static boolean deep2383(boolean x) { - return deep2384(x); - } - - public static boolean deep2384(boolean x) { - return deep2385(x); - } - - public static boolean deep2385(boolean x) { - return deep2386(x); - } - - public static boolean deep2386(boolean x) { - return deep2387(x); - } - - public static boolean deep2387(boolean x) { - return deep2388(x); - } - - public static boolean deep2388(boolean x) { - return deep2389(x); - } - - public static boolean deep2389(boolean x) { - return deep2390(x); - } - - public static boolean deep2390(boolean x) { - return deep2391(x); - } - - public static boolean deep2391(boolean x) { - return deep2392(x); - } - - public static boolean deep2392(boolean x) { - return deep2393(x); - } - - public static boolean deep2393(boolean x) { - return deep2394(x); - } - - public static boolean deep2394(boolean x) { - return deep2395(x); - } - - public static boolean deep2395(boolean x) { - return deep2396(x); - } - - public static boolean deep2396(boolean x) { - return deep2397(x); - } - - public static boolean deep2397(boolean x) { - return deep2398(x); - } - - public static boolean deep2398(boolean x) { - return deep2399(x); - } - - public static boolean deep2399(boolean x) { - return deep2400(x); - } - - public static boolean deep2400(boolean x) { - return deep2401(x); - } - - public static boolean deep2401(boolean x) { - return deep2402(x); - } - - public static boolean deep2402(boolean x) { - return deep2403(x); - } - - public static boolean deep2403(boolean x) { - return deep2404(x); - } - - public static boolean deep2404(boolean x) { - return deep2405(x); - } - - public static boolean deep2405(boolean x) { - return deep2406(x); - } - - public static boolean deep2406(boolean x) { - return deep2407(x); - } - - public static boolean deep2407(boolean x) { - return deep2408(x); - } - - public static boolean deep2408(boolean x) { - return deep2409(x); - } - - public static boolean deep2409(boolean x) { - return deep2410(x); - } - - public static boolean deep2410(boolean x) { - return deep2411(x); - } - - public static boolean deep2411(boolean x) { - return deep2412(x); - } - - public static boolean deep2412(boolean x) { - return deep2413(x); - } - - public static boolean deep2413(boolean x) { - return deep2414(x); - } - - public static boolean deep2414(boolean x) { - return deep2415(x); - } - - public static boolean deep2415(boolean x) { - return deep2416(x); - } - - public static boolean deep2416(boolean x) { - return deep2417(x); - } - - public static boolean deep2417(boolean x) { - return deep2418(x); - } - - public static boolean deep2418(boolean x) { - return deep2419(x); - } - - public static boolean deep2419(boolean x) { - return deep2420(x); - } - - public static boolean deep2420(boolean x) { - return deep2421(x); - } - - public static boolean deep2421(boolean x) { - return deep2422(x); - } - - public static boolean deep2422(boolean x) { - return deep2423(x); - } - - public static boolean deep2423(boolean x) { - return deep2424(x); - } - - public static boolean deep2424(boolean x) { - return deep2425(x); - } - - public static boolean deep2425(boolean x) { - return deep2426(x); - } - - public static boolean deep2426(boolean x) { - return deep2427(x); - } - - public static boolean deep2427(boolean x) { - return deep2428(x); - } - - public static boolean deep2428(boolean x) { - return deep2429(x); - } - - public static boolean deep2429(boolean x) { - return deep2430(x); - } - - public static boolean deep2430(boolean x) { - return deep2431(x); - } - - public static boolean deep2431(boolean x) { - return deep2432(x); - } - - public static boolean deep2432(boolean x) { - return deep2433(x); - } - - public static boolean deep2433(boolean x) { - return deep2434(x); - } - - public static boolean deep2434(boolean x) { - return deep2435(x); - } - - public static boolean deep2435(boolean x) { - return deep2436(x); - } - - public static boolean deep2436(boolean x) { - return deep2437(x); - } - - public static boolean deep2437(boolean x) { - return deep2438(x); - } - - public static boolean deep2438(boolean x) { - return deep2439(x); - } - - public static boolean deep2439(boolean x) { - return deep2440(x); - } - - public static boolean deep2440(boolean x) { - return deep2441(x); - } - - public static boolean deep2441(boolean x) { - return deep2442(x); - } - - public static boolean deep2442(boolean x) { - return deep2443(x); - } - - public static boolean deep2443(boolean x) { - return deep2444(x); - } - - public static boolean deep2444(boolean x) { - return deep2445(x); - } - - public static boolean deep2445(boolean x) { - return deep2446(x); - } - - public static boolean deep2446(boolean x) { - return deep2447(x); - } - - public static boolean deep2447(boolean x) { - return deep2448(x); - } - - public static boolean deep2448(boolean x) { - return deep2449(x); - } - - public static boolean deep2449(boolean x) { - return deep2450(x); - } - - public static boolean deep2450(boolean x) { - return deep2451(x); - } - - public static boolean deep2451(boolean x) { - return deep2452(x); - } - - public static boolean deep2452(boolean x) { - return deep2453(x); - } - - public static boolean deep2453(boolean x) { - return deep2454(x); - } - - public static boolean deep2454(boolean x) { - return deep2455(x); - } - - public static boolean deep2455(boolean x) { - return deep2456(x); - } - - public static boolean deep2456(boolean x) { - return deep2457(x); - } - - public static boolean deep2457(boolean x) { - return deep2458(x); - } - - public static boolean deep2458(boolean x) { - return deep2459(x); - } - - public static boolean deep2459(boolean x) { - return deep2460(x); - } - - public static boolean deep2460(boolean x) { - return deep2461(x); - } - - public static boolean deep2461(boolean x) { - return deep2462(x); - } - - public static boolean deep2462(boolean x) { - return deep2463(x); - } - - public static boolean deep2463(boolean x) { - return deep2464(x); - } - - public static boolean deep2464(boolean x) { - return deep2465(x); - } - - public static boolean deep2465(boolean x) { - return deep2466(x); - } - - public static boolean deep2466(boolean x) { - return deep2467(x); - } - - public static boolean deep2467(boolean x) { - return deep2468(x); - } - - public static boolean deep2468(boolean x) { - return deep2469(x); - } - - public static boolean deep2469(boolean x) { - return deep2470(x); - } - - public static boolean deep2470(boolean x) { - return deep2471(x); - } - - public static boolean deep2471(boolean x) { - return deep2472(x); - } - - public static boolean deep2472(boolean x) { - return deep2473(x); - } - - public static boolean deep2473(boolean x) { - return deep2474(x); - } - - public static boolean deep2474(boolean x) { - return deep2475(x); - } - - public static boolean deep2475(boolean x) { - return deep2476(x); - } - - public static boolean deep2476(boolean x) { - return deep2477(x); - } - - public static boolean deep2477(boolean x) { - return deep2478(x); - } - - public static boolean deep2478(boolean x) { - return deep2479(x); - } - - public static boolean deep2479(boolean x) { - return deep2480(x); - } - - public static boolean deep2480(boolean x) { - return deep2481(x); - } - - public static boolean deep2481(boolean x) { - return deep2482(x); - } - - public static boolean deep2482(boolean x) { - return deep2483(x); - } - - public static boolean deep2483(boolean x) { - return deep2484(x); - } - - public static boolean deep2484(boolean x) { - return deep2485(x); - } - - public static boolean deep2485(boolean x) { - return deep2486(x); - } - - public static boolean deep2486(boolean x) { - return deep2487(x); - } - - public static boolean deep2487(boolean x) { - return deep2488(x); - } - - public static boolean deep2488(boolean x) { - return deep2489(x); - } - - public static boolean deep2489(boolean x) { - return deep2490(x); - } - - public static boolean deep2490(boolean x) { - return deep2491(x); - } - - public static boolean deep2491(boolean x) { - return deep2492(x); - } - - public static boolean deep2492(boolean x) { - return deep2493(x); - } - - public static boolean deep2493(boolean x) { - return deep2494(x); - } - - public static boolean deep2494(boolean x) { - return deep2495(x); - } - - public static boolean deep2495(boolean x) { - return deep2496(x); - } - - public static boolean deep2496(boolean x) { - return deep2497(x); - } - - public static boolean deep2497(boolean x) { - return deep2498(x); - } - - public static boolean deep2498(boolean x) { - return deep2499(x); - } - - public static boolean deep2499(boolean x) { - return deep2500(x); - } - - public static boolean deep2500(boolean x) { - return deep2501(x); - } - - public static boolean deep2501(boolean x) { - return deep2502(x); - } - - public static boolean deep2502(boolean x) { - return deep2503(x); - } - - public static boolean deep2503(boolean x) { - return deep2504(x); - } - - public static boolean deep2504(boolean x) { - return deep2505(x); - } - - public static boolean deep2505(boolean x) { - return deep2506(x); - } - - public static boolean deep2506(boolean x) { - return deep2507(x); - } - - public static boolean deep2507(boolean x) { - return deep2508(x); - } - - public static boolean deep2508(boolean x) { - return deep2509(x); - } - - public static boolean deep2509(boolean x) { - return deep2510(x); - } - - public static boolean deep2510(boolean x) { - return deep2511(x); - } - - public static boolean deep2511(boolean x) { - return deep2512(x); - } - - public static boolean deep2512(boolean x) { - return deep2513(x); - } - - public static boolean deep2513(boolean x) { - return deep2514(x); - } - - public static boolean deep2514(boolean x) { - return deep2515(x); - } - - public static boolean deep2515(boolean x) { - return deep2516(x); - } - - public static boolean deep2516(boolean x) { - return deep2517(x); - } - - public static boolean deep2517(boolean x) { - return deep2518(x); - } - - public static boolean deep2518(boolean x) { - return deep2519(x); - } - - public static boolean deep2519(boolean x) { - return deep2520(x); - } - - public static boolean deep2520(boolean x) { - return deep2521(x); - } - - public static boolean deep2521(boolean x) { - return deep2522(x); - } - - public static boolean deep2522(boolean x) { - return deep2523(x); - } - - public static boolean deep2523(boolean x) { - return deep2524(x); - } - - public static boolean deep2524(boolean x) { - return deep2525(x); - } - - public static boolean deep2525(boolean x) { - return deep2526(x); - } - - public static boolean deep2526(boolean x) { - return deep2527(x); - } - - public static boolean deep2527(boolean x) { - return deep2528(x); - } - - public static boolean deep2528(boolean x) { - return deep2529(x); - } - - public static boolean deep2529(boolean x) { - return deep2530(x); - } - - public static boolean deep2530(boolean x) { - return deep2531(x); - } - - public static boolean deep2531(boolean x) { - return deep2532(x); - } - - public static boolean deep2532(boolean x) { - return deep2533(x); - } - - public static boolean deep2533(boolean x) { - return deep2534(x); - } - - public static boolean deep2534(boolean x) { - return deep2535(x); - } - - public static boolean deep2535(boolean x) { - return deep2536(x); - } - - public static boolean deep2536(boolean x) { - return deep2537(x); - } - - public static boolean deep2537(boolean x) { - return deep2538(x); - } - - public static boolean deep2538(boolean x) { - return deep2539(x); - } - - public static boolean deep2539(boolean x) { - return deep2540(x); - } - - public static boolean deep2540(boolean x) { - return deep2541(x); - } - - public static boolean deep2541(boolean x) { - return deep2542(x); - } - - public static boolean deep2542(boolean x) { - return deep2543(x); - } - - public static boolean deep2543(boolean x) { - return deep2544(x); - } - - public static boolean deep2544(boolean x) { - return deep2545(x); - } - - public static boolean deep2545(boolean x) { - return deep2546(x); - } - - public static boolean deep2546(boolean x) { - return deep2547(x); - } - - public static boolean deep2547(boolean x) { - return deep2548(x); - } - - public static boolean deep2548(boolean x) { - return deep2549(x); - } - - public static boolean deep2549(boolean x) { - return deep2550(x); - } - - public static boolean deep2550(boolean x) { - return deep2551(x); - } - - public static boolean deep2551(boolean x) { - return deep2552(x); - } - - public static boolean deep2552(boolean x) { - return deep2553(x); - } - - public static boolean deep2553(boolean x) { - return deep2554(x); - } - - public static boolean deep2554(boolean x) { - return deep2555(x); - } - - public static boolean deep2555(boolean x) { - return deep2556(x); - } - - public static boolean deep2556(boolean x) { - return deep2557(x); - } - - public static boolean deep2557(boolean x) { - return deep2558(x); - } - - public static boolean deep2558(boolean x) { - return deep2559(x); - } - - public static boolean deep2559(boolean x) { - return deep2560(x); - } - - public static boolean deep2560(boolean x) { - return deep2561(x); - } - - public static boolean deep2561(boolean x) { - return deep2562(x); - } - - public static boolean deep2562(boolean x) { - return deep2563(x); - } - - public static boolean deep2563(boolean x) { - return deep2564(x); - } - - public static boolean deep2564(boolean x) { - return deep2565(x); - } - - public static boolean deep2565(boolean x) { - return deep2566(x); - } - - public static boolean deep2566(boolean x) { - return deep2567(x); - } - - public static boolean deep2567(boolean x) { - return deep2568(x); - } - - public static boolean deep2568(boolean x) { - return deep2569(x); - } - - public static boolean deep2569(boolean x) { - return deep2570(x); - } - - public static boolean deep2570(boolean x) { - return deep2571(x); - } - - public static boolean deep2571(boolean x) { - return deep2572(x); - } - - public static boolean deep2572(boolean x) { - return deep2573(x); - } - - public static boolean deep2573(boolean x) { - return deep2574(x); - } - - public static boolean deep2574(boolean x) { - return deep2575(x); - } - - public static boolean deep2575(boolean x) { - return deep2576(x); - } - - public static boolean deep2576(boolean x) { - return deep2577(x); - } - - public static boolean deep2577(boolean x) { - return deep2578(x); - } - - public static boolean deep2578(boolean x) { - return deep2579(x); - } - - public static boolean deep2579(boolean x) { - return deep2580(x); - } - - public static boolean deep2580(boolean x) { - return deep2581(x); - } - - public static boolean deep2581(boolean x) { - return deep2582(x); - } - - public static boolean deep2582(boolean x) { - return deep2583(x); - } - - public static boolean deep2583(boolean x) { - return deep2584(x); - } - - public static boolean deep2584(boolean x) { - return deep2585(x); - } - - public static boolean deep2585(boolean x) { - return deep2586(x); - } - - public static boolean deep2586(boolean x) { - return deep2587(x); - } - - public static boolean deep2587(boolean x) { - return deep2588(x); - } - - public static boolean deep2588(boolean x) { - return deep2589(x); - } - - public static boolean deep2589(boolean x) { - return deep2590(x); - } - - public static boolean deep2590(boolean x) { - return deep2591(x); - } - - public static boolean deep2591(boolean x) { - return deep2592(x); - } - - public static boolean deep2592(boolean x) { - return deep2593(x); - } - - public static boolean deep2593(boolean x) { - return deep2594(x); - } - - public static boolean deep2594(boolean x) { - return deep2595(x); - } - - public static boolean deep2595(boolean x) { - return deep2596(x); - } - - public static boolean deep2596(boolean x) { - return deep2597(x); - } - - public static boolean deep2597(boolean x) { - return deep2598(x); - } - - public static boolean deep2598(boolean x) { - return deep2599(x); - } - - public static boolean deep2599(boolean x) { - return deep2600(x); - } - - public static boolean deep2600(boolean x) { - return deep2601(x); - } - - public static boolean deep2601(boolean x) { - return deep2602(x); - } - - public static boolean deep2602(boolean x) { - return deep2603(x); - } - - public static boolean deep2603(boolean x) { - return deep2604(x); - } - - public static boolean deep2604(boolean x) { - return deep2605(x); - } - - public static boolean deep2605(boolean x) { - return deep2606(x); - } - - public static boolean deep2606(boolean x) { - return deep2607(x); - } - - public static boolean deep2607(boolean x) { - return deep2608(x); - } - - public static boolean deep2608(boolean x) { - return deep2609(x); - } - - public static boolean deep2609(boolean x) { - return deep2610(x); - } - - public static boolean deep2610(boolean x) { - return deep2611(x); - } - - public static boolean deep2611(boolean x) { - return deep2612(x); - } - - public static boolean deep2612(boolean x) { - return deep2613(x); - } - - public static boolean deep2613(boolean x) { - return deep2614(x); - } - - public static boolean deep2614(boolean x) { - return deep2615(x); - } - - public static boolean deep2615(boolean x) { - return deep2616(x); - } - - public static boolean deep2616(boolean x) { - return deep2617(x); - } - - public static boolean deep2617(boolean x) { - return deep2618(x); - } - - public static boolean deep2618(boolean x) { - return deep2619(x); - } - - public static boolean deep2619(boolean x) { - return deep2620(x); - } - - public static boolean deep2620(boolean x) { - return deep2621(x); - } - - public static boolean deep2621(boolean x) { - return deep2622(x); - } - - public static boolean deep2622(boolean x) { - return deep2623(x); - } - - public static boolean deep2623(boolean x) { - return deep2624(x); - } - - public static boolean deep2624(boolean x) { - return deep2625(x); - } - - public static boolean deep2625(boolean x) { - return deep2626(x); - } - - public static boolean deep2626(boolean x) { - return deep2627(x); - } - - public static boolean deep2627(boolean x) { - return deep2628(x); - } - - public static boolean deep2628(boolean x) { - return deep2629(x); - } - - public static boolean deep2629(boolean x) { - return deep2630(x); - } - - public static boolean deep2630(boolean x) { - return deep2631(x); - } - - public static boolean deep2631(boolean x) { - return deep2632(x); - } - - public static boolean deep2632(boolean x) { - return deep2633(x); - } - - public static boolean deep2633(boolean x) { - return deep2634(x); - } - - public static boolean deep2634(boolean x) { - return deep2635(x); - } - - public static boolean deep2635(boolean x) { - return deep2636(x); - } - - public static boolean deep2636(boolean x) { - return deep2637(x); - } - - public static boolean deep2637(boolean x) { - return deep2638(x); - } - - public static boolean deep2638(boolean x) { - return deep2639(x); - } - - public static boolean deep2639(boolean x) { - return deep2640(x); - } - - public static boolean deep2640(boolean x) { - return deep2641(x); - } - - public static boolean deep2641(boolean x) { - return deep2642(x); - } - - public static boolean deep2642(boolean x) { - return deep2643(x); - } - - public static boolean deep2643(boolean x) { - return deep2644(x); - } - - public static boolean deep2644(boolean x) { - return deep2645(x); - } - - public static boolean deep2645(boolean x) { - return deep2646(x); - } - - public static boolean deep2646(boolean x) { - return deep2647(x); - } - - public static boolean deep2647(boolean x) { - return deep2648(x); - } - - public static boolean deep2648(boolean x) { - return deep2649(x); - } - - public static boolean deep2649(boolean x) { - return deep2650(x); - } - - public static boolean deep2650(boolean x) { - return deep2651(x); - } - - public static boolean deep2651(boolean x) { - return deep2652(x); - } - - public static boolean deep2652(boolean x) { - return deep2653(x); - } - - public static boolean deep2653(boolean x) { - return deep2654(x); - } - - public static boolean deep2654(boolean x) { - return deep2655(x); - } - - public static boolean deep2655(boolean x) { - return deep2656(x); - } - - public static boolean deep2656(boolean x) { - return deep2657(x); - } - - public static boolean deep2657(boolean x) { - return deep2658(x); - } - - public static boolean deep2658(boolean x) { - return deep2659(x); - } - - public static boolean deep2659(boolean x) { - return deep2660(x); - } - - public static boolean deep2660(boolean x) { - return deep2661(x); - } - - public static boolean deep2661(boolean x) { - return deep2662(x); - } - - public static boolean deep2662(boolean x) { - return deep2663(x); - } - - public static boolean deep2663(boolean x) { - return deep2664(x); - } - - public static boolean deep2664(boolean x) { - return deep2665(x); - } - - public static boolean deep2665(boolean x) { - return deep2666(x); - } - - public static boolean deep2666(boolean x) { - return deep2667(x); - } - - public static boolean deep2667(boolean x) { - return deep2668(x); - } - - public static boolean deep2668(boolean x) { - return deep2669(x); - } - - public static boolean deep2669(boolean x) { - return deep2670(x); - } - - public static boolean deep2670(boolean x) { - return deep2671(x); - } - - public static boolean deep2671(boolean x) { - return deep2672(x); - } - - public static boolean deep2672(boolean x) { - return deep2673(x); - } - - public static boolean deep2673(boolean x) { - return deep2674(x); - } - - public static boolean deep2674(boolean x) { - return deep2675(x); - } - - public static boolean deep2675(boolean x) { - return deep2676(x); - } - - public static boolean deep2676(boolean x) { - return deep2677(x); - } - - public static boolean deep2677(boolean x) { - return deep2678(x); - } - - public static boolean deep2678(boolean x) { - return deep2679(x); - } - - public static boolean deep2679(boolean x) { - return deep2680(x); - } - - public static boolean deep2680(boolean x) { - return deep2681(x); - } - - public static boolean deep2681(boolean x) { - return deep2682(x); - } - - public static boolean deep2682(boolean x) { - return deep2683(x); - } - - public static boolean deep2683(boolean x) { - return deep2684(x); - } - - public static boolean deep2684(boolean x) { - return deep2685(x); - } - - public static boolean deep2685(boolean x) { - return deep2686(x); - } - - public static boolean deep2686(boolean x) { - return deep2687(x); - } - - public static boolean deep2687(boolean x) { - return deep2688(x); - } - - public static boolean deep2688(boolean x) { - return deep2689(x); - } - - public static boolean deep2689(boolean x) { - return deep2690(x); - } - - public static boolean deep2690(boolean x) { - return deep2691(x); - } - - public static boolean deep2691(boolean x) { - return deep2692(x); - } - - public static boolean deep2692(boolean x) { - return deep2693(x); - } - - public static boolean deep2693(boolean x) { - return deep2694(x); - } - - public static boolean deep2694(boolean x) { - return deep2695(x); - } - - public static boolean deep2695(boolean x) { - return deep2696(x); - } - - public static boolean deep2696(boolean x) { - return deep2697(x); - } - - public static boolean deep2697(boolean x) { - return deep2698(x); - } - - public static boolean deep2698(boolean x) { - return deep2699(x); - } - - public static boolean deep2699(boolean x) { - return deep2700(x); - } - - public static boolean deep2700(boolean x) { - return deep2701(x); - } - - public static boolean deep2701(boolean x) { - return deep2702(x); - } - - public static boolean deep2702(boolean x) { - return deep2703(x); - } - - public static boolean deep2703(boolean x) { - return deep2704(x); - } - - public static boolean deep2704(boolean x) { - return deep2705(x); - } - - public static boolean deep2705(boolean x) { - return deep2706(x); - } - - public static boolean deep2706(boolean x) { - return deep2707(x); - } - - public static boolean deep2707(boolean x) { - return deep2708(x); - } - - public static boolean deep2708(boolean x) { - return deep2709(x); - } - - public static boolean deep2709(boolean x) { - return deep2710(x); - } - - public static boolean deep2710(boolean x) { - return deep2711(x); - } - - public static boolean deep2711(boolean x) { - return deep2712(x); - } - - public static boolean deep2712(boolean x) { - return deep2713(x); - } - - public static boolean deep2713(boolean x) { - return deep2714(x); - } - - public static boolean deep2714(boolean x) { - return deep2715(x); - } - - public static boolean deep2715(boolean x) { - return deep2716(x); - } - - public static boolean deep2716(boolean x) { - return deep2717(x); - } - - public static boolean deep2717(boolean x) { - return deep2718(x); - } - - public static boolean deep2718(boolean x) { - return deep2719(x); - } - - public static boolean deep2719(boolean x) { - return deep2720(x); - } - - public static boolean deep2720(boolean x) { - return deep2721(x); - } - - public static boolean deep2721(boolean x) { - return deep2722(x); - } - - public static boolean deep2722(boolean x) { - return deep2723(x); - } - - public static boolean deep2723(boolean x) { - return deep2724(x); - } - - public static boolean deep2724(boolean x) { - return deep2725(x); - } - - public static boolean deep2725(boolean x) { - return deep2726(x); - } - - public static boolean deep2726(boolean x) { - return deep2727(x); - } - - public static boolean deep2727(boolean x) { - return deep2728(x); - } - - public static boolean deep2728(boolean x) { - return deep2729(x); - } - - public static boolean deep2729(boolean x) { - return deep2730(x); - } - - public static boolean deep2730(boolean x) { - return deep2731(x); - } - - public static boolean deep2731(boolean x) { - return deep2732(x); - } - - public static boolean deep2732(boolean x) { - return deep2733(x); - } - - public static boolean deep2733(boolean x) { - return deep2734(x); - } - - public static boolean deep2734(boolean x) { - return deep2735(x); - } - - public static boolean deep2735(boolean x) { - return deep2736(x); - } - - public static boolean deep2736(boolean x) { - return deep2737(x); - } - - public static boolean deep2737(boolean x) { - return deep2738(x); - } - - public static boolean deep2738(boolean x) { - return deep2739(x); - } - - public static boolean deep2739(boolean x) { - return deep2740(x); - } - - public static boolean deep2740(boolean x) { - return deep2741(x); - } - - public static boolean deep2741(boolean x) { - return deep2742(x); - } - - public static boolean deep2742(boolean x) { - return deep2743(x); - } - - public static boolean deep2743(boolean x) { - return deep2744(x); - } - - public static boolean deep2744(boolean x) { - return deep2745(x); - } - - public static boolean deep2745(boolean x) { - return deep2746(x); - } - - public static boolean deep2746(boolean x) { - return deep2747(x); - } - - public static boolean deep2747(boolean x) { - return deep2748(x); - } - - public static boolean deep2748(boolean x) { - return deep2749(x); - } - - public static boolean deep2749(boolean x) { - return deep2750(x); - } - - public static boolean deep2750(boolean x) { - return deep2751(x); - } - - public static boolean deep2751(boolean x) { - return deep2752(x); - } - - public static boolean deep2752(boolean x) { - return deep2753(x); - } - - public static boolean deep2753(boolean x) { - return deep2754(x); - } - - public static boolean deep2754(boolean x) { - return deep2755(x); - } - - public static boolean deep2755(boolean x) { - return deep2756(x); - } - - public static boolean deep2756(boolean x) { - return deep2757(x); - } - - public static boolean deep2757(boolean x) { - return deep2758(x); - } - - public static boolean deep2758(boolean x) { - return deep2759(x); - } - - public static boolean deep2759(boolean x) { - return deep2760(x); - } - - public static boolean deep2760(boolean x) { - return deep2761(x); - } - - public static boolean deep2761(boolean x) { - return deep2762(x); - } - - public static boolean deep2762(boolean x) { - return deep2763(x); - } - - public static boolean deep2763(boolean x) { - return deep2764(x); - } - - public static boolean deep2764(boolean x) { - return deep2765(x); - } - - public static boolean deep2765(boolean x) { - return deep2766(x); - } - - public static boolean deep2766(boolean x) { - return deep2767(x); - } - - public static boolean deep2767(boolean x) { - return deep2768(x); - } - - public static boolean deep2768(boolean x) { - return deep2769(x); - } - - public static boolean deep2769(boolean x) { - return deep2770(x); - } - - public static boolean deep2770(boolean x) { - return deep2771(x); - } - - public static boolean deep2771(boolean x) { - return deep2772(x); - } - - public static boolean deep2772(boolean x) { - return deep2773(x); - } - - public static boolean deep2773(boolean x) { - return deep2774(x); - } - - public static boolean deep2774(boolean x) { - return deep2775(x); - } - - public static boolean deep2775(boolean x) { - return deep2776(x); - } - - public static boolean deep2776(boolean x) { - return deep2777(x); - } - - public static boolean deep2777(boolean x) { - return deep2778(x); - } - - public static boolean deep2778(boolean x) { - return deep2779(x); - } - - public static boolean deep2779(boolean x) { - return deep2780(x); - } - - public static boolean deep2780(boolean x) { - return deep2781(x); - } - - public static boolean deep2781(boolean x) { - return deep2782(x); - } - - public static boolean deep2782(boolean x) { - return deep2783(x); - } - - public static boolean deep2783(boolean x) { - return deep2784(x); - } - - public static boolean deep2784(boolean x) { - return deep2785(x); - } - - public static boolean deep2785(boolean x) { - return deep2786(x); - } - - public static boolean deep2786(boolean x) { - return deep2787(x); - } - - public static boolean deep2787(boolean x) { - return deep2788(x); - } - - public static boolean deep2788(boolean x) { - return deep2789(x); - } - - public static boolean deep2789(boolean x) { - return deep2790(x); - } - - public static boolean deep2790(boolean x) { - return deep2791(x); - } - - public static boolean deep2791(boolean x) { - return deep2792(x); - } - - public static boolean deep2792(boolean x) { - return deep2793(x); - } - - public static boolean deep2793(boolean x) { - return deep2794(x); - } - - public static boolean deep2794(boolean x) { - return deep2795(x); - } - - public static boolean deep2795(boolean x) { - return deep2796(x); - } - - public static boolean deep2796(boolean x) { - return deep2797(x); - } - - public static boolean deep2797(boolean x) { - return deep2798(x); - } - - public static boolean deep2798(boolean x) { - return deep2799(x); - } - - public static boolean deep2799(boolean x) { - return deep2800(x); - } - - public static boolean deep2800(boolean x) { - return deep2801(x); - } - - public static boolean deep2801(boolean x) { - return deep2802(x); - } - - public static boolean deep2802(boolean x) { - return deep2803(x); - } - - public static boolean deep2803(boolean x) { - return deep2804(x); - } - - public static boolean deep2804(boolean x) { - return deep2805(x); - } - - public static boolean deep2805(boolean x) { - return deep2806(x); - } - - public static boolean deep2806(boolean x) { - return deep2807(x); - } - - public static boolean deep2807(boolean x) { - return deep2808(x); - } - - public static boolean deep2808(boolean x) { - return deep2809(x); - } - - public static boolean deep2809(boolean x) { - return deep2810(x); - } - - public static boolean deep2810(boolean x) { - return deep2811(x); - } - - public static boolean deep2811(boolean x) { - return deep2812(x); - } - - public static boolean deep2812(boolean x) { - return deep2813(x); - } - - public static boolean deep2813(boolean x) { - return deep2814(x); - } - - public static boolean deep2814(boolean x) { - return deep2815(x); - } - - public static boolean deep2815(boolean x) { - return deep2816(x); - } - - public static boolean deep2816(boolean x) { - return deep2817(x); - } - - public static boolean deep2817(boolean x) { - return deep2818(x); - } - - public static boolean deep2818(boolean x) { - return deep2819(x); - } - - public static boolean deep2819(boolean x) { - return deep2820(x); - } - - public static boolean deep2820(boolean x) { - return deep2821(x); - } - - public static boolean deep2821(boolean x) { - return deep2822(x); - } - - public static boolean deep2822(boolean x) { - return deep2823(x); - } - - public static boolean deep2823(boolean x) { - return deep2824(x); - } - - public static boolean deep2824(boolean x) { - return deep2825(x); - } - - public static boolean deep2825(boolean x) { - return deep2826(x); - } - - public static boolean deep2826(boolean x) { - return deep2827(x); - } - - public static boolean deep2827(boolean x) { - return deep2828(x); - } - - public static boolean deep2828(boolean x) { - return deep2829(x); - } - - public static boolean deep2829(boolean x) { - return deep2830(x); - } - - public static boolean deep2830(boolean x) { - return deep2831(x); - } - - public static boolean deep2831(boolean x) { - return deep2832(x); - } - - public static boolean deep2832(boolean x) { - return deep2833(x); - } - - public static boolean deep2833(boolean x) { - return deep2834(x); - } - - public static boolean deep2834(boolean x) { - return deep2835(x); - } - - public static boolean deep2835(boolean x) { - return deep2836(x); - } - - public static boolean deep2836(boolean x) { - return deep2837(x); - } - - public static boolean deep2837(boolean x) { - return deep2838(x); - } - - public static boolean deep2838(boolean x) { - return deep2839(x); - } - - public static boolean deep2839(boolean x) { - return deep2840(x); - } - - public static boolean deep2840(boolean x) { - return deep2841(x); - } - - public static boolean deep2841(boolean x) { - return deep2842(x); - } - - public static boolean deep2842(boolean x) { - return deep2843(x); - } - - public static boolean deep2843(boolean x) { - return deep2844(x); - } - - public static boolean deep2844(boolean x) { - return deep2845(x); - } - - public static boolean deep2845(boolean x) { - return deep2846(x); - } - - public static boolean deep2846(boolean x) { - return deep2847(x); - } - - public static boolean deep2847(boolean x) { - return deep2848(x); - } - - public static boolean deep2848(boolean x) { - return deep2849(x); - } - - public static boolean deep2849(boolean x) { - return deep2850(x); - } - - public static boolean deep2850(boolean x) { - return deep2851(x); - } - - public static boolean deep2851(boolean x) { - return deep2852(x); - } - - public static boolean deep2852(boolean x) { - return deep2853(x); - } - - public static boolean deep2853(boolean x) { - return deep2854(x); - } - - public static boolean deep2854(boolean x) { - return deep2855(x); - } - - public static boolean deep2855(boolean x) { - return deep2856(x); - } - - public static boolean deep2856(boolean x) { - return deep2857(x); - } - - public static boolean deep2857(boolean x) { - return deep2858(x); - } - - public static boolean deep2858(boolean x) { - return deep2859(x); - } - - public static boolean deep2859(boolean x) { - return deep2860(x); - } - - public static boolean deep2860(boolean x) { - return deep2861(x); - } - - public static boolean deep2861(boolean x) { - return deep2862(x); - } - - public static boolean deep2862(boolean x) { - return deep2863(x); - } - - public static boolean deep2863(boolean x) { - return deep2864(x); - } - - public static boolean deep2864(boolean x) { - return deep2865(x); - } - - public static boolean deep2865(boolean x) { - return deep2866(x); - } - - public static boolean deep2866(boolean x) { - return deep2867(x); - } - - public static boolean deep2867(boolean x) { - return deep2868(x); - } - - public static boolean deep2868(boolean x) { - return deep2869(x); - } - - public static boolean deep2869(boolean x) { - return deep2870(x); - } - - public static boolean deep2870(boolean x) { - return deep2871(x); - } - - public static boolean deep2871(boolean x) { - return deep2872(x); - } - - public static boolean deep2872(boolean x) { - return deep2873(x); - } - - public static boolean deep2873(boolean x) { - return deep2874(x); - } - - public static boolean deep2874(boolean x) { - return deep2875(x); - } - - public static boolean deep2875(boolean x) { - return deep2876(x); - } - - public static boolean deep2876(boolean x) { - return deep2877(x); - } - - public static boolean deep2877(boolean x) { - return deep2878(x); - } - - public static boolean deep2878(boolean x) { - return deep2879(x); - } - - public static boolean deep2879(boolean x) { - return deep2880(x); - } - - public static boolean deep2880(boolean x) { - return deep2881(x); - } - - public static boolean deep2881(boolean x) { - return deep2882(x); - } - - public static boolean deep2882(boolean x) { - return deep2883(x); - } - - public static boolean deep2883(boolean x) { - return deep2884(x); - } - - public static boolean deep2884(boolean x) { - return deep2885(x); - } - - public static boolean deep2885(boolean x) { - return deep2886(x); - } - - public static boolean deep2886(boolean x) { - return deep2887(x); - } - - public static boolean deep2887(boolean x) { - return deep2888(x); - } - - public static boolean deep2888(boolean x) { - return deep2889(x); - } - - public static boolean deep2889(boolean x) { - return deep2890(x); - } - - public static boolean deep2890(boolean x) { - return deep2891(x); - } - - public static boolean deep2891(boolean x) { - return deep2892(x); - } - - public static boolean deep2892(boolean x) { - return deep2893(x); - } - - public static boolean deep2893(boolean x) { - return deep2894(x); - } - - public static boolean deep2894(boolean x) { - return deep2895(x); - } - - public static boolean deep2895(boolean x) { - return deep2896(x); - } - - public static boolean deep2896(boolean x) { - return deep2897(x); - } - - public static boolean deep2897(boolean x) { - return deep2898(x); - } - - public static boolean deep2898(boolean x) { - return deep2899(x); - } - - public static boolean deep2899(boolean x) { - return deep2900(x); - } - - public static boolean deep2900(boolean x) { - return deep2901(x); - } - - public static boolean deep2901(boolean x) { - return deep2902(x); - } - - public static boolean deep2902(boolean x) { - return deep2903(x); - } - - public static boolean deep2903(boolean x) { - return deep2904(x); - } - - public static boolean deep2904(boolean x) { - return deep2905(x); - } - - public static boolean deep2905(boolean x) { - return deep2906(x); - } - - public static boolean deep2906(boolean x) { - return deep2907(x); - } - - public static boolean deep2907(boolean x) { - return deep2908(x); - } - - public static boolean deep2908(boolean x) { - return deep2909(x); - } - - public static boolean deep2909(boolean x) { - return deep2910(x); - } - - public static boolean deep2910(boolean x) { - return deep2911(x); - } - - public static boolean deep2911(boolean x) { - return deep2912(x); - } - - public static boolean deep2912(boolean x) { - return deep2913(x); - } - - public static boolean deep2913(boolean x) { - return deep2914(x); - } - - public static boolean deep2914(boolean x) { - return deep2915(x); - } - - public static boolean deep2915(boolean x) { - return deep2916(x); - } - - public static boolean deep2916(boolean x) { - return deep2917(x); - } - - public static boolean deep2917(boolean x) { - return deep2918(x); - } - - public static boolean deep2918(boolean x) { - return deep2919(x); - } - - public static boolean deep2919(boolean x) { - return deep2920(x); - } - - public static boolean deep2920(boolean x) { - return deep2921(x); - } - - public static boolean deep2921(boolean x) { - return deep2922(x); - } - - public static boolean deep2922(boolean x) { - return deep2923(x); - } - - public static boolean deep2923(boolean x) { - return deep2924(x); - } - - public static boolean deep2924(boolean x) { - return deep2925(x); - } - - public static boolean deep2925(boolean x) { - return deep2926(x); - } - - public static boolean deep2926(boolean x) { - return deep2927(x); - } - - public static boolean deep2927(boolean x) { - return deep2928(x); - } - - public static boolean deep2928(boolean x) { - return deep2929(x); - } - - public static boolean deep2929(boolean x) { - return deep2930(x); - } - - public static boolean deep2930(boolean x) { - return deep2931(x); - } - - public static boolean deep2931(boolean x) { - return deep2932(x); - } - - public static boolean deep2932(boolean x) { - return deep2933(x); - } - - public static boolean deep2933(boolean x) { - return deep2934(x); - } - - public static boolean deep2934(boolean x) { - return deep2935(x); - } - - public static boolean deep2935(boolean x) { - return deep2936(x); - } - - public static boolean deep2936(boolean x) { - return deep2937(x); - } - - public static boolean deep2937(boolean x) { - return deep2938(x); - } - - public static boolean deep2938(boolean x) { - return deep2939(x); - } - - public static boolean deep2939(boolean x) { - return deep2940(x); - } - - public static boolean deep2940(boolean x) { - return deep2941(x); - } - - public static boolean deep2941(boolean x) { - return deep2942(x); - } - - public static boolean deep2942(boolean x) { - return deep2943(x); - } - - public static boolean deep2943(boolean x) { - return deep2944(x); - } - - public static boolean deep2944(boolean x) { - return deep2945(x); - } - - public static boolean deep2945(boolean x) { - return deep2946(x); - } - - public static boolean deep2946(boolean x) { - return deep2947(x); - } - - public static boolean deep2947(boolean x) { - return deep2948(x); - } - - public static boolean deep2948(boolean x) { - return deep2949(x); - } - - public static boolean deep2949(boolean x) { - return deep2950(x); - } - - public static boolean deep2950(boolean x) { - return deep2951(x); - } - - public static boolean deep2951(boolean x) { - return deep2952(x); - } - - public static boolean deep2952(boolean x) { - return deep2953(x); - } - - public static boolean deep2953(boolean x) { - return deep2954(x); - } - - public static boolean deep2954(boolean x) { - return deep2955(x); - } - - public static boolean deep2955(boolean x) { - return deep2956(x); - } - - public static boolean deep2956(boolean x) { - return deep2957(x); - } - - public static boolean deep2957(boolean x) { - return deep2958(x); - } - - public static boolean deep2958(boolean x) { - return deep2959(x); - } - - public static boolean deep2959(boolean x) { - return deep2960(x); - } - - public static boolean deep2960(boolean x) { - return deep2961(x); - } - - public static boolean deep2961(boolean x) { - return deep2962(x); - } - - public static boolean deep2962(boolean x) { - return deep2963(x); - } - - public static boolean deep2963(boolean x) { - return deep2964(x); - } - - public static boolean deep2964(boolean x) { - return deep2965(x); - } - - public static boolean deep2965(boolean x) { - return deep2966(x); - } - - public static boolean deep2966(boolean x) { - return deep2967(x); - } - - public static boolean deep2967(boolean x) { - return deep2968(x); - } - - public static boolean deep2968(boolean x) { - return deep2969(x); - } - - public static boolean deep2969(boolean x) { - return deep2970(x); - } - - public static boolean deep2970(boolean x) { - return deep2971(x); - } - - public static boolean deep2971(boolean x) { - return deep2972(x); - } - - public static boolean deep2972(boolean x) { - return deep2973(x); - } - - public static boolean deep2973(boolean x) { - return deep2974(x); - } - - public static boolean deep2974(boolean x) { - return deep2975(x); - } - - public static boolean deep2975(boolean x) { - return deep2976(x); - } - - public static boolean deep2976(boolean x) { - return deep2977(x); - } - - public static boolean deep2977(boolean x) { - return deep2978(x); - } - - public static boolean deep2978(boolean x) { - return deep2979(x); - } - - public static boolean deep2979(boolean x) { - return deep2980(x); - } - - public static boolean deep2980(boolean x) { - return deep2981(x); - } - - public static boolean deep2981(boolean x) { - return deep2982(x); - } - - public static boolean deep2982(boolean x) { - return deep2983(x); - } - - public static boolean deep2983(boolean x) { - return deep2984(x); - } - - public static boolean deep2984(boolean x) { - return deep2985(x); - } - - public static boolean deep2985(boolean x) { - return deep2986(x); - } - - public static boolean deep2986(boolean x) { - return deep2987(x); - } - - public static boolean deep2987(boolean x) { - return deep2988(x); - } - - public static boolean deep2988(boolean x) { - return deep2989(x); - } - - public static boolean deep2989(boolean x) { - return deep2990(x); - } - - public static boolean deep2990(boolean x) { - return deep2991(x); - } - - public static boolean deep2991(boolean x) { - return deep2992(x); - } - - public static boolean deep2992(boolean x) { - return deep2993(x); - } - - public static boolean deep2993(boolean x) { - return deep2994(x); - } - - public static boolean deep2994(boolean x) { - return deep2995(x); - } - - public static boolean deep2995(boolean x) { - return deep2996(x); - } - - public static boolean deep2996(boolean x) { - return deep2997(x); - } - - public static boolean deep2997(boolean x) { - return deep2998(x); - } - - public static boolean deep2998(boolean x) { - return deep2999(x); - } - - public static boolean deep2999(boolean x) { - return deep3000(x); - } - - public static boolean deep3000(boolean x) { - return deep3001(x); - } - - public static boolean deep3001(boolean x) { - return deep3002(x); - } - - public static boolean deep3002(boolean x) { - return deep3003(x); - } - - public static boolean deep3003(boolean x) { - return deep3004(x); - } - - public static boolean deep3004(boolean x) { - return deep3005(x); - } - - public static boolean deep3005(boolean x) { - return deep3006(x); - } - - public static boolean deep3006(boolean x) { - return deep3007(x); - } - - public static boolean deep3007(boolean x) { - return deep3008(x); - } - - public static boolean deep3008(boolean x) { - return deep3009(x); - } - - public static boolean deep3009(boolean x) { - return deep3010(x); - } - - public static boolean deep3010(boolean x) { - return deep3011(x); - } - - public static boolean deep3011(boolean x) { - return deep3012(x); - } - - public static boolean deep3012(boolean x) { - return deep3013(x); - } - - public static boolean deep3013(boolean x) { - return deep3014(x); - } - - public static boolean deep3014(boolean x) { - return deep3015(x); - } - - public static boolean deep3015(boolean x) { - return deep3016(x); - } - - public static boolean deep3016(boolean x) { - return deep3017(x); - } - - public static boolean deep3017(boolean x) { - return deep3018(x); - } - - public static boolean deep3018(boolean x) { - return deep3019(x); - } - - public static boolean deep3019(boolean x) { - return deep3020(x); - } - - public static boolean deep3020(boolean x) { - return deep3021(x); - } - - public static boolean deep3021(boolean x) { - return deep3022(x); - } - - public static boolean deep3022(boolean x) { - return deep3023(x); - } - - public static boolean deep3023(boolean x) { - return deep3024(x); - } - - public static boolean deep3024(boolean x) { - return deep3025(x); - } - - public static boolean deep3025(boolean x) { - return deep3026(x); - } - - public static boolean deep3026(boolean x) { - return deep3027(x); - } - - public static boolean deep3027(boolean x) { - return deep3028(x); - } - - public static boolean deep3028(boolean x) { - return deep3029(x); - } - - public static boolean deep3029(boolean x) { - return deep3030(x); - } - - public static boolean deep3030(boolean x) { - return deep3031(x); - } - - public static boolean deep3031(boolean x) { - return deep3032(x); - } - - public static boolean deep3032(boolean x) { - return deep3033(x); - } - - public static boolean deep3033(boolean x) { - return deep3034(x); - } - - public static boolean deep3034(boolean x) { - return deep3035(x); - } - - public static boolean deep3035(boolean x) { - return deep3036(x); - } - - public static boolean deep3036(boolean x) { - return deep3037(x); - } - - public static boolean deep3037(boolean x) { - return deep3038(x); - } - - public static boolean deep3038(boolean x) { - return deep3039(x); - } - - public static boolean deep3039(boolean x) { - return deep3040(x); - } - - public static boolean deep3040(boolean x) { - return deep3041(x); - } - - public static boolean deep3041(boolean x) { - return deep3042(x); - } - - public static boolean deep3042(boolean x) { - return deep3043(x); - } - - public static boolean deep3043(boolean x) { - return deep3044(x); - } - - public static boolean deep3044(boolean x) { - return deep3045(x); - } - - public static boolean deep3045(boolean x) { - return deep3046(x); - } - - public static boolean deep3046(boolean x) { - return deep3047(x); - } - - public static boolean deep3047(boolean x) { - return deep3048(x); - } - - public static boolean deep3048(boolean x) { - return deep3049(x); - } - - public static boolean deep3049(boolean x) { - return deep3050(x); - } - - public static boolean deep3050(boolean x) { - return deep3051(x); - } - - public static boolean deep3051(boolean x) { - return deep3052(x); - } - - public static boolean deep3052(boolean x) { - return deep3053(x); - } - - public static boolean deep3053(boolean x) { - return deep3054(x); - } - - public static boolean deep3054(boolean x) { - return deep3055(x); - } - - public static boolean deep3055(boolean x) { - return deep3056(x); - } - - public static boolean deep3056(boolean x) { - return deep3057(x); - } - - public static boolean deep3057(boolean x) { - return deep3058(x); - } - - public static boolean deep3058(boolean x) { - return deep3059(x); - } - - public static boolean deep3059(boolean x) { - return deep3060(x); - } - - public static boolean deep3060(boolean x) { - return deep3061(x); - } - - public static boolean deep3061(boolean x) { - return deep3062(x); - } - - public static boolean deep3062(boolean x) { - return deep3063(x); - } - - public static boolean deep3063(boolean x) { - return deep3064(x); - } - - public static boolean deep3064(boolean x) { - return deep3065(x); - } - - public static boolean deep3065(boolean x) { - return deep3066(x); - } - - public static boolean deep3066(boolean x) { - return deep3067(x); - } - - public static boolean deep3067(boolean x) { - return deep3068(x); - } - - public static boolean deep3068(boolean x) { - return deep3069(x); - } - - public static boolean deep3069(boolean x) { - return deep3070(x); - } - - public static boolean deep3070(boolean x) { - return deep3071(x); - } - - public static boolean deep3071(boolean x) { - return deep3072(x); - } - - public static boolean deep3072(boolean x) { - return deep3073(x); - } - - public static boolean deep3073(boolean x) { - return deep3074(x); - } - - public static boolean deep3074(boolean x) { - return deep3075(x); - } - - public static boolean deep3075(boolean x) { - return deep3076(x); - } - - public static boolean deep3076(boolean x) { - return deep3077(x); - } - - public static boolean deep3077(boolean x) { - return deep3078(x); - } - - public static boolean deep3078(boolean x) { - return deep3079(x); - } - - public static boolean deep3079(boolean x) { - return deep3080(x); - } - - public static boolean deep3080(boolean x) { - return deep3081(x); - } - - public static boolean deep3081(boolean x) { - return deep3082(x); - } - - public static boolean deep3082(boolean x) { - return deep3083(x); - } - - public static boolean deep3083(boolean x) { - return deep3084(x); - } - - public static boolean deep3084(boolean x) { - return deep3085(x); - } - - public static boolean deep3085(boolean x) { - return deep3086(x); - } - - public static boolean deep3086(boolean x) { - return deep3087(x); - } - - public static boolean deep3087(boolean x) { - return deep3088(x); - } - - public static boolean deep3088(boolean x) { - return deep3089(x); - } - - public static boolean deep3089(boolean x) { - return deep3090(x); - } - - public static boolean deep3090(boolean x) { - return deep3091(x); - } - - public static boolean deep3091(boolean x) { - return deep3092(x); - } - - public static boolean deep3092(boolean x) { - return deep3093(x); - } - - public static boolean deep3093(boolean x) { - return deep3094(x); - } - - public static boolean deep3094(boolean x) { - return deep3095(x); - } - - public static boolean deep3095(boolean x) { - return deep3096(x); - } - - public static boolean deep3096(boolean x) { - return deep3097(x); - } - - public static boolean deep3097(boolean x) { - return deep3098(x); - } - - public static boolean deep3098(boolean x) { - return deep3099(x); - } - - public static boolean deep3099(boolean x) { - return deep3100(x); - } - - public static boolean deep3100(boolean x) { - return deep3101(x); - } - - public static boolean deep3101(boolean x) { - return deep3102(x); - } - - public static boolean deep3102(boolean x) { - return deep3103(x); - } - - public static boolean deep3103(boolean x) { - return deep3104(x); - } - - public static boolean deep3104(boolean x) { - return deep3105(x); - } - - public static boolean deep3105(boolean x) { - return deep3106(x); - } - - public static boolean deep3106(boolean x) { - return deep3107(x); - } - - public static boolean deep3107(boolean x) { - return deep3108(x); - } - - public static boolean deep3108(boolean x) { - return deep3109(x); - } - - public static boolean deep3109(boolean x) { - return deep3110(x); - } - - public static boolean deep3110(boolean x) { - return deep3111(x); - } - - public static boolean deep3111(boolean x) { - return deep3112(x); - } - - public static boolean deep3112(boolean x) { - return deep3113(x); - } - - public static boolean deep3113(boolean x) { - return deep3114(x); - } - - public static boolean deep3114(boolean x) { - return deep3115(x); - } - - public static boolean deep3115(boolean x) { - return deep3116(x); - } - - public static boolean deep3116(boolean x) { - return deep3117(x); - } - - public static boolean deep3117(boolean x) { - return deep3118(x); - } - - public static boolean deep3118(boolean x) { - return deep3119(x); - } - - public static boolean deep3119(boolean x) { - return deep3120(x); - } - - public static boolean deep3120(boolean x) { - return deep3121(x); - } - - public static boolean deep3121(boolean x) { - return deep3122(x); - } - - public static boolean deep3122(boolean x) { - return deep3123(x); - } - - public static boolean deep3123(boolean x) { - return deep3124(x); - } - - public static boolean deep3124(boolean x) { - return deep3125(x); - } - - public static boolean deep3125(boolean x) { - return deep3126(x); - } - - public static boolean deep3126(boolean x) { - return deep3127(x); - } - - public static boolean deep3127(boolean x) { - return deep3128(x); - } - - public static boolean deep3128(boolean x) { - return deep3129(x); - } - - public static boolean deep3129(boolean x) { - return deep3130(x); - } - - public static boolean deep3130(boolean x) { - return deep3131(x); - } - - public static boolean deep3131(boolean x) { - return deep3132(x); - } - - public static boolean deep3132(boolean x) { - return deep3133(x); - } - - public static boolean deep3133(boolean x) { - return deep3134(x); - } - - public static boolean deep3134(boolean x) { - return deep3135(x); - } - - public static boolean deep3135(boolean x) { - return deep3136(x); - } - - public static boolean deep3136(boolean x) { - return deep3137(x); - } - - public static boolean deep3137(boolean x) { - return deep3138(x); - } - - public static boolean deep3138(boolean x) { - return deep3139(x); - } - - public static boolean deep3139(boolean x) { - return deep3140(x); - } - - public static boolean deep3140(boolean x) { - return deep3141(x); - } - - public static boolean deep3141(boolean x) { - return deep3142(x); - } - - public static boolean deep3142(boolean x) { - return deep3143(x); - } - - public static boolean deep3143(boolean x) { - return deep3144(x); - } - - public static boolean deep3144(boolean x) { - return deep3145(x); - } - - public static boolean deep3145(boolean x) { - return deep3146(x); - } - - public static boolean deep3146(boolean x) { - return deep3147(x); - } - - public static boolean deep3147(boolean x) { - return deep3148(x); - } - - public static boolean deep3148(boolean x) { - return deep3149(x); - } - - public static boolean deep3149(boolean x) { - return deep3150(x); - } - - public static boolean deep3150(boolean x) { - return deep3151(x); - } - - public static boolean deep3151(boolean x) { - return deep3152(x); - } - - public static boolean deep3152(boolean x) { - return deep3153(x); - } - - public static boolean deep3153(boolean x) { - return deep3154(x); - } - - public static boolean deep3154(boolean x) { - return deep3155(x); - } - - public static boolean deep3155(boolean x) { - return deep3156(x); - } - - public static boolean deep3156(boolean x) { - return deep3157(x); - } - - public static boolean deep3157(boolean x) { - return deep3158(x); - } - - public static boolean deep3158(boolean x) { - return deep3159(x); - } - - public static boolean deep3159(boolean x) { - return deep3160(x); - } - - public static boolean deep3160(boolean x) { - return deep3161(x); - } - - public static boolean deep3161(boolean x) { - return deep3162(x); - } - - public static boolean deep3162(boolean x) { - return deep3163(x); - } - - public static boolean deep3163(boolean x) { - return deep3164(x); - } - - public static boolean deep3164(boolean x) { - return deep3165(x); - } - - public static boolean deep3165(boolean x) { - return deep3166(x); - } - - public static boolean deep3166(boolean x) { - return deep3167(x); - } - - public static boolean deep3167(boolean x) { - return deep3168(x); - } - - public static boolean deep3168(boolean x) { - return deep3169(x); - } - - public static boolean deep3169(boolean x) { - return deep3170(x); - } - - public static boolean deep3170(boolean x) { - return deep3171(x); - } - - public static boolean deep3171(boolean x) { - return deep3172(x); - } - - public static boolean deep3172(boolean x) { - return deep3173(x); - } - - public static boolean deep3173(boolean x) { - return deep3174(x); - } - - public static boolean deep3174(boolean x) { - return deep3175(x); - } - - public static boolean deep3175(boolean x) { - return deep3176(x); - } - - public static boolean deep3176(boolean x) { - return deep3177(x); - } - - public static boolean deep3177(boolean x) { - return deep3178(x); - } - - public static boolean deep3178(boolean x) { - return deep3179(x); - } - - public static boolean deep3179(boolean x) { - return deep3180(x); - } - - public static boolean deep3180(boolean x) { - return deep3181(x); - } - - public static boolean deep3181(boolean x) { - return deep3182(x); - } - - public static boolean deep3182(boolean x) { - return deep3183(x); - } - - public static boolean deep3183(boolean x) { - return deep3184(x); - } - - public static boolean deep3184(boolean x) { - return deep3185(x); - } - - public static boolean deep3185(boolean x) { - return deep3186(x); - } - - public static boolean deep3186(boolean x) { - return deep3187(x); - } - - public static boolean deep3187(boolean x) { - return deep3188(x); - } - - public static boolean deep3188(boolean x) { - return deep3189(x); - } - - public static boolean deep3189(boolean x) { - return deep3190(x); - } - - public static boolean deep3190(boolean x) { - return deep3191(x); - } - - public static boolean deep3191(boolean x) { - return deep3192(x); - } - - public static boolean deep3192(boolean x) { - return deep3193(x); - } - - public static boolean deep3193(boolean x) { - return deep3194(x); - } - - public static boolean deep3194(boolean x) { - return deep3195(x); - } - - public static boolean deep3195(boolean x) { - return deep3196(x); - } - - public static boolean deep3196(boolean x) { - return deep3197(x); - } - - public static boolean deep3197(boolean x) { - return deep3198(x); - } - - public static boolean deep3198(boolean x) { - return deep3199(x); - } - - public static boolean deep3199(boolean x) { - return deep3200(x); - } - - public static boolean deep3200(boolean x) { - return deep3201(x); - } - - public static boolean deep3201(boolean x) { - return deep3202(x); - } - - public static boolean deep3202(boolean x) { - return deep3203(x); - } - - public static boolean deep3203(boolean x) { - return deep3204(x); - } - - public static boolean deep3204(boolean x) { - return deep3205(x); - } - - public static boolean deep3205(boolean x) { - return deep3206(x); - } - - public static boolean deep3206(boolean x) { - return deep3207(x); - } - - public static boolean deep3207(boolean x) { - return deep3208(x); - } - - public static boolean deep3208(boolean x) { - return deep3209(x); - } - - public static boolean deep3209(boolean x) { - return deep3210(x); - } - - public static boolean deep3210(boolean x) { - return deep3211(x); - } - - public static boolean deep3211(boolean x) { - return deep3212(x); - } - - public static boolean deep3212(boolean x) { - return deep3213(x); - } - - public static boolean deep3213(boolean x) { - return deep3214(x); - } - - public static boolean deep3214(boolean x) { - return deep3215(x); - } - - public static boolean deep3215(boolean x) { - return deep3216(x); - } - - public static boolean deep3216(boolean x) { - return deep3217(x); - } - - public static boolean deep3217(boolean x) { - return deep3218(x); - } - - public static boolean deep3218(boolean x) { - return deep3219(x); - } - - public static boolean deep3219(boolean x) { - return deep3220(x); - } - - public static boolean deep3220(boolean x) { - return deep3221(x); - } - - public static boolean deep3221(boolean x) { - return deep3222(x); - } - - public static boolean deep3222(boolean x) { - return deep3223(x); - } - - public static boolean deep3223(boolean x) { - return deep3224(x); - } - - public static boolean deep3224(boolean x) { - return deep3225(x); - } - - public static boolean deep3225(boolean x) { - return deep3226(x); - } - - public static boolean deep3226(boolean x) { - return deep3227(x); - } - - public static boolean deep3227(boolean x) { - return deep3228(x); - } - - public static boolean deep3228(boolean x) { - return deep3229(x); - } - - public static boolean deep3229(boolean x) { - return deep3230(x); - } - - public static boolean deep3230(boolean x) { - return deep3231(x); - } - - public static boolean deep3231(boolean x) { - return deep3232(x); - } - - public static boolean deep3232(boolean x) { - return deep3233(x); - } - - public static boolean deep3233(boolean x) { - return deep3234(x); - } - - public static boolean deep3234(boolean x) { - return deep3235(x); - } - - public static boolean deep3235(boolean x) { - return deep3236(x); - } - - public static boolean deep3236(boolean x) { - return deep3237(x); - } - - public static boolean deep3237(boolean x) { - return deep3238(x); - } - - public static boolean deep3238(boolean x) { - return deep3239(x); - } - - public static boolean deep3239(boolean x) { - return deep3240(x); - } - - public static boolean deep3240(boolean x) { - return deep3241(x); - } - - public static boolean deep3241(boolean x) { - return deep3242(x); - } - - public static boolean deep3242(boolean x) { - return deep3243(x); - } - - public static boolean deep3243(boolean x) { - return deep3244(x); - } - - public static boolean deep3244(boolean x) { - return deep3245(x); - } - - public static boolean deep3245(boolean x) { - return deep3246(x); - } - - public static boolean deep3246(boolean x) { - return deep3247(x); - } - - public static boolean deep3247(boolean x) { - return deep3248(x); - } - - public static boolean deep3248(boolean x) { - return deep3249(x); - } - - public static boolean deep3249(boolean x) { - return deep3250(x); - } - - public static boolean deep3250(boolean x) { - return deep3251(x); - } - - public static boolean deep3251(boolean x) { - return deep3252(x); - } - - public static boolean deep3252(boolean x) { - return deep3253(x); - } - - public static boolean deep3253(boolean x) { - return deep3254(x); - } - - public static boolean deep3254(boolean x) { - return deep3255(x); - } - - public static boolean deep3255(boolean x) { - return deep3256(x); - } - - public static boolean deep3256(boolean x) { - return deep3257(x); - } - - public static boolean deep3257(boolean x) { - return deep3258(x); - } - - public static boolean deep3258(boolean x) { - return deep3259(x); - } - - public static boolean deep3259(boolean x) { - return deep3260(x); - } - - public static boolean deep3260(boolean x) { - return deep3261(x); - } - - public static boolean deep3261(boolean x) { - return deep3262(x); - } - - public static boolean deep3262(boolean x) { - return deep3263(x); - } - - public static boolean deep3263(boolean x) { - return deep3264(x); - } - - public static boolean deep3264(boolean x) { - return deep3265(x); - } - - public static boolean deep3265(boolean x) { - return deep3266(x); - } - - public static boolean deep3266(boolean x) { - return deep3267(x); - } - - public static boolean deep3267(boolean x) { - return deep3268(x); - } - - public static boolean deep3268(boolean x) { - return deep3269(x); - } - - public static boolean deep3269(boolean x) { - return deep3270(x); - } - - public static boolean deep3270(boolean x) { - return deep3271(x); - } - - public static boolean deep3271(boolean x) { - return deep3272(x); - } - - public static boolean deep3272(boolean x) { - return deep3273(x); - } - - public static boolean deep3273(boolean x) { - return deep3274(x); - } - - public static boolean deep3274(boolean x) { - return deep3275(x); - } - - public static boolean deep3275(boolean x) { - return deep3276(x); - } - - public static boolean deep3276(boolean x) { - return deep3277(x); - } - - public static boolean deep3277(boolean x) { - return deep3278(x); - } - - public static boolean deep3278(boolean x) { - return deep3279(x); - } - - public static boolean deep3279(boolean x) { - return deep3280(x); - } - - public static boolean deep3280(boolean x) { - return deep3281(x); - } - - public static boolean deep3281(boolean x) { - return deep3282(x); - } - - public static boolean deep3282(boolean x) { - return deep3283(x); - } - - public static boolean deep3283(boolean x) { - return deep3284(x); - } - - public static boolean deep3284(boolean x) { - return deep3285(x); - } - - public static boolean deep3285(boolean x) { - return deep3286(x); - } - - public static boolean deep3286(boolean x) { - return deep3287(x); - } - - public static boolean deep3287(boolean x) { - return deep3288(x); - } - - public static boolean deep3288(boolean x) { - return deep3289(x); - } - - public static boolean deep3289(boolean x) { - return deep3290(x); - } - - public static boolean deep3290(boolean x) { - return deep3291(x); - } - - public static boolean deep3291(boolean x) { - return deep3292(x); - } - - public static boolean deep3292(boolean x) { - return deep3293(x); - } - - public static boolean deep3293(boolean x) { - return deep3294(x); - } - - public static boolean deep3294(boolean x) { - return deep3295(x); - } - - public static boolean deep3295(boolean x) { - return deep3296(x); - } - - public static boolean deep3296(boolean x) { - return deep3297(x); - } - - public static boolean deep3297(boolean x) { - return deep3298(x); - } - - public static boolean deep3298(boolean x) { - return deep3299(x); - } - - public static boolean deep3299(boolean x) { - return deep3300(x); - } - - public static boolean deep3300(boolean x) { - return deep3301(x); - } - - public static boolean deep3301(boolean x) { - return deep3302(x); - } - - public static boolean deep3302(boolean x) { - return deep3303(x); - } - - public static boolean deep3303(boolean x) { - return deep3304(x); - } - - public static boolean deep3304(boolean x) { - return deep3305(x); - } - - public static boolean deep3305(boolean x) { - return deep3306(x); - } - - public static boolean deep3306(boolean x) { - return deep3307(x); - } - - public static boolean deep3307(boolean x) { - return deep3308(x); - } - - public static boolean deep3308(boolean x) { - return deep3309(x); - } - - public static boolean deep3309(boolean x) { - return deep3310(x); - } - - public static boolean deep3310(boolean x) { - return deep3311(x); - } - - public static boolean deep3311(boolean x) { - return deep3312(x); - } - - public static boolean deep3312(boolean x) { - return deep3313(x); - } - - public static boolean deep3313(boolean x) { - return deep3314(x); - } - - public static boolean deep3314(boolean x) { - return deep3315(x); - } - - public static boolean deep3315(boolean x) { - return deep3316(x); - } - - public static boolean deep3316(boolean x) { - return deep3317(x); - } - - public static boolean deep3317(boolean x) { - return deep3318(x); - } - - public static boolean deep3318(boolean x) { - return deep3319(x); - } - - public static boolean deep3319(boolean x) { - return deep3320(x); - } - - public static boolean deep3320(boolean x) { - return deep3321(x); - } - - public static boolean deep3321(boolean x) { - return deep3322(x); - } - - public static boolean deep3322(boolean x) { - return deep3323(x); - } - - public static boolean deep3323(boolean x) { - return deep3324(x); - } - - public static boolean deep3324(boolean x) { - return deep3325(x); - } - - public static boolean deep3325(boolean x) { - return deep3326(x); - } - - public static boolean deep3326(boolean x) { - return deep3327(x); - } - - public static boolean deep3327(boolean x) { - return deep3328(x); - } - - public static boolean deep3328(boolean x) { - return deep3329(x); - } - - public static boolean deep3329(boolean x) { - return deep3330(x); - } - - public static boolean deep3330(boolean x) { - return deep3331(x); - } - - public static boolean deep3331(boolean x) { - return deep3332(x); - } - - public static boolean deep3332(boolean x) { - return deep3333(x); - } - - public static boolean deep3333(boolean x) { - return deep3334(x); - } - - public static boolean deep3334(boolean x) { - return deep3335(x); - } - - public static boolean deep3335(boolean x) { - return deep3336(x); - } - - public static boolean deep3336(boolean x) { - return deep3337(x); - } - - public static boolean deep3337(boolean x) { - return deep3338(x); - } - - public static boolean deep3338(boolean x) { - return deep3339(x); - } - - public static boolean deep3339(boolean x) { - return deep3340(x); - } - - public static boolean deep3340(boolean x) { - return deep3341(x); - } - - public static boolean deep3341(boolean x) { - return deep3342(x); - } - - public static boolean deep3342(boolean x) { - return deep3343(x); - } - - public static boolean deep3343(boolean x) { - return deep3344(x); - } - - public static boolean deep3344(boolean x) { - return deep3345(x); - } - - public static boolean deep3345(boolean x) { - return deep3346(x); - } - - public static boolean deep3346(boolean x) { - return deep3347(x); - } - - public static boolean deep3347(boolean x) { - return deep3348(x); - } - - public static boolean deep3348(boolean x) { - return deep3349(x); - } - - public static boolean deep3349(boolean x) { - return deep3350(x); - } - - public static boolean deep3350(boolean x) { - return deep3351(x); - } - - public static boolean deep3351(boolean x) { - return deep3352(x); - } - - public static boolean deep3352(boolean x) { - return deep3353(x); - } - - public static boolean deep3353(boolean x) { - return deep3354(x); - } - - public static boolean deep3354(boolean x) { - return deep3355(x); - } - - public static boolean deep3355(boolean x) { - return deep3356(x); - } - - public static boolean deep3356(boolean x) { - return deep3357(x); - } - - public static boolean deep3357(boolean x) { - return deep3358(x); - } - - public static boolean deep3358(boolean x) { - return deep3359(x); - } - - public static boolean deep3359(boolean x) { - return deep3360(x); - } - - public static boolean deep3360(boolean x) { - return deep3361(x); - } - - public static boolean deep3361(boolean x) { - return deep3362(x); - } - - public static boolean deep3362(boolean x) { - return deep3363(x); - } - - public static boolean deep3363(boolean x) { - return deep3364(x); - } - - public static boolean deep3364(boolean x) { - return deep3365(x); - } - - public static boolean deep3365(boolean x) { - return deep3366(x); - } - - public static boolean deep3366(boolean x) { - return deep3367(x); - } - - public static boolean deep3367(boolean x) { - return deep3368(x); - } - - public static boolean deep3368(boolean x) { - return deep3369(x); - } - - public static boolean deep3369(boolean x) { - return deep3370(x); - } - - public static boolean deep3370(boolean x) { - return deep3371(x); - } - - public static boolean deep3371(boolean x) { - return deep3372(x); - } - - public static boolean deep3372(boolean x) { - return deep3373(x); - } - - public static boolean deep3373(boolean x) { - return deep3374(x); - } - - public static boolean deep3374(boolean x) { - return deep3375(x); - } - - public static boolean deep3375(boolean x) { - return deep3376(x); - } - - public static boolean deep3376(boolean x) { - return deep3377(x); - } - - public static boolean deep3377(boolean x) { - return deep3378(x); - } - - public static boolean deep3378(boolean x) { - return deep3379(x); - } - - public static boolean deep3379(boolean x) { - return deep3380(x); - } - - public static boolean deep3380(boolean x) { - return deep3381(x); - } - - public static boolean deep3381(boolean x) { - return deep3382(x); - } - - public static boolean deep3382(boolean x) { - return deep3383(x); - } - - public static boolean deep3383(boolean x) { - return deep3384(x); - } - - public static boolean deep3384(boolean x) { - return deep3385(x); - } - - public static boolean deep3385(boolean x) { - return deep3386(x); - } - - public static boolean deep3386(boolean x) { - return deep3387(x); - } - - public static boolean deep3387(boolean x) { - return deep3388(x); - } - - public static boolean deep3388(boolean x) { - return deep3389(x); - } - - public static boolean deep3389(boolean x) { - return deep3390(x); - } - - public static boolean deep3390(boolean x) { - return deep3391(x); - } - - public static boolean deep3391(boolean x) { - return deep3392(x); - } - - public static boolean deep3392(boolean x) { - return deep3393(x); - } - - public static boolean deep3393(boolean x) { - return deep3394(x); - } - - public static boolean deep3394(boolean x) { - return deep3395(x); - } - - public static boolean deep3395(boolean x) { - return deep3396(x); - } - - public static boolean deep3396(boolean x) { - return deep3397(x); - } - - public static boolean deep3397(boolean x) { - return deep3398(x); - } - - public static boolean deep3398(boolean x) { - return deep3399(x); - } - - public static boolean deep3399(boolean x) { - return deep3400(x); - } - - public static boolean deep3400(boolean x) { - return deep3401(x); - } - - public static boolean deep3401(boolean x) { - return deep3402(x); - } - - public static boolean deep3402(boolean x) { - return deep3403(x); - } - - public static boolean deep3403(boolean x) { - return deep3404(x); - } - - public static boolean deep3404(boolean x) { - return deep3405(x); - } - - public static boolean deep3405(boolean x) { - return deep3406(x); - } - - public static boolean deep3406(boolean x) { - return deep3407(x); - } - - public static boolean deep3407(boolean x) { - return deep3408(x); - } - - public static boolean deep3408(boolean x) { - return deep3409(x); - } - - public static boolean deep3409(boolean x) { - return deep3410(x); - } - - public static boolean deep3410(boolean x) { - return deep3411(x); - } - - public static boolean deep3411(boolean x) { - return deep3412(x); - } - - public static boolean deep3412(boolean x) { - return deep3413(x); - } - - public static boolean deep3413(boolean x) { - return deep3414(x); - } - - public static boolean deep3414(boolean x) { - return deep3415(x); - } - - public static boolean deep3415(boolean x) { - return deep3416(x); - } - - public static boolean deep3416(boolean x) { - return deep3417(x); - } - - public static boolean deep3417(boolean x) { - return deep3418(x); - } - - public static boolean deep3418(boolean x) { - return deep3419(x); - } - - public static boolean deep3419(boolean x) { - return deep3420(x); - } - - public static boolean deep3420(boolean x) { - return deep3421(x); - } - - public static boolean deep3421(boolean x) { - return deep3422(x); - } - - public static boolean deep3422(boolean x) { - return deep3423(x); - } - - public static boolean deep3423(boolean x) { - return deep3424(x); - } - - public static boolean deep3424(boolean x) { - return deep3425(x); - } - - public static boolean deep3425(boolean x) { - return deep3426(x); - } - - public static boolean deep3426(boolean x) { - return deep3427(x); - } - - public static boolean deep3427(boolean x) { - return deep3428(x); - } - - public static boolean deep3428(boolean x) { - return deep3429(x); - } - - public static boolean deep3429(boolean x) { - return deep3430(x); - } - - public static boolean deep3430(boolean x) { - return deep3431(x); - } - - public static boolean deep3431(boolean x) { - return deep3432(x); - } - - public static boolean deep3432(boolean x) { - return deep3433(x); - } - - public static boolean deep3433(boolean x) { - return deep3434(x); - } - - public static boolean deep3434(boolean x) { - return deep3435(x); - } - - public static boolean deep3435(boolean x) { - return deep3436(x); - } - - public static boolean deep3436(boolean x) { - return deep3437(x); - } - - public static boolean deep3437(boolean x) { - return deep3438(x); - } - - public static boolean deep3438(boolean x) { - return deep3439(x); - } - - public static boolean deep3439(boolean x) { - return deep3440(x); - } - - public static boolean deep3440(boolean x) { - return deep3441(x); - } - - public static boolean deep3441(boolean x) { - return deep3442(x); - } - - public static boolean deep3442(boolean x) { - return deep3443(x); - } - - public static boolean deep3443(boolean x) { - return deep3444(x); - } - - public static boolean deep3444(boolean x) { - return deep3445(x); - } - - public static boolean deep3445(boolean x) { - return deep3446(x); - } - - public static boolean deep3446(boolean x) { - return deep3447(x); - } - - public static boolean deep3447(boolean x) { - return deep3448(x); - } - - public static boolean deep3448(boolean x) { - return deep3449(x); - } - - public static boolean deep3449(boolean x) { - return deep3450(x); - } - - public static boolean deep3450(boolean x) { - return deep3451(x); - } - - public static boolean deep3451(boolean x) { - return deep3452(x); - } - - public static boolean deep3452(boolean x) { - return deep3453(x); - } - - public static boolean deep3453(boolean x) { - return deep3454(x); - } - - public static boolean deep3454(boolean x) { - return deep3455(x); - } - - public static boolean deep3455(boolean x) { - return deep3456(x); - } - - public static boolean deep3456(boolean x) { - return deep3457(x); - } - - public static boolean deep3457(boolean x) { - return deep3458(x); - } - - public static boolean deep3458(boolean x) { - return deep3459(x); - } - - public static boolean deep3459(boolean x) { - return deep3460(x); - } - - public static boolean deep3460(boolean x) { - return deep3461(x); - } - - public static boolean deep3461(boolean x) { - return deep3462(x); - } - - public static boolean deep3462(boolean x) { - return deep3463(x); - } - - public static boolean deep3463(boolean x) { - return deep3464(x); - } - - public static boolean deep3464(boolean x) { - return deep3465(x); - } - - public static boolean deep3465(boolean x) { - return deep3466(x); - } - - public static boolean deep3466(boolean x) { - return deep3467(x); - } - - public static boolean deep3467(boolean x) { - return deep3468(x); - } - - public static boolean deep3468(boolean x) { - return deep3469(x); - } - - public static boolean deep3469(boolean x) { - return deep3470(x); - } - - public static boolean deep3470(boolean x) { - return deep3471(x); - } - - public static boolean deep3471(boolean x) { - return deep3472(x); - } - - public static boolean deep3472(boolean x) { - return deep3473(x); - } - - public static boolean deep3473(boolean x) { - return deep3474(x); - } - - public static boolean deep3474(boolean x) { - return deep3475(x); - } - - public static boolean deep3475(boolean x) { - return deep3476(x); - } - - public static boolean deep3476(boolean x) { - return deep3477(x); - } - - public static boolean deep3477(boolean x) { - return deep3478(x); - } - - public static boolean deep3478(boolean x) { - return deep3479(x); - } - - public static boolean deep3479(boolean x) { - return deep3480(x); - } - - public static boolean deep3480(boolean x) { - return deep3481(x); - } - - public static boolean deep3481(boolean x) { - return deep3482(x); - } - - public static boolean deep3482(boolean x) { - return deep3483(x); - } - - public static boolean deep3483(boolean x) { - return deep3484(x); - } - - public static boolean deep3484(boolean x) { - return deep3485(x); - } - - public static boolean deep3485(boolean x) { - return deep3486(x); - } - - public static boolean deep3486(boolean x) { - return deep3487(x); - } - - public static boolean deep3487(boolean x) { - return deep3488(x); - } - - public static boolean deep3488(boolean x) { - return deep3489(x); - } - - public static boolean deep3489(boolean x) { - return deep3490(x); - } - - public static boolean deep3490(boolean x) { - return deep3491(x); - } - - public static boolean deep3491(boolean x) { - return deep3492(x); - } - - public static boolean deep3492(boolean x) { - return deep3493(x); - } - - public static boolean deep3493(boolean x) { - return deep3494(x); - } - - public static boolean deep3494(boolean x) { - return deep3495(x); - } - - public static boolean deep3495(boolean x) { - return deep3496(x); - } - - public static boolean deep3496(boolean x) { - return deep3497(x); - } - - public static boolean deep3497(boolean x) { - return deep3498(x); - } - - public static boolean deep3498(boolean x) { - return deep3499(x); - } - - public static boolean deep3499(boolean x) { - return deep3500(x); - } - - public static boolean deep3500(boolean x) { - return deep3501(x); - } - - public static boolean deep3501(boolean x) { - return deep3502(x); - } - - public static boolean deep3502(boolean x) { - return deep3503(x); - } - - public static boolean deep3503(boolean x) { - return deep3504(x); - } - - public static boolean deep3504(boolean x) { - return deep3505(x); - } - - public static boolean deep3505(boolean x) { - return deep3506(x); - } - - public static boolean deep3506(boolean x) { - return deep3507(x); - } - - public static boolean deep3507(boolean x) { - return deep3508(x); - } - - public static boolean deep3508(boolean x) { - return deep3509(x); - } - - public static boolean deep3509(boolean x) { - return deep3510(x); - } - - public static boolean deep3510(boolean x) { - return deep3511(x); - } - - public static boolean deep3511(boolean x) { - return deep3512(x); - } - - public static boolean deep3512(boolean x) { - return deep3513(x); - } - - public static boolean deep3513(boolean x) { - return deep3514(x); - } - - public static boolean deep3514(boolean x) { - return deep3515(x); - } - - public static boolean deep3515(boolean x) { - return deep3516(x); - } - - public static boolean deep3516(boolean x) { - return deep3517(x); - } - - public static boolean deep3517(boolean x) { - return deep3518(x); - } - - public static boolean deep3518(boolean x) { - return deep3519(x); - } - - public static boolean deep3519(boolean x) { - return deep3520(x); - } - - public static boolean deep3520(boolean x) { - return deep3521(x); - } - - public static boolean deep3521(boolean x) { - return deep3522(x); - } - - public static boolean deep3522(boolean x) { - return deep3523(x); - } - - public static boolean deep3523(boolean x) { - return deep3524(x); - } - - public static boolean deep3524(boolean x) { - return deep3525(x); - } - - public static boolean deep3525(boolean x) { - return deep3526(x); - } - - public static boolean deep3526(boolean x) { - return deep3527(x); - } - - public static boolean deep3527(boolean x) { - return deep3528(x); - } - - public static boolean deep3528(boolean x) { - return deep3529(x); - } - - public static boolean deep3529(boolean x) { - return deep3530(x); - } - - public static boolean deep3530(boolean x) { - return deep3531(x); - } - - public static boolean deep3531(boolean x) { - return deep3532(x); - } - - public static boolean deep3532(boolean x) { - return deep3533(x); - } - - public static boolean deep3533(boolean x) { - return deep3534(x); - } - - public static boolean deep3534(boolean x) { - return deep3535(x); - } - - public static boolean deep3535(boolean x) { - return deep3536(x); - } - - public static boolean deep3536(boolean x) { - return deep3537(x); - } - - public static boolean deep3537(boolean x) { - return deep3538(x); - } - - public static boolean deep3538(boolean x) { - return deep3539(x); - } - - public static boolean deep3539(boolean x) { - return deep3540(x); - } - - public static boolean deep3540(boolean x) { - return deep3541(x); - } - - public static boolean deep3541(boolean x) { - return deep3542(x); - } - - public static boolean deep3542(boolean x) { - return deep3543(x); - } - - public static boolean deep3543(boolean x) { - return deep3544(x); - } - - public static boolean deep3544(boolean x) { - return deep3545(x); - } - - public static boolean deep3545(boolean x) { - return deep3546(x); - } - - public static boolean deep3546(boolean x) { - return deep3547(x); - } - - public static boolean deep3547(boolean x) { - return deep3548(x); - } - - public static boolean deep3548(boolean x) { - return deep3549(x); - } - - public static boolean deep3549(boolean x) { - return deep3550(x); - } - - public static boolean deep3550(boolean x) { - return deep3551(x); - } - - public static boolean deep3551(boolean x) { - return deep3552(x); - } - - public static boolean deep3552(boolean x) { - return deep3553(x); - } - - public static boolean deep3553(boolean x) { - return deep3554(x); - } - - public static boolean deep3554(boolean x) { - return deep3555(x); - } - - public static boolean deep3555(boolean x) { - return deep3556(x); - } - - public static boolean deep3556(boolean x) { - return deep3557(x); - } - - public static boolean deep3557(boolean x) { - return deep3558(x); - } - - public static boolean deep3558(boolean x) { - return deep3559(x); - } - - public static boolean deep3559(boolean x) { - return deep3560(x); - } - - public static boolean deep3560(boolean x) { - return deep3561(x); - } - - public static boolean deep3561(boolean x) { - return deep3562(x); - } - - public static boolean deep3562(boolean x) { - return deep3563(x); - } - - public static boolean deep3563(boolean x) { - return deep3564(x); - } - - public static boolean deep3564(boolean x) { - return deep3565(x); - } - - public static boolean deep3565(boolean x) { - return deep3566(x); - } - - public static boolean deep3566(boolean x) { - return deep3567(x); - } - - public static boolean deep3567(boolean x) { - return deep3568(x); - } - - public static boolean deep3568(boolean x) { - return deep3569(x); - } - - public static boolean deep3569(boolean x) { - return deep3570(x); - } - - public static boolean deep3570(boolean x) { - return deep3571(x); - } - - public static boolean deep3571(boolean x) { - return deep3572(x); - } - - public static boolean deep3572(boolean x) { - return deep3573(x); - } - - public static boolean deep3573(boolean x) { - return deep3574(x); - } - - public static boolean deep3574(boolean x) { - return deep3575(x); - } - - public static boolean deep3575(boolean x) { - return deep3576(x); - } - - public static boolean deep3576(boolean x) { - return deep3577(x); - } - - public static boolean deep3577(boolean x) { - return deep3578(x); - } - - public static boolean deep3578(boolean x) { - return deep3579(x); - } - - public static boolean deep3579(boolean x) { - return deep3580(x); - } - - public static boolean deep3580(boolean x) { - return deep3581(x); - } - - public static boolean deep3581(boolean x) { - return deep3582(x); - } - - public static boolean deep3582(boolean x) { - return deep3583(x); - } - - public static boolean deep3583(boolean x) { - return deep3584(x); - } - - public static boolean deep3584(boolean x) { - return deep3585(x); - } - - public static boolean deep3585(boolean x) { - return deep3586(x); - } - - public static boolean deep3586(boolean x) { - return deep3587(x); - } - - public static boolean deep3587(boolean x) { - return deep3588(x); - } - - public static boolean deep3588(boolean x) { - return deep3589(x); - } - - public static boolean deep3589(boolean x) { - return deep3590(x); - } - - public static boolean deep3590(boolean x) { - return deep3591(x); - } - - public static boolean deep3591(boolean x) { - return deep3592(x); - } - - public static boolean deep3592(boolean x) { - return deep3593(x); - } - - public static boolean deep3593(boolean x) { - return deep3594(x); - } - - public static boolean deep3594(boolean x) { - return deep3595(x); - } - - public static boolean deep3595(boolean x) { - return deep3596(x); - } - - public static boolean deep3596(boolean x) { - return deep3597(x); - } - - public static boolean deep3597(boolean x) { - return deep3598(x); - } - - public static boolean deep3598(boolean x) { - return deep3599(x); - } - - public static boolean deep3599(boolean x) { - return deep3600(x); - } - - public static boolean deep3600(boolean x) { - return deep3601(x); - } - - public static boolean deep3601(boolean x) { - return deep3602(x); - } - - public static boolean deep3602(boolean x) { - return deep3603(x); - } - - public static boolean deep3603(boolean x) { - return deep3604(x); - } - - public static boolean deep3604(boolean x) { - return deep3605(x); - } - - public static boolean deep3605(boolean x) { - return deep3606(x); - } - - public static boolean deep3606(boolean x) { - return deep3607(x); - } - - public static boolean deep3607(boolean x) { - return deep3608(x); - } - - public static boolean deep3608(boolean x) { - return deep3609(x); - } - - public static boolean deep3609(boolean x) { - return deep3610(x); - } - - public static boolean deep3610(boolean x) { - return deep3611(x); - } - - public static boolean deep3611(boolean x) { - return deep3612(x); - } - - public static boolean deep3612(boolean x) { - return deep3613(x); - } - - public static boolean deep3613(boolean x) { - return deep3614(x); - } - - public static boolean deep3614(boolean x) { - return deep3615(x); - } - - public static boolean deep3615(boolean x) { - return deep3616(x); - } - - public static boolean deep3616(boolean x) { - return deep3617(x); - } - - public static boolean deep3617(boolean x) { - return deep3618(x); - } - - public static boolean deep3618(boolean x) { - return deep3619(x); - } - - public static boolean deep3619(boolean x) { - return deep3620(x); - } - - public static boolean deep3620(boolean x) { - return deep3621(x); - } - - public static boolean deep3621(boolean x) { - return deep3622(x); - } - - public static boolean deep3622(boolean x) { - return deep3623(x); - } - - public static boolean deep3623(boolean x) { - return deep3624(x); - } - - public static boolean deep3624(boolean x) { - return deep3625(x); - } - - public static boolean deep3625(boolean x) { - return deep3626(x); - } - - public static boolean deep3626(boolean x) { - return deep3627(x); - } - - public static boolean deep3627(boolean x) { - return deep3628(x); - } - - public static boolean deep3628(boolean x) { - return deep3629(x); - } - - public static boolean deep3629(boolean x) { - return deep3630(x); - } - - public static boolean deep3630(boolean x) { - return deep3631(x); - } - - public static boolean deep3631(boolean x) { - return deep3632(x); - } - - public static boolean deep3632(boolean x) { - return deep3633(x); - } - - public static boolean deep3633(boolean x) { - return deep3634(x); - } - - public static boolean deep3634(boolean x) { - return deep3635(x); - } - - public static boolean deep3635(boolean x) { - return deep3636(x); - } - - public static boolean deep3636(boolean x) { - return deep3637(x); - } - - public static boolean deep3637(boolean x) { - return deep3638(x); - } - - public static boolean deep3638(boolean x) { - return deep3639(x); - } - - public static boolean deep3639(boolean x) { - return deep3640(x); - } - - public static boolean deep3640(boolean x) { - return deep3641(x); - } - - public static boolean deep3641(boolean x) { - return deep3642(x); - } - - public static boolean deep3642(boolean x) { - return deep3643(x); - } - - public static boolean deep3643(boolean x) { - return deep3644(x); - } - - public static boolean deep3644(boolean x) { - return deep3645(x); - } - - public static boolean deep3645(boolean x) { - return deep3646(x); - } - - public static boolean deep3646(boolean x) { - return deep3647(x); - } - - public static boolean deep3647(boolean x) { - return deep3648(x); - } - - public static boolean deep3648(boolean x) { - return deep3649(x); - } - - public static boolean deep3649(boolean x) { - return deep3650(x); - } - - public static boolean deep3650(boolean x) { - return deep3651(x); - } - - public static boolean deep3651(boolean x) { - return deep3652(x); - } - - public static boolean deep3652(boolean x) { - return deep3653(x); - } - - public static boolean deep3653(boolean x) { - return deep3654(x); - } - - public static boolean deep3654(boolean x) { - return deep3655(x); - } - - public static boolean deep3655(boolean x) { - return deep3656(x); - } - - public static boolean deep3656(boolean x) { - return deep3657(x); - } - - public static boolean deep3657(boolean x) { - return deep3658(x); - } - - public static boolean deep3658(boolean x) { - return deep3659(x); - } - - public static boolean deep3659(boolean x) { - return deep3660(x); - } - - public static boolean deep3660(boolean x) { - return deep3661(x); - } - - public static boolean deep3661(boolean x) { - return deep3662(x); - } - - public static boolean deep3662(boolean x) { - return deep3663(x); - } - - public static boolean deep3663(boolean x) { - return deep3664(x); - } - - public static boolean deep3664(boolean x) { - return deep3665(x); - } - - public static boolean deep3665(boolean x) { - return deep3666(x); - } - - public static boolean deep3666(boolean x) { - return deep3667(x); - } - - public static boolean deep3667(boolean x) { - return deep3668(x); - } - - public static boolean deep3668(boolean x) { - return deep3669(x); - } - - public static boolean deep3669(boolean x) { - return deep3670(x); - } - - public static boolean deep3670(boolean x) { - return deep3671(x); - } - - public static boolean deep3671(boolean x) { - return deep3672(x); - } - - public static boolean deep3672(boolean x) { - return deep3673(x); - } - - public static boolean deep3673(boolean x) { - return deep3674(x); - } - - public static boolean deep3674(boolean x) { - return deep3675(x); - } - - public static boolean deep3675(boolean x) { - return deep3676(x); - } - - public static boolean deep3676(boolean x) { - return deep3677(x); - } - - public static boolean deep3677(boolean x) { - return deep3678(x); - } - - public static boolean deep3678(boolean x) { - return deep3679(x); - } - - public static boolean deep3679(boolean x) { - return deep3680(x); - } - - public static boolean deep3680(boolean x) { - return deep3681(x); - } - - public static boolean deep3681(boolean x) { - return deep3682(x); - } - - public static boolean deep3682(boolean x) { - return deep3683(x); - } - - public static boolean deep3683(boolean x) { - return deep3684(x); - } - - public static boolean deep3684(boolean x) { - return deep3685(x); - } - - public static boolean deep3685(boolean x) { - return deep3686(x); - } - - public static boolean deep3686(boolean x) { - return deep3687(x); - } - - public static boolean deep3687(boolean x) { - return deep3688(x); - } - - public static boolean deep3688(boolean x) { - return deep3689(x); - } - - public static boolean deep3689(boolean x) { - return deep3690(x); - } - - public static boolean deep3690(boolean x) { - return deep3691(x); - } - - public static boolean deep3691(boolean x) { - return deep3692(x); - } - - public static boolean deep3692(boolean x) { - return deep3693(x); - } - - public static boolean deep3693(boolean x) { - return deep3694(x); - } - - public static boolean deep3694(boolean x) { - return deep3695(x); - } - - public static boolean deep3695(boolean x) { - return deep3696(x); - } - - public static boolean deep3696(boolean x) { - return deep3697(x); - } - - public static boolean deep3697(boolean x) { - return deep3698(x); - } - - public static boolean deep3698(boolean x) { - return deep3699(x); - } - - public static boolean deep3699(boolean x) { - return deep3700(x); - } - - public static boolean deep3700(boolean x) { - return deep3701(x); - } - - public static boolean deep3701(boolean x) { - return deep3702(x); - } - - public static boolean deep3702(boolean x) { - return deep3703(x); - } - - public static boolean deep3703(boolean x) { - return deep3704(x); - } - - public static boolean deep3704(boolean x) { - return deep3705(x); - } - - public static boolean deep3705(boolean x) { - return deep3706(x); - } - - public static boolean deep3706(boolean x) { - return deep3707(x); - } - - public static boolean deep3707(boolean x) { - return deep3708(x); - } - - public static boolean deep3708(boolean x) { - return deep3709(x); - } - - public static boolean deep3709(boolean x) { - return deep3710(x); - } - - public static boolean deep3710(boolean x) { - return deep3711(x); - } - - public static boolean deep3711(boolean x) { - return deep3712(x); - } - - public static boolean deep3712(boolean x) { - return deep3713(x); - } - - public static boolean deep3713(boolean x) { - return deep3714(x); - } - - public static boolean deep3714(boolean x) { - return deep3715(x); - } - - public static boolean deep3715(boolean x) { - return deep3716(x); - } - - public static boolean deep3716(boolean x) { - return deep3717(x); - } - - public static boolean deep3717(boolean x) { - return deep3718(x); - } - - public static boolean deep3718(boolean x) { - return deep3719(x); - } - - public static boolean deep3719(boolean x) { - return deep3720(x); - } - - public static boolean deep3720(boolean x) { - return deep3721(x); - } - - public static boolean deep3721(boolean x) { - return deep3722(x); - } - - public static boolean deep3722(boolean x) { - return deep3723(x); - } - - public static boolean deep3723(boolean x) { - return deep3724(x); - } - - public static boolean deep3724(boolean x) { - return deep3725(x); - } - - public static boolean deep3725(boolean x) { - return deep3726(x); - } - - public static boolean deep3726(boolean x) { - return deep3727(x); - } - - public static boolean deep3727(boolean x) { - return deep3728(x); - } - - public static boolean deep3728(boolean x) { - return deep3729(x); - } - - public static boolean deep3729(boolean x) { - return deep3730(x); - } - - public static boolean deep3730(boolean x) { - return deep3731(x); - } - - public static boolean deep3731(boolean x) { - return deep3732(x); - } - - public static boolean deep3732(boolean x) { - return deep3733(x); - } - - public static boolean deep3733(boolean x) { - return deep3734(x); - } - - public static boolean deep3734(boolean x) { - return deep3735(x); - } - - public static boolean deep3735(boolean x) { - return deep3736(x); - } - - public static boolean deep3736(boolean x) { - return deep3737(x); - } - - public static boolean deep3737(boolean x) { - return deep3738(x); - } - - public static boolean deep3738(boolean x) { - return deep3739(x); - } - - public static boolean deep3739(boolean x) { - return deep3740(x); - } - - public static boolean deep3740(boolean x) { - return deep3741(x); - } - - public static boolean deep3741(boolean x) { - return deep3742(x); - } - - public static boolean deep3742(boolean x) { - return deep3743(x); - } - - public static boolean deep3743(boolean x) { - return deep3744(x); - } - - public static boolean deep3744(boolean x) { - return deep3745(x); - } - - public static boolean deep3745(boolean x) { - return deep3746(x); - } - - public static boolean deep3746(boolean x) { - return deep3747(x); - } - - public static boolean deep3747(boolean x) { - return deep3748(x); - } - - public static boolean deep3748(boolean x) { - return deep3749(x); - } - - public static boolean deep3749(boolean x) { - return deep3750(x); - } - - public static boolean deep3750(boolean x) { - return deep3751(x); - } - - public static boolean deep3751(boolean x) { - return deep3752(x); - } - - public static boolean deep3752(boolean x) { - return deep3753(x); - } - - public static boolean deep3753(boolean x) { - return deep3754(x); - } - - public static boolean deep3754(boolean x) { - return deep3755(x); - } - - public static boolean deep3755(boolean x) { - return deep3756(x); - } - - public static boolean deep3756(boolean x) { - return deep3757(x); - } - - public static boolean deep3757(boolean x) { - return deep3758(x); - } - - public static boolean deep3758(boolean x) { - return deep3759(x); - } - - public static boolean deep3759(boolean x) { - return deep3760(x); - } - - public static boolean deep3760(boolean x) { - return deep3761(x); - } - - public static boolean deep3761(boolean x) { - return deep3762(x); - } - - public static boolean deep3762(boolean x) { - return deep3763(x); - } - - public static boolean deep3763(boolean x) { - return deep3764(x); - } - - public static boolean deep3764(boolean x) { - return deep3765(x); - } - - public static boolean deep3765(boolean x) { - return deep3766(x); - } - - public static boolean deep3766(boolean x) { - return deep3767(x); - } - - public static boolean deep3767(boolean x) { - return deep3768(x); - } - - public static boolean deep3768(boolean x) { - return deep3769(x); - } - - public static boolean deep3769(boolean x) { - return deep3770(x); - } - - public static boolean deep3770(boolean x) { - return deep3771(x); - } - - public static boolean deep3771(boolean x) { - return deep3772(x); - } - - public static boolean deep3772(boolean x) { - return deep3773(x); - } - - public static boolean deep3773(boolean x) { - return deep3774(x); - } - - public static boolean deep3774(boolean x) { - return deep3775(x); - } - - public static boolean deep3775(boolean x) { - return deep3776(x); - } - - public static boolean deep3776(boolean x) { - return deep3777(x); - } - - public static boolean deep3777(boolean x) { - return deep3778(x); - } - - public static boolean deep3778(boolean x) { - return deep3779(x); - } - - public static boolean deep3779(boolean x) { - return deep3780(x); - } - - public static boolean deep3780(boolean x) { - return deep3781(x); - } - - public static boolean deep3781(boolean x) { - return deep3782(x); - } - - public static boolean deep3782(boolean x) { - return deep3783(x); - } - - public static boolean deep3783(boolean x) { - return deep3784(x); - } - - public static boolean deep3784(boolean x) { - return deep3785(x); - } - - public static boolean deep3785(boolean x) { - return deep3786(x); - } - - public static boolean deep3786(boolean x) { - return deep3787(x); - } - - public static boolean deep3787(boolean x) { - return deep3788(x); - } - - public static boolean deep3788(boolean x) { - return deep3789(x); - } - - public static boolean deep3789(boolean x) { - return deep3790(x); - } - - public static boolean deep3790(boolean x) { - return deep3791(x); - } - - public static boolean deep3791(boolean x) { - return deep3792(x); - } - - public static boolean deep3792(boolean x) { - return deep3793(x); - } - - public static boolean deep3793(boolean x) { - return deep3794(x); - } - - public static boolean deep3794(boolean x) { - return deep3795(x); - } - - public static boolean deep3795(boolean x) { - return deep3796(x); - } - - public static boolean deep3796(boolean x) { - return deep3797(x); - } - - public static boolean deep3797(boolean x) { - return deep3798(x); - } - - public static boolean deep3798(boolean x) { - return deep3799(x); - } - - public static boolean deep3799(boolean x) { - return deep3800(x); - } - - public static boolean deep3800(boolean x) { - return deep3801(x); - } - - public static boolean deep3801(boolean x) { - return deep3802(x); - } - - public static boolean deep3802(boolean x) { - return deep3803(x); - } - - public static boolean deep3803(boolean x) { - return deep3804(x); - } - - public static boolean deep3804(boolean x) { - return deep3805(x); - } - - public static boolean deep3805(boolean x) { - return deep3806(x); - } - - public static boolean deep3806(boolean x) { - return deep3807(x); - } - - public static boolean deep3807(boolean x) { - return deep3808(x); - } - - public static boolean deep3808(boolean x) { - return deep3809(x); - } - - public static boolean deep3809(boolean x) { - return deep3810(x); - } - - public static boolean deep3810(boolean x) { - return deep3811(x); - } - - public static boolean deep3811(boolean x) { - return deep3812(x); - } - - public static boolean deep3812(boolean x) { - return deep3813(x); - } - - public static boolean deep3813(boolean x) { - return deep3814(x); - } - - public static boolean deep3814(boolean x) { - return deep3815(x); - } - - public static boolean deep3815(boolean x) { - return deep3816(x); - } - - public static boolean deep3816(boolean x) { - return deep3817(x); - } - - public static boolean deep3817(boolean x) { - return deep3818(x); - } - - public static boolean deep3818(boolean x) { - return deep3819(x); - } - - public static boolean deep3819(boolean x) { - return deep3820(x); - } - - public static boolean deep3820(boolean x) { - return deep3821(x); - } - - public static boolean deep3821(boolean x) { - return deep3822(x); - } - - public static boolean deep3822(boolean x) { - return deep3823(x); - } - - public static boolean deep3823(boolean x) { - return deep3824(x); - } - - public static boolean deep3824(boolean x) { - return deep3825(x); - } - - public static boolean deep3825(boolean x) { - return deep3826(x); - } - - public static boolean deep3826(boolean x) { - return deep3827(x); - } - - public static boolean deep3827(boolean x) { - return deep3828(x); - } - - public static boolean deep3828(boolean x) { - return deep3829(x); - } - - public static boolean deep3829(boolean x) { - return deep3830(x); - } - - public static boolean deep3830(boolean x) { - return deep3831(x); - } - - public static boolean deep3831(boolean x) { - return deep3832(x); - } - - public static boolean deep3832(boolean x) { - return deep3833(x); - } - - public static boolean deep3833(boolean x) { - return deep3834(x); - } - - public static boolean deep3834(boolean x) { - return deep3835(x); - } - - public static boolean deep3835(boolean x) { - return deep3836(x); - } - - public static boolean deep3836(boolean x) { - return deep3837(x); - } - - public static boolean deep3837(boolean x) { - return deep3838(x); - } - - public static boolean deep3838(boolean x) { - return deep3839(x); - } - - public static boolean deep3839(boolean x) { - return deep3840(x); - } - - public static boolean deep3840(boolean x) { - return deep3841(x); - } - - public static boolean deep3841(boolean x) { - return deep3842(x); - } - - public static boolean deep3842(boolean x) { - return deep3843(x); - } - - public static boolean deep3843(boolean x) { - return deep3844(x); - } - - public static boolean deep3844(boolean x) { - return deep3845(x); - } - - public static boolean deep3845(boolean x) { - return deep3846(x); - } - - public static boolean deep3846(boolean x) { - return deep3847(x); - } - - public static boolean deep3847(boolean x) { - return deep3848(x); - } - - public static boolean deep3848(boolean x) { - return deep3849(x); - } - - public static boolean deep3849(boolean x) { - return deep3850(x); - } - - public static boolean deep3850(boolean x) { - return deep3851(x); - } - - public static boolean deep3851(boolean x) { - return deep3852(x); - } - - public static boolean deep3852(boolean x) { - return deep3853(x); - } - - public static boolean deep3853(boolean x) { - return deep3854(x); - } - - public static boolean deep3854(boolean x) { - return deep3855(x); - } - - public static boolean deep3855(boolean x) { - return deep3856(x); - } - - public static boolean deep3856(boolean x) { - return deep3857(x); - } - - public static boolean deep3857(boolean x) { - return deep3858(x); - } - - public static boolean deep3858(boolean x) { - return deep3859(x); - } - - public static boolean deep3859(boolean x) { - return deep3860(x); - } - - public static boolean deep3860(boolean x) { - return deep3861(x); - } - - public static boolean deep3861(boolean x) { - return deep3862(x); - } - - public static boolean deep3862(boolean x) { - return deep3863(x); - } - - public static boolean deep3863(boolean x) { - return deep3864(x); - } - - public static boolean deep3864(boolean x) { - return deep3865(x); - } - - public static boolean deep3865(boolean x) { - return deep3866(x); - } - - public static boolean deep3866(boolean x) { - return deep3867(x); - } - - public static boolean deep3867(boolean x) { - return deep3868(x); - } - - public static boolean deep3868(boolean x) { - return deep3869(x); - } - - public static boolean deep3869(boolean x) { - return deep3870(x); - } - - public static boolean deep3870(boolean x) { - return deep3871(x); - } - - public static boolean deep3871(boolean x) { - return deep3872(x); - } - - public static boolean deep3872(boolean x) { - return deep3873(x); - } - - public static boolean deep3873(boolean x) { - return deep3874(x); - } - - public static boolean deep3874(boolean x) { - return deep3875(x); - } - - public static boolean deep3875(boolean x) { - return deep3876(x); - } - - public static boolean deep3876(boolean x) { - return deep3877(x); - } - - public static boolean deep3877(boolean x) { - return deep3878(x); - } - - public static boolean deep3878(boolean x) { - return deep3879(x); - } - - public static boolean deep3879(boolean x) { - return deep3880(x); - } - - public static boolean deep3880(boolean x) { - return deep3881(x); - } - - public static boolean deep3881(boolean x) { - return deep3882(x); - } - - public static boolean deep3882(boolean x) { - return deep3883(x); - } - - public static boolean deep3883(boolean x) { - return deep3884(x); - } - - public static boolean deep3884(boolean x) { - return deep3885(x); - } - - public static boolean deep3885(boolean x) { - return deep3886(x); - } - - public static boolean deep3886(boolean x) { - return deep3887(x); - } - - public static boolean deep3887(boolean x) { - return deep3888(x); - } - - public static boolean deep3888(boolean x) { - return deep3889(x); - } - - public static boolean deep3889(boolean x) { - return deep3890(x); - } - - public static boolean deep3890(boolean x) { - return deep3891(x); - } - - public static boolean deep3891(boolean x) { - return deep3892(x); - } - - public static boolean deep3892(boolean x) { - return deep3893(x); - } - - public static boolean deep3893(boolean x) { - return deep3894(x); - } - - public static boolean deep3894(boolean x) { - return deep3895(x); - } - - public static boolean deep3895(boolean x) { - return deep3896(x); - } - - public static boolean deep3896(boolean x) { - return deep3897(x); - } - - public static boolean deep3897(boolean x) { - return deep3898(x); - } - - public static boolean deep3898(boolean x) { - return deep3899(x); - } - - public static boolean deep3899(boolean x) { - return deep3900(x); - } - - public static boolean deep3900(boolean x) { - return deep3901(x); - } - - public static boolean deep3901(boolean x) { - return deep3902(x); - } - - public static boolean deep3902(boolean x) { - return deep3903(x); - } - - public static boolean deep3903(boolean x) { - return deep3904(x); - } - - public static boolean deep3904(boolean x) { - return deep3905(x); - } - - public static boolean deep3905(boolean x) { - return deep3906(x); - } - - public static boolean deep3906(boolean x) { - return deep3907(x); - } - - public static boolean deep3907(boolean x) { - return deep3908(x); - } - - public static boolean deep3908(boolean x) { - return deep3909(x); - } - - public static boolean deep3909(boolean x) { - return deep3910(x); - } - - public static boolean deep3910(boolean x) { - return deep3911(x); - } - - public static boolean deep3911(boolean x) { - return deep3912(x); - } - - public static boolean deep3912(boolean x) { - return deep3913(x); - } - - public static boolean deep3913(boolean x) { - return deep3914(x); - } - - public static boolean deep3914(boolean x) { - return deep3915(x); - } - - public static boolean deep3915(boolean x) { - return deep3916(x); - } - - public static boolean deep3916(boolean x) { - return deep3917(x); - } - - public static boolean deep3917(boolean x) { - return deep3918(x); - } - - public static boolean deep3918(boolean x) { - return deep3919(x); - } - - public static boolean deep3919(boolean x) { - return deep3920(x); - } - - public static boolean deep3920(boolean x) { - return deep3921(x); - } - - public static boolean deep3921(boolean x) { - return deep3922(x); - } - - public static boolean deep3922(boolean x) { - return deep3923(x); - } - - public static boolean deep3923(boolean x) { - return deep3924(x); - } - - public static boolean deep3924(boolean x) { - return deep3925(x); - } - - public static boolean deep3925(boolean x) { - return deep3926(x); - } - - public static boolean deep3926(boolean x) { - return deep3927(x); - } - - public static boolean deep3927(boolean x) { - return deep3928(x); - } - - public static boolean deep3928(boolean x) { - return deep3929(x); - } - - public static boolean deep3929(boolean x) { - return deep3930(x); - } - - public static boolean deep3930(boolean x) { - return deep3931(x); - } - - public static boolean deep3931(boolean x) { - return deep3932(x); - } - - public static boolean deep3932(boolean x) { - return deep3933(x); - } - - public static boolean deep3933(boolean x) { - return deep3934(x); - } - - public static boolean deep3934(boolean x) { - return deep3935(x); - } - - public static boolean deep3935(boolean x) { - return deep3936(x); - } - - public static boolean deep3936(boolean x) { - return deep3937(x); - } - - public static boolean deep3937(boolean x) { - return deep3938(x); - } - - public static boolean deep3938(boolean x) { - return deep3939(x); - } - - public static boolean deep3939(boolean x) { - return deep3940(x); - } - - public static boolean deep3940(boolean x) { - return deep3941(x); - } - - public static boolean deep3941(boolean x) { - return deep3942(x); - } - - public static boolean deep3942(boolean x) { - return deep3943(x); - } - - public static boolean deep3943(boolean x) { - return deep3944(x); - } - - public static boolean deep3944(boolean x) { - return deep3945(x); - } - - public static boolean deep3945(boolean x) { - return deep3946(x); - } - - public static boolean deep3946(boolean x) { - return deep3947(x); - } - - public static boolean deep3947(boolean x) { - return deep3948(x); - } - - public static boolean deep3948(boolean x) { - return deep3949(x); - } - - public static boolean deep3949(boolean x) { - return deep3950(x); - } - - public static boolean deep3950(boolean x) { - return deep3951(x); - } - - public static boolean deep3951(boolean x) { - return deep3952(x); - } - - public static boolean deep3952(boolean x) { - return deep3953(x); - } - - public static boolean deep3953(boolean x) { - return deep3954(x); - } - - public static boolean deep3954(boolean x) { - return deep3955(x); - } - - public static boolean deep3955(boolean x) { - return deep3956(x); - } - - public static boolean deep3956(boolean x) { - return deep3957(x); - } - - public static boolean deep3957(boolean x) { - return deep3958(x); - } - - public static boolean deep3958(boolean x) { - return deep3959(x); - } - - public static boolean deep3959(boolean x) { - return deep3960(x); - } - - public static boolean deep3960(boolean x) { - return deep3961(x); - } - - public static boolean deep3961(boolean x) { - return deep3962(x); - } - - public static boolean deep3962(boolean x) { - return deep3963(x); - } - - public static boolean deep3963(boolean x) { - return deep3964(x); - } - - public static boolean deep3964(boolean x) { - return deep3965(x); - } - - public static boolean deep3965(boolean x) { - return deep3966(x); - } - - public static boolean deep3966(boolean x) { - return deep3967(x); - } - - public static boolean deep3967(boolean x) { - return deep3968(x); - } - - public static boolean deep3968(boolean x) { - return deep3969(x); - } - - public static boolean deep3969(boolean x) { - return deep3970(x); - } - - public static boolean deep3970(boolean x) { - return deep3971(x); - } - - public static boolean deep3971(boolean x) { - return deep3972(x); - } - - public static boolean deep3972(boolean x) { - return deep3973(x); - } - - public static boolean deep3973(boolean x) { - return deep3974(x); - } - - public static boolean deep3974(boolean x) { - return deep3975(x); - } - - public static boolean deep3975(boolean x) { - return deep3976(x); - } - - public static boolean deep3976(boolean x) { - return deep3977(x); - } - - public static boolean deep3977(boolean x) { - return deep3978(x); - } - - public static boolean deep3978(boolean x) { - return deep3979(x); - } - - public static boolean deep3979(boolean x) { - return deep3980(x); - } - - public static boolean deep3980(boolean x) { - return deep3981(x); - } - - public static boolean deep3981(boolean x) { - return deep3982(x); - } - - public static boolean deep3982(boolean x) { - return deep3983(x); - } - - public static boolean deep3983(boolean x) { - return deep3984(x); - } - - public static boolean deep3984(boolean x) { - return deep3985(x); - } - - public static boolean deep3985(boolean x) { - return deep3986(x); - } - - public static boolean deep3986(boolean x) { - return deep3987(x); - } - - public static boolean deep3987(boolean x) { - return deep3988(x); - } - - public static boolean deep3988(boolean x) { - return deep3989(x); - } - - public static boolean deep3989(boolean x) { - return deep3990(x); - } - - public static boolean deep3990(boolean x) { - return deep3991(x); - } - - public static boolean deep3991(boolean x) { - return deep3992(x); - } - - public static boolean deep3992(boolean x) { - return deep3993(x); - } - - public static boolean deep3993(boolean x) { - return deep3994(x); - } - - public static boolean deep3994(boolean x) { - return deep3995(x); - } - - public static boolean deep3995(boolean x) { - return deep3996(x); - } - - public static boolean deep3996(boolean x) { - return deep3997(x); - } - - public static boolean deep3997(boolean x) { - return deep3998(x); - } - - public static boolean deep3998(boolean x) { - return deep3999(x); - } - - public static boolean deep3999(boolean x) { - return deep4000(x); - } - - public static boolean deep4000(boolean x) { - return deep4001(x); - } - - public static boolean deep4001(boolean x) { - return deep4002(x); - } - - public static boolean deep4002(boolean x) { - return deep4003(x); - } - - public static boolean deep4003(boolean x) { - return deep4004(x); - } - - public static boolean deep4004(boolean x) { - return deep4005(x); - } - - public static boolean deep4005(boolean x) { - return deep4006(x); - } - - public static boolean deep4006(boolean x) { - return deep4007(x); - } - - public static boolean deep4007(boolean x) { - return deep4008(x); - } - - public static boolean deep4008(boolean x) { - return deep4009(x); - } - - public static boolean deep4009(boolean x) { - return deep4010(x); - } - - public static boolean deep4010(boolean x) { - return deep4011(x); - } - - public static boolean deep4011(boolean x) { - return deep4012(x); - } - - public static boolean deep4012(boolean x) { - return deep4013(x); - } - - public static boolean deep4013(boolean x) { - return deep4014(x); - } - - public static boolean deep4014(boolean x) { - return deep4015(x); - } - - public static boolean deep4015(boolean x) { - return deep4016(x); - } - - public static boolean deep4016(boolean x) { - return deep4017(x); - } - - public static boolean deep4017(boolean x) { - return deep4018(x); - } - - public static boolean deep4018(boolean x) { - return deep4019(x); - } - - public static boolean deep4019(boolean x) { - return deep4020(x); - } - - public static boolean deep4020(boolean x) { - return deep4021(x); - } - - public static boolean deep4021(boolean x) { - return deep4022(x); - } - - public static boolean deep4022(boolean x) { - return deep4023(x); - } - - public static boolean deep4023(boolean x) { - return deep4024(x); - } - - public static boolean deep4024(boolean x) { - return deep4025(x); - } - - public static boolean deep4025(boolean x) { - return deep4026(x); - } - - public static boolean deep4026(boolean x) { - return deep4027(x); - } - - public static boolean deep4027(boolean x) { - return deep4028(x); - } - - public static boolean deep4028(boolean x) { - return deep4029(x); - } - - public static boolean deep4029(boolean x) { - return deep4030(x); - } - - public static boolean deep4030(boolean x) { - return deep4031(x); - } - - public static boolean deep4031(boolean x) { - return deep4032(x); - } - - public static boolean deep4032(boolean x) { - return deep4033(x); - } - - public static boolean deep4033(boolean x) { - return deep4034(x); - } - - public static boolean deep4034(boolean x) { - return deep4035(x); - } - - public static boolean deep4035(boolean x) { - return deep4036(x); - } - - public static boolean deep4036(boolean x) { - return deep4037(x); - } - - public static boolean deep4037(boolean x) { - return deep4038(x); - } - - public static boolean deep4038(boolean x) { - return deep4039(x); - } - - public static boolean deep4039(boolean x) { - return deep4040(x); - } - - public static boolean deep4040(boolean x) { - return deep4041(x); - } - - public static boolean deep4041(boolean x) { - return deep4042(x); - } - - public static boolean deep4042(boolean x) { - return deep4043(x); - } - - public static boolean deep4043(boolean x) { - return deep4044(x); - } - - public static boolean deep4044(boolean x) { - return deep4045(x); - } - - public static boolean deep4045(boolean x) { - return deep4046(x); - } - - public static boolean deep4046(boolean x) { - return deep4047(x); - } - - public static boolean deep4047(boolean x) { - return deep4048(x); - } - - public static boolean deep4048(boolean x) { - return deep4049(x); - } - - public static boolean deep4049(boolean x) { - return deep4050(x); - } - - public static boolean deep4050(boolean x) { - return deep4051(x); - } - - public static boolean deep4051(boolean x) { - return deep4052(x); - } - - public static boolean deep4052(boolean x) { - return deep4053(x); - } - - public static boolean deep4053(boolean x) { - return deep4054(x); - } - - public static boolean deep4054(boolean x) { - return deep4055(x); - } - - public static boolean deep4055(boolean x) { - return deep4056(x); - } - - public static boolean deep4056(boolean x) { - return deep4057(x); - } - - public static boolean deep4057(boolean x) { - return deep4058(x); - } - - public static boolean deep4058(boolean x) { - return deep4059(x); - } - - public static boolean deep4059(boolean x) { - return deep4060(x); - } - - public static boolean deep4060(boolean x) { - return deep4061(x); - } - - public static boolean deep4061(boolean x) { - return deep4062(x); - } - - public static boolean deep4062(boolean x) { - return deep4063(x); - } - - public static boolean deep4063(boolean x) { - return deep4064(x); - } - - public static boolean deep4064(boolean x) { - return deep4065(x); - } - - public static boolean deep4065(boolean x) { - return deep4066(x); - } - - public static boolean deep4066(boolean x) { - return deep4067(x); - } - - public static boolean deep4067(boolean x) { - return deep4068(x); - } - - public static boolean deep4068(boolean x) { - return deep4069(x); - } - - public static boolean deep4069(boolean x) { - return deep4070(x); - } - - public static boolean deep4070(boolean x) { - return deep4071(x); - } - - public static boolean deep4071(boolean x) { - return deep4072(x); - } - - public static boolean deep4072(boolean x) { - return deep4073(x); - } - - public static boolean deep4073(boolean x) { - return deep4074(x); - } - - public static boolean deep4074(boolean x) { - return deep4075(x); - } - - public static boolean deep4075(boolean x) { - return deep4076(x); - } - - public static boolean deep4076(boolean x) { - return deep4077(x); - } - - public static boolean deep4077(boolean x) { - return deep4078(x); - } - - public static boolean deep4078(boolean x) { - return deep4079(x); - } - - public static boolean deep4079(boolean x) { - return deep4080(x); - } - - public static boolean deep4080(boolean x) { - return deep4081(x); - } - - public static boolean deep4081(boolean x) { - return deep4082(x); - } - - public static boolean deep4082(boolean x) { - return deep4083(x); - } - - public static boolean deep4083(boolean x) { - return deep4084(x); - } - - public static boolean deep4084(boolean x) { - return deep4085(x); - } - - public static boolean deep4085(boolean x) { - return deep4086(x); - } - - public static boolean deep4086(boolean x) { - return deep4087(x); - } - - public static boolean deep4087(boolean x) { - return deep4088(x); - } - - public static boolean deep4088(boolean x) { - return deep4089(x); - } - - public static boolean deep4089(boolean x) { - return deep4090(x); - } - - public static boolean deep4090(boolean x) { - return deep4091(x); - } - - public static boolean deep4091(boolean x) { - return deep4092(x); - } - - public static boolean deep4092(boolean x) { - return deep4093(x); - } - - public static boolean deep4093(boolean x) { - return deep4094(x); - } - - public static boolean deep4094(boolean x) { - return deep4095(x); - } - - public static boolean deep4095(boolean x) { - return deep4096(x); - } - - public static boolean deep4096(boolean x) { - return deep4097(x); - } - - public static boolean deep4097(boolean x) { - return deep4098(x); - } - - public static boolean deep4098(boolean x) { - return deep4099(x); - } - - public static boolean deep4099(boolean x) { - return deep4100(x); - } - - public static boolean deep4100(boolean x) { - return deep4101(x); - } - - public static boolean deep4101(boolean x) { - return deep4102(x); - } - - public static boolean deep4102(boolean x) { - return deep4103(x); - } - - public static boolean deep4103(boolean x) { - return deep4104(x); - } - - public static boolean deep4104(boolean x) { - return deep4105(x); - } - - public static boolean deep4105(boolean x) { - return deep4106(x); - } - - public static boolean deep4106(boolean x) { - return deep4107(x); - } - - public static boolean deep4107(boolean x) { - return deep4108(x); - } - - public static boolean deep4108(boolean x) { - return deep4109(x); - } - - public static boolean deep4109(boolean x) { - return deep4110(x); - } - - public static boolean deep4110(boolean x) { - return deep4111(x); - } - - public static boolean deep4111(boolean x) { - return deep4112(x); - } - - public static boolean deep4112(boolean x) { - return deep4113(x); - } - - public static boolean deep4113(boolean x) { - return deep4114(x); - } - - public static boolean deep4114(boolean x) { - return deep4115(x); - } - - public static boolean deep4115(boolean x) { - return deep4116(x); - } - - public static boolean deep4116(boolean x) { - return deep4117(x); - } - - public static boolean deep4117(boolean x) { - return deep4118(x); - } - - public static boolean deep4118(boolean x) { - return deep4119(x); - } - - public static boolean deep4119(boolean x) { - return deep4120(x); - } - - public static boolean deep4120(boolean x) { - return deep4121(x); - } - - public static boolean deep4121(boolean x) { - return deep4122(x); - } - - public static boolean deep4122(boolean x) { - return deep4123(x); - } - - public static boolean deep4123(boolean x) { - return deep4124(x); - } - - public static boolean deep4124(boolean x) { - return deep4125(x); - } - - public static boolean deep4125(boolean x) { - return deep4126(x); - } - - public static boolean deep4126(boolean x) { - return deep4127(x); - } - - public static boolean deep4127(boolean x) { - return deep4128(x); - } - - public static boolean deep4128(boolean x) { - return deep4129(x); - } - - public static boolean deep4129(boolean x) { - return deep4130(x); - } - - public static boolean deep4130(boolean x) { - return deep4131(x); - } - - public static boolean deep4131(boolean x) { - return deep4132(x); - } - - public static boolean deep4132(boolean x) { - return deep4133(x); - } - - public static boolean deep4133(boolean x) { - return deep4134(x); - } - - public static boolean deep4134(boolean x) { - return deep4135(x); - } - - public static boolean deep4135(boolean x) { - return deep4136(x); - } - - public static boolean deep4136(boolean x) { - return deep4137(x); - } - - public static boolean deep4137(boolean x) { - return deep4138(x); - } - - public static boolean deep4138(boolean x) { - return deep4139(x); - } - - public static boolean deep4139(boolean x) { - return deep4140(x); - } - - public static boolean deep4140(boolean x) { - return deep4141(x); - } - - public static boolean deep4141(boolean x) { - return deep4142(x); - } - - public static boolean deep4142(boolean x) { - return deep4143(x); - } - - public static boolean deep4143(boolean x) { - return deep4144(x); - } - - public static boolean deep4144(boolean x) { - return deep4145(x); - } - - public static boolean deep4145(boolean x) { - return deep4146(x); - } - - public static boolean deep4146(boolean x) { - return deep4147(x); - } - - public static boolean deep4147(boolean x) { - return deep4148(x); - } - - public static boolean deep4148(boolean x) { - return deep4149(x); - } - - public static boolean deep4149(boolean x) { - return deep4150(x); - } - - public static boolean deep4150(boolean x) { - return deep4151(x); - } - - public static boolean deep4151(boolean x) { - return deep4152(x); - } - - public static boolean deep4152(boolean x) { - return deep4153(x); - } - - public static boolean deep4153(boolean x) { - return deep4154(x); - } - - public static boolean deep4154(boolean x) { - return deep4155(x); - } - - public static boolean deep4155(boolean x) { - return deep4156(x); - } - - public static boolean deep4156(boolean x) { - return deep4157(x); - } - - public static boolean deep4157(boolean x) { - return deep4158(x); - } - - public static boolean deep4158(boolean x) { - return deep4159(x); - } - - public static boolean deep4159(boolean x) { - return deep4160(x); - } - - public static boolean deep4160(boolean x) { - return deep4161(x); - } - - public static boolean deep4161(boolean x) { - return deep4162(x); - } - - public static boolean deep4162(boolean x) { - return deep4163(x); - } - - public static boolean deep4163(boolean x) { - return deep4164(x); - } - - public static boolean deep4164(boolean x) { - return deep4165(x); - } - - public static boolean deep4165(boolean x) { - return deep4166(x); - } - - public static boolean deep4166(boolean x) { - return deep4167(x); - } - - public static boolean deep4167(boolean x) { - return deep4168(x); - } - - public static boolean deep4168(boolean x) { - return deep4169(x); - } - - public static boolean deep4169(boolean x) { - return deep4170(x); - } - - public static boolean deep4170(boolean x) { - return deep4171(x); - } - - public static boolean deep4171(boolean x) { - return deep4172(x); - } - - public static boolean deep4172(boolean x) { - return deep4173(x); - } - - public static boolean deep4173(boolean x) { - return deep4174(x); - } - - public static boolean deep4174(boolean x) { - return deep4175(x); - } - - public static boolean deep4175(boolean x) { - return deep4176(x); - } - - public static boolean deep4176(boolean x) { - return deep4177(x); - } - - public static boolean deep4177(boolean x) { - return deep4178(x); - } - - public static boolean deep4178(boolean x) { - return deep4179(x); - } - - public static boolean deep4179(boolean x) { - return deep4180(x); - } - - public static boolean deep4180(boolean x) { - return deep4181(x); - } - - public static boolean deep4181(boolean x) { - return deep4182(x); - } - - public static boolean deep4182(boolean x) { - return deep4183(x); - } - - public static boolean deep4183(boolean x) { - return deep4184(x); - } - - public static boolean deep4184(boolean x) { - return deep4185(x); - } - - public static boolean deep4185(boolean x) { - return deep4186(x); - } - - public static boolean deep4186(boolean x) { - return deep4187(x); - } - - public static boolean deep4187(boolean x) { - return deep4188(x); - } - - public static boolean deep4188(boolean x) { - return deep4189(x); - } - - public static boolean deep4189(boolean x) { - return deep4190(x); - } - - public static boolean deep4190(boolean x) { - return deep4191(x); - } - - public static boolean deep4191(boolean x) { - return deep4192(x); - } - - public static boolean deep4192(boolean x) { - return deep4193(x); - } - - public static boolean deep4193(boolean x) { - return deep4194(x); - } - - public static boolean deep4194(boolean x) { - return deep4195(x); - } - - public static boolean deep4195(boolean x) { - return deep4196(x); - } - - public static boolean deep4196(boolean x) { - return deep4197(x); - } - - public static boolean deep4197(boolean x) { - return deep4198(x); - } - - public static boolean deep4198(boolean x) { - return deep4199(x); - } - - public static boolean deep4199(boolean x) { - return deep4200(x); - } - - public static boolean deep4200(boolean x) { - return deep4201(x); - } - - public static boolean deep4201(boolean x) { - return deep4202(x); - } - - public static boolean deep4202(boolean x) { - return deep4203(x); - } - - public static boolean deep4203(boolean x) { - return deep4204(x); - } - - public static boolean deep4204(boolean x) { - return deep4205(x); - } - - public static boolean deep4205(boolean x) { - return deep4206(x); - } - - public static boolean deep4206(boolean x) { - return deep4207(x); - } - - public static boolean deep4207(boolean x) { - return deep4208(x); - } - - public static boolean deep4208(boolean x) { - return deep4209(x); - } - - public static boolean deep4209(boolean x) { - return deep4210(x); - } - - public static boolean deep4210(boolean x) { - return deep4211(x); - } - - public static boolean deep4211(boolean x) { - return deep4212(x); - } - - public static boolean deep4212(boolean x) { - return deep4213(x); - } - - public static boolean deep4213(boolean x) { - return deep4214(x); - } - - public static boolean deep4214(boolean x) { - return deep4215(x); - } - - public static boolean deep4215(boolean x) { - return deep4216(x); - } - - public static boolean deep4216(boolean x) { - return deep4217(x); - } - - public static boolean deep4217(boolean x) { - return deep4218(x); - } - - public static boolean deep4218(boolean x) { - return deep4219(x); - } - - public static boolean deep4219(boolean x) { - return deep4220(x); - } - - public static boolean deep4220(boolean x) { - return deep4221(x); - } - - public static boolean deep4221(boolean x) { - return deep4222(x); - } - - public static boolean deep4222(boolean x) { - return deep4223(x); - } - - public static boolean deep4223(boolean x) { - return deep4224(x); - } - - public static boolean deep4224(boolean x) { - return deep4225(x); - } - - public static boolean deep4225(boolean x) { - return deep4226(x); - } - - public static boolean deep4226(boolean x) { - return deep4227(x); - } - - public static boolean deep4227(boolean x) { - return deep4228(x); - } - - public static boolean deep4228(boolean x) { - return deep4229(x); - } - - public static boolean deep4229(boolean x) { - return deep4230(x); - } - - public static boolean deep4230(boolean x) { - return deep4231(x); - } - - public static boolean deep4231(boolean x) { - return deep4232(x); - } - - public static boolean deep4232(boolean x) { - return deep4233(x); - } - - public static boolean deep4233(boolean x) { - return deep4234(x); - } - - public static boolean deep4234(boolean x) { - return deep4235(x); - } - - public static boolean deep4235(boolean x) { - return deep4236(x); - } - - public static boolean deep4236(boolean x) { - return deep4237(x); - } - - public static boolean deep4237(boolean x) { - return deep4238(x); - } - - public static boolean deep4238(boolean x) { - return deep4239(x); - } - - public static boolean deep4239(boolean x) { - return deep4240(x); - } - - public static boolean deep4240(boolean x) { - return deep4241(x); - } - - public static boolean deep4241(boolean x) { - return deep4242(x); - } - - public static boolean deep4242(boolean x) { - return deep4243(x); - } - - public static boolean deep4243(boolean x) { - return deep4244(x); - } - - public static boolean deep4244(boolean x) { - return deep4245(x); - } - - public static boolean deep4245(boolean x) { - return deep4246(x); - } - - public static boolean deep4246(boolean x) { - return deep4247(x); - } - - public static boolean deep4247(boolean x) { - return deep4248(x); - } - - public static boolean deep4248(boolean x) { - return deep4249(x); - } - - public static boolean deep4249(boolean x) { - return deep4250(x); - } - - public static boolean deep4250(boolean x) { - return deep4251(x); - } - - public static boolean deep4251(boolean x) { - return deep4252(x); - } - - public static boolean deep4252(boolean x) { - return deep4253(x); - } - - public static boolean deep4253(boolean x) { - return deep4254(x); - } - - public static boolean deep4254(boolean x) { - return deep4255(x); - } - - public static boolean deep4255(boolean x) { - return deep4256(x); - } - - public static boolean deep4256(boolean x) { - return deep4257(x); - } - - public static boolean deep4257(boolean x) { - return deep4258(x); - } - - public static boolean deep4258(boolean x) { - return deep4259(x); - } - - public static boolean deep4259(boolean x) { - return deep4260(x); - } - - public static boolean deep4260(boolean x) { - return deep4261(x); - } - - public static boolean deep4261(boolean x) { - return deep4262(x); - } - - public static boolean deep4262(boolean x) { - return deep4263(x); - } - - public static boolean deep4263(boolean x) { - return deep4264(x); - } - - public static boolean deep4264(boolean x) { - return deep4265(x); - } - - public static boolean deep4265(boolean x) { - return deep4266(x); - } - - public static boolean deep4266(boolean x) { - return deep4267(x); - } - - public static boolean deep4267(boolean x) { - return deep4268(x); - } - - public static boolean deep4268(boolean x) { - return deep4269(x); - } - - public static boolean deep4269(boolean x) { - return deep4270(x); - } - - public static boolean deep4270(boolean x) { - return deep4271(x); - } - - public static boolean deep4271(boolean x) { - return deep4272(x); - } - - public static boolean deep4272(boolean x) { - return deep4273(x); - } - - public static boolean deep4273(boolean x) { - return deep4274(x); - } - - public static boolean deep4274(boolean x) { - return deep4275(x); - } - - public static boolean deep4275(boolean x) { - return deep4276(x); - } - - public static boolean deep4276(boolean x) { - return deep4277(x); - } - - public static boolean deep4277(boolean x) { - return deep4278(x); - } - - public static boolean deep4278(boolean x) { - return deep4279(x); - } - - public static boolean deep4279(boolean x) { - return deep4280(x); - } - - public static boolean deep4280(boolean x) { - return deep4281(x); - } - - public static boolean deep4281(boolean x) { - return deep4282(x); - } - - public static boolean deep4282(boolean x) { - return deep4283(x); - } - - public static boolean deep4283(boolean x) { - return deep4284(x); - } - - public static boolean deep4284(boolean x) { - return deep4285(x); - } - - public static boolean deep4285(boolean x) { - return deep4286(x); - } - - public static boolean deep4286(boolean x) { - return deep4287(x); - } - - public static boolean deep4287(boolean x) { - return deep4288(x); - } - - public static boolean deep4288(boolean x) { - return deep4289(x); - } - - public static boolean deep4289(boolean x) { - return deep4290(x); - } - - public static boolean deep4290(boolean x) { - return deep4291(x); - } - - public static boolean deep4291(boolean x) { - return deep4292(x); - } - - public static boolean deep4292(boolean x) { - return deep4293(x); - } - - public static boolean deep4293(boolean x) { - return deep4294(x); - } - - public static boolean deep4294(boolean x) { - return deep4295(x); - } - - public static boolean deep4295(boolean x) { - return deep4296(x); - } - - public static boolean deep4296(boolean x) { - return deep4297(x); - } - - public static boolean deep4297(boolean x) { - return deep4298(x); - } - - public static boolean deep4298(boolean x) { - return deep4299(x); - } - - public static boolean deep4299(boolean x) { - return deep4300(x); - } - - public static boolean deep4300(boolean x) { - return deep4301(x); - } - - public static boolean deep4301(boolean x) { - return deep4302(x); - } - - public static boolean deep4302(boolean x) { - return deep4303(x); - } - - public static boolean deep4303(boolean x) { - return deep4304(x); - } - - public static boolean deep4304(boolean x) { - return deep4305(x); - } - - public static boolean deep4305(boolean x) { - return deep4306(x); - } - - public static boolean deep4306(boolean x) { - return deep4307(x); - } - - public static boolean deep4307(boolean x) { - return deep4308(x); - } - - public static boolean deep4308(boolean x) { - return deep4309(x); - } - - public static boolean deep4309(boolean x) { - return deep4310(x); - } - - public static boolean deep4310(boolean x) { - return deep4311(x); - } - - public static boolean deep4311(boolean x) { - return deep4312(x); - } - - public static boolean deep4312(boolean x) { - return deep4313(x); - } - - public static boolean deep4313(boolean x) { - return deep4314(x); - } - - public static boolean deep4314(boolean x) { - return deep4315(x); - } - - public static boolean deep4315(boolean x) { - return deep4316(x); - } - - public static boolean deep4316(boolean x) { - return deep4317(x); - } - - public static boolean deep4317(boolean x) { - return deep4318(x); - } - - public static boolean deep4318(boolean x) { - return deep4319(x); - } - - public static boolean deep4319(boolean x) { - return deep4320(x); - } - - public static boolean deep4320(boolean x) { - return deep4321(x); - } - - public static boolean deep4321(boolean x) { - return deep4322(x); - } - - public static boolean deep4322(boolean x) { - return deep4323(x); - } - - public static boolean deep4323(boolean x) { - return deep4324(x); - } - - public static boolean deep4324(boolean x) { - return deep4325(x); - } - - public static boolean deep4325(boolean x) { - return deep4326(x); - } - - public static boolean deep4326(boolean x) { - return deep4327(x); - } - - public static boolean deep4327(boolean x) { - return deep4328(x); - } - - public static boolean deep4328(boolean x) { - return deep4329(x); - } - - public static boolean deep4329(boolean x) { - return deep4330(x); - } - - public static boolean deep4330(boolean x) { - return deep4331(x); - } - - public static boolean deep4331(boolean x) { - return deep4332(x); - } - - public static boolean deep4332(boolean x) { - return deep4333(x); - } - - public static boolean deep4333(boolean x) { - return deep4334(x); - } - - public static boolean deep4334(boolean x) { - return deep4335(x); - } - - public static boolean deep4335(boolean x) { - return deep4336(x); - } - - public static boolean deep4336(boolean x) { - return deep4337(x); - } - - public static boolean deep4337(boolean x) { - return deep4338(x); - } - - public static boolean deep4338(boolean x) { - return deep4339(x); - } - - public static boolean deep4339(boolean x) { - return deep4340(x); - } - - public static boolean deep4340(boolean x) { - return deep4341(x); - } - - public static boolean deep4341(boolean x) { - return deep4342(x); - } - - public static boolean deep4342(boolean x) { - return deep4343(x); - } - - public static boolean deep4343(boolean x) { - return deep4344(x); - } - - public static boolean deep4344(boolean x) { - return deep4345(x); - } - - public static boolean deep4345(boolean x) { - return deep4346(x); - } - - public static boolean deep4346(boolean x) { - return deep4347(x); - } - - public static boolean deep4347(boolean x) { - return deep4348(x); - } - - public static boolean deep4348(boolean x) { - return deep4349(x); - } - - public static boolean deep4349(boolean x) { - return deep4350(x); - } - - public static boolean deep4350(boolean x) { - return deep4351(x); - } - - public static boolean deep4351(boolean x) { - return deep4352(x); - } - - public static boolean deep4352(boolean x) { - return deep4353(x); - } - - public static boolean deep4353(boolean x) { - return deep4354(x); - } - - public static boolean deep4354(boolean x) { - return deep4355(x); - } - - public static boolean deep4355(boolean x) { - return deep4356(x); - } - - public static boolean deep4356(boolean x) { - return deep4357(x); - } - - public static boolean deep4357(boolean x) { - return deep4358(x); - } - - public static boolean deep4358(boolean x) { - return deep4359(x); - } - - public static boolean deep4359(boolean x) { - return deep4360(x); - } - - public static boolean deep4360(boolean x) { - return deep4361(x); - } - - public static boolean deep4361(boolean x) { - return deep4362(x); - } - - public static boolean deep4362(boolean x) { - return deep4363(x); - } - - public static boolean deep4363(boolean x) { - return deep4364(x); - } - - public static boolean deep4364(boolean x) { - return deep4365(x); - } - - public static boolean deep4365(boolean x) { - return deep4366(x); - } - - public static boolean deep4366(boolean x) { - return deep4367(x); - } - - public static boolean deep4367(boolean x) { - return deep4368(x); - } - - public static boolean deep4368(boolean x) { - return deep4369(x); - } - - public static boolean deep4369(boolean x) { - return deep4370(x); - } - - public static boolean deep4370(boolean x) { - return deep4371(x); - } - - public static boolean deep4371(boolean x) { - return deep4372(x); - } - - public static boolean deep4372(boolean x) { - return deep4373(x); - } - - public static boolean deep4373(boolean x) { - return deep4374(x); - } - - public static boolean deep4374(boolean x) { - return deep4375(x); - } - - public static boolean deep4375(boolean x) { - return deep4376(x); - } - - public static boolean deep4376(boolean x) { - return deep4377(x); - } - - public static boolean deep4377(boolean x) { - return deep4378(x); - } - - public static boolean deep4378(boolean x) { - return deep4379(x); - } - - public static boolean deep4379(boolean x) { - return deep4380(x); - } - - public static boolean deep4380(boolean x) { - return deep4381(x); - } - - public static boolean deep4381(boolean x) { - return deep4382(x); - } - - public static boolean deep4382(boolean x) { - return deep4383(x); - } - - public static boolean deep4383(boolean x) { - return deep4384(x); - } - - public static boolean deep4384(boolean x) { - return deep4385(x); - } - - public static boolean deep4385(boolean x) { - return deep4386(x); - } - - public static boolean deep4386(boolean x) { - return deep4387(x); - } - - public static boolean deep4387(boolean x) { - return deep4388(x); - } - - public static boolean deep4388(boolean x) { - return deep4389(x); - } - - public static boolean deep4389(boolean x) { - return deep4390(x); - } - - public static boolean deep4390(boolean x) { - return deep4391(x); - } - - public static boolean deep4391(boolean x) { - return deep4392(x); - } - - public static boolean deep4392(boolean x) { - return deep4393(x); - } - - public static boolean deep4393(boolean x) { - return deep4394(x); - } - - public static boolean deep4394(boolean x) { - return deep4395(x); - } - - public static boolean deep4395(boolean x) { - return deep4396(x); - } - - public static boolean deep4396(boolean x) { - return deep4397(x); - } - - public static boolean deep4397(boolean x) { - return deep4398(x); - } - - public static boolean deep4398(boolean x) { - return deep4399(x); - } - - public static boolean deep4399(boolean x) { - return deep4400(x); - } - - public static boolean deep4400(boolean x) { - return deep4401(x); - } - - public static boolean deep4401(boolean x) { - return deep4402(x); - } - - public static boolean deep4402(boolean x) { - return deep4403(x); - } - - public static boolean deep4403(boolean x) { - return deep4404(x); - } - - public static boolean deep4404(boolean x) { - return deep4405(x); - } - - public static boolean deep4405(boolean x) { - return deep4406(x); - } - - public static boolean deep4406(boolean x) { - return deep4407(x); - } - - public static boolean deep4407(boolean x) { - return deep4408(x); - } - - public static boolean deep4408(boolean x) { - return deep4409(x); - } - - public static boolean deep4409(boolean x) { - return deep4410(x); - } - - public static boolean deep4410(boolean x) { - return deep4411(x); - } - - public static boolean deep4411(boolean x) { - return deep4412(x); - } - - public static boolean deep4412(boolean x) { - return deep4413(x); - } - - public static boolean deep4413(boolean x) { - return deep4414(x); - } - - public static boolean deep4414(boolean x) { - return deep4415(x); - } - - public static boolean deep4415(boolean x) { - return deep4416(x); - } - - public static boolean deep4416(boolean x) { - return deep4417(x); - } - - public static boolean deep4417(boolean x) { - return deep4418(x); - } - - public static boolean deep4418(boolean x) { - return deep4419(x); - } - - public static boolean deep4419(boolean x) { - return deep4420(x); - } - - public static boolean deep4420(boolean x) { - return deep4421(x); - } - - public static boolean deep4421(boolean x) { - return deep4422(x); - } - - public static boolean deep4422(boolean x) { - return deep4423(x); - } - - public static boolean deep4423(boolean x) { - return deep4424(x); - } - - public static boolean deep4424(boolean x) { - return deep4425(x); - } - - public static boolean deep4425(boolean x) { - return deep4426(x); - } - - public static boolean deep4426(boolean x) { - return deep4427(x); - } - - public static boolean deep4427(boolean x) { - return deep4428(x); - } - - public static boolean deep4428(boolean x) { - return deep4429(x); - } - - public static boolean deep4429(boolean x) { - return deep4430(x); - } - - public static boolean deep4430(boolean x) { - return deep4431(x); - } - - public static boolean deep4431(boolean x) { - return deep4432(x); - } - - public static boolean deep4432(boolean x) { - return deep4433(x); - } - - public static boolean deep4433(boolean x) { - return deep4434(x); - } - - public static boolean deep4434(boolean x) { - return deep4435(x); - } - - public static boolean deep4435(boolean x) { - return deep4436(x); - } - - public static boolean deep4436(boolean x) { - return deep4437(x); - } - - public static boolean deep4437(boolean x) { - return deep4438(x); - } - - public static boolean deep4438(boolean x) { - return deep4439(x); - } - - public static boolean deep4439(boolean x) { - return deep4440(x); - } - - public static boolean deep4440(boolean x) { - return deep4441(x); - } - - public static boolean deep4441(boolean x) { - return deep4442(x); - } - - public static boolean deep4442(boolean x) { - return deep4443(x); - } - - public static boolean deep4443(boolean x) { - return deep4444(x); - } - - public static boolean deep4444(boolean x) { - return deep4445(x); - } - - public static boolean deep4445(boolean x) { - return deep4446(x); - } - - public static boolean deep4446(boolean x) { - return deep4447(x); - } - - public static boolean deep4447(boolean x) { - return deep4448(x); - } - - public static boolean deep4448(boolean x) { - return deep4449(x); - } - - public static boolean deep4449(boolean x) { - return deep4450(x); - } - - public static boolean deep4450(boolean x) { - return deep4451(x); - } - - public static boolean deep4451(boolean x) { - return deep4452(x); - } - - public static boolean deep4452(boolean x) { - return deep4453(x); - } - - public static boolean deep4453(boolean x) { - return deep4454(x); - } - - public static boolean deep4454(boolean x) { - return deep4455(x); - } - - public static boolean deep4455(boolean x) { - return deep4456(x); - } - - public static boolean deep4456(boolean x) { - return deep4457(x); - } - - public static boolean deep4457(boolean x) { - return deep4458(x); - } - - public static boolean deep4458(boolean x) { - return deep4459(x); - } - - public static boolean deep4459(boolean x) { - return deep4460(x); - } - - public static boolean deep4460(boolean x) { - return deep4461(x); - } - - public static boolean deep4461(boolean x) { - return deep4462(x); - } - - public static boolean deep4462(boolean x) { - return deep4463(x); - } - - public static boolean deep4463(boolean x) { - return deep4464(x); - } - - public static boolean deep4464(boolean x) { - return deep4465(x); - } - - public static boolean deep4465(boolean x) { - return deep4466(x); - } - - public static boolean deep4466(boolean x) { - return deep4467(x); - } - - public static boolean deep4467(boolean x) { - return deep4468(x); - } - - public static boolean deep4468(boolean x) { - return deep4469(x); - } - - public static boolean deep4469(boolean x) { - return deep4470(x); - } - - public static boolean deep4470(boolean x) { - return deep4471(x); - } - - public static boolean deep4471(boolean x) { - return deep4472(x); - } - - public static boolean deep4472(boolean x) { - return deep4473(x); - } - - public static boolean deep4473(boolean x) { - return deep4474(x); - } - - public static boolean deep4474(boolean x) { - return deep4475(x); - } - - public static boolean deep4475(boolean x) { - return deep4476(x); - } - - public static boolean deep4476(boolean x) { - return deep4477(x); - } - - public static boolean deep4477(boolean x) { - return deep4478(x); - } - - public static boolean deep4478(boolean x) { - return deep4479(x); - } - - public static boolean deep4479(boolean x) { - return deep4480(x); - } - - public static boolean deep4480(boolean x) { - return deep4481(x); - } - - public static boolean deep4481(boolean x) { - return deep4482(x); - } - - public static boolean deep4482(boolean x) { - return deep4483(x); - } - - public static boolean deep4483(boolean x) { - return deep4484(x); - } - - public static boolean deep4484(boolean x) { - return deep4485(x); - } - - public static boolean deep4485(boolean x) { - return deep4486(x); - } - - public static boolean deep4486(boolean x) { - return deep4487(x); - } - - public static boolean deep4487(boolean x) { - return deep4488(x); - } - - public static boolean deep4488(boolean x) { - return deep4489(x); - } - - public static boolean deep4489(boolean x) { - return deep4490(x); - } - - public static boolean deep4490(boolean x) { - return deep4491(x); - } - - public static boolean deep4491(boolean x) { - return deep4492(x); - } - - public static boolean deep4492(boolean x) { - return deep4493(x); - } - - public static boolean deep4493(boolean x) { - return deep4494(x); - } - - public static boolean deep4494(boolean x) { - return deep4495(x); - } - - public static boolean deep4495(boolean x) { - return deep4496(x); - } - - public static boolean deep4496(boolean x) { - return deep4497(x); - } - - public static boolean deep4497(boolean x) { - return deep4498(x); - } - - public static boolean deep4498(boolean x) { - return deep4499(x); - } - - public static boolean deep4499(boolean x) { - return deep4500(x); - } - - public static boolean deep4500(boolean x) { - return deep4501(x); - } - - public static boolean deep4501(boolean x) { - return deep4502(x); - } - - public static boolean deep4502(boolean x) { - return deep4503(x); - } - - public static boolean deep4503(boolean x) { - return deep4504(x); - } - - public static boolean deep4504(boolean x) { - return deep4505(x); - } - - public static boolean deep4505(boolean x) { - return deep4506(x); - } - - public static boolean deep4506(boolean x) { - return deep4507(x); - } - - public static boolean deep4507(boolean x) { - return deep4508(x); - } - - public static boolean deep4508(boolean x) { - return deep4509(x); - } - - public static boolean deep4509(boolean x) { - return deep4510(x); - } - - public static boolean deep4510(boolean x) { - return deep4511(x); - } - - public static boolean deep4511(boolean x) { - return deep4512(x); - } - - public static boolean deep4512(boolean x) { - return deep4513(x); - } - - public static boolean deep4513(boolean x) { - return deep4514(x); - } - - public static boolean deep4514(boolean x) { - return deep4515(x); - } - - public static boolean deep4515(boolean x) { - return deep4516(x); - } - - public static boolean deep4516(boolean x) { - return deep4517(x); - } - - public static boolean deep4517(boolean x) { - return deep4518(x); - } - - public static boolean deep4518(boolean x) { - return deep4519(x); - } - - public static boolean deep4519(boolean x) { - return deep4520(x); - } - - public static boolean deep4520(boolean x) { - return deep4521(x); - } - - public static boolean deep4521(boolean x) { - return deep4522(x); - } - - public static boolean deep4522(boolean x) { - return deep4523(x); - } - - public static boolean deep4523(boolean x) { - return deep4524(x); - } - - public static boolean deep4524(boolean x) { - return deep4525(x); - } - - public static boolean deep4525(boolean x) { - return deep4526(x); - } - - public static boolean deep4526(boolean x) { - return deep4527(x); - } - - public static boolean deep4527(boolean x) { - return deep4528(x); - } - - public static boolean deep4528(boolean x) { - return deep4529(x); - } - - public static boolean deep4529(boolean x) { - return deep4530(x); - } - - public static boolean deep4530(boolean x) { - return deep4531(x); - } - - public static boolean deep4531(boolean x) { - return deep4532(x); - } - - public static boolean deep4532(boolean x) { - return deep4533(x); - } - - public static boolean deep4533(boolean x) { - return deep4534(x); - } - - public static boolean deep4534(boolean x) { - return deep4535(x); - } - - public static boolean deep4535(boolean x) { - return deep4536(x); - } - - public static boolean deep4536(boolean x) { - return deep4537(x); - } - - public static boolean deep4537(boolean x) { - return deep4538(x); - } - - public static boolean deep4538(boolean x) { - return deep4539(x); - } - - public static boolean deep4539(boolean x) { - return deep4540(x); - } - - public static boolean deep4540(boolean x) { - return deep4541(x); - } - - public static boolean deep4541(boolean x) { - return deep4542(x); - } - - public static boolean deep4542(boolean x) { - return deep4543(x); - } - - public static boolean deep4543(boolean x) { - return deep4544(x); - } - - public static boolean deep4544(boolean x) { - return deep4545(x); - } - - public static boolean deep4545(boolean x) { - return deep4546(x); - } - - public static boolean deep4546(boolean x) { - return deep4547(x); - } - - public static boolean deep4547(boolean x) { - return deep4548(x); - } - - public static boolean deep4548(boolean x) { - return deep4549(x); - } - - public static boolean deep4549(boolean x) { - return deep4550(x); - } - - public static boolean deep4550(boolean x) { - return deep4551(x); - } - - public static boolean deep4551(boolean x) { - return deep4552(x); - } - - public static boolean deep4552(boolean x) { - return deep4553(x); - } - - public static boolean deep4553(boolean x) { - return deep4554(x); - } - - public static boolean deep4554(boolean x) { - return deep4555(x); - } - - public static boolean deep4555(boolean x) { - return deep4556(x); - } - - public static boolean deep4556(boolean x) { - return deep4557(x); - } - - public static boolean deep4557(boolean x) { - return deep4558(x); - } - - public static boolean deep4558(boolean x) { - return deep4559(x); - } - - public static boolean deep4559(boolean x) { - return deep4560(x); - } - - public static boolean deep4560(boolean x) { - return deep4561(x); - } - - public static boolean deep4561(boolean x) { - return deep4562(x); - } - - public static boolean deep4562(boolean x) { - return deep4563(x); - } - - public static boolean deep4563(boolean x) { - return deep4564(x); - } - - public static boolean deep4564(boolean x) { - return deep4565(x); - } - - public static boolean deep4565(boolean x) { - return deep4566(x); - } - - public static boolean deep4566(boolean x) { - return deep4567(x); - } - - public static boolean deep4567(boolean x) { - return deep4568(x); - } - - public static boolean deep4568(boolean x) { - return deep4569(x); - } - - public static boolean deep4569(boolean x) { - return deep4570(x); - } - - public static boolean deep4570(boolean x) { - return deep4571(x); - } - - public static boolean deep4571(boolean x) { - return deep4572(x); - } - - public static boolean deep4572(boolean x) { - return deep4573(x); - } - - public static boolean deep4573(boolean x) { - return deep4574(x); - } - - public static boolean deep4574(boolean x) { - return deep4575(x); - } - - public static boolean deep4575(boolean x) { - return deep4576(x); - } - - public static boolean deep4576(boolean x) { - return deep4577(x); - } - - public static boolean deep4577(boolean x) { - return deep4578(x); - } - - public static boolean deep4578(boolean x) { - return deep4579(x); - } - - public static boolean deep4579(boolean x) { - return deep4580(x); - } - - public static boolean deep4580(boolean x) { - return deep4581(x); - } - - public static boolean deep4581(boolean x) { - return deep4582(x); - } - - public static boolean deep4582(boolean x) { - return deep4583(x); - } - - public static boolean deep4583(boolean x) { - return deep4584(x); - } - - public static boolean deep4584(boolean x) { - return deep4585(x); - } - - public static boolean deep4585(boolean x) { - return deep4586(x); - } - - public static boolean deep4586(boolean x) { - return deep4587(x); - } - - public static boolean deep4587(boolean x) { - return deep4588(x); - } - - public static boolean deep4588(boolean x) { - return deep4589(x); - } - - public static boolean deep4589(boolean x) { - return deep4590(x); - } - - public static boolean deep4590(boolean x) { - return deep4591(x); - } - - public static boolean deep4591(boolean x) { - return deep4592(x); - } - - public static boolean deep4592(boolean x) { - return deep4593(x); - } - - public static boolean deep4593(boolean x) { - return deep4594(x); - } - - public static boolean deep4594(boolean x) { - return deep4595(x); - } - - public static boolean deep4595(boolean x) { - return deep4596(x); - } - - public static boolean deep4596(boolean x) { - return deep4597(x); - } - - public static boolean deep4597(boolean x) { - return deep4598(x); - } - - public static boolean deep4598(boolean x) { - return deep4599(x); - } - - public static boolean deep4599(boolean x) { - return deep4600(x); - } - - public static boolean deep4600(boolean x) { - return deep4601(x); - } - - public static boolean deep4601(boolean x) { - return deep4602(x); - } - - public static boolean deep4602(boolean x) { - return deep4603(x); - } - - public static boolean deep4603(boolean x) { - return deep4604(x); - } - - public static boolean deep4604(boolean x) { - return deep4605(x); - } - - public static boolean deep4605(boolean x) { - return deep4606(x); - } - - public static boolean deep4606(boolean x) { - return deep4607(x); - } - - public static boolean deep4607(boolean x) { - return deep4608(x); - } - - public static boolean deep4608(boolean x) { - return deep4609(x); - } - - public static boolean deep4609(boolean x) { - return deep4610(x); - } - - public static boolean deep4610(boolean x) { - return deep4611(x); - } - - public static boolean deep4611(boolean x) { - return deep4612(x); - } - - public static boolean deep4612(boolean x) { - return deep4613(x); - } - - public static boolean deep4613(boolean x) { - return deep4614(x); - } - - public static boolean deep4614(boolean x) { - return deep4615(x); - } - - public static boolean deep4615(boolean x) { - return deep4616(x); - } - - public static boolean deep4616(boolean x) { - return deep4617(x); - } - - public static boolean deep4617(boolean x) { - return deep4618(x); - } - - public static boolean deep4618(boolean x) { - return deep4619(x); - } - - public static boolean deep4619(boolean x) { - return deep4620(x); - } - - public static boolean deep4620(boolean x) { - return deep4621(x); - } - - public static boolean deep4621(boolean x) { - return deep4622(x); - } - - public static boolean deep4622(boolean x) { - return deep4623(x); - } - - public static boolean deep4623(boolean x) { - return deep4624(x); - } - - public static boolean deep4624(boolean x) { - return deep4625(x); - } - - public static boolean deep4625(boolean x) { - return deep4626(x); - } - - public static boolean deep4626(boolean x) { - return deep4627(x); - } - - public static boolean deep4627(boolean x) { - return deep4628(x); - } - - public static boolean deep4628(boolean x) { - return deep4629(x); - } - - public static boolean deep4629(boolean x) { - return deep4630(x); - } - - public static boolean deep4630(boolean x) { - return deep4631(x); - } - - public static boolean deep4631(boolean x) { - return deep4632(x); - } - - public static boolean deep4632(boolean x) { - return deep4633(x); - } - - public static boolean deep4633(boolean x) { - return deep4634(x); - } - - public static boolean deep4634(boolean x) { - return deep4635(x); - } - - public static boolean deep4635(boolean x) { - return deep4636(x); - } - - public static boolean deep4636(boolean x) { - return deep4637(x); - } - - public static boolean deep4637(boolean x) { - return deep4638(x); - } - - public static boolean deep4638(boolean x) { - return deep4639(x); - } - - public static boolean deep4639(boolean x) { - return deep4640(x); - } - - public static boolean deep4640(boolean x) { - return deep4641(x); - } - - public static boolean deep4641(boolean x) { - return deep4642(x); - } - - public static boolean deep4642(boolean x) { - return deep4643(x); - } - - public static boolean deep4643(boolean x) { - return deep4644(x); - } - - public static boolean deep4644(boolean x) { - return deep4645(x); - } - - public static boolean deep4645(boolean x) { - return deep4646(x); - } - - public static boolean deep4646(boolean x) { - return deep4647(x); - } - - public static boolean deep4647(boolean x) { - return deep4648(x); - } - - public static boolean deep4648(boolean x) { - return deep4649(x); - } - - public static boolean deep4649(boolean x) { - return deep4650(x); - } - - public static boolean deep4650(boolean x) { - return deep4651(x); - } - - public static boolean deep4651(boolean x) { - return deep4652(x); - } - - public static boolean deep4652(boolean x) { - return deep4653(x); - } - - public static boolean deep4653(boolean x) { - return deep4654(x); - } - - public static boolean deep4654(boolean x) { - return deep4655(x); - } - - public static boolean deep4655(boolean x) { - return deep4656(x); - } - - public static boolean deep4656(boolean x) { - return deep4657(x); - } - - public static boolean deep4657(boolean x) { - return deep4658(x); - } - - public static boolean deep4658(boolean x) { - return deep4659(x); - } - - public static boolean deep4659(boolean x) { - return deep4660(x); - } - - public static boolean deep4660(boolean x) { - return deep4661(x); - } - - public static boolean deep4661(boolean x) { - return deep4662(x); - } - - public static boolean deep4662(boolean x) { - return deep4663(x); - } - - public static boolean deep4663(boolean x) { - return deep4664(x); - } - - public static boolean deep4664(boolean x) { - return deep4665(x); - } - - public static boolean deep4665(boolean x) { - return deep4666(x); - } - - public static boolean deep4666(boolean x) { - return deep4667(x); - } - - public static boolean deep4667(boolean x) { - return deep4668(x); - } - - public static boolean deep4668(boolean x) { - return deep4669(x); - } - - public static boolean deep4669(boolean x) { - return deep4670(x); - } - - public static boolean deep4670(boolean x) { - return deep4671(x); - } - - public static boolean deep4671(boolean x) { - return deep4672(x); - } - - public static boolean deep4672(boolean x) { - return deep4673(x); - } - - public static boolean deep4673(boolean x) { - return deep4674(x); - } - - public static boolean deep4674(boolean x) { - return deep4675(x); - } - - public static boolean deep4675(boolean x) { - return deep4676(x); - } - - public static boolean deep4676(boolean x) { - return deep4677(x); - } - - public static boolean deep4677(boolean x) { - return deep4678(x); - } - - public static boolean deep4678(boolean x) { - return deep4679(x); - } - - public static boolean deep4679(boolean x) { - return deep4680(x); - } - - public static boolean deep4680(boolean x) { - return deep4681(x); - } - - public static boolean deep4681(boolean x) { - return deep4682(x); - } - - public static boolean deep4682(boolean x) { - return deep4683(x); - } - - public static boolean deep4683(boolean x) { - return deep4684(x); - } - - public static boolean deep4684(boolean x) { - return deep4685(x); - } - - public static boolean deep4685(boolean x) { - return deep4686(x); - } - - public static boolean deep4686(boolean x) { - return deep4687(x); - } - - public static boolean deep4687(boolean x) { - return deep4688(x); - } - - public static boolean deep4688(boolean x) { - return deep4689(x); - } - - public static boolean deep4689(boolean x) { - return deep4690(x); - } - - public static boolean deep4690(boolean x) { - return deep4691(x); - } - - public static boolean deep4691(boolean x) { - return deep4692(x); - } - - public static boolean deep4692(boolean x) { - return deep4693(x); - } - - public static boolean deep4693(boolean x) { - return deep4694(x); - } - - public static boolean deep4694(boolean x) { - return deep4695(x); - } - - public static boolean deep4695(boolean x) { - return deep4696(x); - } - - public static boolean deep4696(boolean x) { - return deep4697(x); - } - - public static boolean deep4697(boolean x) { - return deep4698(x); - } - - public static boolean deep4698(boolean x) { - return deep4699(x); - } - - public static boolean deep4699(boolean x) { - return deep4700(x); - } - - public static boolean deep4700(boolean x) { - return deep4701(x); - } - - public static boolean deep4701(boolean x) { - return deep4702(x); - } - - public static boolean deep4702(boolean x) { - return deep4703(x); - } - - public static boolean deep4703(boolean x) { - return deep4704(x); - } - - public static boolean deep4704(boolean x) { - return deep4705(x); - } - - public static boolean deep4705(boolean x) { - return deep4706(x); - } - - public static boolean deep4706(boolean x) { - return deep4707(x); - } - - public static boolean deep4707(boolean x) { - return deep4708(x); - } - - public static boolean deep4708(boolean x) { - return deep4709(x); - } - - public static boolean deep4709(boolean x) { - return deep4710(x); - } - - public static boolean deep4710(boolean x) { - return deep4711(x); - } - - public static boolean deep4711(boolean x) { - return deep4712(x); - } - - public static boolean deep4712(boolean x) { - return deep4713(x); - } - - public static boolean deep4713(boolean x) { - return deep4714(x); - } - - public static boolean deep4714(boolean x) { - return deep4715(x); - } - - public static boolean deep4715(boolean x) { - return deep4716(x); - } - - public static boolean deep4716(boolean x) { - return deep4717(x); - } - - public static boolean deep4717(boolean x) { - return deep4718(x); - } - - public static boolean deep4718(boolean x) { - return deep4719(x); - } - - public static boolean deep4719(boolean x) { - return deep4720(x); - } - - public static boolean deep4720(boolean x) { - return deep4721(x); - } - - public static boolean deep4721(boolean x) { - return deep4722(x); - } - - public static boolean deep4722(boolean x) { - return deep4723(x); - } - - public static boolean deep4723(boolean x) { - return deep4724(x); - } - - public static boolean deep4724(boolean x) { - return deep4725(x); - } - - public static boolean deep4725(boolean x) { - return deep4726(x); - } - - public static boolean deep4726(boolean x) { - return deep4727(x); - } - - public static boolean deep4727(boolean x) { - return deep4728(x); - } - - public static boolean deep4728(boolean x) { - return deep4729(x); - } - - public static boolean deep4729(boolean x) { - return deep4730(x); - } - - public static boolean deep4730(boolean x) { - return deep4731(x); - } - - public static boolean deep4731(boolean x) { - return deep4732(x); - } - - public static boolean deep4732(boolean x) { - return deep4733(x); - } - - public static boolean deep4733(boolean x) { - return deep4734(x); - } - - public static boolean deep4734(boolean x) { - return deep4735(x); - } - - public static boolean deep4735(boolean x) { - return deep4736(x); - } - - public static boolean deep4736(boolean x) { - return deep4737(x); - } - - public static boolean deep4737(boolean x) { - return deep4738(x); - } - - public static boolean deep4738(boolean x) { - return deep4739(x); - } - - public static boolean deep4739(boolean x) { - return deep4740(x); - } - - public static boolean deep4740(boolean x) { - return deep4741(x); - } - - public static boolean deep4741(boolean x) { - return deep4742(x); - } - - public static boolean deep4742(boolean x) { - return deep4743(x); - } - - public static boolean deep4743(boolean x) { - return deep4744(x); - } - - public static boolean deep4744(boolean x) { - return deep4745(x); - } - - public static boolean deep4745(boolean x) { - return deep4746(x); - } - - public static boolean deep4746(boolean x) { - return deep4747(x); - } - - public static boolean deep4747(boolean x) { - return deep4748(x); - } - - public static boolean deep4748(boolean x) { - return deep4749(x); - } - - public static boolean deep4749(boolean x) { - return deep4750(x); - } - - public static boolean deep4750(boolean x) { - return deep4751(x); - } - - public static boolean deep4751(boolean x) { - return deep4752(x); - } - - public static boolean deep4752(boolean x) { - return deep4753(x); - } - - public static boolean deep4753(boolean x) { - return deep4754(x); - } - - public static boolean deep4754(boolean x) { - return deep4755(x); - } - - public static boolean deep4755(boolean x) { - return deep4756(x); - } - - public static boolean deep4756(boolean x) { - return deep4757(x); - } - - public static boolean deep4757(boolean x) { - return deep4758(x); - } - - public static boolean deep4758(boolean x) { - return deep4759(x); - } - - public static boolean deep4759(boolean x) { - return deep4760(x); - } - - public static boolean deep4760(boolean x) { - return deep4761(x); - } - - public static boolean deep4761(boolean x) { - return deep4762(x); - } - - public static boolean deep4762(boolean x) { - return deep4763(x); - } - - public static boolean deep4763(boolean x) { - return deep4764(x); - } - - public static boolean deep4764(boolean x) { - return deep4765(x); - } - - public static boolean deep4765(boolean x) { - return deep4766(x); - } - - public static boolean deep4766(boolean x) { - return deep4767(x); - } - - public static boolean deep4767(boolean x) { - return deep4768(x); - } - - public static boolean deep4768(boolean x) { - return deep4769(x); - } - - public static boolean deep4769(boolean x) { - return deep4770(x); - } - - public static boolean deep4770(boolean x) { - return deep4771(x); - } - - public static boolean deep4771(boolean x) { - return deep4772(x); - } - - public static boolean deep4772(boolean x) { - return deep4773(x); - } - - public static boolean deep4773(boolean x) { - return deep4774(x); - } - - public static boolean deep4774(boolean x) { - return deep4775(x); - } - - public static boolean deep4775(boolean x) { - return deep4776(x); - } - - public static boolean deep4776(boolean x) { - return deep4777(x); - } - - public static boolean deep4777(boolean x) { - return deep4778(x); - } - - public static boolean deep4778(boolean x) { - return deep4779(x); - } - - public static boolean deep4779(boolean x) { - return deep4780(x); - } - - public static boolean deep4780(boolean x) { - return deep4781(x); - } - - public static boolean deep4781(boolean x) { - return deep4782(x); - } - - public static boolean deep4782(boolean x) { - return deep4783(x); - } - - public static boolean deep4783(boolean x) { - return deep4784(x); - } - - public static boolean deep4784(boolean x) { - return deep4785(x); - } - - public static boolean deep4785(boolean x) { - return deep4786(x); - } - - public static boolean deep4786(boolean x) { - return deep4787(x); - } - - public static boolean deep4787(boolean x) { - return deep4788(x); - } - - public static boolean deep4788(boolean x) { - return deep4789(x); - } - - public static boolean deep4789(boolean x) { - return deep4790(x); - } - - public static boolean deep4790(boolean x) { - return deep4791(x); - } - - public static boolean deep4791(boolean x) { - return deep4792(x); - } - - public static boolean deep4792(boolean x) { - return deep4793(x); - } - - public static boolean deep4793(boolean x) { - return deep4794(x); - } - - public static boolean deep4794(boolean x) { - return deep4795(x); - } - - public static boolean deep4795(boolean x) { - return deep4796(x); - } - - public static boolean deep4796(boolean x) { - return deep4797(x); - } - - public static boolean deep4797(boolean x) { - return deep4798(x); - } - - public static boolean deep4798(boolean x) { - return deep4799(x); - } - - public static boolean deep4799(boolean x) { - return deep4800(x); - } - - public static boolean deep4800(boolean x) { - return deep4801(x); - } - - public static boolean deep4801(boolean x) { - return deep4802(x); - } - - public static boolean deep4802(boolean x) { - return deep4803(x); - } - - public static boolean deep4803(boolean x) { - return deep4804(x); - } - - public static boolean deep4804(boolean x) { - return deep4805(x); - } - - public static boolean deep4805(boolean x) { - return deep4806(x); - } - - public static boolean deep4806(boolean x) { - return deep4807(x); - } - - public static boolean deep4807(boolean x) { - return deep4808(x); - } - - public static boolean deep4808(boolean x) { - return deep4809(x); - } - - public static boolean deep4809(boolean x) { - return deep4810(x); - } - - public static boolean deep4810(boolean x) { - return deep4811(x); - } - - public static boolean deep4811(boolean x) { - return deep4812(x); - } - - public static boolean deep4812(boolean x) { - return deep4813(x); - } - - public static boolean deep4813(boolean x) { - return deep4814(x); - } - - public static boolean deep4814(boolean x) { - return deep4815(x); - } - - public static boolean deep4815(boolean x) { - return deep4816(x); - } - - public static boolean deep4816(boolean x) { - return deep4817(x); - } - - public static boolean deep4817(boolean x) { - return deep4818(x); - } - - public static boolean deep4818(boolean x) { - return deep4819(x); - } - - public static boolean deep4819(boolean x) { - return deep4820(x); - } - - public static boolean deep4820(boolean x) { - return deep4821(x); - } - - public static boolean deep4821(boolean x) { - return deep4822(x); - } - - public static boolean deep4822(boolean x) { - return deep4823(x); - } - - public static boolean deep4823(boolean x) { - return deep4824(x); - } - - public static boolean deep4824(boolean x) { - return deep4825(x); - } - - public static boolean deep4825(boolean x) { - return deep4826(x); - } - - public static boolean deep4826(boolean x) { - return deep4827(x); - } - - public static boolean deep4827(boolean x) { - return deep4828(x); - } - - public static boolean deep4828(boolean x) { - return deep4829(x); - } - - public static boolean deep4829(boolean x) { - return deep4830(x); - } - - public static boolean deep4830(boolean x) { - return deep4831(x); - } - - public static boolean deep4831(boolean x) { - return deep4832(x); - } - - public static boolean deep4832(boolean x) { - return deep4833(x); - } - - public static boolean deep4833(boolean x) { - return deep4834(x); - } - - public static boolean deep4834(boolean x) { - return deep4835(x); - } - - public static boolean deep4835(boolean x) { - return deep4836(x); - } - - public static boolean deep4836(boolean x) { - return deep4837(x); - } - - public static boolean deep4837(boolean x) { - return deep4838(x); - } - - public static boolean deep4838(boolean x) { - return deep4839(x); - } - - public static boolean deep4839(boolean x) { - return deep4840(x); - } - - public static boolean deep4840(boolean x) { - return deep4841(x); - } - - public static boolean deep4841(boolean x) { - return deep4842(x); - } - - public static boolean deep4842(boolean x) { - return deep4843(x); - } - - public static boolean deep4843(boolean x) { - return deep4844(x); - } - - public static boolean deep4844(boolean x) { - return deep4845(x); - } - - public static boolean deep4845(boolean x) { - return deep4846(x); - } - - public static boolean deep4846(boolean x) { - return deep4847(x); - } - - public static boolean deep4847(boolean x) { - return deep4848(x); - } - - public static boolean deep4848(boolean x) { - return deep4849(x); - } - - public static boolean deep4849(boolean x) { - return deep4850(x); - } - - public static boolean deep4850(boolean x) { - return deep4851(x); - } - - public static boolean deep4851(boolean x) { - return deep4852(x); - } - - public static boolean deep4852(boolean x) { - return deep4853(x); - } - - public static boolean deep4853(boolean x) { - return deep4854(x); - } - - public static boolean deep4854(boolean x) { - return deep4855(x); - } - - public static boolean deep4855(boolean x) { - return deep4856(x); - } - - public static boolean deep4856(boolean x) { - return deep4857(x); - } - - public static boolean deep4857(boolean x) { - return deep4858(x); - } - - public static boolean deep4858(boolean x) { - return deep4859(x); - } - - public static boolean deep4859(boolean x) { - return deep4860(x); - } - - public static boolean deep4860(boolean x) { - return deep4861(x); - } - - public static boolean deep4861(boolean x) { - return deep4862(x); - } - - public static boolean deep4862(boolean x) { - return deep4863(x); - } - - public static boolean deep4863(boolean x) { - return deep4864(x); - } - - public static boolean deep4864(boolean x) { - return deep4865(x); - } - - public static boolean deep4865(boolean x) { - return deep4866(x); - } - - public static boolean deep4866(boolean x) { - return deep4867(x); - } - - public static boolean deep4867(boolean x) { - return deep4868(x); - } - - public static boolean deep4868(boolean x) { - return deep4869(x); - } - - public static boolean deep4869(boolean x) { - return deep4870(x); - } - - public static boolean deep4870(boolean x) { - return deep4871(x); - } - - public static boolean deep4871(boolean x) { - return deep4872(x); - } - - public static boolean deep4872(boolean x) { - return deep4873(x); - } - - public static boolean deep4873(boolean x) { - return deep4874(x); - } - - public static boolean deep4874(boolean x) { - return deep4875(x); - } - - public static boolean deep4875(boolean x) { - return deep4876(x); - } - - public static boolean deep4876(boolean x) { - return deep4877(x); - } - - public static boolean deep4877(boolean x) { - return deep4878(x); - } - - public static boolean deep4878(boolean x) { - return deep4879(x); - } - - public static boolean deep4879(boolean x) { - return deep4880(x); - } - - public static boolean deep4880(boolean x) { - return deep4881(x); - } - - public static boolean deep4881(boolean x) { - return deep4882(x); - } - - public static boolean deep4882(boolean x) { - return deep4883(x); - } - - public static boolean deep4883(boolean x) { - return deep4884(x); - } - - public static boolean deep4884(boolean x) { - return deep4885(x); - } - - public static boolean deep4885(boolean x) { - return deep4886(x); - } - - public static boolean deep4886(boolean x) { - return deep4887(x); - } - - public static boolean deep4887(boolean x) { - return deep4888(x); - } - - public static boolean deep4888(boolean x) { - return deep4889(x); - } - - public static boolean deep4889(boolean x) { - return deep4890(x); - } - - public static boolean deep4890(boolean x) { - return deep4891(x); - } - - public static boolean deep4891(boolean x) { - return deep4892(x); - } - - public static boolean deep4892(boolean x) { - return deep4893(x); - } - - public static boolean deep4893(boolean x) { - return deep4894(x); - } - - public static boolean deep4894(boolean x) { - return deep4895(x); - } - - public static boolean deep4895(boolean x) { - return deep4896(x); - } - - public static boolean deep4896(boolean x) { - return deep4897(x); - } - - public static boolean deep4897(boolean x) { - return deep4898(x); - } - - public static boolean deep4898(boolean x) { - return deep4899(x); - } - - public static boolean deep4899(boolean x) { - return deep4900(x); - } - - public static boolean deep4900(boolean x) { - return deep4901(x); - } - - public static boolean deep4901(boolean x) { - return deep4902(x); - } - - public static boolean deep4902(boolean x) { - return deep4903(x); - } - - public static boolean deep4903(boolean x) { - return deep4904(x); - } - - public static boolean deep4904(boolean x) { - return deep4905(x); - } - - public static boolean deep4905(boolean x) { - return deep4906(x); - } - - public static boolean deep4906(boolean x) { - return deep4907(x); - } - - public static boolean deep4907(boolean x) { - return deep4908(x); - } - - public static boolean deep4908(boolean x) { - return deep4909(x); - } - - public static boolean deep4909(boolean x) { - return deep4910(x); - } - - public static boolean deep4910(boolean x) { - return deep4911(x); - } - - public static boolean deep4911(boolean x) { - return deep4912(x); - } - - public static boolean deep4912(boolean x) { - return deep4913(x); - } - - public static boolean deep4913(boolean x) { - return deep4914(x); - } - - public static boolean deep4914(boolean x) { - return deep4915(x); - } - - public static boolean deep4915(boolean x) { - return deep4916(x); - } - - public static boolean deep4916(boolean x) { - return deep4917(x); - } - - public static boolean deep4917(boolean x) { - return deep4918(x); - } - - public static boolean deep4918(boolean x) { - return deep4919(x); - } - - public static boolean deep4919(boolean x) { - return deep4920(x); - } - - public static boolean deep4920(boolean x) { - return deep4921(x); - } - - public static boolean deep4921(boolean x) { - return deep4922(x); - } - - public static boolean deep4922(boolean x) { - return deep4923(x); - } - - public static boolean deep4923(boolean x) { - return deep4924(x); - } - - public static boolean deep4924(boolean x) { - return deep4925(x); - } - - public static boolean deep4925(boolean x) { - return deep4926(x); - } - - public static boolean deep4926(boolean x) { - return deep4927(x); - } - - public static boolean deep4927(boolean x) { - return deep4928(x); - } - - public static boolean deep4928(boolean x) { - return deep4929(x); - } - - public static boolean deep4929(boolean x) { - return deep4930(x); - } - - public static boolean deep4930(boolean x) { - return deep4931(x); - } - - public static boolean deep4931(boolean x) { - return deep4932(x); - } - - public static boolean deep4932(boolean x) { - return deep4933(x); - } - - public static boolean deep4933(boolean x) { - return deep4934(x); - } - - public static boolean deep4934(boolean x) { - return deep4935(x); - } - - public static boolean deep4935(boolean x) { - return deep4936(x); - } - - public static boolean deep4936(boolean x) { - return deep4937(x); - } - - public static boolean deep4937(boolean x) { - return deep4938(x); - } - - public static boolean deep4938(boolean x) { - return deep4939(x); - } - - public static boolean deep4939(boolean x) { - return deep4940(x); - } - - public static boolean deep4940(boolean x) { - return deep4941(x); - } - - public static boolean deep4941(boolean x) { - return deep4942(x); - } - - public static boolean deep4942(boolean x) { - return deep4943(x); - } - - public static boolean deep4943(boolean x) { - return deep4944(x); - } - - public static boolean deep4944(boolean x) { - return deep4945(x); - } - - public static boolean deep4945(boolean x) { - return deep4946(x); - } - - public static boolean deep4946(boolean x) { - return deep4947(x); - } - - public static boolean deep4947(boolean x) { - return deep4948(x); - } - - public static boolean deep4948(boolean x) { - return deep4949(x); - } - - public static boolean deep4949(boolean x) { - return deep4950(x); - } - - public static boolean deep4950(boolean x) { - return deep4951(x); - } - - public static boolean deep4951(boolean x) { - return deep4952(x); - } - - public static boolean deep4952(boolean x) { - return deep4953(x); - } - - public static boolean deep4953(boolean x) { - return deep4954(x); - } - - public static boolean deep4954(boolean x) { - return deep4955(x); - } - - public static boolean deep4955(boolean x) { - return deep4956(x); - } - - public static boolean deep4956(boolean x) { - return deep4957(x); - } - - public static boolean deep4957(boolean x) { - return deep4958(x); - } - - public static boolean deep4958(boolean x) { - return deep4959(x); - } - - public static boolean deep4959(boolean x) { - return deep4960(x); - } - - public static boolean deep4960(boolean x) { - return deep4961(x); - } - - public static boolean deep4961(boolean x) { - return deep4962(x); - } - - public static boolean deep4962(boolean x) { - return deep4963(x); - } - - public static boolean deep4963(boolean x) { - return deep4964(x); - } - - public static boolean deep4964(boolean x) { - return deep4965(x); - } - - public static boolean deep4965(boolean x) { - return deep4966(x); - } - - public static boolean deep4966(boolean x) { - return deep4967(x); - } - - public static boolean deep4967(boolean x) { - return deep4968(x); - } - - public static boolean deep4968(boolean x) { - return deep4969(x); - } - - public static boolean deep4969(boolean x) { - return deep4970(x); - } - - public static boolean deep4970(boolean x) { - return deep4971(x); - } - - public static boolean deep4971(boolean x) { - return deep4972(x); - } - - public static boolean deep4972(boolean x) { - return deep4973(x); - } - - public static boolean deep4973(boolean x) { - return deep4974(x); - } - - public static boolean deep4974(boolean x) { - return deep4975(x); - } - - public static boolean deep4975(boolean x) { - return deep4976(x); - } - - public static boolean deep4976(boolean x) { - return deep4977(x); - } - - public static boolean deep4977(boolean x) { - return deep4978(x); - } - - public static boolean deep4978(boolean x) { - return deep4979(x); - } - - public static boolean deep4979(boolean x) { - return deep4980(x); - } - - public static boolean deep4980(boolean x) { - return deep4981(x); - } - - public static boolean deep4981(boolean x) { - return deep4982(x); - } - - public static boolean deep4982(boolean x) { - return deep4983(x); - } - - public static boolean deep4983(boolean x) { - return deep4984(x); - } - - public static boolean deep4984(boolean x) { - return deep4985(x); - } - - public static boolean deep4985(boolean x) { - return deep4986(x); - } - - public static boolean deep4986(boolean x) { - return deep4987(x); - } - - public static boolean deep4987(boolean x) { - return deep4988(x); - } - - public static boolean deep4988(boolean x) { - return deep4989(x); - } - - public static boolean deep4989(boolean x) { - return deep4990(x); - } - - public static boolean deep4990(boolean x) { - return deep4991(x); - } - - public static boolean deep4991(boolean x) { - return deep4992(x); - } - - public static boolean deep4992(boolean x) { - return deep4993(x); - } - - public static boolean deep4993(boolean x) { - return deep4994(x); - } - - public static boolean deep4994(boolean x) { - return deep4995(x); - } - - public static boolean deep4995(boolean x) { - return deep4996(x); - } - - public static boolean deep4996(boolean x) { - return deep4997(x); - } - - public static boolean deep4997(boolean x) { - return deep4998(x); - } - - public static boolean deep4998(boolean x) { - return deep4999(x); - } - - public static boolean deep4999(boolean x) { - return deep5000(x); - } - - public static boolean deep5000(boolean x) { - return deep5001(x); - } - - public static boolean deep5001(boolean x) { - return deep5002(x); - } - - public static boolean deep5002(boolean x) { - return deep5003(x); - } - - public static boolean deep5003(boolean x) { - return deep5004(x); - } - - public static boolean deep5004(boolean x) { - return deep5005(x); - } - - public static boolean deep5005(boolean x) { - return deep5006(x); - } - - public static boolean deep5006(boolean x) { - return deep5007(x); - } - - public static boolean deep5007(boolean x) { - return deep5008(x); - } - - public static boolean deep5008(boolean x) { - return deep5009(x); - } - - public static boolean deep5009(boolean x) { - return deep5010(x); - } - - public static boolean deep5010(boolean x) { - return deep5011(x); - } - - public static boolean deep5011(boolean x) { - return deep5012(x); - } - - public static boolean deep5012(boolean x) { - return deep5013(x); - } - - public static boolean deep5013(boolean x) { - return deep5014(x); - } - - public static boolean deep5014(boolean x) { - return deep5015(x); - } - - public static boolean deep5015(boolean x) { - return deep5016(x); - } - - public static boolean deep5016(boolean x) { - return deep5017(x); - } - - public static boolean deep5017(boolean x) { - return deep5018(x); - } - - public static boolean deep5018(boolean x) { - return deep5019(x); - } - - public static boolean deep5019(boolean x) { - return deep5020(x); - } - - public static boolean deep5020(boolean x) { - return deep5021(x); - } - - public static boolean deep5021(boolean x) { - return deep5022(x); - } - - public static boolean deep5022(boolean x) { - return deep5023(x); - } - - public static boolean deep5023(boolean x) { - return deep5024(x); - } - - public static boolean deep5024(boolean x) { - return deep5025(x); - } - - public static boolean deep5025(boolean x) { - return deep5026(x); - } - - public static boolean deep5026(boolean x) { - return deep5027(x); - } - - public static boolean deep5027(boolean x) { - return deep5028(x); - } - - public static boolean deep5028(boolean x) { - return deep5029(x); - } - - public static boolean deep5029(boolean x) { - return deep5030(x); - } - - public static boolean deep5030(boolean x) { - return deep5031(x); - } - - public static boolean deep5031(boolean x) { - return deep5032(x); - } - - public static boolean deep5032(boolean x) { - return deep5033(x); - } - - public static boolean deep5033(boolean x) { - return deep5034(x); - } - - public static boolean deep5034(boolean x) { - return deep5035(x); - } - - public static boolean deep5035(boolean x) { - return deep5036(x); - } - - public static boolean deep5036(boolean x) { - return deep5037(x); - } - - public static boolean deep5037(boolean x) { - return deep5038(x); - } - - public static boolean deep5038(boolean x) { - return deep5039(x); - } - - public static boolean deep5039(boolean x) { - return deep5040(x); - } - - public static boolean deep5040(boolean x) { - return deep5041(x); - } - - public static boolean deep5041(boolean x) { - return deep5042(x); - } - - public static boolean deep5042(boolean x) { - return deep5043(x); - } - - public static boolean deep5043(boolean x) { - return deep5044(x); - } - - public static boolean deep5044(boolean x) { - return deep5045(x); - } - - public static boolean deep5045(boolean x) { - return deep5046(x); - } - - public static boolean deep5046(boolean x) { - return deep5047(x); - } - - public static boolean deep5047(boolean x) { - return deep5048(x); - } - - public static boolean deep5048(boolean x) { - return deep5049(x); - } - - public static boolean deep5049(boolean x) { - return deep5050(x); - } - - public static boolean deep5050(boolean x) { - return deep5051(x); - } - - public static boolean deep5051(boolean x) { - return deep5052(x); - } - - public static boolean deep5052(boolean x) { - return deep5053(x); - } - - public static boolean deep5053(boolean x) { - return deep5054(x); - } - - public static boolean deep5054(boolean x) { - return deep5055(x); - } - - public static boolean deep5055(boolean x) { - return deep5056(x); - } - - public static boolean deep5056(boolean x) { - return deep5057(x); - } - - public static boolean deep5057(boolean x) { - return deep5058(x); - } - - public static boolean deep5058(boolean x) { - return deep5059(x); - } - - public static boolean deep5059(boolean x) { - return deep5060(x); - } - - public static boolean deep5060(boolean x) { - return deep5061(x); - } - - public static boolean deep5061(boolean x) { - return deep5062(x); - } - - public static boolean deep5062(boolean x) { - return deep5063(x); - } - - public static boolean deep5063(boolean x) { - return deep5064(x); - } - - public static boolean deep5064(boolean x) { - return deep5065(x); - } - - public static boolean deep5065(boolean x) { - return deep5066(x); - } - - public static boolean deep5066(boolean x) { - return deep5067(x); - } - - public static boolean deep5067(boolean x) { - return deep5068(x); - } - - public static boolean deep5068(boolean x) { - return deep5069(x); - } - - public static boolean deep5069(boolean x) { - return deep5070(x); - } - - public static boolean deep5070(boolean x) { - return deep5071(x); - } - - public static boolean deep5071(boolean x) { - return deep5072(x); - } - - public static boolean deep5072(boolean x) { - return deep5073(x); - } - - public static boolean deep5073(boolean x) { - return deep5074(x); - } - - public static boolean deep5074(boolean x) { - return deep5075(x); - } - - public static boolean deep5075(boolean x) { - return deep5076(x); - } - - public static boolean deep5076(boolean x) { - return deep5077(x); - } - - public static boolean deep5077(boolean x) { - return deep5078(x); - } - - public static boolean deep5078(boolean x) { - return deep5079(x); - } - - public static boolean deep5079(boolean x) { - return deep5080(x); - } - - public static boolean deep5080(boolean x) { - return deep5081(x); - } - - public static boolean deep5081(boolean x) { - return deep5082(x); - } - - public static boolean deep5082(boolean x) { - return deep5083(x); - } - - public static boolean deep5083(boolean x) { - return deep5084(x); - } - - public static boolean deep5084(boolean x) { - return deep5085(x); - } - - public static boolean deep5085(boolean x) { - return deep5086(x); - } - - public static boolean deep5086(boolean x) { - return deep5087(x); - } - - public static boolean deep5087(boolean x) { - return deep5088(x); - } - - public static boolean deep5088(boolean x) { - return deep5089(x); - } - - public static boolean deep5089(boolean x) { - return deep5090(x); - } - - public static boolean deep5090(boolean x) { - return deep5091(x); - } - - public static boolean deep5091(boolean x) { - return deep5092(x); - } - - public static boolean deep5092(boolean x) { - return deep5093(x); - } - - public static boolean deep5093(boolean x) { - return deep5094(x); - } - - public static boolean deep5094(boolean x) { - return deep5095(x); - } - - public static boolean deep5095(boolean x) { - return deep5096(x); - } - - public static boolean deep5096(boolean x) { - return deep5097(x); - } - - public static boolean deep5097(boolean x) { - return deep5098(x); - } - - public static boolean deep5098(boolean x) { - return deep5099(x); - } - - public static boolean deep5099(boolean x) { - return deep5100(x); - } - - public static boolean deep5100(boolean x) { - return deep5101(x); - } - - public static boolean deep5101(boolean x) { - return deep5102(x); - } - - public static boolean deep5102(boolean x) { - return deep5103(x); - } - - public static boolean deep5103(boolean x) { - return deep5104(x); - } - - public static boolean deep5104(boolean x) { - return deep5105(x); - } - - public static boolean deep5105(boolean x) { - return deep5106(x); - } - - public static boolean deep5106(boolean x) { - return deep5107(x); - } - - public static boolean deep5107(boolean x) { - return deep5108(x); - } - - public static boolean deep5108(boolean x) { - return deep5109(x); - } - - public static boolean deep5109(boolean x) { - return deep5110(x); - } - - public static boolean deep5110(boolean x) { - return deep5111(x); - } - - public static boolean deep5111(boolean x) { - return deep5112(x); - } - - public static boolean deep5112(boolean x) { - return deep5113(x); - } - - public static boolean deep5113(boolean x) { - return deep5114(x); - } - - public static boolean deep5114(boolean x) { - return deep5115(x); - } - - public static boolean deep5115(boolean x) { - return deep5116(x); - } - - public static boolean deep5116(boolean x) { - return deep5117(x); - } - - public static boolean deep5117(boolean x) { - return deep5118(x); - } - - public static boolean deep5118(boolean x) { - return deep5119(x); - } - - public static boolean deep5119(boolean x) { - return deep5120(x); - } - - public static boolean deep5120(boolean x) { - return deep5121(x); - } - - public static boolean deep5121(boolean x) { - return deep5122(x); - } - - public static boolean deep5122(boolean x) { - return deep5123(x); - } - - public static boolean deep5123(boolean x) { - return deep5124(x); - } - - public static boolean deep5124(boolean x) { - return deep5125(x); - } - - public static boolean deep5125(boolean x) { - return deep5126(x); - } - - public static boolean deep5126(boolean x) { - return deep5127(x); - } - - public static boolean deep5127(boolean x) { - return deep5128(x); - } - - public static boolean deep5128(boolean x) { - return deep5129(x); - } - - public static boolean deep5129(boolean x) { - return deep5130(x); - } - - public static boolean deep5130(boolean x) { - return deep5131(x); - } - - public static boolean deep5131(boolean x) { - return deep5132(x); - } - - public static boolean deep5132(boolean x) { - return deep5133(x); - } - - public static boolean deep5133(boolean x) { - return deep5134(x); - } - - public static boolean deep5134(boolean x) { - return deep5135(x); - } - - public static boolean deep5135(boolean x) { - return deep5136(x); - } - - public static boolean deep5136(boolean x) { - return deep5137(x); - } - - public static boolean deep5137(boolean x) { - return deep5138(x); - } - - public static boolean deep5138(boolean x) { - return deep5139(x); - } - - public static boolean deep5139(boolean x) { - return deep5140(x); - } - - public static boolean deep5140(boolean x) { - return deep5141(x); - } - - public static boolean deep5141(boolean x) { - return deep5142(x); - } - - public static boolean deep5142(boolean x) { - return deep5143(x); - } - - public static boolean deep5143(boolean x) { - return deep5144(x); - } - - public static boolean deep5144(boolean x) { - return deep5145(x); - } - - public static boolean deep5145(boolean x) { - return deep5146(x); - } - - public static boolean deep5146(boolean x) { - return deep5147(x); - } - - public static boolean deep5147(boolean x) { - return deep5148(x); - } - - public static boolean deep5148(boolean x) { - return deep5149(x); - } - - public static boolean deep5149(boolean x) { - return deep5150(x); - } - - public static boolean deep5150(boolean x) { - return deep5151(x); - } - - public static boolean deep5151(boolean x) { - return deep5152(x); - } - - public static boolean deep5152(boolean x) { - return deep5153(x); - } - - public static boolean deep5153(boolean x) { - return deep5154(x); - } - - public static boolean deep5154(boolean x) { - return deep5155(x); - } - - public static boolean deep5155(boolean x) { - return deep5156(x); - } - - public static boolean deep5156(boolean x) { - return deep5157(x); - } - - public static boolean deep5157(boolean x) { - return deep5158(x); - } - - public static boolean deep5158(boolean x) { - return deep5159(x); - } - - public static boolean deep5159(boolean x) { - return deep5160(x); - } - - public static boolean deep5160(boolean x) { - return deep5161(x); - } - - public static boolean deep5161(boolean x) { - return deep5162(x); - } - - public static boolean deep5162(boolean x) { - return deep5163(x); - } - - public static boolean deep5163(boolean x) { - return deep5164(x); - } - - public static boolean deep5164(boolean x) { - return deep5165(x); - } - - public static boolean deep5165(boolean x) { - return deep5166(x); - } - - public static boolean deep5166(boolean x) { - return deep5167(x); - } - - public static boolean deep5167(boolean x) { - return deep5168(x); - } - - public static boolean deep5168(boolean x) { - return deep5169(x); - } - - public static boolean deep5169(boolean x) { - return deep5170(x); - } - - public static boolean deep5170(boolean x) { - return deep5171(x); - } - - public static boolean deep5171(boolean x) { - return deep5172(x); - } - - public static boolean deep5172(boolean x) { - return deep5173(x); - } - - public static boolean deep5173(boolean x) { - return deep5174(x); - } - - public static boolean deep5174(boolean x) { - return deep5175(x); - } - - public static boolean deep5175(boolean x) { - return deep5176(x); - } - - public static boolean deep5176(boolean x) { - return deep5177(x); - } - - public static boolean deep5177(boolean x) { - return deep5178(x); - } - - public static boolean deep5178(boolean x) { - return deep5179(x); - } - - public static boolean deep5179(boolean x) { - return deep5180(x); - } - - public static boolean deep5180(boolean x) { - return deep5181(x); - } - - public static boolean deep5181(boolean x) { - return deep5182(x); - } - - public static boolean deep5182(boolean x) { - return deep5183(x); - } - - public static boolean deep5183(boolean x) { - return deep5184(x); - } - - public static boolean deep5184(boolean x) { - return deep5185(x); - } - - public static boolean deep5185(boolean x) { - return deep5186(x); - } - - public static boolean deep5186(boolean x) { - return deep5187(x); - } - - public static boolean deep5187(boolean x) { - return deep5188(x); - } - - public static boolean deep5188(boolean x) { - return deep5189(x); - } - - public static boolean deep5189(boolean x) { - return deep5190(x); - } - - public static boolean deep5190(boolean x) { - return deep5191(x); - } - - public static boolean deep5191(boolean x) { - return deep5192(x); - } - - public static boolean deep5192(boolean x) { - return deep5193(x); - } - - public static boolean deep5193(boolean x) { - return deep5194(x); - } - - public static boolean deep5194(boolean x) { - return deep5195(x); - } - - public static boolean deep5195(boolean x) { - return deep5196(x); - } - - public static boolean deep5196(boolean x) { - return deep5197(x); - } - - public static boolean deep5197(boolean x) { - return deep5198(x); - } - - public static boolean deep5198(boolean x) { - return deep5199(x); - } - - public static boolean deep5199(boolean x) { - return deep5200(x); - } - - public static boolean deep5200(boolean x) { - return deep5201(x); - } - - public static boolean deep5201(boolean x) { - return deep5202(x); - } - - public static boolean deep5202(boolean x) { - return deep5203(x); - } - - public static boolean deep5203(boolean x) { - return deep5204(x); - } - - public static boolean deep5204(boolean x) { - return deep5205(x); - } - - public static boolean deep5205(boolean x) { - return deep5206(x); - } - - public static boolean deep5206(boolean x) { - return deep5207(x); - } - - public static boolean deep5207(boolean x) { - return deep5208(x); - } - - public static boolean deep5208(boolean x) { - return deep5209(x); - } - - public static boolean deep5209(boolean x) { - return deep5210(x); - } - - public static boolean deep5210(boolean x) { - return deep5211(x); - } - - public static boolean deep5211(boolean x) { - return deep5212(x); - } - - public static boolean deep5212(boolean x) { - return deep5213(x); - } - - public static boolean deep5213(boolean x) { - return deep5214(x); - } - - public static boolean deep5214(boolean x) { - return deep5215(x); - } - - public static boolean deep5215(boolean x) { - return deep5216(x); - } - - public static boolean deep5216(boolean x) { - return deep5217(x); - } - - public static boolean deep5217(boolean x) { - return deep5218(x); - } - - public static boolean deep5218(boolean x) { - return deep5219(x); - } - - public static boolean deep5219(boolean x) { - return deep5220(x); - } - - public static boolean deep5220(boolean x) { - return deep5221(x); - } - - public static boolean deep5221(boolean x) { - return deep5222(x); - } - - public static boolean deep5222(boolean x) { - return deep5223(x); - } - - public static boolean deep5223(boolean x) { - return deep5224(x); - } - - public static boolean deep5224(boolean x) { - return deep5225(x); - } - - public static boolean deep5225(boolean x) { - return deep5226(x); - } - - public static boolean deep5226(boolean x) { - return deep5227(x); - } - - public static boolean deep5227(boolean x) { - return deep5228(x); - } - - public static boolean deep5228(boolean x) { - return deep5229(x); - } - - public static boolean deep5229(boolean x) { - return deep5230(x); - } - - public static boolean deep5230(boolean x) { - return deep5231(x); - } - - public static boolean deep5231(boolean x) { - return deep5232(x); - } - - public static boolean deep5232(boolean x) { - return deep5233(x); - } - - public static boolean deep5233(boolean x) { - return deep5234(x); - } - - public static boolean deep5234(boolean x) { - return deep5235(x); - } - - public static boolean deep5235(boolean x) { - return deep5236(x); - } - - public static boolean deep5236(boolean x) { - return deep5237(x); - } - - public static boolean deep5237(boolean x) { - return deep5238(x); - } - - public static boolean deep5238(boolean x) { - return deep5239(x); - } - - public static boolean deep5239(boolean x) { - return deep5240(x); - } - - public static boolean deep5240(boolean x) { - return deep5241(x); - } - - public static boolean deep5241(boolean x) { - return deep5242(x); - } - - public static boolean deep5242(boolean x) { - return deep5243(x); - } - - public static boolean deep5243(boolean x) { - return deep5244(x); - } - - public static boolean deep5244(boolean x) { - return deep5245(x); - } - - public static boolean deep5245(boolean x) { - return deep5246(x); - } - - public static boolean deep5246(boolean x) { - return deep5247(x); - } - - public static boolean deep5247(boolean x) { - return deep5248(x); - } - - public static boolean deep5248(boolean x) { - return deep5249(x); - } - - public static boolean deep5249(boolean x) { - return deep5250(x); - } - - public static boolean deep5250(boolean x) { - return deep5251(x); - } - - public static boolean deep5251(boolean x) { - return deep5252(x); - } - - public static boolean deep5252(boolean x) { - return deep5253(x); - } - - public static boolean deep5253(boolean x) { - return deep5254(x); - } - - public static boolean deep5254(boolean x) { - return deep5255(x); - } - - public static boolean deep5255(boolean x) { - return deep5256(x); - } - - public static boolean deep5256(boolean x) { - return deep5257(x); - } - - public static boolean deep5257(boolean x) { - return deep5258(x); - } - - public static boolean deep5258(boolean x) { - return deep5259(x); - } - - public static boolean deep5259(boolean x) { - return deep5260(x); - } - - public static boolean deep5260(boolean x) { - return deep5261(x); - } - - public static boolean deep5261(boolean x) { - return deep5262(x); - } - - public static boolean deep5262(boolean x) { - return deep5263(x); - } - - public static boolean deep5263(boolean x) { - return deep5264(x); - } - - public static boolean deep5264(boolean x) { - return deep5265(x); - } - - public static boolean deep5265(boolean x) { - return deep5266(x); - } - - public static boolean deep5266(boolean x) { - return deep5267(x); - } - - public static boolean deep5267(boolean x) { - return deep5268(x); - } - - public static boolean deep5268(boolean x) { - return deep5269(x); - } - - public static boolean deep5269(boolean x) { - return deep5270(x); - } - - public static boolean deep5270(boolean x) { - return deep5271(x); - } - - public static boolean deep5271(boolean x) { - return deep5272(x); - } - - public static boolean deep5272(boolean x) { - return deep5273(x); - } - - public static boolean deep5273(boolean x) { - return deep5274(x); - } - - public static boolean deep5274(boolean x) { - return deep5275(x); - } - - public static boolean deep5275(boolean x) { - return deep5276(x); - } - - public static boolean deep5276(boolean x) { - return deep5277(x); - } - - public static boolean deep5277(boolean x) { - return deep5278(x); - } - - public static boolean deep5278(boolean x) { - return deep5279(x); - } - - public static boolean deep5279(boolean x) { - return deep5280(x); - } - - public static boolean deep5280(boolean x) { - return deep5281(x); - } - - public static boolean deep5281(boolean x) { - return deep5282(x); - } - - public static boolean deep5282(boolean x) { - return deep5283(x); - } - - public static boolean deep5283(boolean x) { - return deep5284(x); - } - - public static boolean deep5284(boolean x) { - return deep5285(x); - } - - public static boolean deep5285(boolean x) { - return deep5286(x); - } - - public static boolean deep5286(boolean x) { - return deep5287(x); - } - - public static boolean deep5287(boolean x) { - return deep5288(x); - } - - public static boolean deep5288(boolean x) { - return deep5289(x); - } - - public static boolean deep5289(boolean x) { - return deep5290(x); - } - - public static boolean deep5290(boolean x) { - return deep5291(x); - } - - public static boolean deep5291(boolean x) { - return deep5292(x); - } - - public static boolean deep5292(boolean x) { - return deep5293(x); - } - - public static boolean deep5293(boolean x) { - return deep5294(x); - } - - public static boolean deep5294(boolean x) { - return deep5295(x); - } - - public static boolean deep5295(boolean x) { - return deep5296(x); - } - - public static boolean deep5296(boolean x) { - return deep5297(x); - } - - public static boolean deep5297(boolean x) { - return deep5298(x); - } - - public static boolean deep5298(boolean x) { - return deep5299(x); - } - - public static boolean deep5299(boolean x) { - return deep5300(x); - } - - public static boolean deep5300(boolean x) { - return deep5301(x); - } - - public static boolean deep5301(boolean x) { - return deep5302(x); - } - - public static boolean deep5302(boolean x) { - return deep5303(x); - } - - public static boolean deep5303(boolean x) { - return deep5304(x); - } - - public static boolean deep5304(boolean x) { - return deep5305(x); - } - - public static boolean deep5305(boolean x) { - return deep5306(x); - } - - public static boolean deep5306(boolean x) { - return deep5307(x); - } - - public static boolean deep5307(boolean x) { - return deep5308(x); - } - - public static boolean deep5308(boolean x) { - return deep5309(x); - } - - public static boolean deep5309(boolean x) { - return deep5310(x); - } - - public static boolean deep5310(boolean x) { - return deep5311(x); - } - - public static boolean deep5311(boolean x) { - return deep5312(x); - } - - public static boolean deep5312(boolean x) { - return deep5313(x); - } - - public static boolean deep5313(boolean x) { - return deep5314(x); - } - - public static boolean deep5314(boolean x) { - return deep5315(x); - } - - public static boolean deep5315(boolean x) { - return deep5316(x); - } - - public static boolean deep5316(boolean x) { - return deep5317(x); - } - - public static boolean deep5317(boolean x) { - return deep5318(x); - } - - public static boolean deep5318(boolean x) { - return deep5319(x); - } - - public static boolean deep5319(boolean x) { - return deep5320(x); - } - - public static boolean deep5320(boolean x) { - return deep5321(x); - } - - public static boolean deep5321(boolean x) { - return deep5322(x); - } - - public static boolean deep5322(boolean x) { - return deep5323(x); - } - - public static boolean deep5323(boolean x) { - return deep5324(x); - } - - public static boolean deep5324(boolean x) { - return deep5325(x); - } - - public static boolean deep5325(boolean x) { - return deep5326(x); - } - - public static boolean deep5326(boolean x) { - return deep5327(x); - } - - public static boolean deep5327(boolean x) { - return deep5328(x); - } - - public static boolean deep5328(boolean x) { - return deep5329(x); - } - - public static boolean deep5329(boolean x) { - return deep5330(x); - } - - public static boolean deep5330(boolean x) { - return deep5331(x); - } - - public static boolean deep5331(boolean x) { - return deep5332(x); - } - - public static boolean deep5332(boolean x) { - return deep5333(x); - } - - public static boolean deep5333(boolean x) { - return deep5334(x); - } - - public static boolean deep5334(boolean x) { - return deep5335(x); - } - - public static boolean deep5335(boolean x) { - return deep5336(x); - } - - public static boolean deep5336(boolean x) { - return deep5337(x); - } - - public static boolean deep5337(boolean x) { - return deep5338(x); - } - - public static boolean deep5338(boolean x) { - return deep5339(x); - } - - public static boolean deep5339(boolean x) { - return deep5340(x); - } - - public static boolean deep5340(boolean x) { - return deep5341(x); - } - - public static boolean deep5341(boolean x) { - return deep5342(x); - } - - public static boolean deep5342(boolean x) { - return deep5343(x); - } - - public static boolean deep5343(boolean x) { - return deep5344(x); - } - - public static boolean deep5344(boolean x) { - return deep5345(x); - } - - public static boolean deep5345(boolean x) { - return deep5346(x); - } - - public static boolean deep5346(boolean x) { - return deep5347(x); - } - - public static boolean deep5347(boolean x) { - return deep5348(x); - } - - public static boolean deep5348(boolean x) { - return deep5349(x); - } - - public static boolean deep5349(boolean x) { - return deep5350(x); - } - - public static boolean deep5350(boolean x) { - return deep5351(x); - } - - public static boolean deep5351(boolean x) { - return deep5352(x); - } - - public static boolean deep5352(boolean x) { - return deep5353(x); - } - - public static boolean deep5353(boolean x) { - return deep5354(x); - } - - public static boolean deep5354(boolean x) { - return deep5355(x); - } - - public static boolean deep5355(boolean x) { - return deep5356(x); - } - - public static boolean deep5356(boolean x) { - return deep5357(x); - } - - public static boolean deep5357(boolean x) { - return deep5358(x); - } - - public static boolean deep5358(boolean x) { - return deep5359(x); - } - - public static boolean deep5359(boolean x) { - return deep5360(x); - } - - public static boolean deep5360(boolean x) { - return deep5361(x); - } - - public static boolean deep5361(boolean x) { - return deep5362(x); - } - - public static boolean deep5362(boolean x) { - return deep5363(x); - } - - public static boolean deep5363(boolean x) { - return deep5364(x); - } - - public static boolean deep5364(boolean x) { - return deep5365(x); - } - - public static boolean deep5365(boolean x) { - return deep5366(x); - } - - public static boolean deep5366(boolean x) { - return deep5367(x); - } - - public static boolean deep5367(boolean x) { - return deep5368(x); - } - - public static boolean deep5368(boolean x) { - return deep5369(x); - } - - public static boolean deep5369(boolean x) { - return deep5370(x); - } - - public static boolean deep5370(boolean x) { - return deep5371(x); - } - - public static boolean deep5371(boolean x) { - return deep5372(x); - } - - public static boolean deep5372(boolean x) { - return deep5373(x); - } - - public static boolean deep5373(boolean x) { - return deep5374(x); - } - - public static boolean deep5374(boolean x) { - return deep5375(x); - } - - public static boolean deep5375(boolean x) { - return deep5376(x); - } - - public static boolean deep5376(boolean x) { - return deep5377(x); - } - - public static boolean deep5377(boolean x) { - return deep5378(x); - } - - public static boolean deep5378(boolean x) { - return deep5379(x); - } - - public static boolean deep5379(boolean x) { - return deep5380(x); - } - - public static boolean deep5380(boolean x) { - return deep5381(x); - } - - public static boolean deep5381(boolean x) { - return deep5382(x); - } - - public static boolean deep5382(boolean x) { - return deep5383(x); - } - - public static boolean deep5383(boolean x) { - return deep5384(x); - } - - public static boolean deep5384(boolean x) { - return deep5385(x); - } - - public static boolean deep5385(boolean x) { - return deep5386(x); - } - - public static boolean deep5386(boolean x) { - return deep5387(x); - } - - public static boolean deep5387(boolean x) { - return deep5388(x); - } - - public static boolean deep5388(boolean x) { - return deep5389(x); - } - - public static boolean deep5389(boolean x) { - return deep5390(x); - } - - public static boolean deep5390(boolean x) { - return deep5391(x); - } - - public static boolean deep5391(boolean x) { - return deep5392(x); - } - - public static boolean deep5392(boolean x) { - return deep5393(x); - } - - public static boolean deep5393(boolean x) { - return deep5394(x); - } - - public static boolean deep5394(boolean x) { - return deep5395(x); - } - - public static boolean deep5395(boolean x) { - return deep5396(x); - } - - public static boolean deep5396(boolean x) { - return deep5397(x); - } - - public static boolean deep5397(boolean x) { - return deep5398(x); - } - - public static boolean deep5398(boolean x) { - return deep5399(x); - } - - public static boolean deep5399(boolean x) { - return deep5400(x); - } - - public static boolean deep5400(boolean x) { - return deep5401(x); - } - - public static boolean deep5401(boolean x) { - return deep5402(x); - } - - public static boolean deep5402(boolean x) { - return deep5403(x); - } - - public static boolean deep5403(boolean x) { - return deep5404(x); - } - - public static boolean deep5404(boolean x) { - return deep5405(x); - } - - public static boolean deep5405(boolean x) { - return deep5406(x); - } - - public static boolean deep5406(boolean x) { - return deep5407(x); - } - - public static boolean deep5407(boolean x) { - return deep5408(x); - } - - public static boolean deep5408(boolean x) { - return deep5409(x); - } - - public static boolean deep5409(boolean x) { - return deep5410(x); - } - - public static boolean deep5410(boolean x) { - return deep5411(x); - } - - public static boolean deep5411(boolean x) { - return deep5412(x); - } - - public static boolean deep5412(boolean x) { - return deep5413(x); - } - - public static boolean deep5413(boolean x) { - return deep5414(x); - } - - public static boolean deep5414(boolean x) { - return deep5415(x); - } - - public static boolean deep5415(boolean x) { - return deep5416(x); - } - - public static boolean deep5416(boolean x) { - return deep5417(x); - } - - public static boolean deep5417(boolean x) { - return deep5418(x); - } - - public static boolean deep5418(boolean x) { - return deep5419(x); - } - - public static boolean deep5419(boolean x) { - return deep5420(x); - } - - public static boolean deep5420(boolean x) { - return deep5421(x); - } - - public static boolean deep5421(boolean x) { - return deep5422(x); - } - - public static boolean deep5422(boolean x) { - return deep5423(x); - } - - public static boolean deep5423(boolean x) { - return deep5424(x); - } - - public static boolean deep5424(boolean x) { - return deep5425(x); - } - - public static boolean deep5425(boolean x) { - return deep5426(x); - } - - public static boolean deep5426(boolean x) { - return deep5427(x); - } - - public static boolean deep5427(boolean x) { - return deep5428(x); - } - - public static boolean deep5428(boolean x) { - return deep5429(x); - } - - public static boolean deep5429(boolean x) { - return deep5430(x); - } - - public static boolean deep5430(boolean x) { - return deep5431(x); - } - - public static boolean deep5431(boolean x) { - return deep5432(x); - } - - public static boolean deep5432(boolean x) { - return deep5433(x); - } - - public static boolean deep5433(boolean x) { - return deep5434(x); - } - - public static boolean deep5434(boolean x) { - return deep5435(x); - } - - public static boolean deep5435(boolean x) { - return deep5436(x); - } - - public static boolean deep5436(boolean x) { - return deep5437(x); - } - - public static boolean deep5437(boolean x) { - return deep5438(x); - } - - public static boolean deep5438(boolean x) { - return deep5439(x); - } - - public static boolean deep5439(boolean x) { - return deep5440(x); - } - - public static boolean deep5440(boolean x) { - return deep5441(x); - } - - public static boolean deep5441(boolean x) { - return deep5442(x); - } - - public static boolean deep5442(boolean x) { - return deep5443(x); - } - - public static boolean deep5443(boolean x) { - return deep5444(x); - } - - public static boolean deep5444(boolean x) { - return deep5445(x); - } - - public static boolean deep5445(boolean x) { - return deep5446(x); - } - - public static boolean deep5446(boolean x) { - return deep5447(x); - } - - public static boolean deep5447(boolean x) { - return deep5448(x); - } - - public static boolean deep5448(boolean x) { - return deep5449(x); - } - - public static boolean deep5449(boolean x) { - return deep5450(x); - } - - public static boolean deep5450(boolean x) { - return deep5451(x); - } - - public static boolean deep5451(boolean x) { - return deep5452(x); - } - - public static boolean deep5452(boolean x) { - return deep5453(x); - } - - public static boolean deep5453(boolean x) { - return deep5454(x); - } - - public static boolean deep5454(boolean x) { - return deep5455(x); - } - - public static boolean deep5455(boolean x) { - return deep5456(x); - } - - public static boolean deep5456(boolean x) { - return deep5457(x); - } - - public static boolean deep5457(boolean x) { - return deep5458(x); - } - - public static boolean deep5458(boolean x) { - return deep5459(x); - } - - public static boolean deep5459(boolean x) { - return deep5460(x); - } - - public static boolean deep5460(boolean x) { - return deep5461(x); - } - - public static boolean deep5461(boolean x) { - return deep5462(x); - } - - public static boolean deep5462(boolean x) { - return deep5463(x); - } - - public static boolean deep5463(boolean x) { - return deep5464(x); - } - - public static boolean deep5464(boolean x) { - return deep5465(x); - } - - public static boolean deep5465(boolean x) { - return deep5466(x); - } - - public static boolean deep5466(boolean x) { - return deep5467(x); - } - - public static boolean deep5467(boolean x) { - return deep5468(x); - } - - public static boolean deep5468(boolean x) { - return deep5469(x); - } - - public static boolean deep5469(boolean x) { - return deep5470(x); - } - - public static boolean deep5470(boolean x) { - return deep5471(x); - } - - public static boolean deep5471(boolean x) { - return deep5472(x); - } - - public static boolean deep5472(boolean x) { - return deep5473(x); - } - - public static boolean deep5473(boolean x) { - return deep5474(x); - } - - public static boolean deep5474(boolean x) { - return deep5475(x); - } - - public static boolean deep5475(boolean x) { - return deep5476(x); - } - - public static boolean deep5476(boolean x) { - return deep5477(x); - } - - public static boolean deep5477(boolean x) { - return deep5478(x); - } - - public static boolean deep5478(boolean x) { - return deep5479(x); - } - - public static boolean deep5479(boolean x) { - return deep5480(x); - } - - public static boolean deep5480(boolean x) { - return deep5481(x); - } - - public static boolean deep5481(boolean x) { - return deep5482(x); - } - - public static boolean deep5482(boolean x) { - return deep5483(x); - } - - public static boolean deep5483(boolean x) { - return deep5484(x); - } - - public static boolean deep5484(boolean x) { - return deep5485(x); - } - - public static boolean deep5485(boolean x) { - return deep5486(x); - } - - public static boolean deep5486(boolean x) { - return deep5487(x); - } - - public static boolean deep5487(boolean x) { - return deep5488(x); - } - - public static boolean deep5488(boolean x) { - return deep5489(x); - } - - public static boolean deep5489(boolean x) { - return deep5490(x); - } - - public static boolean deep5490(boolean x) { - return deep5491(x); - } - - public static boolean deep5491(boolean x) { - return deep5492(x); - } - - public static boolean deep5492(boolean x) { - return deep5493(x); - } - - public static boolean deep5493(boolean x) { - return deep5494(x); - } - - public static boolean deep5494(boolean x) { - return deep5495(x); - } - - public static boolean deep5495(boolean x) { - return deep5496(x); - } - - public static boolean deep5496(boolean x) { - return deep5497(x); - } - - public static boolean deep5497(boolean x) { - return deep5498(x); - } - - public static boolean deep5498(boolean x) { - return deep5499(x); - } - - public static boolean deep5499(boolean x) { - return deep5500(x); - } - - public static boolean deep5500(boolean x) { - return deep5501(x); - } - - public static boolean deep5501(boolean x) { - return deep5502(x); - } - - public static boolean deep5502(boolean x) { - return deep5503(x); - } - - public static boolean deep5503(boolean x) { - return deep5504(x); - } - - public static boolean deep5504(boolean x) { - return deep5505(x); - } - - public static boolean deep5505(boolean x) { - return deep5506(x); - } - - public static boolean deep5506(boolean x) { - return deep5507(x); - } - - public static boolean deep5507(boolean x) { - return deep5508(x); - } - - public static boolean deep5508(boolean x) { - return deep5509(x); - } - - public static boolean deep5509(boolean x) { - return deep5510(x); - } - - public static boolean deep5510(boolean x) { - return deep5511(x); - } - - public static boolean deep5511(boolean x) { - return deep5512(x); - } - - public static boolean deep5512(boolean x) { - return deep5513(x); - } - - public static boolean deep5513(boolean x) { - return deep5514(x); - } - - public static boolean deep5514(boolean x) { - return deep5515(x); - } - - public static boolean deep5515(boolean x) { - return deep5516(x); - } - - public static boolean deep5516(boolean x) { - return deep5517(x); - } - - public static boolean deep5517(boolean x) { - return deep5518(x); - } - - public static boolean deep5518(boolean x) { - return deep5519(x); - } - - public static boolean deep5519(boolean x) { - return deep5520(x); - } - - public static boolean deep5520(boolean x) { - return deep5521(x); - } - - public static boolean deep5521(boolean x) { - return deep5522(x); - } - - public static boolean deep5522(boolean x) { - return deep5523(x); - } - - public static boolean deep5523(boolean x) { - return deep5524(x); - } - - public static boolean deep5524(boolean x) { - return deep5525(x); - } - - public static boolean deep5525(boolean x) { - return deep5526(x); - } - - public static boolean deep5526(boolean x) { - return deep5527(x); - } - - public static boolean deep5527(boolean x) { - return deep5528(x); - } - - public static boolean deep5528(boolean x) { - return deep5529(x); - } - - public static boolean deep5529(boolean x) { - return deep5530(x); - } - - public static boolean deep5530(boolean x) { - return deep5531(x); - } - - public static boolean deep5531(boolean x) { - return deep5532(x); - } - - public static boolean deep5532(boolean x) { - return deep5533(x); - } - - public static boolean deep5533(boolean x) { - return deep5534(x); - } - - public static boolean deep5534(boolean x) { - return deep5535(x); - } - - public static boolean deep5535(boolean x) { - return deep5536(x); - } - - public static boolean deep5536(boolean x) { - return deep5537(x); - } - - public static boolean deep5537(boolean x) { - return deep5538(x); - } - - public static boolean deep5538(boolean x) { - return deep5539(x); - } - - public static boolean deep5539(boolean x) { - return deep5540(x); - } - - public static boolean deep5540(boolean x) { - return deep5541(x); - } - - public static boolean deep5541(boolean x) { - return deep5542(x); - } - - public static boolean deep5542(boolean x) { - return deep5543(x); - } - - public static boolean deep5543(boolean x) { - return deep5544(x); - } - - public static boolean deep5544(boolean x) { - return deep5545(x); - } - - public static boolean deep5545(boolean x) { - return deep5546(x); - } - - public static boolean deep5546(boolean x) { - return deep5547(x); - } - - public static boolean deep5547(boolean x) { - return deep5548(x); - } - - public static boolean deep5548(boolean x) { - return deep5549(x); - } - - public static boolean deep5549(boolean x) { - return deep5550(x); - } - - public static boolean deep5550(boolean x) { - return deep5551(x); - } - - public static boolean deep5551(boolean x) { - return deep5552(x); - } - - public static boolean deep5552(boolean x) { - return deep5553(x); - } - - public static boolean deep5553(boolean x) { - return deep5554(x); - } - - public static boolean deep5554(boolean x) { - return deep5555(x); - } - - public static boolean deep5555(boolean x) { - return deep5556(x); - } - - public static boolean deep5556(boolean x) { - return deep5557(x); - } - - public static boolean deep5557(boolean x) { - return deep5558(x); - } - - public static boolean deep5558(boolean x) { - return deep5559(x); - } - - public static boolean deep5559(boolean x) { - return deep5560(x); - } - - public static boolean deep5560(boolean x) { - return deep5561(x); - } - - public static boolean deep5561(boolean x) { - return deep5562(x); - } - - public static boolean deep5562(boolean x) { - return deep5563(x); - } - - public static boolean deep5563(boolean x) { - return deep5564(x); - } - - public static boolean deep5564(boolean x) { - return deep5565(x); - } - - public static boolean deep5565(boolean x) { - return deep5566(x); - } - - public static boolean deep5566(boolean x) { - return deep5567(x); - } - - public static boolean deep5567(boolean x) { - return deep5568(x); - } - - public static boolean deep5568(boolean x) { - return deep5569(x); - } - - public static boolean deep5569(boolean x) { - return deep5570(x); - } - - public static boolean deep5570(boolean x) { - return deep5571(x); - } - - public static boolean deep5571(boolean x) { - return deep5572(x); - } - - public static boolean deep5572(boolean x) { - return deep5573(x); - } - - public static boolean deep5573(boolean x) { - return deep5574(x); - } - - public static boolean deep5574(boolean x) { - return deep5575(x); - } - - public static boolean deep5575(boolean x) { - return deep5576(x); - } - - public static boolean deep5576(boolean x) { - return deep5577(x); - } - - public static boolean deep5577(boolean x) { - return deep5578(x); - } - - public static boolean deep5578(boolean x) { - return deep5579(x); - } - - public static boolean deep5579(boolean x) { - return deep5580(x); - } - - public static boolean deep5580(boolean x) { - return deep5581(x); - } - - public static boolean deep5581(boolean x) { - return deep5582(x); - } - - public static boolean deep5582(boolean x) { - return deep5583(x); - } - - public static boolean deep5583(boolean x) { - return deep5584(x); - } - - public static boolean deep5584(boolean x) { - return deep5585(x); - } - - public static boolean deep5585(boolean x) { - return deep5586(x); - } - - public static boolean deep5586(boolean x) { - return deep5587(x); - } - - public static boolean deep5587(boolean x) { - return deep5588(x); - } - - public static boolean deep5588(boolean x) { - return deep5589(x); - } - - public static boolean deep5589(boolean x) { - return deep5590(x); - } - - public static boolean deep5590(boolean x) { - return deep5591(x); - } - - public static boolean deep5591(boolean x) { - return deep5592(x); - } - - public static boolean deep5592(boolean x) { - return deep5593(x); - } - - public static boolean deep5593(boolean x) { - return deep5594(x); - } - - public static boolean deep5594(boolean x) { - return deep5595(x); - } - - public static boolean deep5595(boolean x) { - return deep5596(x); - } - - public static boolean deep5596(boolean x) { - return deep5597(x); - } - - public static boolean deep5597(boolean x) { - return deep5598(x); - } - - public static boolean deep5598(boolean x) { - return deep5599(x); - } - - public static boolean deep5599(boolean x) { - return deep5600(x); - } - - public static boolean deep5600(boolean x) { - return deep5601(x); - } - - public static boolean deep5601(boolean x) { - return deep5602(x); - } - - public static boolean deep5602(boolean x) { - return deep5603(x); - } - - public static boolean deep5603(boolean x) { - return deep5604(x); - } - - public static boolean deep5604(boolean x) { - return deep5605(x); - } - - public static boolean deep5605(boolean x) { - return deep5606(x); - } - - public static boolean deep5606(boolean x) { - return deep5607(x); - } - - public static boolean deep5607(boolean x) { - return deep5608(x); - } - - public static boolean deep5608(boolean x) { - return deep5609(x); - } - - public static boolean deep5609(boolean x) { - return deep5610(x); - } - - public static boolean deep5610(boolean x) { - return deep5611(x); - } - - public static boolean deep5611(boolean x) { - return deep5612(x); - } - - public static boolean deep5612(boolean x) { - return deep5613(x); - } - - public static boolean deep5613(boolean x) { - return deep5614(x); - } - - public static boolean deep5614(boolean x) { - return deep5615(x); - } - - public static boolean deep5615(boolean x) { - return deep5616(x); - } - - public static boolean deep5616(boolean x) { - return deep5617(x); - } - - public static boolean deep5617(boolean x) { - return deep5618(x); - } - - public static boolean deep5618(boolean x) { - return deep5619(x); - } - - public static boolean deep5619(boolean x) { - return deep5620(x); - } - - public static boolean deep5620(boolean x) { - return deep5621(x); - } - - public static boolean deep5621(boolean x) { - return deep5622(x); - } - - public static boolean deep5622(boolean x) { - return deep5623(x); - } - - public static boolean deep5623(boolean x) { - return deep5624(x); - } - - public static boolean deep5624(boolean x) { - return deep5625(x); - } - - public static boolean deep5625(boolean x) { - return deep5626(x); - } - - public static boolean deep5626(boolean x) { - return deep5627(x); - } - - public static boolean deep5627(boolean x) { - return deep5628(x); - } - - public static boolean deep5628(boolean x) { - return deep5629(x); - } - - public static boolean deep5629(boolean x) { - return deep5630(x); - } - - public static boolean deep5630(boolean x) { - return deep5631(x); - } - - public static boolean deep5631(boolean x) { - return deep5632(x); - } - - public static boolean deep5632(boolean x) { - return deep5633(x); - } - - public static boolean deep5633(boolean x) { - return deep5634(x); - } - - public static boolean deep5634(boolean x) { - return deep5635(x); - } - - public static boolean deep5635(boolean x) { - return deep5636(x); - } - - public static boolean deep5636(boolean x) { - return deep5637(x); - } - - public static boolean deep5637(boolean x) { - return deep5638(x); - } - - public static boolean deep5638(boolean x) { - return deep5639(x); - } - - public static boolean deep5639(boolean x) { - return deep5640(x); - } - - public static boolean deep5640(boolean x) { - return deep5641(x); - } - - public static boolean deep5641(boolean x) { - return deep5642(x); - } - - public static boolean deep5642(boolean x) { - return deep5643(x); - } - - public static boolean deep5643(boolean x) { - return deep5644(x); - } - - public static boolean deep5644(boolean x) { - return deep5645(x); - } - - public static boolean deep5645(boolean x) { - return deep5646(x); - } - - public static boolean deep5646(boolean x) { - return deep5647(x); - } - - public static boolean deep5647(boolean x) { - return deep5648(x); - } - - public static boolean deep5648(boolean x) { - return deep5649(x); - } - - public static boolean deep5649(boolean x) { - return deep5650(x); - } - - public static boolean deep5650(boolean x) { - return deep5651(x); - } - - public static boolean deep5651(boolean x) { - return deep5652(x); - } - - public static boolean deep5652(boolean x) { - return deep5653(x); - } - - public static boolean deep5653(boolean x) { - return deep5654(x); - } - - public static boolean deep5654(boolean x) { - return deep5655(x); - } - - public static boolean deep5655(boolean x) { - return deep5656(x); - } - - public static boolean deep5656(boolean x) { - return deep5657(x); - } - - public static boolean deep5657(boolean x) { - return deep5658(x); - } - - public static boolean deep5658(boolean x) { - return deep5659(x); - } - - public static boolean deep5659(boolean x) { - return deep5660(x); - } - - public static boolean deep5660(boolean x) { - return deep5661(x); - } - - public static boolean deep5661(boolean x) { - return deep5662(x); - } - - public static boolean deep5662(boolean x) { - return deep5663(x); - } - - public static boolean deep5663(boolean x) { - return deep5664(x); - } - - public static boolean deep5664(boolean x) { - return deep5665(x); - } - - public static boolean deep5665(boolean x) { - return deep5666(x); - } - - public static boolean deep5666(boolean x) { - return deep5667(x); - } - - public static boolean deep5667(boolean x) { - return deep5668(x); - } - - public static boolean deep5668(boolean x) { - return deep5669(x); - } - - public static boolean deep5669(boolean x) { - return deep5670(x); - } - - public static boolean deep5670(boolean x) { - return deep5671(x); - } - - public static boolean deep5671(boolean x) { - return deep5672(x); - } - - public static boolean deep5672(boolean x) { - return deep5673(x); - } - - public static boolean deep5673(boolean x) { - return deep5674(x); - } - - public static boolean deep5674(boolean x) { - return deep5675(x); - } - - public static boolean deep5675(boolean x) { - return deep5676(x); - } - - public static boolean deep5676(boolean x) { - return deep5677(x); - } - - public static boolean deep5677(boolean x) { - return deep5678(x); - } - - public static boolean deep5678(boolean x) { - return deep5679(x); - } - - public static boolean deep5679(boolean x) { - return deep5680(x); - } - - public static boolean deep5680(boolean x) { - return deep5681(x); - } - - public static boolean deep5681(boolean x) { - return deep5682(x); - } - - public static boolean deep5682(boolean x) { - return deep5683(x); - } - - public static boolean deep5683(boolean x) { - return deep5684(x); - } - - public static boolean deep5684(boolean x) { - return deep5685(x); - } - - public static boolean deep5685(boolean x) { - return deep5686(x); - } - - public static boolean deep5686(boolean x) { - return deep5687(x); - } - - public static boolean deep5687(boolean x) { - return deep5688(x); - } - - public static boolean deep5688(boolean x) { - return deep5689(x); - } - - public static boolean deep5689(boolean x) { - return deep5690(x); - } - - public static boolean deep5690(boolean x) { - return deep5691(x); - } - - public static boolean deep5691(boolean x) { - return deep5692(x); - } - - public static boolean deep5692(boolean x) { - return deep5693(x); - } - - public static boolean deep5693(boolean x) { - return deep5694(x); - } - - public static boolean deep5694(boolean x) { - return deep5695(x); - } - - public static boolean deep5695(boolean x) { - return deep5696(x); - } - - public static boolean deep5696(boolean x) { - return deep5697(x); - } - - public static boolean deep5697(boolean x) { - return deep5698(x); - } - - public static boolean deep5698(boolean x) { - return deep5699(x); - } - - public static boolean deep5699(boolean x) { - return deep5700(x); - } - - public static boolean deep5700(boolean x) { - return deep5701(x); - } - - public static boolean deep5701(boolean x) { - return deep5702(x); - } - - public static boolean deep5702(boolean x) { - return deep5703(x); - } - - public static boolean deep5703(boolean x) { - return deep5704(x); - } - - public static boolean deep5704(boolean x) { - return deep5705(x); - } - - public static boolean deep5705(boolean x) { - return deep5706(x); - } - - public static boolean deep5706(boolean x) { - return deep5707(x); - } - - public static boolean deep5707(boolean x) { - return deep5708(x); - } - - public static boolean deep5708(boolean x) { - return deep5709(x); - } - - public static boolean deep5709(boolean x) { - return deep5710(x); - } - - public static boolean deep5710(boolean x) { - return deep5711(x); - } - - public static boolean deep5711(boolean x) { - return deep5712(x); - } - - public static boolean deep5712(boolean x) { - return deep5713(x); - } - - public static boolean deep5713(boolean x) { - return deep5714(x); - } - - public static boolean deep5714(boolean x) { - return deep5715(x); - } - - public static boolean deep5715(boolean x) { - return deep5716(x); - } - - public static boolean deep5716(boolean x) { - return deep5717(x); - } - - public static boolean deep5717(boolean x) { - return deep5718(x); - } - - public static boolean deep5718(boolean x) { - return deep5719(x); - } - - public static boolean deep5719(boolean x) { - return deep5720(x); - } - - public static boolean deep5720(boolean x) { - return deep5721(x); - } - - public static boolean deep5721(boolean x) { - return deep5722(x); - } - - public static boolean deep5722(boolean x) { - return deep5723(x); - } - - public static boolean deep5723(boolean x) { - return deep5724(x); - } - - public static boolean deep5724(boolean x) { - return deep5725(x); - } - - public static boolean deep5725(boolean x) { - return deep5726(x); - } - - public static boolean deep5726(boolean x) { - return deep5727(x); - } - - public static boolean deep5727(boolean x) { - return deep5728(x); - } - - public static boolean deep5728(boolean x) { - return deep5729(x); - } - - public static boolean deep5729(boolean x) { - return deep5730(x); - } - - public static boolean deep5730(boolean x) { - return deep5731(x); - } - - public static boolean deep5731(boolean x) { - return deep5732(x); - } - - public static boolean deep5732(boolean x) { - return deep5733(x); - } - - public static boolean deep5733(boolean x) { - return deep5734(x); - } - - public static boolean deep5734(boolean x) { - return deep5735(x); - } - - public static boolean deep5735(boolean x) { - return deep5736(x); - } - - public static boolean deep5736(boolean x) { - return deep5737(x); - } - - public static boolean deep5737(boolean x) { - return deep5738(x); - } - - public static boolean deep5738(boolean x) { - return deep5739(x); - } - - public static boolean deep5739(boolean x) { - return deep5740(x); - } - - public static boolean deep5740(boolean x) { - return deep5741(x); - } - - public static boolean deep5741(boolean x) { - return deep5742(x); - } - - public static boolean deep5742(boolean x) { - return deep5743(x); - } - - public static boolean deep5743(boolean x) { - return deep5744(x); - } - - public static boolean deep5744(boolean x) { - return deep5745(x); - } - - public static boolean deep5745(boolean x) { - return deep5746(x); - } - - public static boolean deep5746(boolean x) { - return deep5747(x); - } - - public static boolean deep5747(boolean x) { - return deep5748(x); - } - - public static boolean deep5748(boolean x) { - return deep5749(x); - } - - public static boolean deep5749(boolean x) { - return deep5750(x); - } - - public static boolean deep5750(boolean x) { - return deep5751(x); - } - - public static boolean deep5751(boolean x) { - return deep5752(x); - } - - public static boolean deep5752(boolean x) { - return deep5753(x); - } - - public static boolean deep5753(boolean x) { - return deep5754(x); - } - - public static boolean deep5754(boolean x) { - return deep5755(x); - } - - public static boolean deep5755(boolean x) { - return deep5756(x); - } - - public static boolean deep5756(boolean x) { - return deep5757(x); - } - - public static boolean deep5757(boolean x) { - return deep5758(x); - } - - public static boolean deep5758(boolean x) { - return deep5759(x); - } - - public static boolean deep5759(boolean x) { - return deep5760(x); - } - - public static boolean deep5760(boolean x) { - return deep5761(x); - } - - public static boolean deep5761(boolean x) { - return deep5762(x); - } - - public static boolean deep5762(boolean x) { - return deep5763(x); - } - - public static boolean deep5763(boolean x) { - return deep5764(x); - } - - public static boolean deep5764(boolean x) { - return deep5765(x); - } - - public static boolean deep5765(boolean x) { - return deep5766(x); - } - - public static boolean deep5766(boolean x) { - return deep5767(x); - } - - public static boolean deep5767(boolean x) { - return deep5768(x); - } - - public static boolean deep5768(boolean x) { - return deep5769(x); - } - - public static boolean deep5769(boolean x) { - return deep5770(x); - } - - public static boolean deep5770(boolean x) { - return deep5771(x); - } - - public static boolean deep5771(boolean x) { - return deep5772(x); - } - - public static boolean deep5772(boolean x) { - return deep5773(x); - } - - public static boolean deep5773(boolean x) { - return deep5774(x); - } - - public static boolean deep5774(boolean x) { - return deep5775(x); - } - - public static boolean deep5775(boolean x) { - return deep5776(x); - } - - public static boolean deep5776(boolean x) { - return deep5777(x); - } - - public static boolean deep5777(boolean x) { - return deep5778(x); - } - - public static boolean deep5778(boolean x) { - return deep5779(x); - } - - public static boolean deep5779(boolean x) { - return deep5780(x); - } - - public static boolean deep5780(boolean x) { - return deep5781(x); - } - - public static boolean deep5781(boolean x) { - return deep5782(x); - } - - public static boolean deep5782(boolean x) { - return deep5783(x); - } - - public static boolean deep5783(boolean x) { - return deep5784(x); - } - - public static boolean deep5784(boolean x) { - return deep5785(x); - } - - public static boolean deep5785(boolean x) { - return deep5786(x); - } - - public static boolean deep5786(boolean x) { - return deep5787(x); - } - - public static boolean deep5787(boolean x) { - return deep5788(x); - } - - public static boolean deep5788(boolean x) { - return deep5789(x); - } - - public static boolean deep5789(boolean x) { - return deep5790(x); - } - - public static boolean deep5790(boolean x) { - return deep5791(x); - } - - public static boolean deep5791(boolean x) { - return deep5792(x); - } - - public static boolean deep5792(boolean x) { - return deep5793(x); - } - - public static boolean deep5793(boolean x) { - return deep5794(x); - } - - public static boolean deep5794(boolean x) { - return deep5795(x); - } - - public static boolean deep5795(boolean x) { - return deep5796(x); - } - - public static boolean deep5796(boolean x) { - return deep5797(x); - } - - public static boolean deep5797(boolean x) { - return deep5798(x); - } - - public static boolean deep5798(boolean x) { - return deep5799(x); - } - - public static boolean deep5799(boolean x) { - return deep5800(x); - } - - public static boolean deep5800(boolean x) { - return deep5801(x); - } - - public static boolean deep5801(boolean x) { - return deep5802(x); - } - - public static boolean deep5802(boolean x) { - return deep5803(x); - } - - public static boolean deep5803(boolean x) { - return deep5804(x); - } - - public static boolean deep5804(boolean x) { - return deep5805(x); - } - - public static boolean deep5805(boolean x) { - return deep5806(x); - } - - public static boolean deep5806(boolean x) { - return deep5807(x); - } - - public static boolean deep5807(boolean x) { - return deep5808(x); - } - - public static boolean deep5808(boolean x) { - return deep5809(x); - } - - public static boolean deep5809(boolean x) { - return deep5810(x); - } - - public static boolean deep5810(boolean x) { - return deep5811(x); - } - - public static boolean deep5811(boolean x) { - return deep5812(x); - } - - public static boolean deep5812(boolean x) { - return deep5813(x); - } - - public static boolean deep5813(boolean x) { - return deep5814(x); - } - - public static boolean deep5814(boolean x) { - return deep5815(x); - } - - public static boolean deep5815(boolean x) { - return deep5816(x); - } - - public static boolean deep5816(boolean x) { - return deep5817(x); - } - - public static boolean deep5817(boolean x) { - return deep5818(x); - } - - public static boolean deep5818(boolean x) { - return deep5819(x); - } - - public static boolean deep5819(boolean x) { - return deep5820(x); - } - - public static boolean deep5820(boolean x) { - return deep5821(x); - } - - public static boolean deep5821(boolean x) { - return deep5822(x); - } - - public static boolean deep5822(boolean x) { - return deep5823(x); - } - - public static boolean deep5823(boolean x) { - return deep5824(x); - } - - public static boolean deep5824(boolean x) { - return deep5825(x); - } - - public static boolean deep5825(boolean x) { - return deep5826(x); - } - - public static boolean deep5826(boolean x) { - return deep5827(x); - } - - public static boolean deep5827(boolean x) { - return deep5828(x); - } - - public static boolean deep5828(boolean x) { - return deep5829(x); - } - - public static boolean deep5829(boolean x) { - return deep5830(x); - } - - public static boolean deep5830(boolean x) { - return deep5831(x); - } - - public static boolean deep5831(boolean x) { - return deep5832(x); - } - - public static boolean deep5832(boolean x) { - return deep5833(x); - } - - public static boolean deep5833(boolean x) { - return deep5834(x); - } - - public static boolean deep5834(boolean x) { - return deep5835(x); - } - - public static boolean deep5835(boolean x) { - return deep5836(x); - } - - public static boolean deep5836(boolean x) { - return deep5837(x); - } - - public static boolean deep5837(boolean x) { - return deep5838(x); - } - - public static boolean deep5838(boolean x) { - return deep5839(x); - } - - public static boolean deep5839(boolean x) { - return deep5840(x); - } - - public static boolean deep5840(boolean x) { - return deep5841(x); - } - - public static boolean deep5841(boolean x) { - return deep5842(x); - } - - public static boolean deep5842(boolean x) { - return deep5843(x); - } - - public static boolean deep5843(boolean x) { - return deep5844(x); - } - - public static boolean deep5844(boolean x) { - return deep5845(x); - } - - public static boolean deep5845(boolean x) { - return deep5846(x); - } - - public static boolean deep5846(boolean x) { - return deep5847(x); - } - - public static boolean deep5847(boolean x) { - return deep5848(x); - } - - public static boolean deep5848(boolean x) { - return deep5849(x); - } - - public static boolean deep5849(boolean x) { - return deep5850(x); - } - - public static boolean deep5850(boolean x) { - return deep5851(x); - } - - public static boolean deep5851(boolean x) { - return deep5852(x); - } - - public static boolean deep5852(boolean x) { - return deep5853(x); - } - - public static boolean deep5853(boolean x) { - return deep5854(x); - } - - public static boolean deep5854(boolean x) { - return deep5855(x); - } - - public static boolean deep5855(boolean x) { - return deep5856(x); - } - - public static boolean deep5856(boolean x) { - return deep5857(x); - } - - public static boolean deep5857(boolean x) { - return deep5858(x); - } - - public static boolean deep5858(boolean x) { - return deep5859(x); - } - - public static boolean deep5859(boolean x) { - return deep5860(x); - } - - public static boolean deep5860(boolean x) { - return deep5861(x); - } - - public static boolean deep5861(boolean x) { - return deep5862(x); - } - - public static boolean deep5862(boolean x) { - return deep5863(x); - } - - public static boolean deep5863(boolean x) { - return deep5864(x); - } - - public static boolean deep5864(boolean x) { - return deep5865(x); - } - - public static boolean deep5865(boolean x) { - return deep5866(x); - } - - public static boolean deep5866(boolean x) { - return deep5867(x); - } - - public static boolean deep5867(boolean x) { - return deep5868(x); - } - - public static boolean deep5868(boolean x) { - return deep5869(x); - } - - public static boolean deep5869(boolean x) { - return deep5870(x); - } - - public static boolean deep5870(boolean x) { - return deep5871(x); - } - - public static boolean deep5871(boolean x) { - return deep5872(x); - } - - public static boolean deep5872(boolean x) { - return deep5873(x); - } - - public static boolean deep5873(boolean x) { - return deep5874(x); - } - - public static boolean deep5874(boolean x) { - return deep5875(x); - } - - public static boolean deep5875(boolean x) { - return deep5876(x); - } - - public static boolean deep5876(boolean x) { - return deep5877(x); - } - - public static boolean deep5877(boolean x) { - return deep5878(x); - } - - public static boolean deep5878(boolean x) { - return deep5879(x); - } - - public static boolean deep5879(boolean x) { - return deep5880(x); - } - - public static boolean deep5880(boolean x) { - return deep5881(x); - } - - public static boolean deep5881(boolean x) { - return deep5882(x); - } - - public static boolean deep5882(boolean x) { - return deep5883(x); - } - - public static boolean deep5883(boolean x) { - return deep5884(x); - } - - public static boolean deep5884(boolean x) { - return deep5885(x); - } - - public static boolean deep5885(boolean x) { - return deep5886(x); - } - - public static boolean deep5886(boolean x) { - return deep5887(x); - } - - public static boolean deep5887(boolean x) { - return deep5888(x); - } - - public static boolean deep5888(boolean x) { - return deep5889(x); - } - - public static boolean deep5889(boolean x) { - return deep5890(x); - } - - public static boolean deep5890(boolean x) { - return deep5891(x); - } - - public static boolean deep5891(boolean x) { - return deep5892(x); - } - - public static boolean deep5892(boolean x) { - return deep5893(x); - } - - public static boolean deep5893(boolean x) { - return deep5894(x); - } - - public static boolean deep5894(boolean x) { - return deep5895(x); - } - - public static boolean deep5895(boolean x) { - return deep5896(x); - } - - public static boolean deep5896(boolean x) { - return deep5897(x); - } - - public static boolean deep5897(boolean x) { - return deep5898(x); - } - - public static boolean deep5898(boolean x) { - return deep5899(x); - } - - public static boolean deep5899(boolean x) { - return deep5900(x); - } - - public static boolean deep5900(boolean x) { - return deep5901(x); - } - - public static boolean deep5901(boolean x) { - return deep5902(x); - } - - public static boolean deep5902(boolean x) { - return deep5903(x); - } - - public static boolean deep5903(boolean x) { - return deep5904(x); - } - - public static boolean deep5904(boolean x) { - return deep5905(x); - } - - public static boolean deep5905(boolean x) { - return deep5906(x); - } - - public static boolean deep5906(boolean x) { - return deep5907(x); - } - - public static boolean deep5907(boolean x) { - return deep5908(x); - } - - public static boolean deep5908(boolean x) { - return deep5909(x); - } - - public static boolean deep5909(boolean x) { - return deep5910(x); - } - - public static boolean deep5910(boolean x) { - return deep5911(x); - } - - public static boolean deep5911(boolean x) { - return deep5912(x); - } - - public static boolean deep5912(boolean x) { - return deep5913(x); - } - - public static boolean deep5913(boolean x) { - return deep5914(x); - } - - public static boolean deep5914(boolean x) { - return deep5915(x); - } - - public static boolean deep5915(boolean x) { - return deep5916(x); - } - - public static boolean deep5916(boolean x) { - return deep5917(x); - } - - public static boolean deep5917(boolean x) { - return deep5918(x); - } - - public static boolean deep5918(boolean x) { - return deep5919(x); - } - - public static boolean deep5919(boolean x) { - return deep5920(x); - } - - public static boolean deep5920(boolean x) { - return deep5921(x); - } - - public static boolean deep5921(boolean x) { - return deep5922(x); - } - - public static boolean deep5922(boolean x) { - return deep5923(x); - } - - public static boolean deep5923(boolean x) { - return deep5924(x); - } - - public static boolean deep5924(boolean x) { - return deep5925(x); - } - - public static boolean deep5925(boolean x) { - return deep5926(x); - } - - public static boolean deep5926(boolean x) { - return deep5927(x); - } - - public static boolean deep5927(boolean x) { - return deep5928(x); - } - - public static boolean deep5928(boolean x) { - return deep5929(x); - } - - public static boolean deep5929(boolean x) { - return deep5930(x); - } - - public static boolean deep5930(boolean x) { - return deep5931(x); - } - - public static boolean deep5931(boolean x) { - return deep5932(x); - } - - public static boolean deep5932(boolean x) { - return deep5933(x); - } - - public static boolean deep5933(boolean x) { - return deep5934(x); - } - - public static boolean deep5934(boolean x) { - return deep5935(x); - } - - public static boolean deep5935(boolean x) { - return deep5936(x); - } - - public static boolean deep5936(boolean x) { - return deep5937(x); - } - - public static boolean deep5937(boolean x) { - return deep5938(x); - } - - public static boolean deep5938(boolean x) { - return deep5939(x); - } - - public static boolean deep5939(boolean x) { - return deep5940(x); - } - - public static boolean deep5940(boolean x) { - return deep5941(x); - } - - public static boolean deep5941(boolean x) { - return deep5942(x); - } - - public static boolean deep5942(boolean x) { - return deep5943(x); - } - - public static boolean deep5943(boolean x) { - return deep5944(x); - } - - public static boolean deep5944(boolean x) { - return deep5945(x); - } - - public static boolean deep5945(boolean x) { - return deep5946(x); - } - - public static boolean deep5946(boolean x) { - return deep5947(x); - } - - public static boolean deep5947(boolean x) { - return deep5948(x); - } - - public static boolean deep5948(boolean x) { - return deep5949(x); - } - - public static boolean deep5949(boolean x) { - return deep5950(x); - } - - public static boolean deep5950(boolean x) { - return deep5951(x); - } - - public static boolean deep5951(boolean x) { - return deep5952(x); - } - - public static boolean deep5952(boolean x) { - return deep5953(x); - } - - public static boolean deep5953(boolean x) { - return deep5954(x); - } - - public static boolean deep5954(boolean x) { - return deep5955(x); - } - - public static boolean deep5955(boolean x) { - return deep5956(x); - } - - public static boolean deep5956(boolean x) { - return deep5957(x); - } - - public static boolean deep5957(boolean x) { - return deep5958(x); - } - - public static boolean deep5958(boolean x) { - return deep5959(x); - } - - public static boolean deep5959(boolean x) { - return deep5960(x); - } - - public static boolean deep5960(boolean x) { - return deep5961(x); - } - - public static boolean deep5961(boolean x) { - return deep5962(x); - } - - public static boolean deep5962(boolean x) { - return deep5963(x); - } - - public static boolean deep5963(boolean x) { - return deep5964(x); - } - - public static boolean deep5964(boolean x) { - return deep5965(x); - } - - public static boolean deep5965(boolean x) { - return deep5966(x); - } - - public static boolean deep5966(boolean x) { - return deep5967(x); - } - - public static boolean deep5967(boolean x) { - return deep5968(x); - } - - public static boolean deep5968(boolean x) { - return deep5969(x); - } - - public static boolean deep5969(boolean x) { - return deep5970(x); - } - - public static boolean deep5970(boolean x) { - return deep5971(x); - } - - public static boolean deep5971(boolean x) { - return deep5972(x); - } - - public static boolean deep5972(boolean x) { - return deep5973(x); - } - - public static boolean deep5973(boolean x) { - return deep5974(x); - } - - public static boolean deep5974(boolean x) { - return deep5975(x); - } - - public static boolean deep5975(boolean x) { - return deep5976(x); - } - - public static boolean deep5976(boolean x) { - return deep5977(x); - } - - public static boolean deep5977(boolean x) { - return deep5978(x); - } - - public static boolean deep5978(boolean x) { - return deep5979(x); - } - - public static boolean deep5979(boolean x) { - return deep5980(x); - } - - public static boolean deep5980(boolean x) { - return deep5981(x); - } - - public static boolean deep5981(boolean x) { - return deep5982(x); - } - - public static boolean deep5982(boolean x) { - return deep5983(x); - } - - public static boolean deep5983(boolean x) { - return deep5984(x); - } - - public static boolean deep5984(boolean x) { - return deep5985(x); - } - - public static boolean deep5985(boolean x) { - return deep5986(x); - } - - public static boolean deep5986(boolean x) { - return deep5987(x); - } - - public static boolean deep5987(boolean x) { - return deep5988(x); - } - - public static boolean deep5988(boolean x) { - return deep5989(x); - } - - public static boolean deep5989(boolean x) { - return deep5990(x); - } - - public static boolean deep5990(boolean x) { - return deep5991(x); - } - - public static boolean deep5991(boolean x) { - return deep5992(x); - } - - public static boolean deep5992(boolean x) { - return deep5993(x); - } - - public static boolean deep5993(boolean x) { - return deep5994(x); - } - - public static boolean deep5994(boolean x) { - return deep5995(x); - } - - public static boolean deep5995(boolean x) { - return deep5996(x); - } - - public static boolean deep5996(boolean x) { - return deep5997(x); - } - - public static boolean deep5997(boolean x) { - return deep5998(x); - } - - public static boolean deep5998(boolean x) { - return deep5999(x); - } - - public static boolean deep5999(boolean x) { - return deep6000(x); - } - - public static boolean deep6000(boolean x) { - return deep6001(x); - } - - public static boolean deep6001(boolean x) { - return deep6002(x); - } - - public static boolean deep6002(boolean x) { - return deep6003(x); - } - - public static boolean deep6003(boolean x) { - return deep6004(x); - } - - public static boolean deep6004(boolean x) { - return deep6005(x); - } - - public static boolean deep6005(boolean x) { - return deep6006(x); - } - - public static boolean deep6006(boolean x) { - return deep6007(x); - } - - public static boolean deep6007(boolean x) { - return deep6008(x); - } - - public static boolean deep6008(boolean x) { - return deep6009(x); - } - - public static boolean deep6009(boolean x) { - return deep6010(x); - } - - public static boolean deep6010(boolean x) { - return deep6011(x); - } - - public static boolean deep6011(boolean x) { - return deep6012(x); - } - - public static boolean deep6012(boolean x) { - return deep6013(x); - } - - public static boolean deep6013(boolean x) { - return deep6014(x); - } - - public static boolean deep6014(boolean x) { - return deep6015(x); - } - - public static boolean deep6015(boolean x) { - return deep6016(x); - } - - public static boolean deep6016(boolean x) { - return deep6017(x); - } - - public static boolean deep6017(boolean x) { - return deep6018(x); - } - - public static boolean deep6018(boolean x) { - return deep6019(x); - } - - public static boolean deep6019(boolean x) { - return deep6020(x); - } - - public static boolean deep6020(boolean x) { - return deep6021(x); - } - - public static boolean deep6021(boolean x) { - return deep6022(x); - } - - public static boolean deep6022(boolean x) { - return deep6023(x); - } - - public static boolean deep6023(boolean x) { - return deep6024(x); - } - - public static boolean deep6024(boolean x) { - return deep6025(x); - } - - public static boolean deep6025(boolean x) { - return deep6026(x); - } - - public static boolean deep6026(boolean x) { - return deep6027(x); - } - - public static boolean deep6027(boolean x) { - return deep6028(x); - } - - public static boolean deep6028(boolean x) { - return deep6029(x); - } - - public static boolean deep6029(boolean x) { - return deep6030(x); - } - - public static boolean deep6030(boolean x) { - return deep6031(x); - } - - public static boolean deep6031(boolean x) { - return deep6032(x); - } - - public static boolean deep6032(boolean x) { - return deep6033(x); - } - - public static boolean deep6033(boolean x) { - return deep6034(x); - } - - public static boolean deep6034(boolean x) { - return deep6035(x); - } - - public static boolean deep6035(boolean x) { - return deep6036(x); - } - - public static boolean deep6036(boolean x) { - return deep6037(x); - } - - public static boolean deep6037(boolean x) { - return deep6038(x); - } - - public static boolean deep6038(boolean x) { - return deep6039(x); - } - - public static boolean deep6039(boolean x) { - return deep6040(x); - } - - public static boolean deep6040(boolean x) { - return deep6041(x); - } - - public static boolean deep6041(boolean x) { - return deep6042(x); - } - - public static boolean deep6042(boolean x) { - return deep6043(x); - } - - public static boolean deep6043(boolean x) { - return deep6044(x); - } - - public static boolean deep6044(boolean x) { - return deep6045(x); - } - - public static boolean deep6045(boolean x) { - return deep6046(x); - } - - public static boolean deep6046(boolean x) { - return deep6047(x); - } - - public static boolean deep6047(boolean x) { - return deep6048(x); - } - - public static boolean deep6048(boolean x) { - return deep6049(x); - } - - public static boolean deep6049(boolean x) { - return deep6050(x); - } - - public static boolean deep6050(boolean x) { - return deep6051(x); - } - - public static boolean deep6051(boolean x) { - return deep6052(x); - } - - public static boolean deep6052(boolean x) { - return deep6053(x); - } - - public static boolean deep6053(boolean x) { - return deep6054(x); - } - - public static boolean deep6054(boolean x) { - return deep6055(x); - } - - public static boolean deep6055(boolean x) { - return deep6056(x); - } - - public static boolean deep6056(boolean x) { - return deep6057(x); - } - - public static boolean deep6057(boolean x) { - return deep6058(x); - } - - public static boolean deep6058(boolean x) { - return deep6059(x); - } - - public static boolean deep6059(boolean x) { - return deep6060(x); - } - - public static boolean deep6060(boolean x) { - return deep6061(x); - } - - public static boolean deep6061(boolean x) { - return deep6062(x); - } - - public static boolean deep6062(boolean x) { - return deep6063(x); - } - - public static boolean deep6063(boolean x) { - return deep6064(x); - } - - public static boolean deep6064(boolean x) { - return deep6065(x); - } - - public static boolean deep6065(boolean x) { - return deep6066(x); - } - - public static boolean deep6066(boolean x) { - return deep6067(x); - } - - public static boolean deep6067(boolean x) { - return deep6068(x); - } - - public static boolean deep6068(boolean x) { - return deep6069(x); - } - - public static boolean deep6069(boolean x) { - return deep6070(x); - } - - public static boolean deep6070(boolean x) { - return deep6071(x); - } - - public static boolean deep6071(boolean x) { - return deep6072(x); - } - - public static boolean deep6072(boolean x) { - return deep6073(x); - } - - public static boolean deep6073(boolean x) { - return deep6074(x); - } - - public static boolean deep6074(boolean x) { - return deep6075(x); - } - - public static boolean deep6075(boolean x) { - return deep6076(x); - } - - public static boolean deep6076(boolean x) { - return deep6077(x); - } - - public static boolean deep6077(boolean x) { - return deep6078(x); - } - - public static boolean deep6078(boolean x) { - return deep6079(x); - } - - public static boolean deep6079(boolean x) { - return deep6080(x); - } - - public static boolean deep6080(boolean x) { - return deep6081(x); - } - - public static boolean deep6081(boolean x) { - return deep6082(x); - } - - public static boolean deep6082(boolean x) { - return deep6083(x); - } - - public static boolean deep6083(boolean x) { - return deep6084(x); - } - - public static boolean deep6084(boolean x) { - return deep6085(x); - } - - public static boolean deep6085(boolean x) { - return deep6086(x); - } - - public static boolean deep6086(boolean x) { - return deep6087(x); - } - - public static boolean deep6087(boolean x) { - return deep6088(x); - } - - public static boolean deep6088(boolean x) { - return deep6089(x); - } - - public static boolean deep6089(boolean x) { - return deep6090(x); - } - - public static boolean deep6090(boolean x) { - return deep6091(x); - } - - public static boolean deep6091(boolean x) { - return deep6092(x); - } - - public static boolean deep6092(boolean x) { - return deep6093(x); - } - - public static boolean deep6093(boolean x) { - return deep6094(x); - } - - public static boolean deep6094(boolean x) { - return deep6095(x); - } - - public static boolean deep6095(boolean x) { - return deep6096(x); - } - - public static boolean deep6096(boolean x) { - return deep6097(x); - } - - public static boolean deep6097(boolean x) { - return deep6098(x); - } - - public static boolean deep6098(boolean x) { - return deep6099(x); - } - - public static boolean deep6099(boolean x) { - return deep6100(x); - } - - public static boolean deep6100(boolean x) { - return deep6101(x); - } - - public static boolean deep6101(boolean x) { - return deep6102(x); - } - - public static boolean deep6102(boolean x) { - return deep6103(x); - } - - public static boolean deep6103(boolean x) { - return deep6104(x); - } - - public static boolean deep6104(boolean x) { - return deep6105(x); - } - - public static boolean deep6105(boolean x) { - return deep6106(x); - } - - public static boolean deep6106(boolean x) { - return deep6107(x); - } - - public static boolean deep6107(boolean x) { - return deep6108(x); - } - - public static boolean deep6108(boolean x) { - return deep6109(x); - } - - public static boolean deep6109(boolean x) { - return deep6110(x); - } - - public static boolean deep6110(boolean x) { - return deep6111(x); - } - - public static boolean deep6111(boolean x) { - return deep6112(x); - } - - public static boolean deep6112(boolean x) { - return deep6113(x); - } - - public static boolean deep6113(boolean x) { - return deep6114(x); - } - - public static boolean deep6114(boolean x) { - return deep6115(x); - } - - public static boolean deep6115(boolean x) { - return deep6116(x); - } - - public static boolean deep6116(boolean x) { - return deep6117(x); - } - - public static boolean deep6117(boolean x) { - return deep6118(x); - } - - public static boolean deep6118(boolean x) { - return deep6119(x); - } - - public static boolean deep6119(boolean x) { - return deep6120(x); - } - - public static boolean deep6120(boolean x) { - return deep6121(x); - } - - public static boolean deep6121(boolean x) { - return deep6122(x); - } - - public static boolean deep6122(boolean x) { - return deep6123(x); - } - - public static boolean deep6123(boolean x) { - return deep6124(x); - } - - public static boolean deep6124(boolean x) { - return deep6125(x); - } - - public static boolean deep6125(boolean x) { - return deep6126(x); - } - - public static boolean deep6126(boolean x) { - return deep6127(x); - } - - public static boolean deep6127(boolean x) { - return deep6128(x); - } - - public static boolean deep6128(boolean x) { - return deep6129(x); - } - - public static boolean deep6129(boolean x) { - return deep6130(x); - } - - public static boolean deep6130(boolean x) { - return deep6131(x); - } - - public static boolean deep6131(boolean x) { - return deep6132(x); - } - - public static boolean deep6132(boolean x) { - return deep6133(x); - } - - public static boolean deep6133(boolean x) { - return deep6134(x); - } - - public static boolean deep6134(boolean x) { - return deep6135(x); - } - - public static boolean deep6135(boolean x) { - return deep6136(x); - } - - public static boolean deep6136(boolean x) { - return deep6137(x); - } - - public static boolean deep6137(boolean x) { - return deep6138(x); - } - - public static boolean deep6138(boolean x) { - return deep6139(x); - } - - public static boolean deep6139(boolean x) { - return deep6140(x); - } - - public static boolean deep6140(boolean x) { - return deep6141(x); - } - - public static boolean deep6141(boolean x) { - return deep6142(x); - } - - public static boolean deep6142(boolean x) { - return deep6143(x); - } - - public static boolean deep6143(boolean x) { - return deep6144(x); - } - - public static boolean deep6144(boolean x) { - return deep6145(x); - } - - public static boolean deep6145(boolean x) { - return deep6146(x); - } - - public static boolean deep6146(boolean x) { - return deep6147(x); - } - - public static boolean deep6147(boolean x) { - return deep6148(x); - } - - public static boolean deep6148(boolean x) { - return deep6149(x); - } - - public static boolean deep6149(boolean x) { - return deep6150(x); - } - - public static boolean deep6150(boolean x) { - return deep6151(x); - } - - public static boolean deep6151(boolean x) { - return deep6152(x); - } - - public static boolean deep6152(boolean x) { - return deep6153(x); - } - - public static boolean deep6153(boolean x) { - return deep6154(x); - } - - public static boolean deep6154(boolean x) { - return deep6155(x); - } - - public static boolean deep6155(boolean x) { - return deep6156(x); - } - - public static boolean deep6156(boolean x) { - return deep6157(x); - } - - public static boolean deep6157(boolean x) { - return deep6158(x); - } - - public static boolean deep6158(boolean x) { - return deep6159(x); - } - - public static boolean deep6159(boolean x) { - return deep6160(x); - } - - public static boolean deep6160(boolean x) { - return deep6161(x); - } - - public static boolean deep6161(boolean x) { - return deep6162(x); - } - - public static boolean deep6162(boolean x) { - return deep6163(x); - } - - public static boolean deep6163(boolean x) { - return deep6164(x); - } - - public static boolean deep6164(boolean x) { - return deep6165(x); - } - - public static boolean deep6165(boolean x) { - return deep6166(x); - } - - public static boolean deep6166(boolean x) { - return deep6167(x); - } - - public static boolean deep6167(boolean x) { - return deep6168(x); - } - - public static boolean deep6168(boolean x) { - return deep6169(x); - } - - public static boolean deep6169(boolean x) { - return deep6170(x); - } - - public static boolean deep6170(boolean x) { - return deep6171(x); - } - - public static boolean deep6171(boolean x) { - return deep6172(x); - } - - public static boolean deep6172(boolean x) { - return deep6173(x); - } - - public static boolean deep6173(boolean x) { - return deep6174(x); - } - - public static boolean deep6174(boolean x) { - return deep6175(x); - } - - public static boolean deep6175(boolean x) { - return deep6176(x); - } - - public static boolean deep6176(boolean x) { - return deep6177(x); - } - - public static boolean deep6177(boolean x) { - return deep6178(x); - } - - public static boolean deep6178(boolean x) { - return deep6179(x); - } - - public static boolean deep6179(boolean x) { - return deep6180(x); - } - - public static boolean deep6180(boolean x) { - return deep6181(x); - } - - public static boolean deep6181(boolean x) { - return deep6182(x); - } - - public static boolean deep6182(boolean x) { - return deep6183(x); - } - - public static boolean deep6183(boolean x) { - return deep6184(x); - } - - public static boolean deep6184(boolean x) { - return deep6185(x); - } - - public static boolean deep6185(boolean x) { - return deep6186(x); - } - - public static boolean deep6186(boolean x) { - return deep6187(x); - } - - public static boolean deep6187(boolean x) { - return deep6188(x); - } - - public static boolean deep6188(boolean x) { - return deep6189(x); - } - - public static boolean deep6189(boolean x) { - return deep6190(x); - } - - public static boolean deep6190(boolean x) { - return deep6191(x); - } - - public static boolean deep6191(boolean x) { - return deep6192(x); - } - - public static boolean deep6192(boolean x) { - return deep6193(x); - } - - public static boolean deep6193(boolean x) { - return deep6194(x); - } - - public static boolean deep6194(boolean x) { - return deep6195(x); - } - - public static boolean deep6195(boolean x) { - return deep6196(x); - } - - public static boolean deep6196(boolean x) { - return deep6197(x); - } - - public static boolean deep6197(boolean x) { - return deep6198(x); - } - - public static boolean deep6198(boolean x) { - return deep6199(x); - } - - public static boolean deep6199(boolean x) { - return deep6200(x); - } - - public static boolean deep6200(boolean x) { - return deep6201(x); - } - - public static boolean deep6201(boolean x) { - return deep6202(x); - } - - public static boolean deep6202(boolean x) { - return deep6203(x); - } - - public static boolean deep6203(boolean x) { - return deep6204(x); - } - - public static boolean deep6204(boolean x) { - return deep6205(x); - } - - public static boolean deep6205(boolean x) { - return deep6206(x); - } - - public static boolean deep6206(boolean x) { - return deep6207(x); - } - - public static boolean deep6207(boolean x) { - return deep6208(x); - } - - public static boolean deep6208(boolean x) { - return deep6209(x); - } - - public static boolean deep6209(boolean x) { - return deep6210(x); - } - - public static boolean deep6210(boolean x) { - return deep6211(x); - } - - public static boolean deep6211(boolean x) { - return deep6212(x); - } - - public static boolean deep6212(boolean x) { - return deep6213(x); - } - - public static boolean deep6213(boolean x) { - return deep6214(x); - } - - public static boolean deep6214(boolean x) { - return deep6215(x); - } - - public static boolean deep6215(boolean x) { - return deep6216(x); - } - - public static boolean deep6216(boolean x) { - return deep6217(x); - } - - public static boolean deep6217(boolean x) { - return deep6218(x); - } - - public static boolean deep6218(boolean x) { - return deep6219(x); - } - - public static boolean deep6219(boolean x) { - return deep6220(x); - } - - public static boolean deep6220(boolean x) { - return deep6221(x); - } - - public static boolean deep6221(boolean x) { - return deep6222(x); - } - - public static boolean deep6222(boolean x) { - return deep6223(x); - } - - public static boolean deep6223(boolean x) { - return deep6224(x); - } - - public static boolean deep6224(boolean x) { - return deep6225(x); - } - - public static boolean deep6225(boolean x) { - return deep6226(x); - } - - public static boolean deep6226(boolean x) { - return deep6227(x); - } - - public static boolean deep6227(boolean x) { - return deep6228(x); - } - - public static boolean deep6228(boolean x) { - return deep6229(x); - } - - public static boolean deep6229(boolean x) { - return deep6230(x); - } - - public static boolean deep6230(boolean x) { - return deep6231(x); - } - - public static boolean deep6231(boolean x) { - return deep6232(x); - } - - public static boolean deep6232(boolean x) { - return deep6233(x); - } - - public static boolean deep6233(boolean x) { - return deep6234(x); - } - - public static boolean deep6234(boolean x) { - return deep6235(x); - } - - public static boolean deep6235(boolean x) { - return deep6236(x); - } - - public static boolean deep6236(boolean x) { - return deep6237(x); - } - - public static boolean deep6237(boolean x) { - return deep6238(x); - } - - public static boolean deep6238(boolean x) { - return deep6239(x); - } - - public static boolean deep6239(boolean x) { - return deep6240(x); - } - - public static boolean deep6240(boolean x) { - return deep6241(x); - } - - public static boolean deep6241(boolean x) { - return deep6242(x); - } - - public static boolean deep6242(boolean x) { - return deep6243(x); - } - - public static boolean deep6243(boolean x) { - return deep6244(x); - } - - public static boolean deep6244(boolean x) { - return deep6245(x); - } - - public static boolean deep6245(boolean x) { - return deep6246(x); - } - - public static boolean deep6246(boolean x) { - return deep6247(x); - } - - public static boolean deep6247(boolean x) { - return deep6248(x); - } - - public static boolean deep6248(boolean x) { - return deep6249(x); - } - - public static boolean deep6249(boolean x) { - return deep6250(x); - } - - public static boolean deep6250(boolean x) { - return deep6251(x); - } - - public static boolean deep6251(boolean x) { - return deep6252(x); - } - - public static boolean deep6252(boolean x) { - return deep6253(x); - } - - public static boolean deep6253(boolean x) { - return deep6254(x); - } - - public static boolean deep6254(boolean x) { - return deep6255(x); - } - - public static boolean deep6255(boolean x) { - return deep6256(x); - } - - public static boolean deep6256(boolean x) { - return deep6257(x); - } - - public static boolean deep6257(boolean x) { - return deep6258(x); - } - - public static boolean deep6258(boolean x) { - return deep6259(x); - } - - public static boolean deep6259(boolean x) { - return deep6260(x); - } - - public static boolean deep6260(boolean x) { - return deep6261(x); - } - - public static boolean deep6261(boolean x) { - return deep6262(x); - } - - public static boolean deep6262(boolean x) { - return deep6263(x); - } - - public static boolean deep6263(boolean x) { - return deep6264(x); - } - - public static boolean deep6264(boolean x) { - return deep6265(x); - } - - public static boolean deep6265(boolean x) { - return deep6266(x); - } - - public static boolean deep6266(boolean x) { - return deep6267(x); - } - - public static boolean deep6267(boolean x) { - return deep6268(x); - } - - public static boolean deep6268(boolean x) { - return deep6269(x); - } - - public static boolean deep6269(boolean x) { - return deep6270(x); - } - - public static boolean deep6270(boolean x) { - return deep6271(x); - } - - public static boolean deep6271(boolean x) { - return deep6272(x); - } - - public static boolean deep6272(boolean x) { - return deep6273(x); - } - - public static boolean deep6273(boolean x) { - return deep6274(x); - } - - public static boolean deep6274(boolean x) { - return deep6275(x); - } - - public static boolean deep6275(boolean x) { - return deep6276(x); - } - - public static boolean deep6276(boolean x) { - return deep6277(x); - } - - public static boolean deep6277(boolean x) { - return deep6278(x); - } - - public static boolean deep6278(boolean x) { - return deep6279(x); - } - - public static boolean deep6279(boolean x) { - return deep6280(x); - } - - public static boolean deep6280(boolean x) { - return deep6281(x); - } - - public static boolean deep6281(boolean x) { - return deep6282(x); - } - - public static boolean deep6282(boolean x) { - return deep6283(x); - } - - public static boolean deep6283(boolean x) { - return deep6284(x); - } - - public static boolean deep6284(boolean x) { - return deep6285(x); - } - - public static boolean deep6285(boolean x) { - return deep6286(x); - } - - public static boolean deep6286(boolean x) { - return deep6287(x); - } - - public static boolean deep6287(boolean x) { - return deep6288(x); - } - - public static boolean deep6288(boolean x) { - return deep6289(x); - } - - public static boolean deep6289(boolean x) { - return deep6290(x); - } - - public static boolean deep6290(boolean x) { - return deep6291(x); - } - - public static boolean deep6291(boolean x) { - return deep6292(x); - } - - public static boolean deep6292(boolean x) { - return deep6293(x); - } - - public static boolean deep6293(boolean x) { - return deep6294(x); - } - - public static boolean deep6294(boolean x) { - return deep6295(x); - } - - public static boolean deep6295(boolean x) { - return deep6296(x); - } - - public static boolean deep6296(boolean x) { - return deep6297(x); - } - - public static boolean deep6297(boolean x) { - return deep6298(x); - } - - public static boolean deep6298(boolean x) { - return deep6299(x); - } - - public static boolean deep6299(boolean x) { - return deep6300(x); - } - - public static boolean deep6300(boolean x) { - return deep6301(x); - } - - public static boolean deep6301(boolean x) { - return deep6302(x); - } - - public static boolean deep6302(boolean x) { - return deep6303(x); - } - - public static boolean deep6303(boolean x) { - return deep6304(x); - } - - public static boolean deep6304(boolean x) { - return deep6305(x); - } - - public static boolean deep6305(boolean x) { - return deep6306(x); - } - - public static boolean deep6306(boolean x) { - return deep6307(x); - } - - public static boolean deep6307(boolean x) { - return deep6308(x); - } - - public static boolean deep6308(boolean x) { - return deep6309(x); - } - - public static boolean deep6309(boolean x) { - return deep6310(x); - } - - public static boolean deep6310(boolean x) { - return deep6311(x); - } - - public static boolean deep6311(boolean x) { - return deep6312(x); - } - - public static boolean deep6312(boolean x) { - return deep6313(x); - } - - public static boolean deep6313(boolean x) { - return deep6314(x); - } - - public static boolean deep6314(boolean x) { - return deep6315(x); - } - - public static boolean deep6315(boolean x) { - return deep6316(x); - } - - public static boolean deep6316(boolean x) { - return deep6317(x); - } - - public static boolean deep6317(boolean x) { - return deep6318(x); - } - - public static boolean deep6318(boolean x) { - return deep6319(x); - } - - public static boolean deep6319(boolean x) { - return deep6320(x); - } - - public static boolean deep6320(boolean x) { - return deep6321(x); - } - - public static boolean deep6321(boolean x) { - return deep6322(x); - } - - public static boolean deep6322(boolean x) { - return deep6323(x); - } - - public static boolean deep6323(boolean x) { - return deep6324(x); - } - - public static boolean deep6324(boolean x) { - return deep6325(x); - } - - public static boolean deep6325(boolean x) { - return deep6326(x); - } - - public static boolean deep6326(boolean x) { - return deep6327(x); - } - - public static boolean deep6327(boolean x) { - return deep6328(x); - } - - public static boolean deep6328(boolean x) { - return deep6329(x); - } - - public static boolean deep6329(boolean x) { - return deep6330(x); - } - - public static boolean deep6330(boolean x) { - return deep6331(x); - } - - public static boolean deep6331(boolean x) { - return deep6332(x); - } - - public static boolean deep6332(boolean x) { - return deep6333(x); - } - - public static boolean deep6333(boolean x) { - return deep6334(x); - } - - public static boolean deep6334(boolean x) { - return deep6335(x); - } - - public static boolean deep6335(boolean x) { - return deep6336(x); - } - - public static boolean deep6336(boolean x) { - return deep6337(x); - } - - public static boolean deep6337(boolean x) { - return deep6338(x); - } - - public static boolean deep6338(boolean x) { - return deep6339(x); - } - - public static boolean deep6339(boolean x) { - return deep6340(x); - } - - public static boolean deep6340(boolean x) { - return deep6341(x); - } - - public static boolean deep6341(boolean x) { - return deep6342(x); - } - - public static boolean deep6342(boolean x) { - return deep6343(x); - } - - public static boolean deep6343(boolean x) { - return deep6344(x); - } - - public static boolean deep6344(boolean x) { - return deep6345(x); - } - - public static boolean deep6345(boolean x) { - return deep6346(x); - } - - public static boolean deep6346(boolean x) { - return deep6347(x); - } - - public static boolean deep6347(boolean x) { - return deep6348(x); - } - - public static boolean deep6348(boolean x) { - return deep6349(x); - } - - public static boolean deep6349(boolean x) { - return deep6350(x); - } - - public static boolean deep6350(boolean x) { - return deep6351(x); - } - - public static boolean deep6351(boolean x) { - return deep6352(x); - } - - public static boolean deep6352(boolean x) { - return deep6353(x); - } - - public static boolean deep6353(boolean x) { - return deep6354(x); - } - - public static boolean deep6354(boolean x) { - return deep6355(x); - } - - public static boolean deep6355(boolean x) { - return deep6356(x); - } - - public static boolean deep6356(boolean x) { - return deep6357(x); - } - - public static boolean deep6357(boolean x) { - return deep6358(x); - } - - public static boolean deep6358(boolean x) { - return deep6359(x); - } - - public static boolean deep6359(boolean x) { - return deep6360(x); - } - - public static boolean deep6360(boolean x) { - return deep6361(x); - } - - public static boolean deep6361(boolean x) { - return deep6362(x); - } - - public static boolean deep6362(boolean x) { - return deep6363(x); - } - - public static boolean deep6363(boolean x) { - return deep6364(x); - } - - public static boolean deep6364(boolean x) { - return deep6365(x); - } - - public static boolean deep6365(boolean x) { - return deep6366(x); - } - - public static boolean deep6366(boolean x) { - return deep6367(x); - } - - public static boolean deep6367(boolean x) { - return deep6368(x); - } - - public static boolean deep6368(boolean x) { - return deep6369(x); - } - - public static boolean deep6369(boolean x) { - return deep6370(x); - } - - public static boolean deep6370(boolean x) { - return deep6371(x); - } - - public static boolean deep6371(boolean x) { - return deep6372(x); - } - - public static boolean deep6372(boolean x) { - return deep6373(x); - } - - public static boolean deep6373(boolean x) { - return deep6374(x); - } - - public static boolean deep6374(boolean x) { - return deep6375(x); - } - - public static boolean deep6375(boolean x) { - return deep6376(x); - } - - public static boolean deep6376(boolean x) { - return deep6377(x); - } - - public static boolean deep6377(boolean x) { - return deep6378(x); - } - - public static boolean deep6378(boolean x) { - return deep6379(x); - } - - public static boolean deep6379(boolean x) { - return deep6380(x); - } - - public static boolean deep6380(boolean x) { - return deep6381(x); - } - - public static boolean deep6381(boolean x) { - return deep6382(x); - } - - public static boolean deep6382(boolean x) { - return deep6383(x); - } - - public static boolean deep6383(boolean x) { - return deep6384(x); - } - - public static boolean deep6384(boolean x) { - return deep6385(x); - } - - public static boolean deep6385(boolean x) { - return deep6386(x); - } - - public static boolean deep6386(boolean x) { - return deep6387(x); - } - - public static boolean deep6387(boolean x) { - return deep6388(x); - } - - public static boolean deep6388(boolean x) { - return deep6389(x); - } - - public static boolean deep6389(boolean x) { - return deep6390(x); - } - - public static boolean deep6390(boolean x) { - return deep6391(x); - } - - public static boolean deep6391(boolean x) { - return deep6392(x); - } - - public static boolean deep6392(boolean x) { - return deep6393(x); - } - - public static boolean deep6393(boolean x) { - return deep6394(x); - } - - public static boolean deep6394(boolean x) { - return deep6395(x); - } - - public static boolean deep6395(boolean x) { - return deep6396(x); - } - - public static boolean deep6396(boolean x) { - return deep6397(x); - } - - public static boolean deep6397(boolean x) { - return deep6398(x); - } - - public static boolean deep6398(boolean x) { - return deep6399(x); - } - - public static boolean deep6399(boolean x) { - return deep6400(x); - } - - public static boolean deep6400(boolean x) { - return deep6401(x); - } - - public static boolean deep6401(boolean x) { - return deep6402(x); - } - - public static boolean deep6402(boolean x) { - return deep6403(x); - } - - public static boolean deep6403(boolean x) { - return deep6404(x); - } - - public static boolean deep6404(boolean x) { - return deep6405(x); - } - - public static boolean deep6405(boolean x) { - return deep6406(x); - } - - public static boolean deep6406(boolean x) { - return deep6407(x); - } - - public static boolean deep6407(boolean x) { - return deep6408(x); - } - - public static boolean deep6408(boolean x) { - return deep6409(x); - } - - public static boolean deep6409(boolean x) { - return deep6410(x); - } - - public static boolean deep6410(boolean x) { - return deep6411(x); - } - - public static boolean deep6411(boolean x) { - return deep6412(x); - } - - public static boolean deep6412(boolean x) { - return deep6413(x); - } - - public static boolean deep6413(boolean x) { - return deep6414(x); - } - - public static boolean deep6414(boolean x) { - return deep6415(x); - } - - public static boolean deep6415(boolean x) { - return deep6416(x); - } - - public static boolean deep6416(boolean x) { - return deep6417(x); - } - - public static boolean deep6417(boolean x) { - return deep6418(x); - } - - public static boolean deep6418(boolean x) { - return deep6419(x); - } - - public static boolean deep6419(boolean x) { - return deep6420(x); - } - - public static boolean deep6420(boolean x) { - return deep6421(x); - } - - public static boolean deep6421(boolean x) { - return deep6422(x); - } - - public static boolean deep6422(boolean x) { - return deep6423(x); - } - - public static boolean deep6423(boolean x) { - return deep6424(x); - } - - public static boolean deep6424(boolean x) { - return deep6425(x); - } - - public static boolean deep6425(boolean x) { - return deep6426(x); - } - - public static boolean deep6426(boolean x) { - return deep6427(x); - } - - public static boolean deep6427(boolean x) { - return deep6428(x); - } - - public static boolean deep6428(boolean x) { - return deep6429(x); - } - - public static boolean deep6429(boolean x) { - return deep6430(x); - } - - public static boolean deep6430(boolean x) { - return deep6431(x); - } - - public static boolean deep6431(boolean x) { - return deep6432(x); - } - - public static boolean deep6432(boolean x) { - return deep6433(x); - } - - public static boolean deep6433(boolean x) { - return deep6434(x); - } - - public static boolean deep6434(boolean x) { - return deep6435(x); - } - - public static boolean deep6435(boolean x) { - return deep6436(x); - } - - public static boolean deep6436(boolean x) { - return deep6437(x); - } - - public static boolean deep6437(boolean x) { - return deep6438(x); - } - - public static boolean deep6438(boolean x) { - return deep6439(x); - } - - public static boolean deep6439(boolean x) { - return deep6440(x); - } - - public static boolean deep6440(boolean x) { - return deep6441(x); - } - - public static boolean deep6441(boolean x) { - return deep6442(x); - } - - public static boolean deep6442(boolean x) { - return deep6443(x); - } - - public static boolean deep6443(boolean x) { - return deep6444(x); - } - - public static boolean deep6444(boolean x) { - return deep6445(x); - } - - public static boolean deep6445(boolean x) { - return deep6446(x); - } - - public static boolean deep6446(boolean x) { - return deep6447(x); - } - - public static boolean deep6447(boolean x) { - return deep6448(x); - } - - public static boolean deep6448(boolean x) { - return deep6449(x); - } - - public static boolean deep6449(boolean x) { - return deep6450(x); - } - - public static boolean deep6450(boolean x) { - return deep6451(x); - } - - public static boolean deep6451(boolean x) { - return deep6452(x); - } - - public static boolean deep6452(boolean x) { - return deep6453(x); - } - - public static boolean deep6453(boolean x) { - return deep6454(x); - } - - public static boolean deep6454(boolean x) { - return deep6455(x); - } - - public static boolean deep6455(boolean x) { - return deep6456(x); - } - - public static boolean deep6456(boolean x) { - return deep6457(x); - } - - public static boolean deep6457(boolean x) { - return deep6458(x); - } - - public static boolean deep6458(boolean x) { - return deep6459(x); - } - - public static boolean deep6459(boolean x) { - return deep6460(x); - } - - public static boolean deep6460(boolean x) { - return deep6461(x); - } - - public static boolean deep6461(boolean x) { - return deep6462(x); - } - - public static boolean deep6462(boolean x) { - return deep6463(x); - } - - public static boolean deep6463(boolean x) { - return deep6464(x); - } - - public static boolean deep6464(boolean x) { - return deep6465(x); - } - - public static boolean deep6465(boolean x) { - return deep6466(x); - } - - public static boolean deep6466(boolean x) { - return deep6467(x); - } - - public static boolean deep6467(boolean x) { - return deep6468(x); - } - - public static boolean deep6468(boolean x) { - return deep6469(x); - } - - public static boolean deep6469(boolean x) { - return deep6470(x); - } - - public static boolean deep6470(boolean x) { - return deep6471(x); - } - - public static boolean deep6471(boolean x) { - return deep6472(x); - } - - public static boolean deep6472(boolean x) { - return deep6473(x); - } - - public static boolean deep6473(boolean x) { - return deep6474(x); - } - - public static boolean deep6474(boolean x) { - return deep6475(x); - } - - public static boolean deep6475(boolean x) { - return deep6476(x); - } - - public static boolean deep6476(boolean x) { - return deep6477(x); - } - - public static boolean deep6477(boolean x) { - return deep6478(x); - } - - public static boolean deep6478(boolean x) { - return deep6479(x); - } - - public static boolean deep6479(boolean x) { - return deep6480(x); - } - - public static boolean deep6480(boolean x) { - return deep6481(x); - } - - public static boolean deep6481(boolean x) { - return deep6482(x); - } - - public static boolean deep6482(boolean x) { - return deep6483(x); - } - - public static boolean deep6483(boolean x) { - return deep6484(x); - } - - public static boolean deep6484(boolean x) { - return deep6485(x); - } - - public static boolean deep6485(boolean x) { - return deep6486(x); - } - - public static boolean deep6486(boolean x) { - return deep6487(x); - } - - public static boolean deep6487(boolean x) { - return deep6488(x); - } - - public static boolean deep6488(boolean x) { - return deep6489(x); - } - - public static boolean deep6489(boolean x) { - return deep6490(x); - } - - public static boolean deep6490(boolean x) { - return deep6491(x); - } - - public static boolean deep6491(boolean x) { - return deep6492(x); - } - - public static boolean deep6492(boolean x) { - return deep6493(x); - } - - public static boolean deep6493(boolean x) { - return deep6494(x); - } - - public static boolean deep6494(boolean x) { - return deep6495(x); - } - - public static boolean deep6495(boolean x) { - return deep6496(x); - } - - public static boolean deep6496(boolean x) { - return deep6497(x); - } - - public static boolean deep6497(boolean x) { - return deep6498(x); - } - - public static boolean deep6498(boolean x) { - return deep6499(x); - } - - public static boolean deep6499(boolean x) { - return deep6500(x); - } - - public static boolean deep6500(boolean x) { - return deep6501(x); - } - - public static boolean deep6501(boolean x) { - return deep6502(x); - } - - public static boolean deep6502(boolean x) { - return deep6503(x); - } - - public static boolean deep6503(boolean x) { - return deep6504(x); - } - - public static boolean deep6504(boolean x) { - return deep6505(x); - } - - public static boolean deep6505(boolean x) { - return deep6506(x); - } - - public static boolean deep6506(boolean x) { - return deep6507(x); - } - - public static boolean deep6507(boolean x) { - return deep6508(x); - } - - public static boolean deep6508(boolean x) { - return deep6509(x); - } - - public static boolean deep6509(boolean x) { - return deep6510(x); - } - - public static boolean deep6510(boolean x) { - return deep6511(x); - } - - public static boolean deep6511(boolean x) { - return deep6512(x); - } - - public static boolean deep6512(boolean x) { - return deep6513(x); - } - - public static boolean deep6513(boolean x) { - return deep6514(x); - } - - public static boolean deep6514(boolean x) { - return deep6515(x); - } - - public static boolean deep6515(boolean x) { - return deep6516(x); - } - - public static boolean deep6516(boolean x) { - return deep6517(x); - } - - public static boolean deep6517(boolean x) { - return deep6518(x); - } - - public static boolean deep6518(boolean x) { - return deep6519(x); - } - - public static boolean deep6519(boolean x) { - return deep6520(x); - } - - public static boolean deep6520(boolean x) { - return deep6521(x); - } - - public static boolean deep6521(boolean x) { - return deep6522(x); - } - - public static boolean deep6522(boolean x) { - return deep6523(x); - } - - public static boolean deep6523(boolean x) { - return deep6524(x); - } - - public static boolean deep6524(boolean x) { - return deep6525(x); - } - - public static boolean deep6525(boolean x) { - return deep6526(x); - } - - public static boolean deep6526(boolean x) { - return deep6527(x); - } - - public static boolean deep6527(boolean x) { - return deep6528(x); - } - - public static boolean deep6528(boolean x) { - return deep6529(x); - } - - public static boolean deep6529(boolean x) { - return deep6530(x); - } - - public static boolean deep6530(boolean x) { - return deep6531(x); - } - - public static boolean deep6531(boolean x) { - return deep6532(x); - } - - public static boolean deep6532(boolean x) { - return deep6533(x); - } - - public static boolean deep6533(boolean x) { - return deep6534(x); - } - - public static boolean deep6534(boolean x) { - return deep6535(x); - } - - public static boolean deep6535(boolean x) { - return deep6536(x); - } - - public static boolean deep6536(boolean x) { - return deep6537(x); - } - - public static boolean deep6537(boolean x) { - return deep6538(x); - } - - public static boolean deep6538(boolean x) { - return deep6539(x); - } - - public static boolean deep6539(boolean x) { - return deep6540(x); - } - - public static boolean deep6540(boolean x) { - return deep6541(x); - } - - public static boolean deep6541(boolean x) { - return deep6542(x); - } - - public static boolean deep6542(boolean x) { - return deep6543(x); - } - - public static boolean deep6543(boolean x) { - return deep6544(x); - } - - public static boolean deep6544(boolean x) { - return deep6545(x); - } - - public static boolean deep6545(boolean x) { - return deep6546(x); - } - - public static boolean deep6546(boolean x) { - return deep6547(x); - } - - public static boolean deep6547(boolean x) { - return deep6548(x); - } - - public static boolean deep6548(boolean x) { - return deep6549(x); - } - - public static boolean deep6549(boolean x) { - return deep6550(x); - } - - public static boolean deep6550(boolean x) { - return deep6551(x); - } - - public static boolean deep6551(boolean x) { - return deep6552(x); - } - - public static boolean deep6552(boolean x) { - return deep6553(x); - } - - public static boolean deep6553(boolean x) { - return deep6554(x); - } - - public static boolean deep6554(boolean x) { - return deep6555(x); - } - - public static boolean deep6555(boolean x) { - return deep6556(x); - } - - public static boolean deep6556(boolean x) { - return deep6557(x); - } - - public static boolean deep6557(boolean x) { - return deep6558(x); - } - - public static boolean deep6558(boolean x) { - return deep6559(x); - } - - public static boolean deep6559(boolean x) { - return deep6560(x); - } - - public static boolean deep6560(boolean x) { - return deep6561(x); - } - - public static boolean deep6561(boolean x) { - return deep6562(x); - } - - public static boolean deep6562(boolean x) { - return deep6563(x); - } - - public static boolean deep6563(boolean x) { - return deep6564(x); - } - - public static boolean deep6564(boolean x) { - return deep6565(x); - } - - public static boolean deep6565(boolean x) { - return deep6566(x); - } - - public static boolean deep6566(boolean x) { - return deep6567(x); - } - - public static boolean deep6567(boolean x) { - return deep6568(x); - } - - public static boolean deep6568(boolean x) { - return deep6569(x); - } - - public static boolean deep6569(boolean x) { - return deep6570(x); - } - - public static boolean deep6570(boolean x) { - return deep6571(x); - } - - public static boolean deep6571(boolean x) { - return deep6572(x); - } - - public static boolean deep6572(boolean x) { - return deep6573(x); - } - - public static boolean deep6573(boolean x) { - return deep6574(x); - } - - public static boolean deep6574(boolean x) { - return deep6575(x); - } - - public static boolean deep6575(boolean x) { - return deep6576(x); - } - - public static boolean deep6576(boolean x) { - return deep6577(x); - } - - public static boolean deep6577(boolean x) { - return deep6578(x); - } - - public static boolean deep6578(boolean x) { - return deep6579(x); - } - - public static boolean deep6579(boolean x) { - return deep6580(x); - } - - public static boolean deep6580(boolean x) { - return deep6581(x); - } - - public static boolean deep6581(boolean x) { - return deep6582(x); - } - - public static boolean deep6582(boolean x) { - return deep6583(x); - } - - public static boolean deep6583(boolean x) { - return deep6584(x); - } - - public static boolean deep6584(boolean x) { - return deep6585(x); - } - - public static boolean deep6585(boolean x) { - return deep6586(x); - } - - public static boolean deep6586(boolean x) { - return deep6587(x); - } - - public static boolean deep6587(boolean x) { - return deep6588(x); - } - - public static boolean deep6588(boolean x) { - return deep6589(x); - } - - public static boolean deep6589(boolean x) { - return deep6590(x); - } - - public static boolean deep6590(boolean x) { - return deep6591(x); - } - - public static boolean deep6591(boolean x) { - return deep6592(x); - } - - public static boolean deep6592(boolean x) { - return deep6593(x); - } - - public static boolean deep6593(boolean x) { - return deep6594(x); - } - - public static boolean deep6594(boolean x) { - return deep6595(x); - } - - public static boolean deep6595(boolean x) { - return deep6596(x); - } - - public static boolean deep6596(boolean x) { - return deep6597(x); - } - - public static boolean deep6597(boolean x) { - return deep6598(x); - } - - public static boolean deep6598(boolean x) { - return deep6599(x); - } - - public static boolean deep6599(boolean x) { - return deep6600(x); - } - - public static boolean deep6600(boolean x) { - return deep6601(x); - } - - public static boolean deep6601(boolean x) { - return deep6602(x); - } - - public static boolean deep6602(boolean x) { - return deep6603(x); - } - - public static boolean deep6603(boolean x) { - return deep6604(x); - } - - public static boolean deep6604(boolean x) { - return deep6605(x); - } - - public static boolean deep6605(boolean x) { - return deep6606(x); - } - - public static boolean deep6606(boolean x) { - return deep6607(x); - } - - public static boolean deep6607(boolean x) { - return deep6608(x); - } - - public static boolean deep6608(boolean x) { - return deep6609(x); - } - - public static boolean deep6609(boolean x) { - return deep6610(x); - } - - public static boolean deep6610(boolean x) { - return deep6611(x); - } - - public static boolean deep6611(boolean x) { - return deep6612(x); - } - - public static boolean deep6612(boolean x) { - return deep6613(x); - } - - public static boolean deep6613(boolean x) { - return deep6614(x); - } - - public static boolean deep6614(boolean x) { - return deep6615(x); - } - - public static boolean deep6615(boolean x) { - return deep6616(x); - } - - public static boolean deep6616(boolean x) { - return deep6617(x); - } - - public static boolean deep6617(boolean x) { - return deep6618(x); - } - - public static boolean deep6618(boolean x) { - return deep6619(x); - } - - public static boolean deep6619(boolean x) { - return deep6620(x); - } - - public static boolean deep6620(boolean x) { - return deep6621(x); - } - - public static boolean deep6621(boolean x) { - return deep6622(x); - } - - public static boolean deep6622(boolean x) { - return deep6623(x); - } - - public static boolean deep6623(boolean x) { - return deep6624(x); - } - - public static boolean deep6624(boolean x) { - return deep6625(x); - } - - public static boolean deep6625(boolean x) { - return deep6626(x); - } - - public static boolean deep6626(boolean x) { - return deep6627(x); - } - - public static boolean deep6627(boolean x) { - return deep6628(x); - } - - public static boolean deep6628(boolean x) { - return deep6629(x); - } - - public static boolean deep6629(boolean x) { - return deep6630(x); - } - - public static boolean deep6630(boolean x) { - return deep6631(x); - } - - public static boolean deep6631(boolean x) { - return deep6632(x); - } - - public static boolean deep6632(boolean x) { - return deep6633(x); - } - - public static boolean deep6633(boolean x) { - return deep6634(x); - } - - public static boolean deep6634(boolean x) { - return deep6635(x); - } - - public static boolean deep6635(boolean x) { - return deep6636(x); - } - - public static boolean deep6636(boolean x) { - return deep6637(x); - } - - public static boolean deep6637(boolean x) { - return deep6638(x); - } - - public static boolean deep6638(boolean x) { - return deep6639(x); - } - - public static boolean deep6639(boolean x) { - return deep6640(x); - } - - public static boolean deep6640(boolean x) { - return deep6641(x); - } - - public static boolean deep6641(boolean x) { - return deep6642(x); - } - - public static boolean deep6642(boolean x) { - return deep6643(x); - } - - public static boolean deep6643(boolean x) { - return deep6644(x); - } - - public static boolean deep6644(boolean x) { - return deep6645(x); - } - - public static boolean deep6645(boolean x) { - return deep6646(x); - } - - public static boolean deep6646(boolean x) { - return deep6647(x); - } - - public static boolean deep6647(boolean x) { - return deep6648(x); - } - - public static boolean deep6648(boolean x) { - return deep6649(x); - } - - public static boolean deep6649(boolean x) { - return deep6650(x); - } - - public static boolean deep6650(boolean x) { - return deep6651(x); - } - - public static boolean deep6651(boolean x) { - return deep6652(x); - } - - public static boolean deep6652(boolean x) { - return deep6653(x); - } - - public static boolean deep6653(boolean x) { - return deep6654(x); - } - - public static boolean deep6654(boolean x) { - return deep6655(x); - } - - public static boolean deep6655(boolean x) { - return deep6656(x); - } - - public static boolean deep6656(boolean x) { - return deep6657(x); - } - - public static boolean deep6657(boolean x) { - return deep6658(x); - } - - public static boolean deep6658(boolean x) { - return deep6659(x); - } - - public static boolean deep6659(boolean x) { - return deep6660(x); - } - - public static boolean deep6660(boolean x) { - return deep6661(x); - } - - public static boolean deep6661(boolean x) { - return deep6662(x); - } - - public static boolean deep6662(boolean x) { - return deep6663(x); - } - - public static boolean deep6663(boolean x) { - return deep6664(x); - } - - public static boolean deep6664(boolean x) { - return deep6665(x); - } - - public static boolean deep6665(boolean x) { - return deep6666(x); - } - - public static boolean deep6666(boolean x) { - return deep6667(x); - } - - public static boolean deep6667(boolean x) { - return deep6668(x); - } - - public static boolean deep6668(boolean x) { - return deep6669(x); - } - - public static boolean deep6669(boolean x) { - return deep6670(x); - } - - public static boolean deep6670(boolean x) { - return deep6671(x); - } - - public static boolean deep6671(boolean x) { - return deep6672(x); - } - - public static boolean deep6672(boolean x) { - return deep6673(x); - } - - public static boolean deep6673(boolean x) { - return deep6674(x); - } - - public static boolean deep6674(boolean x) { - return deep6675(x); - } - - public static boolean deep6675(boolean x) { - return deep6676(x); - } - - public static boolean deep6676(boolean x) { - return deep6677(x); - } - - public static boolean deep6677(boolean x) { - return deep6678(x); - } - - public static boolean deep6678(boolean x) { - return deep6679(x); - } - - public static boolean deep6679(boolean x) { - return deep6680(x); - } - - public static boolean deep6680(boolean x) { - return deep6681(x); - } - - public static boolean deep6681(boolean x) { - return deep6682(x); - } - - public static boolean deep6682(boolean x) { - return deep6683(x); - } - - public static boolean deep6683(boolean x) { - return deep6684(x); - } - - public static boolean deep6684(boolean x) { - return deep6685(x); - } - - public static boolean deep6685(boolean x) { - return deep6686(x); - } - - public static boolean deep6686(boolean x) { - return deep6687(x); - } - - public static boolean deep6687(boolean x) { - return deep6688(x); - } - - public static boolean deep6688(boolean x) { - return deep6689(x); - } - - public static boolean deep6689(boolean x) { - return deep6690(x); - } - - public static boolean deep6690(boolean x) { - return deep6691(x); - } - - public static boolean deep6691(boolean x) { - return deep6692(x); - } - - public static boolean deep6692(boolean x) { - return deep6693(x); - } - - public static boolean deep6693(boolean x) { - return deep6694(x); - } - - public static boolean deep6694(boolean x) { - return deep6695(x); - } - - public static boolean deep6695(boolean x) { - return deep6696(x); - } - - public static boolean deep6696(boolean x) { - return deep6697(x); - } - - public static boolean deep6697(boolean x) { - return deep6698(x); - } - - public static boolean deep6698(boolean x) { - return deep6699(x); - } - - public static boolean deep6699(boolean x) { - return deep6700(x); - } - - public static boolean deep6700(boolean x) { - return deep6701(x); - } - - public static boolean deep6701(boolean x) { - return deep6702(x); - } - - public static boolean deep6702(boolean x) { - return deep6703(x); - } - - public static boolean deep6703(boolean x) { - return deep6704(x); - } - - public static boolean deep6704(boolean x) { - return deep6705(x); - } - - public static boolean deep6705(boolean x) { - return deep6706(x); - } - - public static boolean deep6706(boolean x) { - return deep6707(x); - } - - public static boolean deep6707(boolean x) { - return deep6708(x); - } - - public static boolean deep6708(boolean x) { - return deep6709(x); - } - - public static boolean deep6709(boolean x) { - return deep6710(x); - } - - public static boolean deep6710(boolean x) { - return deep6711(x); - } - - public static boolean deep6711(boolean x) { - return deep6712(x); - } - - public static boolean deep6712(boolean x) { - return deep6713(x); - } - - public static boolean deep6713(boolean x) { - return deep6714(x); - } - - public static boolean deep6714(boolean x) { - return deep6715(x); - } - - public static boolean deep6715(boolean x) { - return deep6716(x); - } - - public static boolean deep6716(boolean x) { - return deep6717(x); - } - - public static boolean deep6717(boolean x) { - return deep6718(x); - } - - public static boolean deep6718(boolean x) { - return deep6719(x); - } - - public static boolean deep6719(boolean x) { - return deep6720(x); - } - - public static boolean deep6720(boolean x) { - return deep6721(x); - } - - public static boolean deep6721(boolean x) { - return deep6722(x); - } - - public static boolean deep6722(boolean x) { - return deep6723(x); - } - - public static boolean deep6723(boolean x) { - return deep6724(x); - } - - public static boolean deep6724(boolean x) { - return deep6725(x); - } - - public static boolean deep6725(boolean x) { - return deep6726(x); - } - - public static boolean deep6726(boolean x) { - return deep6727(x); - } - - public static boolean deep6727(boolean x) { - return deep6728(x); - } - - public static boolean deep6728(boolean x) { - return deep6729(x); - } - - public static boolean deep6729(boolean x) { - return deep6730(x); - } - - public static boolean deep6730(boolean x) { - return deep6731(x); - } - - public static boolean deep6731(boolean x) { - return deep6732(x); - } - - public static boolean deep6732(boolean x) { - return deep6733(x); - } - - public static boolean deep6733(boolean x) { - return deep6734(x); - } - - public static boolean deep6734(boolean x) { - return deep6735(x); - } - - public static boolean deep6735(boolean x) { - return deep6736(x); - } - - public static boolean deep6736(boolean x) { - return deep6737(x); - } - - public static boolean deep6737(boolean x) { - return deep6738(x); - } - - public static boolean deep6738(boolean x) { - return deep6739(x); - } - - public static boolean deep6739(boolean x) { - return deep6740(x); - } - - public static boolean deep6740(boolean x) { - return deep6741(x); - } - - public static boolean deep6741(boolean x) { - return deep6742(x); - } - - public static boolean deep6742(boolean x) { - return deep6743(x); - } - - public static boolean deep6743(boolean x) { - return deep6744(x); - } - - public static boolean deep6744(boolean x) { - return deep6745(x); - } - - public static boolean deep6745(boolean x) { - return deep6746(x); - } - - public static boolean deep6746(boolean x) { - return deep6747(x); - } - - public static boolean deep6747(boolean x) { - return deep6748(x); - } - - public static boolean deep6748(boolean x) { - return deep6749(x); - } - - public static boolean deep6749(boolean x) { - return deep6750(x); - } - - public static boolean deep6750(boolean x) { - return deep6751(x); - } - - public static boolean deep6751(boolean x) { - return deep6752(x); - } - - public static boolean deep6752(boolean x) { - return deep6753(x); - } - - public static boolean deep6753(boolean x) { - return deep6754(x); - } - - public static boolean deep6754(boolean x) { - return deep6755(x); - } - - public static boolean deep6755(boolean x) { - return deep6756(x); - } - - public static boolean deep6756(boolean x) { - return deep6757(x); - } - - public static boolean deep6757(boolean x) { - return deep6758(x); - } - - public static boolean deep6758(boolean x) { - return deep6759(x); - } - - public static boolean deep6759(boolean x) { - return deep6760(x); - } - - public static boolean deep6760(boolean x) { - return deep6761(x); - } - - public static boolean deep6761(boolean x) { - return deep6762(x); - } - - public static boolean deep6762(boolean x) { - return deep6763(x); - } - - public static boolean deep6763(boolean x) { - return deep6764(x); - } - - public static boolean deep6764(boolean x) { - return deep6765(x); - } - - public static boolean deep6765(boolean x) { - return deep6766(x); - } - - public static boolean deep6766(boolean x) { - return deep6767(x); - } - - public static boolean deep6767(boolean x) { - return deep6768(x); - } - - public static boolean deep6768(boolean x) { - return deep6769(x); - } - - public static boolean deep6769(boolean x) { - return deep6770(x); - } - - public static boolean deep6770(boolean x) { - return deep6771(x); - } - - public static boolean deep6771(boolean x) { - return deep6772(x); - } - - public static boolean deep6772(boolean x) { - return deep6773(x); - } - - public static boolean deep6773(boolean x) { - return deep6774(x); - } - - public static boolean deep6774(boolean x) { - return deep6775(x); - } - - public static boolean deep6775(boolean x) { - return deep6776(x); - } - - public static boolean deep6776(boolean x) { - return deep6777(x); - } - - public static boolean deep6777(boolean x) { - return deep6778(x); - } - - public static boolean deep6778(boolean x) { - return deep6779(x); - } - - public static boolean deep6779(boolean x) { - return deep6780(x); - } - - public static boolean deep6780(boolean x) { - return deep6781(x); - } - - public static boolean deep6781(boolean x) { - return deep6782(x); - } - - public static boolean deep6782(boolean x) { - return deep6783(x); - } - - public static boolean deep6783(boolean x) { - return deep6784(x); - } - - public static boolean deep6784(boolean x) { - return deep6785(x); - } - - public static boolean deep6785(boolean x) { - return deep6786(x); - } - - public static boolean deep6786(boolean x) { - return deep6787(x); - } - - public static boolean deep6787(boolean x) { - return deep6788(x); - } - - public static boolean deep6788(boolean x) { - return deep6789(x); - } - - public static boolean deep6789(boolean x) { - return deep6790(x); - } - - public static boolean deep6790(boolean x) { - return deep6791(x); - } - - public static boolean deep6791(boolean x) { - return deep6792(x); - } - - public static boolean deep6792(boolean x) { - return deep6793(x); - } - - public static boolean deep6793(boolean x) { - return deep6794(x); - } - - public static boolean deep6794(boolean x) { - return deep6795(x); - } - - public static boolean deep6795(boolean x) { - return deep6796(x); - } - - public static boolean deep6796(boolean x) { - return deep6797(x); - } - - public static boolean deep6797(boolean x) { - return deep6798(x); - } - - public static boolean deep6798(boolean x) { - return deep6799(x); - } - - public static boolean deep6799(boolean x) { - return deep6800(x); - } - - public static boolean deep6800(boolean x) { - return deep6801(x); - } - - public static boolean deep6801(boolean x) { - return deep6802(x); - } - - public static boolean deep6802(boolean x) { - return deep6803(x); - } - - public static boolean deep6803(boolean x) { - return deep6804(x); - } - - public static boolean deep6804(boolean x) { - return deep6805(x); - } - - public static boolean deep6805(boolean x) { - return deep6806(x); - } - - public static boolean deep6806(boolean x) { - return deep6807(x); - } - - public static boolean deep6807(boolean x) { - return deep6808(x); - } - - public static boolean deep6808(boolean x) { - return deep6809(x); - } - - public static boolean deep6809(boolean x) { - return deep6810(x); - } - - public static boolean deep6810(boolean x) { - return deep6811(x); - } - - public static boolean deep6811(boolean x) { - return deep6812(x); - } - - public static boolean deep6812(boolean x) { - return deep6813(x); - } - - public static boolean deep6813(boolean x) { - return deep6814(x); - } - - public static boolean deep6814(boolean x) { - return deep6815(x); - } - - public static boolean deep6815(boolean x) { - return deep6816(x); - } - - public static boolean deep6816(boolean x) { - return deep6817(x); - } - - public static boolean deep6817(boolean x) { - return deep6818(x); - } - - public static boolean deep6818(boolean x) { - return deep6819(x); - } - - public static boolean deep6819(boolean x) { - return deep6820(x); - } - - public static boolean deep6820(boolean x) { - return deep6821(x); - } - - public static boolean deep6821(boolean x) { - return deep6822(x); - } - - public static boolean deep6822(boolean x) { - return deep6823(x); - } - - public static boolean deep6823(boolean x) { - return deep6824(x); - } - - public static boolean deep6824(boolean x) { - return deep6825(x); - } - - public static boolean deep6825(boolean x) { - return deep6826(x); - } - - public static boolean deep6826(boolean x) { - return deep6827(x); - } - - public static boolean deep6827(boolean x) { - return deep6828(x); - } - - public static boolean deep6828(boolean x) { - return deep6829(x); - } - - public static boolean deep6829(boolean x) { - return deep6830(x); - } - - public static boolean deep6830(boolean x) { - return deep6831(x); - } - - public static boolean deep6831(boolean x) { - return deep6832(x); - } - - public static boolean deep6832(boolean x) { - return deep6833(x); - } - - public static boolean deep6833(boolean x) { - return deep6834(x); - } - - public static boolean deep6834(boolean x) { - return deep6835(x); - } - - public static boolean deep6835(boolean x) { - return deep6836(x); - } - - public static boolean deep6836(boolean x) { - return deep6837(x); - } - - public static boolean deep6837(boolean x) { - return deep6838(x); - } - - public static boolean deep6838(boolean x) { - return deep6839(x); - } - - public static boolean deep6839(boolean x) { - return deep6840(x); - } - - public static boolean deep6840(boolean x) { - return deep6841(x); - } - - public static boolean deep6841(boolean x) { - return deep6842(x); - } - - public static boolean deep6842(boolean x) { - return deep6843(x); - } - - public static boolean deep6843(boolean x) { - return deep6844(x); - } - - public static boolean deep6844(boolean x) { - return deep6845(x); - } - - public static boolean deep6845(boolean x) { - return deep6846(x); - } - - public static boolean deep6846(boolean x) { - return deep6847(x); - } - - public static boolean deep6847(boolean x) { - return deep6848(x); - } - - public static boolean deep6848(boolean x) { - return deep6849(x); - } - - public static boolean deep6849(boolean x) { - return deep6850(x); - } - - public static boolean deep6850(boolean x) { - return deep6851(x); - } - - public static boolean deep6851(boolean x) { - return deep6852(x); - } - - public static boolean deep6852(boolean x) { - return deep6853(x); - } - - public static boolean deep6853(boolean x) { - return deep6854(x); - } - - public static boolean deep6854(boolean x) { - return deep6855(x); - } - - public static boolean deep6855(boolean x) { - return deep6856(x); - } - - public static boolean deep6856(boolean x) { - return deep6857(x); - } - - public static boolean deep6857(boolean x) { - return deep6858(x); - } - - public static boolean deep6858(boolean x) { - return deep6859(x); - } - - public static boolean deep6859(boolean x) { - return deep6860(x); - } - - public static boolean deep6860(boolean x) { - return deep6861(x); - } - - public static boolean deep6861(boolean x) { - return deep6862(x); - } - - public static boolean deep6862(boolean x) { - return deep6863(x); - } - - public static boolean deep6863(boolean x) { - return deep6864(x); - } - - public static boolean deep6864(boolean x) { - return deep6865(x); - } - - public static boolean deep6865(boolean x) { - return deep6866(x); - } - - public static boolean deep6866(boolean x) { - return deep6867(x); - } - - public static boolean deep6867(boolean x) { - return deep6868(x); - } - - public static boolean deep6868(boolean x) { - return deep6869(x); - } - - public static boolean deep6869(boolean x) { - return deep6870(x); - } - - public static boolean deep6870(boolean x) { - return deep6871(x); - } - - public static boolean deep6871(boolean x) { - return deep6872(x); - } - - public static boolean deep6872(boolean x) { - return deep6873(x); - } - - public static boolean deep6873(boolean x) { - return deep6874(x); - } - - public static boolean deep6874(boolean x) { - return deep6875(x); - } - - public static boolean deep6875(boolean x) { - return deep6876(x); - } - - public static boolean deep6876(boolean x) { - return deep6877(x); - } - - public static boolean deep6877(boolean x) { - return deep6878(x); - } - - public static boolean deep6878(boolean x) { - return deep6879(x); - } - - public static boolean deep6879(boolean x) { - return deep6880(x); - } - - public static boolean deep6880(boolean x) { - return deep6881(x); - } - - public static boolean deep6881(boolean x) { - return deep6882(x); - } - - public static boolean deep6882(boolean x) { - return deep6883(x); - } - - public static boolean deep6883(boolean x) { - return deep6884(x); - } - - public static boolean deep6884(boolean x) { - return deep6885(x); - } - - public static boolean deep6885(boolean x) { - return deep6886(x); - } - - public static boolean deep6886(boolean x) { - return deep6887(x); - } - - public static boolean deep6887(boolean x) { - return deep6888(x); - } - - public static boolean deep6888(boolean x) { - return deep6889(x); - } - - public static boolean deep6889(boolean x) { - return deep6890(x); - } - - public static boolean deep6890(boolean x) { - return deep6891(x); - } - - public static boolean deep6891(boolean x) { - return deep6892(x); - } - - public static boolean deep6892(boolean x) { - return deep6893(x); - } - - public static boolean deep6893(boolean x) { - return deep6894(x); - } - - public static boolean deep6894(boolean x) { - return deep6895(x); - } - - public static boolean deep6895(boolean x) { - return deep6896(x); - } - - public static boolean deep6896(boolean x) { - return deep6897(x); - } - - public static boolean deep6897(boolean x) { - return deep6898(x); - } - - public static boolean deep6898(boolean x) { - return deep6899(x); - } - - public static boolean deep6899(boolean x) { - return deep6900(x); - } - - public static boolean deep6900(boolean x) { - return deep6901(x); - } - - public static boolean deep6901(boolean x) { - return deep6902(x); - } - - public static boolean deep6902(boolean x) { - return deep6903(x); - } - - public static boolean deep6903(boolean x) { - return deep6904(x); - } - - public static boolean deep6904(boolean x) { - return deep6905(x); - } - - public static boolean deep6905(boolean x) { - return deep6906(x); - } - - public static boolean deep6906(boolean x) { - return deep6907(x); - } - - public static boolean deep6907(boolean x) { - return deep6908(x); - } - - public static boolean deep6908(boolean x) { - return deep6909(x); - } - - public static boolean deep6909(boolean x) { - return deep6910(x); - } - - public static boolean deep6910(boolean x) { - return deep6911(x); - } - - public static boolean deep6911(boolean x) { - return deep6912(x); - } - - public static boolean deep6912(boolean x) { - return deep6913(x); - } - - public static boolean deep6913(boolean x) { - return deep6914(x); - } - - public static boolean deep6914(boolean x) { - return deep6915(x); - } - - public static boolean deep6915(boolean x) { - return deep6916(x); - } - - public static boolean deep6916(boolean x) { - return deep6917(x); - } - - public static boolean deep6917(boolean x) { - return deep6918(x); - } - - public static boolean deep6918(boolean x) { - return deep6919(x); - } - - public static boolean deep6919(boolean x) { - return deep6920(x); - } - - public static boolean deep6920(boolean x) { - return deep6921(x); - } - - public static boolean deep6921(boolean x) { - return deep6922(x); - } - - public static boolean deep6922(boolean x) { - return deep6923(x); - } - - public static boolean deep6923(boolean x) { - return deep6924(x); - } - - public static boolean deep6924(boolean x) { - return deep6925(x); - } - - public static boolean deep6925(boolean x) { - return deep6926(x); - } - - public static boolean deep6926(boolean x) { - return deep6927(x); - } - - public static boolean deep6927(boolean x) { - return deep6928(x); - } - - public static boolean deep6928(boolean x) { - return deep6929(x); - } - - public static boolean deep6929(boolean x) { - return deep6930(x); - } - - public static boolean deep6930(boolean x) { - return deep6931(x); - } - - public static boolean deep6931(boolean x) { - return deep6932(x); - } - - public static boolean deep6932(boolean x) { - return deep6933(x); - } - - public static boolean deep6933(boolean x) { - return deep6934(x); - } - - public static boolean deep6934(boolean x) { - return deep6935(x); - } - - public static boolean deep6935(boolean x) { - return deep6936(x); - } - - public static boolean deep6936(boolean x) { - return deep6937(x); - } - - public static boolean deep6937(boolean x) { - return deep6938(x); - } - - public static boolean deep6938(boolean x) { - return deep6939(x); - } - - public static boolean deep6939(boolean x) { - return deep6940(x); - } - - public static boolean deep6940(boolean x) { - return deep6941(x); - } - - public static boolean deep6941(boolean x) { - return deep6942(x); - } - - public static boolean deep6942(boolean x) { - return deep6943(x); - } - - public static boolean deep6943(boolean x) { - return deep6944(x); - } - - public static boolean deep6944(boolean x) { - return deep6945(x); - } - - public static boolean deep6945(boolean x) { - return deep6946(x); - } - - public static boolean deep6946(boolean x) { - return deep6947(x); - } - - public static boolean deep6947(boolean x) { - return deep6948(x); - } - - public static boolean deep6948(boolean x) { - return deep6949(x); - } - - public static boolean deep6949(boolean x) { - return deep6950(x); - } - - public static boolean deep6950(boolean x) { - return deep6951(x); - } - - public static boolean deep6951(boolean x) { - return deep6952(x); - } - - public static boolean deep6952(boolean x) { - return deep6953(x); - } - - public static boolean deep6953(boolean x) { - return deep6954(x); - } - - public static boolean deep6954(boolean x) { - return deep6955(x); - } - - public static boolean deep6955(boolean x) { - return deep6956(x); - } - - public static boolean deep6956(boolean x) { - return deep6957(x); - } - - public static boolean deep6957(boolean x) { - return deep6958(x); - } - - public static boolean deep6958(boolean x) { - return deep6959(x); - } - - public static boolean deep6959(boolean x) { - return deep6960(x); - } - - public static boolean deep6960(boolean x) { - return deep6961(x); - } - - public static boolean deep6961(boolean x) { - return deep6962(x); - } - - public static boolean deep6962(boolean x) { - return deep6963(x); - } - - public static boolean deep6963(boolean x) { - return deep6964(x); - } - - public static boolean deep6964(boolean x) { - return deep6965(x); - } - - public static boolean deep6965(boolean x) { - return deep6966(x); - } - - public static boolean deep6966(boolean x) { - return deep6967(x); - } - - public static boolean deep6967(boolean x) { - return deep6968(x); - } - - public static boolean deep6968(boolean x) { - return deep6969(x); - } - - public static boolean deep6969(boolean x) { - return deep6970(x); - } - - public static boolean deep6970(boolean x) { - return deep6971(x); - } - - public static boolean deep6971(boolean x) { - return deep6972(x); - } - - public static boolean deep6972(boolean x) { - return deep6973(x); - } - - public static boolean deep6973(boolean x) { - return deep6974(x); - } - - public static boolean deep6974(boolean x) { - return deep6975(x); - } - - public static boolean deep6975(boolean x) { - return deep6976(x); - } - - public static boolean deep6976(boolean x) { - return deep6977(x); - } - - public static boolean deep6977(boolean x) { - return deep6978(x); - } - - public static boolean deep6978(boolean x) { - return deep6979(x); - } - - public static boolean deep6979(boolean x) { - return deep6980(x); - } - - public static boolean deep6980(boolean x) { - return deep6981(x); - } - - public static boolean deep6981(boolean x) { - return deep6982(x); - } - - public static boolean deep6982(boolean x) { - return deep6983(x); - } - - public static boolean deep6983(boolean x) { - return deep6984(x); - } - - public static boolean deep6984(boolean x) { - return deep6985(x); - } - - public static boolean deep6985(boolean x) { - return deep6986(x); - } - - public static boolean deep6986(boolean x) { - return deep6987(x); - } - - public static boolean deep6987(boolean x) { - return deep6988(x); - } - - public static boolean deep6988(boolean x) { - return deep6989(x); - } - - public static boolean deep6989(boolean x) { - return deep6990(x); - } - - public static boolean deep6990(boolean x) { - return deep6991(x); - } - - public static boolean deep6991(boolean x) { - return deep6992(x); - } - - public static boolean deep6992(boolean x) { - return deep6993(x); - } - - public static boolean deep6993(boolean x) { - return deep6994(x); - } - - public static boolean deep6994(boolean x) { - return deep6995(x); - } - - public static boolean deep6995(boolean x) { - return deep6996(x); - } - - public static boolean deep6996(boolean x) { - return deep6997(x); - } - - public static boolean deep6997(boolean x) { - return deep6998(x); - } - - public static boolean deep6998(boolean x) { - return deep6999(x); - } - - public static boolean deep6999(boolean x) { - return deep7000(x); - } - - public static boolean deep7000(boolean x) { - return deep7001(x); - } - - public static boolean deep7001(boolean x) { - return deep7002(x); - } - - public static boolean deep7002(boolean x) { - return deep7003(x); - } - - public static boolean deep7003(boolean x) { - return deep7004(x); - } - - public static boolean deep7004(boolean x) { - return deep7005(x); - } - - public static boolean deep7005(boolean x) { - return deep7006(x); - } - - public static boolean deep7006(boolean x) { - return deep7007(x); - } - - public static boolean deep7007(boolean x) { - return deep7008(x); - } - - public static boolean deep7008(boolean x) { - return deep7009(x); - } - - public static boolean deep7009(boolean x) { - return deep7010(x); - } - - public static boolean deep7010(boolean x) { - return deep7011(x); - } - - public static boolean deep7011(boolean x) { - return deep7012(x); - } - - public static boolean deep7012(boolean x) { - return deep7013(x); - } - - public static boolean deep7013(boolean x) { - return deep7014(x); - } - - public static boolean deep7014(boolean x) { - return deep7015(x); - } - - public static boolean deep7015(boolean x) { - return deep7016(x); - } - - public static boolean deep7016(boolean x) { - return deep7017(x); - } - - public static boolean deep7017(boolean x) { - return deep7018(x); - } - - public static boolean deep7018(boolean x) { - return deep7019(x); - } - - public static boolean deep7019(boolean x) { - return deep7020(x); - } - - public static boolean deep7020(boolean x) { - return deep7021(x); - } - - public static boolean deep7021(boolean x) { - return deep7022(x); - } - - public static boolean deep7022(boolean x) { - return deep7023(x); - } - - public static boolean deep7023(boolean x) { - return deep7024(x); - } - - public static boolean deep7024(boolean x) { - return deep7025(x); - } - - public static boolean deep7025(boolean x) { - return deep7026(x); - } - - public static boolean deep7026(boolean x) { - return deep7027(x); - } - - public static boolean deep7027(boolean x) { - return deep7028(x); - } - - public static boolean deep7028(boolean x) { - return deep7029(x); - } - - public static boolean deep7029(boolean x) { - return deep7030(x); - } - - public static boolean deep7030(boolean x) { - return deep7031(x); - } - - public static boolean deep7031(boolean x) { - return deep7032(x); - } - - public static boolean deep7032(boolean x) { - return deep7033(x); - } - - public static boolean deep7033(boolean x) { - return deep7034(x); - } - - public static boolean deep7034(boolean x) { - return deep7035(x); - } - - public static boolean deep7035(boolean x) { - return deep7036(x); - } - - public static boolean deep7036(boolean x) { - return deep7037(x); - } - - public static boolean deep7037(boolean x) { - return deep7038(x); - } - - public static boolean deep7038(boolean x) { - return deep7039(x); - } - - public static boolean deep7039(boolean x) { - return deep7040(x); - } - - public static boolean deep7040(boolean x) { - return deep7041(x); - } - - public static boolean deep7041(boolean x) { - return deep7042(x); - } - - public static boolean deep7042(boolean x) { - return deep7043(x); - } - - public static boolean deep7043(boolean x) { - return deep7044(x); - } - - public static boolean deep7044(boolean x) { - return deep7045(x); - } - - public static boolean deep7045(boolean x) { - return deep7046(x); - } - - public static boolean deep7046(boolean x) { - return deep7047(x); - } - - public static boolean deep7047(boolean x) { - return deep7048(x); - } - - public static boolean deep7048(boolean x) { - return deep7049(x); - } - - public static boolean deep7049(boolean x) { - return deep7050(x); - } - - public static boolean deep7050(boolean x) { - return deep7051(x); - } - - public static boolean deep7051(boolean x) { - return deep7052(x); - } - - public static boolean deep7052(boolean x) { - return deep7053(x); - } - - public static boolean deep7053(boolean x) { - return deep7054(x); - } - - public static boolean deep7054(boolean x) { - return deep7055(x); - } - - public static boolean deep7055(boolean x) { - return deep7056(x); - } - - public static boolean deep7056(boolean x) { - return deep7057(x); - } - - public static boolean deep7057(boolean x) { - return deep7058(x); - } - - public static boolean deep7058(boolean x) { - return deep7059(x); - } - - public static boolean deep7059(boolean x) { - return deep7060(x); - } - - public static boolean deep7060(boolean x) { - return deep7061(x); - } - - public static boolean deep7061(boolean x) { - return deep7062(x); - } - - public static boolean deep7062(boolean x) { - return deep7063(x); - } - - public static boolean deep7063(boolean x) { - return deep7064(x); - } - - public static boolean deep7064(boolean x) { - return deep7065(x); - } - - public static boolean deep7065(boolean x) { - return deep7066(x); - } - - public static boolean deep7066(boolean x) { - return deep7067(x); - } - - public static boolean deep7067(boolean x) { - return deep7068(x); - } - - public static boolean deep7068(boolean x) { - return deep7069(x); - } - - public static boolean deep7069(boolean x) { - return deep7070(x); - } - - public static boolean deep7070(boolean x) { - return deep7071(x); - } - - public static boolean deep7071(boolean x) { - return deep7072(x); - } - - public static boolean deep7072(boolean x) { - return deep7073(x); - } - - public static boolean deep7073(boolean x) { - return deep7074(x); - } - - public static boolean deep7074(boolean x) { - return deep7075(x); - } - - public static boolean deep7075(boolean x) { - return deep7076(x); - } - - public static boolean deep7076(boolean x) { - return deep7077(x); - } - - public static boolean deep7077(boolean x) { - return deep7078(x); - } - - public static boolean deep7078(boolean x) { - return deep7079(x); - } - - public static boolean deep7079(boolean x) { - return deep7080(x); - } - - public static boolean deep7080(boolean x) { - return deep7081(x); - } - - public static boolean deep7081(boolean x) { - return deep7082(x); - } - - public static boolean deep7082(boolean x) { - return deep7083(x); - } - - public static boolean deep7083(boolean x) { - return deep7084(x); - } - - public static boolean deep7084(boolean x) { - return deep7085(x); - } - - public static boolean deep7085(boolean x) { - return deep7086(x); - } - - public static boolean deep7086(boolean x) { - return deep7087(x); - } - - public static boolean deep7087(boolean x) { - return deep7088(x); - } - - public static boolean deep7088(boolean x) { - return deep7089(x); - } - - public static boolean deep7089(boolean x) { - return deep7090(x); - } - - public static boolean deep7090(boolean x) { - return deep7091(x); - } - - public static boolean deep7091(boolean x) { - return deep7092(x); - } - - public static boolean deep7092(boolean x) { - return deep7093(x); - } - - public static boolean deep7093(boolean x) { - return deep7094(x); - } - - public static boolean deep7094(boolean x) { - return deep7095(x); - } - - public static boolean deep7095(boolean x) { - return deep7096(x); - } - - public static boolean deep7096(boolean x) { - return deep7097(x); - } - - public static boolean deep7097(boolean x) { - return deep7098(x); - } - - public static boolean deep7098(boolean x) { - return deep7099(x); - } - - public static boolean deep7099(boolean x) { - return deep7100(x); - } - - public static boolean deep7100(boolean x) { - return deep7101(x); - } - - public static boolean deep7101(boolean x) { - return deep7102(x); - } - - public static boolean deep7102(boolean x) { - return deep7103(x); - } - - public static boolean deep7103(boolean x) { - return deep7104(x); - } - - public static boolean deep7104(boolean x) { - return deep7105(x); - } - - public static boolean deep7105(boolean x) { - return deep7106(x); - } - - public static boolean deep7106(boolean x) { - return deep7107(x); - } - - public static boolean deep7107(boolean x) { - return deep7108(x); - } - - public static boolean deep7108(boolean x) { - return deep7109(x); - } - - public static boolean deep7109(boolean x) { - return deep7110(x); - } - - public static boolean deep7110(boolean x) { - return deep7111(x); - } - - public static boolean deep7111(boolean x) { - return deep7112(x); - } - - public static boolean deep7112(boolean x) { - return deep7113(x); - } - - public static boolean deep7113(boolean x) { - return deep7114(x); - } - - public static boolean deep7114(boolean x) { - return deep7115(x); - } - - public static boolean deep7115(boolean x) { - return deep7116(x); - } - - public static boolean deep7116(boolean x) { - return deep7117(x); - } - - public static boolean deep7117(boolean x) { - return deep7118(x); - } - - public static boolean deep7118(boolean x) { - return deep7119(x); - } - - public static boolean deep7119(boolean x) { - return deep7120(x); - } - - public static boolean deep7120(boolean x) { - return deep7121(x); - } - - public static boolean deep7121(boolean x) { - return deep7122(x); - } - - public static boolean deep7122(boolean x) { - return deep7123(x); - } - - public static boolean deep7123(boolean x) { - return deep7124(x); - } - - public static boolean deep7124(boolean x) { - return deep7125(x); - } - - public static boolean deep7125(boolean x) { - return deep7126(x); - } - - public static boolean deep7126(boolean x) { - return deep7127(x); - } - - public static boolean deep7127(boolean x) { - return deep7128(x); - } - - public static boolean deep7128(boolean x) { - return deep7129(x); - } - - public static boolean deep7129(boolean x) { - return deep7130(x); - } - - public static boolean deep7130(boolean x) { - return deep7131(x); - } - - public static boolean deep7131(boolean x) { - return deep7132(x); - } - - public static boolean deep7132(boolean x) { - return deep7133(x); - } - - public static boolean deep7133(boolean x) { - return deep7134(x); - } - - public static boolean deep7134(boolean x) { - return deep7135(x); - } - - public static boolean deep7135(boolean x) { - return deep7136(x); - } - - public static boolean deep7136(boolean x) { - return deep7137(x); - } - - public static boolean deep7137(boolean x) { - return deep7138(x); - } - - public static boolean deep7138(boolean x) { - return deep7139(x); - } - - public static boolean deep7139(boolean x) { - return deep7140(x); - } - - public static boolean deep7140(boolean x) { - return deep7141(x); - } - - public static boolean deep7141(boolean x) { - return deep7142(x); - } - - public static boolean deep7142(boolean x) { - return deep7143(x); - } - - public static boolean deep7143(boolean x) { - return deep7144(x); - } - - public static boolean deep7144(boolean x) { - return deep7145(x); - } - - public static boolean deep7145(boolean x) { - return deep7146(x); - } - - public static boolean deep7146(boolean x) { - return deep7147(x); - } - - public static boolean deep7147(boolean x) { - return deep7148(x); - } - - public static boolean deep7148(boolean x) { - return deep7149(x); - } - - public static boolean deep7149(boolean x) { - return deep7150(x); - } - - public static boolean deep7150(boolean x) { - return deep7151(x); - } - - public static boolean deep7151(boolean x) { - return deep7152(x); - } - - public static boolean deep7152(boolean x) { - return deep7153(x); - } - - public static boolean deep7153(boolean x) { - return deep7154(x); - } - - public static boolean deep7154(boolean x) { - return deep7155(x); - } - - public static boolean deep7155(boolean x) { - return deep7156(x); - } - - public static boolean deep7156(boolean x) { - return deep7157(x); - } - - public static boolean deep7157(boolean x) { - return deep7158(x); - } - - public static boolean deep7158(boolean x) { - return deep7159(x); - } - - public static boolean deep7159(boolean x) { - return deep7160(x); - } - - public static boolean deep7160(boolean x) { - return deep7161(x); - } - - public static boolean deep7161(boolean x) { - return deep7162(x); - } - - public static boolean deep7162(boolean x) { - return deep7163(x); - } - - public static boolean deep7163(boolean x) { - return deep7164(x); - } - - public static boolean deep7164(boolean x) { - return deep7165(x); - } - - public static boolean deep7165(boolean x) { - return deep7166(x); - } - - public static boolean deep7166(boolean x) { - return deep7167(x); - } - - public static boolean deep7167(boolean x) { - return deep7168(x); - } - - public static boolean deep7168(boolean x) { - return deep7169(x); - } - - public static boolean deep7169(boolean x) { - return deep7170(x); - } - - public static boolean deep7170(boolean x) { - return deep7171(x); - } - - public static boolean deep7171(boolean x) { - return deep7172(x); - } - - public static boolean deep7172(boolean x) { - return deep7173(x); - } - - public static boolean deep7173(boolean x) { - return deep7174(x); - } - - public static boolean deep7174(boolean x) { - return deep7175(x); - } - - public static boolean deep7175(boolean x) { - return deep7176(x); - } - - public static boolean deep7176(boolean x) { - return deep7177(x); - } - - public static boolean deep7177(boolean x) { - return deep7178(x); - } - - public static boolean deep7178(boolean x) { - return deep7179(x); - } - - public static boolean deep7179(boolean x) { - return deep7180(x); - } - - public static boolean deep7180(boolean x) { - return deep7181(x); - } - - public static boolean deep7181(boolean x) { - return deep7182(x); - } - - public static boolean deep7182(boolean x) { - return deep7183(x); - } - - public static boolean deep7183(boolean x) { - return deep7184(x); - } - - public static boolean deep7184(boolean x) { - return deep7185(x); - } - - public static boolean deep7185(boolean x) { - return deep7186(x); - } - - public static boolean deep7186(boolean x) { - return deep7187(x); - } - - public static boolean deep7187(boolean x) { - return deep7188(x); - } - - public static boolean deep7188(boolean x) { - return deep7189(x); - } - - public static boolean deep7189(boolean x) { - return deep7190(x); - } - - public static boolean deep7190(boolean x) { - return deep7191(x); - } - - public static boolean deep7191(boolean x) { - return deep7192(x); - } - - public static boolean deep7192(boolean x) { - return deep7193(x); - } - - public static boolean deep7193(boolean x) { - return deep7194(x); - } - - public static boolean deep7194(boolean x) { - return deep7195(x); - } - - public static boolean deep7195(boolean x) { - return deep7196(x); - } - - public static boolean deep7196(boolean x) { - return deep7197(x); - } - - public static boolean deep7197(boolean x) { - return deep7198(x); - } - - public static boolean deep7198(boolean x) { - return deep7199(x); - } - - public static boolean deep7199(boolean x) { - return deep7200(x); - } - - public static boolean deep7200(boolean x) { - return deep7201(x); - } - - public static boolean deep7201(boolean x) { - return deep7202(x); - } - - public static boolean deep7202(boolean x) { - return deep7203(x); - } - - public static boolean deep7203(boolean x) { - return deep7204(x); - } - - public static boolean deep7204(boolean x) { - return deep7205(x); - } - - public static boolean deep7205(boolean x) { - return deep7206(x); - } - - public static boolean deep7206(boolean x) { - return deep7207(x); - } - - public static boolean deep7207(boolean x) { - return deep7208(x); - } - - public static boolean deep7208(boolean x) { - return deep7209(x); - } - - public static boolean deep7209(boolean x) { - return deep7210(x); - } - - public static boolean deep7210(boolean x) { - return deep7211(x); - } - - public static boolean deep7211(boolean x) { - return deep7212(x); - } - - public static boolean deep7212(boolean x) { - return deep7213(x); - } - - public static boolean deep7213(boolean x) { - return deep7214(x); - } - - public static boolean deep7214(boolean x) { - return deep7215(x); - } - - public static boolean deep7215(boolean x) { - return deep7216(x); - } - - public static boolean deep7216(boolean x) { - return deep7217(x); - } - - public static boolean deep7217(boolean x) { - return deep7218(x); - } - - public static boolean deep7218(boolean x) { - return deep7219(x); - } - - public static boolean deep7219(boolean x) { - return deep7220(x); - } - - public static boolean deep7220(boolean x) { - return deep7221(x); - } - - public static boolean deep7221(boolean x) { - return deep7222(x); - } - - public static boolean deep7222(boolean x) { - return deep7223(x); - } - - public static boolean deep7223(boolean x) { - return deep7224(x); - } - - public static boolean deep7224(boolean x) { - return deep7225(x); - } - - public static boolean deep7225(boolean x) { - return deep7226(x); - } - - public static boolean deep7226(boolean x) { - return deep7227(x); - } - - public static boolean deep7227(boolean x) { - return deep7228(x); - } - - public static boolean deep7228(boolean x) { - return deep7229(x); - } - - public static boolean deep7229(boolean x) { - return deep7230(x); - } - - public static boolean deep7230(boolean x) { - return deep7231(x); - } - - public static boolean deep7231(boolean x) { - return deep7232(x); - } - - public static boolean deep7232(boolean x) { - return deep7233(x); - } - - public static boolean deep7233(boolean x) { - return deep7234(x); - } - - public static boolean deep7234(boolean x) { - return deep7235(x); - } - - public static boolean deep7235(boolean x) { - return deep7236(x); - } - - public static boolean deep7236(boolean x) { - return deep7237(x); - } - - public static boolean deep7237(boolean x) { - return deep7238(x); - } - - public static boolean deep7238(boolean x) { - return deep7239(x); - } - - public static boolean deep7239(boolean x) { - return deep7240(x); - } - - public static boolean deep7240(boolean x) { - return deep7241(x); - } - - public static boolean deep7241(boolean x) { - return deep7242(x); - } - - public static boolean deep7242(boolean x) { - return deep7243(x); - } - - public static boolean deep7243(boolean x) { - return deep7244(x); - } - - public static boolean deep7244(boolean x) { - return deep7245(x); - } - - public static boolean deep7245(boolean x) { - return deep7246(x); - } - - public static boolean deep7246(boolean x) { - return deep7247(x); - } - - public static boolean deep7247(boolean x) { - return deep7248(x); - } - - public static boolean deep7248(boolean x) { - return deep7249(x); - } - - public static boolean deep7249(boolean x) { - return deep7250(x); - } - - public static boolean deep7250(boolean x) { - return deep7251(x); - } - - public static boolean deep7251(boolean x) { - return deep7252(x); - } - - public static boolean deep7252(boolean x) { - return deep7253(x); - } - - public static boolean deep7253(boolean x) { - return deep7254(x); - } - - public static boolean deep7254(boolean x) { - return deep7255(x); - } - - public static boolean deep7255(boolean x) { - return deep7256(x); - } - - public static boolean deep7256(boolean x) { - return deep7257(x); - } - - public static boolean deep7257(boolean x) { - return deep7258(x); - } - - public static boolean deep7258(boolean x) { - return deep7259(x); - } - - public static boolean deep7259(boolean x) { - return deep7260(x); - } - - public static boolean deep7260(boolean x) { - return deep7261(x); - } - - public static boolean deep7261(boolean x) { - return deep7262(x); - } - - public static boolean deep7262(boolean x) { - return deep7263(x); - } - - public static boolean deep7263(boolean x) { - return deep7264(x); - } - - public static boolean deep7264(boolean x) { - return deep7265(x); - } - - public static boolean deep7265(boolean x) { - return deep7266(x); - } - - public static boolean deep7266(boolean x) { - return deep7267(x); - } - - public static boolean deep7267(boolean x) { - return deep7268(x); - } - - public static boolean deep7268(boolean x) { - return deep7269(x); - } - - public static boolean deep7269(boolean x) { - return deep7270(x); - } - - public static boolean deep7270(boolean x) { - return deep7271(x); - } - - public static boolean deep7271(boolean x) { - return deep7272(x); - } - - public static boolean deep7272(boolean x) { - return deep7273(x); - } - - public static boolean deep7273(boolean x) { - return deep7274(x); - } - - public static boolean deep7274(boolean x) { - return deep7275(x); - } - - public static boolean deep7275(boolean x) { - return deep7276(x); - } - - public static boolean deep7276(boolean x) { - return deep7277(x); - } - - public static boolean deep7277(boolean x) { - return deep7278(x); - } - - public static boolean deep7278(boolean x) { - return deep7279(x); - } - - public static boolean deep7279(boolean x) { - return deep7280(x); - } - - public static boolean deep7280(boolean x) { - return deep7281(x); - } - - public static boolean deep7281(boolean x) { - return deep7282(x); - } - - public static boolean deep7282(boolean x) { - return deep7283(x); - } - - public static boolean deep7283(boolean x) { - return deep7284(x); - } - - public static boolean deep7284(boolean x) { - return deep7285(x); - } - - public static boolean deep7285(boolean x) { - return deep7286(x); - } - - public static boolean deep7286(boolean x) { - return deep7287(x); - } - - public static boolean deep7287(boolean x) { - return deep7288(x); - } - - public static boolean deep7288(boolean x) { - return deep7289(x); - } - - public static boolean deep7289(boolean x) { - return deep7290(x); - } - - public static boolean deep7290(boolean x) { - return deep7291(x); - } - - public static boolean deep7291(boolean x) { - return deep7292(x); - } - - public static boolean deep7292(boolean x) { - return deep7293(x); - } - - public static boolean deep7293(boolean x) { - return deep7294(x); - } - - public static boolean deep7294(boolean x) { - return deep7295(x); - } - - public static boolean deep7295(boolean x) { - return deep7296(x); - } - - public static boolean deep7296(boolean x) { - return deep7297(x); - } - - public static boolean deep7297(boolean x) { - return deep7298(x); - } - - public static boolean deep7298(boolean x) { - return deep7299(x); - } - - public static boolean deep7299(boolean x) { - return deep7300(x); - } - - public static boolean deep7300(boolean x) { - return deep7301(x); - } - - public static boolean deep7301(boolean x) { - return deep7302(x); - } - - public static boolean deep7302(boolean x) { - return deep7303(x); - } - - public static boolean deep7303(boolean x) { - return deep7304(x); - } - - public static boolean deep7304(boolean x) { - return deep7305(x); - } - - public static boolean deep7305(boolean x) { - return deep7306(x); - } - - public static boolean deep7306(boolean x) { - return deep7307(x); - } - - public static boolean deep7307(boolean x) { - return deep7308(x); - } - - public static boolean deep7308(boolean x) { - return deep7309(x); - } - - public static boolean deep7309(boolean x) { - return deep7310(x); - } - - public static boolean deep7310(boolean x) { - return deep7311(x); - } - - public static boolean deep7311(boolean x) { - return deep7312(x); - } - - public static boolean deep7312(boolean x) { - return deep7313(x); - } - - public static boolean deep7313(boolean x) { - return deep7314(x); - } - - public static boolean deep7314(boolean x) { - return deep7315(x); - } - - public static boolean deep7315(boolean x) { - return deep7316(x); - } - - public static boolean deep7316(boolean x) { - return deep7317(x); - } - - public static boolean deep7317(boolean x) { - return deep7318(x); - } - - public static boolean deep7318(boolean x) { - return deep7319(x); - } - - public static boolean deep7319(boolean x) { - return deep7320(x); - } - - public static boolean deep7320(boolean x) { - return deep7321(x); - } - - public static boolean deep7321(boolean x) { - return deep7322(x); - } - - public static boolean deep7322(boolean x) { - return deep7323(x); - } - - public static boolean deep7323(boolean x) { - return deep7324(x); - } - - public static boolean deep7324(boolean x) { - return deep7325(x); - } - - public static boolean deep7325(boolean x) { - return deep7326(x); - } - - public static boolean deep7326(boolean x) { - return deep7327(x); - } - - public static boolean deep7327(boolean x) { - return deep7328(x); - } - - public static boolean deep7328(boolean x) { - return deep7329(x); - } - - public static boolean deep7329(boolean x) { - return deep7330(x); - } - - public static boolean deep7330(boolean x) { - return deep7331(x); - } - - public static boolean deep7331(boolean x) { - return deep7332(x); - } - - public static boolean deep7332(boolean x) { - return deep7333(x); - } - - public static boolean deep7333(boolean x) { - return deep7334(x); - } - - public static boolean deep7334(boolean x) { - return deep7335(x); - } - - public static boolean deep7335(boolean x) { - return deep7336(x); - } - - public static boolean deep7336(boolean x) { - return deep7337(x); - } - - public static boolean deep7337(boolean x) { - return deep7338(x); - } - - public static boolean deep7338(boolean x) { - return deep7339(x); - } - - public static boolean deep7339(boolean x) { - return deep7340(x); - } - - public static boolean deep7340(boolean x) { - return deep7341(x); - } - - public static boolean deep7341(boolean x) { - return deep7342(x); - } - - public static boolean deep7342(boolean x) { - return deep7343(x); - } - - public static boolean deep7343(boolean x) { - return deep7344(x); - } - - public static boolean deep7344(boolean x) { - return deep7345(x); - } - - public static boolean deep7345(boolean x) { - return deep7346(x); - } - - public static boolean deep7346(boolean x) { - return deep7347(x); - } - - public static boolean deep7347(boolean x) { - return deep7348(x); - } - - public static boolean deep7348(boolean x) { - return deep7349(x); - } - - public static boolean deep7349(boolean x) { - return deep7350(x); - } - - public static boolean deep7350(boolean x) { - return deep7351(x); - } - - public static boolean deep7351(boolean x) { - return deep7352(x); - } - - public static boolean deep7352(boolean x) { - return deep7353(x); - } - - public static boolean deep7353(boolean x) { - return deep7354(x); - } - - public static boolean deep7354(boolean x) { - return deep7355(x); - } - - public static boolean deep7355(boolean x) { - return deep7356(x); - } - - public static boolean deep7356(boolean x) { - return deep7357(x); - } - - public static boolean deep7357(boolean x) { - return deep7358(x); - } - - public static boolean deep7358(boolean x) { - return deep7359(x); - } - - public static boolean deep7359(boolean x) { - return deep7360(x); - } - - public static boolean deep7360(boolean x) { - return deep7361(x); - } - - public static boolean deep7361(boolean x) { - return deep7362(x); - } - - public static boolean deep7362(boolean x) { - return deep7363(x); - } - - public static boolean deep7363(boolean x) { - return deep7364(x); - } - - public static boolean deep7364(boolean x) { - return deep7365(x); - } - - public static boolean deep7365(boolean x) { - return deep7366(x); - } - - public static boolean deep7366(boolean x) { - return deep7367(x); - } - - public static boolean deep7367(boolean x) { - return deep7368(x); - } - - public static boolean deep7368(boolean x) { - return deep7369(x); - } - - public static boolean deep7369(boolean x) { - return deep7370(x); - } - - public static boolean deep7370(boolean x) { - return deep7371(x); - } - - public static boolean deep7371(boolean x) { - return deep7372(x); - } - - public static boolean deep7372(boolean x) { - return deep7373(x); - } - - public static boolean deep7373(boolean x) { - return deep7374(x); - } - - public static boolean deep7374(boolean x) { - return deep7375(x); - } - - public static boolean deep7375(boolean x) { - return deep7376(x); - } - - public static boolean deep7376(boolean x) { - return deep7377(x); - } - - public static boolean deep7377(boolean x) { - return deep7378(x); - } - - public static boolean deep7378(boolean x) { - return deep7379(x); - } - - public static boolean deep7379(boolean x) { - return deep7380(x); - } - - public static boolean deep7380(boolean x) { - return deep7381(x); - } - - public static boolean deep7381(boolean x) { - return deep7382(x); - } - - public static boolean deep7382(boolean x) { - return deep7383(x); - } - - public static boolean deep7383(boolean x) { - return deep7384(x); - } - - public static boolean deep7384(boolean x) { - return deep7385(x); - } - - public static boolean deep7385(boolean x) { - return deep7386(x); - } - - public static boolean deep7386(boolean x) { - return deep7387(x); - } - - public static boolean deep7387(boolean x) { - return deep7388(x); - } - - public static boolean deep7388(boolean x) { - return deep7389(x); - } - - public static boolean deep7389(boolean x) { - return deep7390(x); - } - - public static boolean deep7390(boolean x) { - return deep7391(x); - } - - public static boolean deep7391(boolean x) { - return deep7392(x); - } - - public static boolean deep7392(boolean x) { - return deep7393(x); - } - - public static boolean deep7393(boolean x) { - return deep7394(x); - } - - public static boolean deep7394(boolean x) { - return deep7395(x); - } - - public static boolean deep7395(boolean x) { - return deep7396(x); - } - - public static boolean deep7396(boolean x) { - return deep7397(x); - } - - public static boolean deep7397(boolean x) { - return deep7398(x); - } - - public static boolean deep7398(boolean x) { - return deep7399(x); - } - - public static boolean deep7399(boolean x) { - return deep7400(x); - } - - public static boolean deep7400(boolean x) { - return deep7401(x); - } - - public static boolean deep7401(boolean x) { - return deep7402(x); - } - - public static boolean deep7402(boolean x) { - return deep7403(x); - } - - public static boolean deep7403(boolean x) { - return deep7404(x); - } - - public static boolean deep7404(boolean x) { - return deep7405(x); - } - - public static boolean deep7405(boolean x) { - return deep7406(x); - } - - public static boolean deep7406(boolean x) { - return deep7407(x); - } - - public static boolean deep7407(boolean x) { - return deep7408(x); - } - - public static boolean deep7408(boolean x) { - return deep7409(x); - } - - public static boolean deep7409(boolean x) { - return deep7410(x); - } - - public static boolean deep7410(boolean x) { - return deep7411(x); - } - - public static boolean deep7411(boolean x) { - return deep7412(x); - } - - public static boolean deep7412(boolean x) { - return deep7413(x); - } - - public static boolean deep7413(boolean x) { - return deep7414(x); - } - - public static boolean deep7414(boolean x) { - return deep7415(x); - } - - public static boolean deep7415(boolean x) { - return deep7416(x); - } - - public static boolean deep7416(boolean x) { - return deep7417(x); - } - - public static boolean deep7417(boolean x) { - return deep7418(x); - } - - public static boolean deep7418(boolean x) { - return deep7419(x); - } - - public static boolean deep7419(boolean x) { - return deep7420(x); - } - - public static boolean deep7420(boolean x) { - return deep7421(x); - } - - public static boolean deep7421(boolean x) { - return deep7422(x); - } - - public static boolean deep7422(boolean x) { - return deep7423(x); - } - - public static boolean deep7423(boolean x) { - return deep7424(x); - } - - public static boolean deep7424(boolean x) { - return deep7425(x); - } - - public static boolean deep7425(boolean x) { - return deep7426(x); - } - - public static boolean deep7426(boolean x) { - return deep7427(x); - } - - public static boolean deep7427(boolean x) { - return deep7428(x); - } - - public static boolean deep7428(boolean x) { - return deep7429(x); - } - - public static boolean deep7429(boolean x) { - return deep7430(x); - } - - public static boolean deep7430(boolean x) { - return deep7431(x); - } - - public static boolean deep7431(boolean x) { - return deep7432(x); - } - - public static boolean deep7432(boolean x) { - return deep7433(x); - } - - public static boolean deep7433(boolean x) { - return deep7434(x); - } - - public static boolean deep7434(boolean x) { - return deep7435(x); - } - - public static boolean deep7435(boolean x) { - return deep7436(x); - } - - public static boolean deep7436(boolean x) { - return deep7437(x); - } - - public static boolean deep7437(boolean x) { - return deep7438(x); - } - - public static boolean deep7438(boolean x) { - return deep7439(x); - } - - public static boolean deep7439(boolean x) { - return deep7440(x); - } - - public static boolean deep7440(boolean x) { - return deep7441(x); - } - - public static boolean deep7441(boolean x) { - return deep7442(x); - } - - public static boolean deep7442(boolean x) { - return deep7443(x); - } - - public static boolean deep7443(boolean x) { - return deep7444(x); - } - - public static boolean deep7444(boolean x) { - return deep7445(x); - } - - public static boolean deep7445(boolean x) { - return deep7446(x); - } - - public static boolean deep7446(boolean x) { - return deep7447(x); - } - - public static boolean deep7447(boolean x) { - return deep7448(x); - } - - public static boolean deep7448(boolean x) { - return deep7449(x); - } - - public static boolean deep7449(boolean x) { - return deep7450(x); - } - - public static boolean deep7450(boolean x) { - return deep7451(x); - } - - public static boolean deep7451(boolean x) { - return deep7452(x); - } - - public static boolean deep7452(boolean x) { - return deep7453(x); - } - - public static boolean deep7453(boolean x) { - return deep7454(x); - } - - public static boolean deep7454(boolean x) { - return deep7455(x); - } - - public static boolean deep7455(boolean x) { - return deep7456(x); - } - - public static boolean deep7456(boolean x) { - return deep7457(x); - } - - public static boolean deep7457(boolean x) { - return deep7458(x); - } - - public static boolean deep7458(boolean x) { - return deep7459(x); - } - - public static boolean deep7459(boolean x) { - return deep7460(x); - } - - public static boolean deep7460(boolean x) { - return deep7461(x); - } - - public static boolean deep7461(boolean x) { - return deep7462(x); - } - - public static boolean deep7462(boolean x) { - return deep7463(x); - } - - public static boolean deep7463(boolean x) { - return deep7464(x); - } - - public static boolean deep7464(boolean x) { - return deep7465(x); - } - - public static boolean deep7465(boolean x) { - return deep7466(x); - } - - public static boolean deep7466(boolean x) { - return deep7467(x); - } - - public static boolean deep7467(boolean x) { - return deep7468(x); - } - - public static boolean deep7468(boolean x) { - return deep7469(x); - } - - public static boolean deep7469(boolean x) { - return deep7470(x); - } - - public static boolean deep7470(boolean x) { - return deep7471(x); - } - - public static boolean deep7471(boolean x) { - return deep7472(x); - } - - public static boolean deep7472(boolean x) { - return deep7473(x); - } - - public static boolean deep7473(boolean x) { - return deep7474(x); - } - - public static boolean deep7474(boolean x) { - return deep7475(x); - } - - public static boolean deep7475(boolean x) { - return deep7476(x); - } - - public static boolean deep7476(boolean x) { - return deep7477(x); - } - - public static boolean deep7477(boolean x) { - return deep7478(x); - } - - public static boolean deep7478(boolean x) { - return deep7479(x); - } - - public static boolean deep7479(boolean x) { - return deep7480(x); - } - - public static boolean deep7480(boolean x) { - return deep7481(x); - } - - public static boolean deep7481(boolean x) { - return deep7482(x); - } - - public static boolean deep7482(boolean x) { - return deep7483(x); - } - - public static boolean deep7483(boolean x) { - return deep7484(x); - } - - public static boolean deep7484(boolean x) { - return deep7485(x); - } - - public static boolean deep7485(boolean x) { - return deep7486(x); - } - - public static boolean deep7486(boolean x) { - return deep7487(x); - } - - public static boolean deep7487(boolean x) { - return deep7488(x); - } - - public static boolean deep7488(boolean x) { - return deep7489(x); - } - - public static boolean deep7489(boolean x) { - return deep7490(x); - } - - public static boolean deep7490(boolean x) { - return deep7491(x); - } - - public static boolean deep7491(boolean x) { - return deep7492(x); - } - - public static boolean deep7492(boolean x) { - return deep7493(x); - } - - public static boolean deep7493(boolean x) { - return deep7494(x); - } - - public static boolean deep7494(boolean x) { - return deep7495(x); - } - - public static boolean deep7495(boolean x) { - return deep7496(x); - } - - public static boolean deep7496(boolean x) { - return deep7497(x); - } - - public static boolean deep7497(boolean x) { - return deep7498(x); - } - - public static boolean deep7498(boolean x) { - return deep7499(x); - } - - public static boolean deep7499(boolean x) { - return deep7500(x); - } - - public static boolean deep7500(boolean x) { - return deep7501(x); - } - - public static boolean deep7501(boolean x) { - return deep7502(x); - } - - public static boolean deep7502(boolean x) { - return deep7503(x); - } - - public static boolean deep7503(boolean x) { - return deep7504(x); - } - - public static boolean deep7504(boolean x) { - return deep7505(x); - } - - public static boolean deep7505(boolean x) { - return deep7506(x); - } - - public static boolean deep7506(boolean x) { - return deep7507(x); - } - - public static boolean deep7507(boolean x) { - return deep7508(x); - } - - public static boolean deep7508(boolean x) { - return deep7509(x); - } - - public static boolean deep7509(boolean x) { - return deep7510(x); - } - - public static boolean deep7510(boolean x) { - return deep7511(x); - } - - public static boolean deep7511(boolean x) { - return deep7512(x); - } - - public static boolean deep7512(boolean x) { - return deep7513(x); - } - - public static boolean deep7513(boolean x) { - return deep7514(x); - } - - public static boolean deep7514(boolean x) { - return deep7515(x); - } - - public static boolean deep7515(boolean x) { - return deep7516(x); - } - - public static boolean deep7516(boolean x) { - return deep7517(x); - } - - public static boolean deep7517(boolean x) { - return deep7518(x); - } - - public static boolean deep7518(boolean x) { - return deep7519(x); - } - - public static boolean deep7519(boolean x) { - return deep7520(x); - } - - public static boolean deep7520(boolean x) { - return deep7521(x); - } - - public static boolean deep7521(boolean x) { - return deep7522(x); - } - - public static boolean deep7522(boolean x) { - return deep7523(x); - } - - public static boolean deep7523(boolean x) { - return deep7524(x); - } - - public static boolean deep7524(boolean x) { - return deep7525(x); - } - - public static boolean deep7525(boolean x) { - return deep7526(x); - } - - public static boolean deep7526(boolean x) { - return deep7527(x); - } - - public static boolean deep7527(boolean x) { - return deep7528(x); - } - - public static boolean deep7528(boolean x) { - return deep7529(x); - } - - public static boolean deep7529(boolean x) { - return deep7530(x); - } - - public static boolean deep7530(boolean x) { - return deep7531(x); - } - - public static boolean deep7531(boolean x) { - return deep7532(x); - } - - public static boolean deep7532(boolean x) { - return deep7533(x); - } - - public static boolean deep7533(boolean x) { - return deep7534(x); - } - - public static boolean deep7534(boolean x) { - return deep7535(x); - } - - public static boolean deep7535(boolean x) { - return deep7536(x); - } - - public static boolean deep7536(boolean x) { - return deep7537(x); - } - - public static boolean deep7537(boolean x) { - return deep7538(x); - } - - public static boolean deep7538(boolean x) { - return deep7539(x); - } - - public static boolean deep7539(boolean x) { - return deep7540(x); - } - - public static boolean deep7540(boolean x) { - return deep7541(x); - } - - public static boolean deep7541(boolean x) { - return deep7542(x); - } - - public static boolean deep7542(boolean x) { - return deep7543(x); - } - - public static boolean deep7543(boolean x) { - return deep7544(x); - } - - public static boolean deep7544(boolean x) { - return deep7545(x); - } - - public static boolean deep7545(boolean x) { - return deep7546(x); - } - - public static boolean deep7546(boolean x) { - return deep7547(x); - } - - public static boolean deep7547(boolean x) { - return deep7548(x); - } - - public static boolean deep7548(boolean x) { - return deep7549(x); - } - - public static boolean deep7549(boolean x) { - return deep7550(x); - } - - public static boolean deep7550(boolean x) { - return deep7551(x); - } - - public static boolean deep7551(boolean x) { - return deep7552(x); - } - - public static boolean deep7552(boolean x) { - return deep7553(x); - } - - public static boolean deep7553(boolean x) { - return deep7554(x); - } - - public static boolean deep7554(boolean x) { - return deep7555(x); - } - - public static boolean deep7555(boolean x) { - return deep7556(x); - } - - public static boolean deep7556(boolean x) { - return deep7557(x); - } - - public static boolean deep7557(boolean x) { - return deep7558(x); - } - - public static boolean deep7558(boolean x) { - return deep7559(x); - } - - public static boolean deep7559(boolean x) { - return deep7560(x); - } - - public static boolean deep7560(boolean x) { - return deep7561(x); - } - - public static boolean deep7561(boolean x) { - return deep7562(x); - } - - public static boolean deep7562(boolean x) { - return deep7563(x); - } - - public static boolean deep7563(boolean x) { - return deep7564(x); - } - - public static boolean deep7564(boolean x) { - return deep7565(x); - } - - public static boolean deep7565(boolean x) { - return deep7566(x); - } - - public static boolean deep7566(boolean x) { - return deep7567(x); - } - - public static boolean deep7567(boolean x) { - return deep7568(x); - } - - public static boolean deep7568(boolean x) { - return deep7569(x); - } - - public static boolean deep7569(boolean x) { - return deep7570(x); - } - - public static boolean deep7570(boolean x) { - return deep7571(x); - } - - public static boolean deep7571(boolean x) { - return deep7572(x); - } - - public static boolean deep7572(boolean x) { - return deep7573(x); - } - - public static boolean deep7573(boolean x) { - return deep7574(x); - } - - public static boolean deep7574(boolean x) { - return deep7575(x); - } - - public static boolean deep7575(boolean x) { - return deep7576(x); - } - - public static boolean deep7576(boolean x) { - return deep7577(x); - } - - public static boolean deep7577(boolean x) { - return deep7578(x); - } - - public static boolean deep7578(boolean x) { - return deep7579(x); - } - - public static boolean deep7579(boolean x) { - return deep7580(x); - } - - public static boolean deep7580(boolean x) { - return deep7581(x); - } - - public static boolean deep7581(boolean x) { - return deep7582(x); - } - - public static boolean deep7582(boolean x) { - return deep7583(x); - } - - public static boolean deep7583(boolean x) { - return deep7584(x); - } - - public static boolean deep7584(boolean x) { - return deep7585(x); - } - - public static boolean deep7585(boolean x) { - return deep7586(x); - } - - public static boolean deep7586(boolean x) { - return deep7587(x); - } - - public static boolean deep7587(boolean x) { - return deep7588(x); - } - - public static boolean deep7588(boolean x) { - return deep7589(x); - } - - public static boolean deep7589(boolean x) { - return deep7590(x); - } - - public static boolean deep7590(boolean x) { - return deep7591(x); - } - - public static boolean deep7591(boolean x) { - return deep7592(x); - } - - public static boolean deep7592(boolean x) { - return deep7593(x); - } - - public static boolean deep7593(boolean x) { - return deep7594(x); - } - - public static boolean deep7594(boolean x) { - return deep7595(x); - } - - public static boolean deep7595(boolean x) { - return deep7596(x); - } - - public static boolean deep7596(boolean x) { - return deep7597(x); - } - - public static boolean deep7597(boolean x) { - return deep7598(x); - } - - public static boolean deep7598(boolean x) { - return deep7599(x); - } - - public static boolean deep7599(boolean x) { - return deep7600(x); - } - - public static boolean deep7600(boolean x) { - return deep7601(x); - } - - public static boolean deep7601(boolean x) { - return deep7602(x); - } - - public static boolean deep7602(boolean x) { - return deep7603(x); - } - - public static boolean deep7603(boolean x) { - return deep7604(x); - } - - public static boolean deep7604(boolean x) { - return deep7605(x); - } - - public static boolean deep7605(boolean x) { - return deep7606(x); - } - - public static boolean deep7606(boolean x) { - return deep7607(x); - } - - public static boolean deep7607(boolean x) { - return deep7608(x); - } - - public static boolean deep7608(boolean x) { - return deep7609(x); - } - - public static boolean deep7609(boolean x) { - return deep7610(x); - } - - public static boolean deep7610(boolean x) { - return deep7611(x); - } - - public static boolean deep7611(boolean x) { - return deep7612(x); - } - - public static boolean deep7612(boolean x) { - return deep7613(x); - } - - public static boolean deep7613(boolean x) { - return deep7614(x); - } - - public static boolean deep7614(boolean x) { - return deep7615(x); - } - - public static boolean deep7615(boolean x) { - return deep7616(x); - } - - public static boolean deep7616(boolean x) { - return deep7617(x); - } - - public static boolean deep7617(boolean x) { - return deep7618(x); - } - - public static boolean deep7618(boolean x) { - return deep7619(x); - } - - public static boolean deep7619(boolean x) { - return deep7620(x); - } - - public static boolean deep7620(boolean x) { - return deep7621(x); - } - - public static boolean deep7621(boolean x) { - return deep7622(x); - } - - public static boolean deep7622(boolean x) { - return deep7623(x); - } - - public static boolean deep7623(boolean x) { - return deep7624(x); - } - - public static boolean deep7624(boolean x) { - return deep7625(x); - } - - public static boolean deep7625(boolean x) { - return deep7626(x); - } - - public static boolean deep7626(boolean x) { - return deep7627(x); - } - - public static boolean deep7627(boolean x) { - return deep7628(x); - } - - public static boolean deep7628(boolean x) { - return deep7629(x); - } - - public static boolean deep7629(boolean x) { - return deep7630(x); - } - - public static boolean deep7630(boolean x) { - return deep7631(x); - } - - public static boolean deep7631(boolean x) { - return deep7632(x); - } - - public static boolean deep7632(boolean x) { - return deep7633(x); - } - - public static boolean deep7633(boolean x) { - return deep7634(x); - } - - public static boolean deep7634(boolean x) { - return deep7635(x); - } - - public static boolean deep7635(boolean x) { - return deep7636(x); - } - - public static boolean deep7636(boolean x) { - return deep7637(x); - } - - public static boolean deep7637(boolean x) { - return deep7638(x); - } - - public static boolean deep7638(boolean x) { - return deep7639(x); - } - - public static boolean deep7639(boolean x) { - return deep7640(x); - } - - public static boolean deep7640(boolean x) { - return deep7641(x); - } - - public static boolean deep7641(boolean x) { - return deep7642(x); - } - - public static boolean deep7642(boolean x) { - return deep7643(x); - } - - public static boolean deep7643(boolean x) { - return deep7644(x); - } - - public static boolean deep7644(boolean x) { - return deep7645(x); - } - - public static boolean deep7645(boolean x) { - return deep7646(x); - } - - public static boolean deep7646(boolean x) { - return deep7647(x); - } - - public static boolean deep7647(boolean x) { - return deep7648(x); - } - - public static boolean deep7648(boolean x) { - return deep7649(x); - } - - public static boolean deep7649(boolean x) { - return deep7650(x); - } - - public static boolean deep7650(boolean x) { - return deep7651(x); - } - - public static boolean deep7651(boolean x) { - return deep7652(x); - } - - public static boolean deep7652(boolean x) { - return deep7653(x); - } - - public static boolean deep7653(boolean x) { - return deep7654(x); - } - - public static boolean deep7654(boolean x) { - return deep7655(x); - } - - public static boolean deep7655(boolean x) { - return deep7656(x); - } - - public static boolean deep7656(boolean x) { - return deep7657(x); - } - - public static boolean deep7657(boolean x) { - return deep7658(x); - } - - public static boolean deep7658(boolean x) { - return deep7659(x); - } - - public static boolean deep7659(boolean x) { - return deep7660(x); - } - - public static boolean deep7660(boolean x) { - return deep7661(x); - } - - public static boolean deep7661(boolean x) { - return deep7662(x); - } - - public static boolean deep7662(boolean x) { - return deep7663(x); - } - - public static boolean deep7663(boolean x) { - return deep7664(x); - } - - public static boolean deep7664(boolean x) { - return deep7665(x); - } - - public static boolean deep7665(boolean x) { - return deep7666(x); - } - - public static boolean deep7666(boolean x) { - return deep7667(x); - } - - public static boolean deep7667(boolean x) { - return deep7668(x); - } - - public static boolean deep7668(boolean x) { - return deep7669(x); - } - - public static boolean deep7669(boolean x) { - return deep7670(x); - } - - public static boolean deep7670(boolean x) { - return deep7671(x); - } - - public static boolean deep7671(boolean x) { - return deep7672(x); - } - - public static boolean deep7672(boolean x) { - return deep7673(x); - } - - public static boolean deep7673(boolean x) { - return deep7674(x); - } - - public static boolean deep7674(boolean x) { - return deep7675(x); - } - - public static boolean deep7675(boolean x) { - return deep7676(x); - } - - public static boolean deep7676(boolean x) { - return deep7677(x); - } - - public static boolean deep7677(boolean x) { - return deep7678(x); - } - - public static boolean deep7678(boolean x) { - return deep7679(x); - } - - public static boolean deep7679(boolean x) { - return deep7680(x); - } - - public static boolean deep7680(boolean x) { - return deep7681(x); - } - - public static boolean deep7681(boolean x) { - return deep7682(x); - } - - public static boolean deep7682(boolean x) { - return deep7683(x); - } - - public static boolean deep7683(boolean x) { - return deep7684(x); - } - - public static boolean deep7684(boolean x) { - return deep7685(x); - } - - public static boolean deep7685(boolean x) { - return deep7686(x); - } - - public static boolean deep7686(boolean x) { - return deep7687(x); - } - - public static boolean deep7687(boolean x) { - return deep7688(x); - } - - public static boolean deep7688(boolean x) { - return deep7689(x); - } - - public static boolean deep7689(boolean x) { - return deep7690(x); - } - - public static boolean deep7690(boolean x) { - return deep7691(x); - } - - public static boolean deep7691(boolean x) { - return deep7692(x); - } - - public static boolean deep7692(boolean x) { - return deep7693(x); - } - - public static boolean deep7693(boolean x) { - return deep7694(x); - } - - public static boolean deep7694(boolean x) { - return deep7695(x); - } - - public static boolean deep7695(boolean x) { - return deep7696(x); - } - - public static boolean deep7696(boolean x) { - return deep7697(x); - } - - public static boolean deep7697(boolean x) { - return deep7698(x); - } - - public static boolean deep7698(boolean x) { - return deep7699(x); - } - - public static boolean deep7699(boolean x) { - return deep7700(x); - } - - public static boolean deep7700(boolean x) { - return deep7701(x); - } - - public static boolean deep7701(boolean x) { - return deep7702(x); - } - - public static boolean deep7702(boolean x) { - return deep7703(x); - } - - public static boolean deep7703(boolean x) { - return deep7704(x); - } - - public static boolean deep7704(boolean x) { - return deep7705(x); - } - - public static boolean deep7705(boolean x) { - return deep7706(x); - } - - public static boolean deep7706(boolean x) { - return deep7707(x); - } - - public static boolean deep7707(boolean x) { - return deep7708(x); - } - - public static boolean deep7708(boolean x) { - return deep7709(x); - } - - public static boolean deep7709(boolean x) { - return deep7710(x); - } - - public static boolean deep7710(boolean x) { - return deep7711(x); - } - - public static boolean deep7711(boolean x) { - return deep7712(x); - } - - public static boolean deep7712(boolean x) { - return deep7713(x); - } - - public static boolean deep7713(boolean x) { - return deep7714(x); - } - - public static boolean deep7714(boolean x) { - return deep7715(x); - } - - public static boolean deep7715(boolean x) { - return deep7716(x); - } - - public static boolean deep7716(boolean x) { - return deep7717(x); - } - - public static boolean deep7717(boolean x) { - return deep7718(x); - } - - public static boolean deep7718(boolean x) { - return deep7719(x); - } - - public static boolean deep7719(boolean x) { - return deep7720(x); - } - - public static boolean deep7720(boolean x) { - return deep7721(x); - } - - public static boolean deep7721(boolean x) { - return deep7722(x); - } - - public static boolean deep7722(boolean x) { - return deep7723(x); - } - - public static boolean deep7723(boolean x) { - return deep7724(x); - } - - public static boolean deep7724(boolean x) { - return deep7725(x); - } - - public static boolean deep7725(boolean x) { - return deep7726(x); - } - - public static boolean deep7726(boolean x) { - return deep7727(x); - } - - public static boolean deep7727(boolean x) { - return deep7728(x); - } - - public static boolean deep7728(boolean x) { - return deep7729(x); - } - - public static boolean deep7729(boolean x) { - return deep7730(x); - } - - public static boolean deep7730(boolean x) { - return deep7731(x); - } - - public static boolean deep7731(boolean x) { - return deep7732(x); - } - - public static boolean deep7732(boolean x) { - return deep7733(x); - } - - public static boolean deep7733(boolean x) { - return deep7734(x); - } - - public static boolean deep7734(boolean x) { - return deep7735(x); - } - - public static boolean deep7735(boolean x) { - return deep7736(x); - } - - public static boolean deep7736(boolean x) { - return deep7737(x); - } - - public static boolean deep7737(boolean x) { - return deep7738(x); - } - - public static boolean deep7738(boolean x) { - return deep7739(x); - } - - public static boolean deep7739(boolean x) { - return deep7740(x); - } - - public static boolean deep7740(boolean x) { - return deep7741(x); - } - - public static boolean deep7741(boolean x) { - return deep7742(x); - } - - public static boolean deep7742(boolean x) { - return deep7743(x); - } - - public static boolean deep7743(boolean x) { - return deep7744(x); - } - - public static boolean deep7744(boolean x) { - return deep7745(x); - } - - public static boolean deep7745(boolean x) { - return deep7746(x); - } - - public static boolean deep7746(boolean x) { - return deep7747(x); - } - - public static boolean deep7747(boolean x) { - return deep7748(x); - } - - public static boolean deep7748(boolean x) { - return deep7749(x); - } - - public static boolean deep7749(boolean x) { - return deep7750(x); - } - - public static boolean deep7750(boolean x) { - return deep7751(x); - } - - public static boolean deep7751(boolean x) { - return deep7752(x); - } - - public static boolean deep7752(boolean x) { - return deep7753(x); - } - - public static boolean deep7753(boolean x) { - return deep7754(x); - } - - public static boolean deep7754(boolean x) { - return deep7755(x); - } - - public static boolean deep7755(boolean x) { - return deep7756(x); - } - - public static boolean deep7756(boolean x) { - return deep7757(x); - } - - public static boolean deep7757(boolean x) { - return deep7758(x); - } - - public static boolean deep7758(boolean x) { - return deep7759(x); - } - - public static boolean deep7759(boolean x) { - return deep7760(x); - } - - public static boolean deep7760(boolean x) { - return deep7761(x); - } - - public static boolean deep7761(boolean x) { - return deep7762(x); - } - - public static boolean deep7762(boolean x) { - return deep7763(x); - } - - public static boolean deep7763(boolean x) { - return deep7764(x); - } - - public static boolean deep7764(boolean x) { - return deep7765(x); - } - - public static boolean deep7765(boolean x) { - return deep7766(x); - } - - public static boolean deep7766(boolean x) { - return deep7767(x); - } - - public static boolean deep7767(boolean x) { - return deep7768(x); - } - - public static boolean deep7768(boolean x) { - return deep7769(x); - } - - public static boolean deep7769(boolean x) { - return deep7770(x); - } - - public static boolean deep7770(boolean x) { - return deep7771(x); - } - - public static boolean deep7771(boolean x) { - return deep7772(x); - } - - public static boolean deep7772(boolean x) { - return deep7773(x); - } - - public static boolean deep7773(boolean x) { - return deep7774(x); - } - - public static boolean deep7774(boolean x) { - return deep7775(x); - } - - public static boolean deep7775(boolean x) { - return deep7776(x); - } - - public static boolean deep7776(boolean x) { - return deep7777(x); - } - - public static boolean deep7777(boolean x) { - return deep7778(x); - } - - public static boolean deep7778(boolean x) { - return deep7779(x); - } - - public static boolean deep7779(boolean x) { - return deep7780(x); - } - - public static boolean deep7780(boolean x) { - return deep7781(x); - } - - public static boolean deep7781(boolean x) { - return deep7782(x); - } - - public static boolean deep7782(boolean x) { - return deep7783(x); - } - - public static boolean deep7783(boolean x) { - return deep7784(x); - } - - public static boolean deep7784(boolean x) { - return deep7785(x); - } - - public static boolean deep7785(boolean x) { - return deep7786(x); - } - - public static boolean deep7786(boolean x) { - return deep7787(x); - } - - public static boolean deep7787(boolean x) { - return deep7788(x); - } - - public static boolean deep7788(boolean x) { - return deep7789(x); - } - - public static boolean deep7789(boolean x) { - return deep7790(x); - } - - public static boolean deep7790(boolean x) { - return deep7791(x); - } - - public static boolean deep7791(boolean x) { - return deep7792(x); - } - - public static boolean deep7792(boolean x) { - return deep7793(x); - } - - public static boolean deep7793(boolean x) { - return deep7794(x); - } - - public static boolean deep7794(boolean x) { - return deep7795(x); - } - - public static boolean deep7795(boolean x) { - return deep7796(x); - } - - public static boolean deep7796(boolean x) { - return deep7797(x); - } - - public static boolean deep7797(boolean x) { - return deep7798(x); - } - - public static boolean deep7798(boolean x) { - return deep7799(x); - } - - public static boolean deep7799(boolean x) { - return deep7800(x); - } - - public static boolean deep7800(boolean x) { - return deep7801(x); - } - - public static boolean deep7801(boolean x) { - return deep7802(x); - } - - public static boolean deep7802(boolean x) { - return deep7803(x); - } - - public static boolean deep7803(boolean x) { - return deep7804(x); - } - - public static boolean deep7804(boolean x) { - return deep7805(x); - } - - public static boolean deep7805(boolean x) { - return deep7806(x); - } - - public static boolean deep7806(boolean x) { - return deep7807(x); - } - - public static boolean deep7807(boolean x) { - return deep7808(x); - } - - public static boolean deep7808(boolean x) { - return deep7809(x); - } - - public static boolean deep7809(boolean x) { - return deep7810(x); - } - - public static boolean deep7810(boolean x) { - return deep7811(x); - } - - public static boolean deep7811(boolean x) { - return deep7812(x); - } - - public static boolean deep7812(boolean x) { - return deep7813(x); - } - - public static boolean deep7813(boolean x) { - return deep7814(x); - } - - public static boolean deep7814(boolean x) { - return deep7815(x); - } - - public static boolean deep7815(boolean x) { - return deep7816(x); - } - - public static boolean deep7816(boolean x) { - return deep7817(x); - } - - public static boolean deep7817(boolean x) { - return deep7818(x); - } - - public static boolean deep7818(boolean x) { - return deep7819(x); - } - - public static boolean deep7819(boolean x) { - return deep7820(x); - } - - public static boolean deep7820(boolean x) { - return deep7821(x); - } - - public static boolean deep7821(boolean x) { - return deep7822(x); - } - - public static boolean deep7822(boolean x) { - return deep7823(x); - } - - public static boolean deep7823(boolean x) { - return deep7824(x); - } - - public static boolean deep7824(boolean x) { - return deep7825(x); - } - - public static boolean deep7825(boolean x) { - return deep7826(x); - } - - public static boolean deep7826(boolean x) { - return deep7827(x); - } - - public static boolean deep7827(boolean x) { - return deep7828(x); - } - - public static boolean deep7828(boolean x) { - return deep7829(x); - } - - public static boolean deep7829(boolean x) { - return deep7830(x); - } - - public static boolean deep7830(boolean x) { - return deep7831(x); - } - - public static boolean deep7831(boolean x) { - return deep7832(x); - } - - public static boolean deep7832(boolean x) { - return deep7833(x); - } - - public static boolean deep7833(boolean x) { - return deep7834(x); - } - - public static boolean deep7834(boolean x) { - return deep7835(x); - } - - public static boolean deep7835(boolean x) { - return deep7836(x); - } - - public static boolean deep7836(boolean x) { - return deep7837(x); - } - - public static boolean deep7837(boolean x) { - return deep7838(x); - } - - public static boolean deep7838(boolean x) { - return deep7839(x); - } - - public static boolean deep7839(boolean x) { - return deep7840(x); - } - - public static boolean deep7840(boolean x) { - return deep7841(x); - } - - public static boolean deep7841(boolean x) { - return deep7842(x); - } - - public static boolean deep7842(boolean x) { - return deep7843(x); - } - - public static boolean deep7843(boolean x) { - return deep7844(x); - } - - public static boolean deep7844(boolean x) { - return deep7845(x); - } - - public static boolean deep7845(boolean x) { - return deep7846(x); - } - - public static boolean deep7846(boolean x) { - return deep7847(x); - } - - public static boolean deep7847(boolean x) { - return deep7848(x); - } - - public static boolean deep7848(boolean x) { - return deep7849(x); - } - - public static boolean deep7849(boolean x) { - return deep7850(x); - } - - public static boolean deep7850(boolean x) { - return deep7851(x); - } - - public static boolean deep7851(boolean x) { - return deep7852(x); - } - - public static boolean deep7852(boolean x) { - return deep7853(x); - } - - public static boolean deep7853(boolean x) { - return deep7854(x); - } - - public static boolean deep7854(boolean x) { - return deep7855(x); - } - - public static boolean deep7855(boolean x) { - return deep7856(x); - } - - public static boolean deep7856(boolean x) { - return deep7857(x); - } - - public static boolean deep7857(boolean x) { - return deep7858(x); - } - - public static boolean deep7858(boolean x) { - return deep7859(x); - } - - public static boolean deep7859(boolean x) { - return deep7860(x); - } - - public static boolean deep7860(boolean x) { - return deep7861(x); - } - - public static boolean deep7861(boolean x) { - return deep7862(x); - } - - public static boolean deep7862(boolean x) { - return deep7863(x); - } - - public static boolean deep7863(boolean x) { - return deep7864(x); - } - - public static boolean deep7864(boolean x) { - return deep7865(x); - } - - public static boolean deep7865(boolean x) { - return deep7866(x); - } - - public static boolean deep7866(boolean x) { - return deep7867(x); - } - - public static boolean deep7867(boolean x) { - return deep7868(x); - } - - public static boolean deep7868(boolean x) { - return deep7869(x); - } - - public static boolean deep7869(boolean x) { - return deep7870(x); - } - - public static boolean deep7870(boolean x) { - return deep7871(x); - } - - public static boolean deep7871(boolean x) { - return deep7872(x); - } - - public static boolean deep7872(boolean x) { - return deep7873(x); - } - - public static boolean deep7873(boolean x) { - return deep7874(x); - } - - public static boolean deep7874(boolean x) { - return deep7875(x); - } - - public static boolean deep7875(boolean x) { - return deep7876(x); - } - - public static boolean deep7876(boolean x) { - return deep7877(x); - } - - public static boolean deep7877(boolean x) { - return deep7878(x); - } - - public static boolean deep7878(boolean x) { - return deep7879(x); - } - - public static boolean deep7879(boolean x) { - return deep7880(x); - } - - public static boolean deep7880(boolean x) { - return deep7881(x); - } - - public static boolean deep7881(boolean x) { - return deep7882(x); - } - - public static boolean deep7882(boolean x) { - return deep7883(x); - } - - public static boolean deep7883(boolean x) { - return deep7884(x); - } - - public static boolean deep7884(boolean x) { - return deep7885(x); - } - - public static boolean deep7885(boolean x) { - return deep7886(x); - } - - public static boolean deep7886(boolean x) { - return deep7887(x); - } - - public static boolean deep7887(boolean x) { - return deep7888(x); - } - - public static boolean deep7888(boolean x) { - return deep7889(x); - } - - public static boolean deep7889(boolean x) { - return deep7890(x); - } - - public static boolean deep7890(boolean x) { - return deep7891(x); - } - - public static boolean deep7891(boolean x) { - return deep7892(x); - } - - public static boolean deep7892(boolean x) { - return deep7893(x); - } - - public static boolean deep7893(boolean x) { - return deep7894(x); - } - - public static boolean deep7894(boolean x) { - return deep7895(x); - } - - public static boolean deep7895(boolean x) { - return deep7896(x); - } - - public static boolean deep7896(boolean x) { - return deep7897(x); - } - - public static boolean deep7897(boolean x) { - return deep7898(x); - } - - public static boolean deep7898(boolean x) { - return deep7899(x); - } - - public static boolean deep7899(boolean x) { - return deep7900(x); - } - - public static boolean deep7900(boolean x) { - return deep7901(x); - } - - public static boolean deep7901(boolean x) { - return deep7902(x); - } - - public static boolean deep7902(boolean x) { - return deep7903(x); - } - - public static boolean deep7903(boolean x) { - return deep7904(x); - } - - public static boolean deep7904(boolean x) { - return deep7905(x); - } - - public static boolean deep7905(boolean x) { - return deep7906(x); - } - - public static boolean deep7906(boolean x) { - return deep7907(x); - } - - public static boolean deep7907(boolean x) { - return deep7908(x); - } - - public static boolean deep7908(boolean x) { - return deep7909(x); - } - - public static boolean deep7909(boolean x) { - return deep7910(x); - } - - public static boolean deep7910(boolean x) { - return deep7911(x); - } - - public static boolean deep7911(boolean x) { - return deep7912(x); - } - - public static boolean deep7912(boolean x) { - return deep7913(x); - } - - public static boolean deep7913(boolean x) { - return deep7914(x); - } - - public static boolean deep7914(boolean x) { - return deep7915(x); - } - - public static boolean deep7915(boolean x) { - return deep7916(x); - } - - public static boolean deep7916(boolean x) { - return deep7917(x); - } - - public static boolean deep7917(boolean x) { - return deep7918(x); - } - - public static boolean deep7918(boolean x) { - return deep7919(x); - } - - public static boolean deep7919(boolean x) { - return deep7920(x); - } - - public static boolean deep7920(boolean x) { - return deep7921(x); - } - - public static boolean deep7921(boolean x) { - return deep7922(x); - } - - public static boolean deep7922(boolean x) { - return deep7923(x); - } - - public static boolean deep7923(boolean x) { - return deep7924(x); - } - - public static boolean deep7924(boolean x) { - return deep7925(x); - } - - public static boolean deep7925(boolean x) { - return deep7926(x); - } - - public static boolean deep7926(boolean x) { - return deep7927(x); - } - - public static boolean deep7927(boolean x) { - return deep7928(x); - } - - public static boolean deep7928(boolean x) { - return deep7929(x); - } - - public static boolean deep7929(boolean x) { - return deep7930(x); - } - - public static boolean deep7930(boolean x) { - return deep7931(x); - } - - public static boolean deep7931(boolean x) { - return deep7932(x); - } - - public static boolean deep7932(boolean x) { - return deep7933(x); - } - - public static boolean deep7933(boolean x) { - return deep7934(x); - } - - public static boolean deep7934(boolean x) { - return deep7935(x); - } - - public static boolean deep7935(boolean x) { - return deep7936(x); - } - - public static boolean deep7936(boolean x) { - return deep7937(x); - } - - public static boolean deep7937(boolean x) { - return deep7938(x); - } - - public static boolean deep7938(boolean x) { - return deep7939(x); - } - - public static boolean deep7939(boolean x) { - return deep7940(x); - } - - public static boolean deep7940(boolean x) { - return deep7941(x); - } - - public static boolean deep7941(boolean x) { - return deep7942(x); - } - - public static boolean deep7942(boolean x) { - return deep7943(x); - } - - public static boolean deep7943(boolean x) { - return deep7944(x); - } - - public static boolean deep7944(boolean x) { - return deep7945(x); - } - - public static boolean deep7945(boolean x) { - return deep7946(x); - } - - public static boolean deep7946(boolean x) { - return deep7947(x); - } - - public static boolean deep7947(boolean x) { - return deep7948(x); - } - - public static boolean deep7948(boolean x) { - return deep7949(x); - } - - public static boolean deep7949(boolean x) { - return deep7950(x); - } - - public static boolean deep7950(boolean x) { - return deep7951(x); - } - - public static boolean deep7951(boolean x) { - return deep7952(x); - } - - public static boolean deep7952(boolean x) { - return deep7953(x); - } - - public static boolean deep7953(boolean x) { - return deep7954(x); - } - - public static boolean deep7954(boolean x) { - return deep7955(x); - } - - public static boolean deep7955(boolean x) { - return deep7956(x); - } - - public static boolean deep7956(boolean x) { - return deep7957(x); - } - - public static boolean deep7957(boolean x) { - return deep7958(x); - } - - public static boolean deep7958(boolean x) { - return deep7959(x); - } - - public static boolean deep7959(boolean x) { - return deep7960(x); - } - - public static boolean deep7960(boolean x) { - return deep7961(x); - } - - public static boolean deep7961(boolean x) { - return deep7962(x); - } - - public static boolean deep7962(boolean x) { - return deep7963(x); - } - - public static boolean deep7963(boolean x) { - return deep7964(x); - } - - public static boolean deep7964(boolean x) { - return deep7965(x); - } - - public static boolean deep7965(boolean x) { - return deep7966(x); - } - - public static boolean deep7966(boolean x) { - return deep7967(x); - } - - public static boolean deep7967(boolean x) { - return deep7968(x); - } - - public static boolean deep7968(boolean x) { - return deep7969(x); - } - - public static boolean deep7969(boolean x) { - return deep7970(x); - } - - public static boolean deep7970(boolean x) { - return deep7971(x); - } - - public static boolean deep7971(boolean x) { - return deep7972(x); - } - - public static boolean deep7972(boolean x) { - return deep7973(x); - } - - public static boolean deep7973(boolean x) { - return deep7974(x); - } - - public static boolean deep7974(boolean x) { - return deep7975(x); - } - - public static boolean deep7975(boolean x) { - return deep7976(x); - } - - public static boolean deep7976(boolean x) { - return deep7977(x); - } - - public static boolean deep7977(boolean x) { - return deep7978(x); - } - - public static boolean deep7978(boolean x) { - return deep7979(x); - } - - public static boolean deep7979(boolean x) { - return deep7980(x); - } - - public static boolean deep7980(boolean x) { - return deep7981(x); - } - - public static boolean deep7981(boolean x) { - return deep7982(x); - } - - public static boolean deep7982(boolean x) { - return deep7983(x); - } - - public static boolean deep7983(boolean x) { - return deep7984(x); - } - - public static boolean deep7984(boolean x) { - return deep7985(x); - } - - public static boolean deep7985(boolean x) { - return deep7986(x); - } - - public static boolean deep7986(boolean x) { - return deep7987(x); - } - - public static boolean deep7987(boolean x) { - return deep7988(x); - } - - public static boolean deep7988(boolean x) { - return deep7989(x); - } - - public static boolean deep7989(boolean x) { - return deep7990(x); - } - - public static boolean deep7990(boolean x) { - return deep7991(x); - } - - public static boolean deep7991(boolean x) { - return deep7992(x); - } - - public static boolean deep7992(boolean x) { - return deep7993(x); - } - - public static boolean deep7993(boolean x) { - return deep7994(x); - } - - public static boolean deep7994(boolean x) { - return deep7995(x); - } - - public static boolean deep7995(boolean x) { - return deep7996(x); - } - - public static boolean deep7996(boolean x) { - return deep7997(x); - } - - public static boolean deep7997(boolean x) { - return deep7998(x); - } - - public static boolean deep7998(boolean x) { - return deep7999(x); - } - - public static boolean deep7999(boolean x) { - return deep8000(x); - } - - public static boolean deep8000(boolean x) { - return deep8001(x); - } - - public static boolean deep8001(boolean x) { - return deep8002(x); - } - - public static boolean deep8002(boolean x) { - return deep8003(x); - } - - public static boolean deep8003(boolean x) { - return deep8004(x); - } - - public static boolean deep8004(boolean x) { - return deep8005(x); - } - - public static boolean deep8005(boolean x) { - return deep8006(x); - } - - public static boolean deep8006(boolean x) { - return deep8007(x); - } - - public static boolean deep8007(boolean x) { - return deep8008(x); - } - - public static boolean deep8008(boolean x) { - return deep8009(x); - } - - public static boolean deep8009(boolean x) { - return deep8010(x); - } - - public static boolean deep8010(boolean x) { - return deep8011(x); - } - - public static boolean deep8011(boolean x) { - return deep8012(x); - } - - public static boolean deep8012(boolean x) { - return deep8013(x); - } - - public static boolean deep8013(boolean x) { - return deep8014(x); - } - - public static boolean deep8014(boolean x) { - return deep8015(x); - } - - public static boolean deep8015(boolean x) { - return deep8016(x); - } - - public static boolean deep8016(boolean x) { - return deep8017(x); - } - - public static boolean deep8017(boolean x) { - return deep8018(x); - } - - public static boolean deep8018(boolean x) { - return deep8019(x); - } - - public static boolean deep8019(boolean x) { - return deep8020(x); - } - - public static boolean deep8020(boolean x) { - return deep8021(x); - } - - public static boolean deep8021(boolean x) { - return deep8022(x); - } - - public static boolean deep8022(boolean x) { - return deep8023(x); - } - - public static boolean deep8023(boolean x) { - return deep8024(x); - } - - public static boolean deep8024(boolean x) { - return deep8025(x); - } - - public static boolean deep8025(boolean x) { - return deep8026(x); - } - - public static boolean deep8026(boolean x) { - return deep8027(x); - } - - public static boolean deep8027(boolean x) { - return deep8028(x); - } - - public static boolean deep8028(boolean x) { - return deep8029(x); - } - - public static boolean deep8029(boolean x) { - return deep8030(x); - } - - public static boolean deep8030(boolean x) { - return deep8031(x); - } - - public static boolean deep8031(boolean x) { - return deep8032(x); - } - - public static boolean deep8032(boolean x) { - return deep8033(x); - } - - public static boolean deep8033(boolean x) { - return deep8034(x); - } - - public static boolean deep8034(boolean x) { - return deep8035(x); - } - - public static boolean deep8035(boolean x) { - return deep8036(x); - } - - public static boolean deep8036(boolean x) { - return deep8037(x); - } - - public static boolean deep8037(boolean x) { - return deep8038(x); - } - - public static boolean deep8038(boolean x) { - return deep8039(x); - } - - public static boolean deep8039(boolean x) { - return deep8040(x); - } - - public static boolean deep8040(boolean x) { - return deep8041(x); - } - - public static boolean deep8041(boolean x) { - return deep8042(x); - } - - public static boolean deep8042(boolean x) { - return deep8043(x); - } - - public static boolean deep8043(boolean x) { - return deep8044(x); - } - - public static boolean deep8044(boolean x) { - return deep8045(x); - } - - public static boolean deep8045(boolean x) { - return deep8046(x); - } - - public static boolean deep8046(boolean x) { - return deep8047(x); - } - - public static boolean deep8047(boolean x) { - return deep8048(x); - } - - public static boolean deep8048(boolean x) { - return deep8049(x); - } - - public static boolean deep8049(boolean x) { - return deep8050(x); - } - - public static boolean deep8050(boolean x) { - return deep8051(x); - } - - public static boolean deep8051(boolean x) { - return deep8052(x); - } - - public static boolean deep8052(boolean x) { - return deep8053(x); - } - - public static boolean deep8053(boolean x) { - return deep8054(x); - } - - public static boolean deep8054(boolean x) { - return deep8055(x); - } - - public static boolean deep8055(boolean x) { - return deep8056(x); - } - - public static boolean deep8056(boolean x) { - return deep8057(x); - } - - public static boolean deep8057(boolean x) { - return deep8058(x); - } - - public static boolean deep8058(boolean x) { - return deep8059(x); - } - - public static boolean deep8059(boolean x) { - return deep8060(x); - } - - public static boolean deep8060(boolean x) { - return deep8061(x); - } - - public static boolean deep8061(boolean x) { - return deep8062(x); - } - - public static boolean deep8062(boolean x) { - return deep8063(x); - } - - public static boolean deep8063(boolean x) { - return deep8064(x); - } - - public static boolean deep8064(boolean x) { - return deep8065(x); - } - - public static boolean deep8065(boolean x) { - return deep8066(x); - } - - public static boolean deep8066(boolean x) { - return deep8067(x); - } - - public static boolean deep8067(boolean x) { - return deep8068(x); - } - - public static boolean deep8068(boolean x) { - return deep8069(x); - } - - public static boolean deep8069(boolean x) { - return deep8070(x); - } - - public static boolean deep8070(boolean x) { - return deep8071(x); - } - - public static boolean deep8071(boolean x) { - return deep8072(x); - } - - public static boolean deep8072(boolean x) { - return deep8073(x); - } - - public static boolean deep8073(boolean x) { - return deep8074(x); - } - - public static boolean deep8074(boolean x) { - return deep8075(x); - } - - public static boolean deep8075(boolean x) { - return deep8076(x); - } - - public static boolean deep8076(boolean x) { - return deep8077(x); - } - - public static boolean deep8077(boolean x) { - return deep8078(x); - } - - public static boolean deep8078(boolean x) { - return deep8079(x); - } - - public static boolean deep8079(boolean x) { - return deep8080(x); - } - - public static boolean deep8080(boolean x) { - return deep8081(x); - } - - public static boolean deep8081(boolean x) { - return deep8082(x); - } - - public static boolean deep8082(boolean x) { - return deep8083(x); - } - - public static boolean deep8083(boolean x) { - return deep8084(x); - } - - public static boolean deep8084(boolean x) { - return deep8085(x); - } - - public static boolean deep8085(boolean x) { - return deep8086(x); - } - - public static boolean deep8086(boolean x) { - return deep8087(x); - } - - public static boolean deep8087(boolean x) { - return deep8088(x); - } - - public static boolean deep8088(boolean x) { - return deep8089(x); - } - - public static boolean deep8089(boolean x) { - return deep8090(x); - } - - public static boolean deep8090(boolean x) { - return deep8091(x); - } - - public static boolean deep8091(boolean x) { - return deep8092(x); - } - - public static boolean deep8092(boolean x) { - return deep8093(x); - } - - public static boolean deep8093(boolean x) { - return deep8094(x); - } - - public static boolean deep8094(boolean x) { - return deep8095(x); - } - - public static boolean deep8095(boolean x) { - return deep8096(x); - } - - public static boolean deep8096(boolean x) { - return deep8097(x); - } - - public static boolean deep8097(boolean x) { - return deep8098(x); - } - - public static boolean deep8098(boolean x) { - return deep8099(x); - } - - public static boolean deep8099(boolean x) { - return deep8100(x); - } - - public static boolean deep8100(boolean x) { - return deep8101(x); - } - - public static boolean deep8101(boolean x) { - return deep8102(x); - } - - public static boolean deep8102(boolean x) { - return deep8103(x); - } - - public static boolean deep8103(boolean x) { - return deep8104(x); - } - - public static boolean deep8104(boolean x) { - return deep8105(x); - } - - public static boolean deep8105(boolean x) { - return deep8106(x); - } - - public static boolean deep8106(boolean x) { - return deep8107(x); - } - - public static boolean deep8107(boolean x) { - return deep8108(x); - } - - public static boolean deep8108(boolean x) { - return deep8109(x); - } - - public static boolean deep8109(boolean x) { - return deep8110(x); - } - - public static boolean deep8110(boolean x) { - return deep8111(x); - } - - public static boolean deep8111(boolean x) { - return deep8112(x); - } - - public static boolean deep8112(boolean x) { - return deep8113(x); - } - - public static boolean deep8113(boolean x) { - return deep8114(x); - } - - public static boolean deep8114(boolean x) { - return deep8115(x); - } - - public static boolean deep8115(boolean x) { - return deep8116(x); - } - - public static boolean deep8116(boolean x) { - return deep8117(x); - } - - public static boolean deep8117(boolean x) { - return deep8118(x); - } - - public static boolean deep8118(boolean x) { - return deep8119(x); - } - - public static boolean deep8119(boolean x) { - return deep8120(x); - } - - public static boolean deep8120(boolean x) { - return deep8121(x); - } - - public static boolean deep8121(boolean x) { - return deep8122(x); - } - - public static boolean deep8122(boolean x) { - return deep8123(x); - } - - public static boolean deep8123(boolean x) { - return deep8124(x); - } - - public static boolean deep8124(boolean x) { - return deep8125(x); - } - - public static boolean deep8125(boolean x) { - return deep8126(x); - } - - public static boolean deep8126(boolean x) { - return deep8127(x); - } - - public static boolean deep8127(boolean x) { - return deep8128(x); - } - - public static boolean deep8128(boolean x) { - return deep8129(x); - } - - public static boolean deep8129(boolean x) { - return deep8130(x); - } - - public static boolean deep8130(boolean x) { - return deep8131(x); - } - - public static boolean deep8131(boolean x) { - return deep8132(x); - } - - public static boolean deep8132(boolean x) { - return deep8133(x); - } - - public static boolean deep8133(boolean x) { - return deep8134(x); - } - - public static boolean deep8134(boolean x) { - return deep8135(x); - } - - public static boolean deep8135(boolean x) { - return deep8136(x); - } - - public static boolean deep8136(boolean x) { - return deep8137(x); - } - - public static boolean deep8137(boolean x) { - return deep8138(x); - } - - public static boolean deep8138(boolean x) { - return deep8139(x); - } - - public static boolean deep8139(boolean x) { - return deep8140(x); - } - - public static boolean deep8140(boolean x) { - return deep8141(x); - } - - public static boolean deep8141(boolean x) { - return deep8142(x); - } - - public static boolean deep8142(boolean x) { - return deep8143(x); - } - - public static boolean deep8143(boolean x) { - return deep8144(x); - } - - public static boolean deep8144(boolean x) { - return deep8145(x); - } - - public static boolean deep8145(boolean x) { - return deep8146(x); - } - - public static boolean deep8146(boolean x) { - return deep8147(x); - } - - public static boolean deep8147(boolean x) { - return deep8148(x); - } - - public static boolean deep8148(boolean x) { - return deep8149(x); - } - - public static boolean deep8149(boolean x) { - return deep8150(x); - } - - public static boolean deep8150(boolean x) { - return deep8151(x); - } - - public static boolean deep8151(boolean x) { - return deep8152(x); - } - - public static boolean deep8152(boolean x) { - return deep8153(x); - } - - public static boolean deep8153(boolean x) { - return deep8154(x); - } - - public static boolean deep8154(boolean x) { - return deep8155(x); - } - - public static boolean deep8155(boolean x) { - return deep8156(x); - } - - public static boolean deep8156(boolean x) { - return deep8157(x); - } - - public static boolean deep8157(boolean x) { - return deep8158(x); - } - - public static boolean deep8158(boolean x) { - return deep8159(x); - } - - public static boolean deep8159(boolean x) { - return deep8160(x); - } - - public static boolean deep8160(boolean x) { - return deep8161(x); - } - - public static boolean deep8161(boolean x) { - return deep8162(x); - } - - public static boolean deep8162(boolean x) { - return deep8163(x); - } - - public static boolean deep8163(boolean x) { - return deep8164(x); - } - - public static boolean deep8164(boolean x) { - return deep8165(x); - } - - public static boolean deep8165(boolean x) { - return deep8166(x); - } - - public static boolean deep8166(boolean x) { - return deep8167(x); - } - - public static boolean deep8167(boolean x) { - return deep8168(x); - } - - public static boolean deep8168(boolean x) { - return deep8169(x); - } - - public static boolean deep8169(boolean x) { - return deep8170(x); - } - - public static boolean deep8170(boolean x) { - return deep8171(x); - } - - public static boolean deep8171(boolean x) { - return deep8172(x); - } - - public static boolean deep8172(boolean x) { - return deep8173(x); - } - - public static boolean deep8173(boolean x) { - return deep8174(x); - } - - public static boolean deep8174(boolean x) { - return deep8175(x); - } - - public static boolean deep8175(boolean x) { - return deep8176(x); - } - - public static boolean deep8176(boolean x) { - return deep8177(x); - } - - public static boolean deep8177(boolean x) { - return deep8178(x); - } - - public static boolean deep8178(boolean x) { - return deep8179(x); - } - - public static boolean deep8179(boolean x) { - return deep8180(x); - } - - public static boolean deep8180(boolean x) { - return deep8181(x); - } - - public static boolean deep8181(boolean x) { - return deep8182(x); - } - - public static boolean deep8182(boolean x) { - return deep8183(x); - } - - public static boolean deep8183(boolean x) { - return deep8184(x); - } - - public static boolean deep8184(boolean x) { - return deep8185(x); - } - - public static boolean deep8185(boolean x) { - return deep8186(x); - } - - public static boolean deep8186(boolean x) { - return deep8187(x); - } - - public static boolean deep8187(boolean x) { - return deep8188(x); - } - - public static boolean deep8188(boolean x) { - return deep8189(x); - } - - public static boolean deep8189(boolean x) { - return deep8190(x); - } - - public static boolean deep8190(boolean x) { - return deep8191(x); - } - - public static boolean deep8191(boolean x) { - return deep8192(x); - } - - public static boolean deep8192(boolean x) { - return deep8193(x); - } - - public static boolean deep8193(boolean x) { - return deep8194(x); - } - - public static boolean deep8194(boolean x) { - return deep8195(x); - } - - public static boolean deep8195(boolean x) { - return deep8196(x); - } - - public static boolean deep8196(boolean x) { - return deep8197(x); - } - - public static boolean deep8197(boolean x) { - return deep8198(x); - } - - public static boolean deep8198(boolean x) { - return deep8199(x); - } - - public static boolean deep8199(boolean x) { - return deep8200(x); - } - - public static boolean deep8200(boolean x) { - return deep8201(x); - } - - public static boolean deep8201(boolean x) { - return deep8202(x); - } - - public static boolean deep8202(boolean x) { - return deep8203(x); - } - - public static boolean deep8203(boolean x) { - return deep8204(x); - } - - public static boolean deep8204(boolean x) { - return deep8205(x); - } - - public static boolean deep8205(boolean x) { - return deep8206(x); - } - - public static boolean deep8206(boolean x) { - return deep8207(x); - } - - public static boolean deep8207(boolean x) { - return deep8208(x); - } - - public static boolean deep8208(boolean x) { - return deep8209(x); - } - - public static boolean deep8209(boolean x) { - return deep8210(x); - } - - public static boolean deep8210(boolean x) { - return deep8211(x); - } - - public static boolean deep8211(boolean x) { - return deep8212(x); - } - - public static boolean deep8212(boolean x) { - return deep8213(x); - } - - public static boolean deep8213(boolean x) { - return deep8214(x); - } - - public static boolean deep8214(boolean x) { - return deep8215(x); - } - - public static boolean deep8215(boolean x) { - return deep8216(x); - } - - public static boolean deep8216(boolean x) { - return deep8217(x); - } - - public static boolean deep8217(boolean x) { - return deep8218(x); - } - - public static boolean deep8218(boolean x) { - return deep8219(x); - } - - public static boolean deep8219(boolean x) { - return deep8220(x); - } - - public static boolean deep8220(boolean x) { - return deep8221(x); - } - - public static boolean deep8221(boolean x) { - return deep8222(x); - } - - public static boolean deep8222(boolean x) { - return deep8223(x); - } - - public static boolean deep8223(boolean x) { - return deep8224(x); - } - - public static boolean deep8224(boolean x) { - return deep8225(x); - } - - public static boolean deep8225(boolean x) { - return deep8226(x); - } - - public static boolean deep8226(boolean x) { - return deep8227(x); - } - - public static boolean deep8227(boolean x) { - return deep8228(x); - } - - public static boolean deep8228(boolean x) { - return deep8229(x); - } - - public static boolean deep8229(boolean x) { - return deep8230(x); - } - - public static boolean deep8230(boolean x) { - return deep8231(x); - } - - public static boolean deep8231(boolean x) { - return deep8232(x); - } - - public static boolean deep8232(boolean x) { - return deep8233(x); - } - - public static boolean deep8233(boolean x) { - return deep8234(x); - } - - public static boolean deep8234(boolean x) { - return deep8235(x); - } - - public static boolean deep8235(boolean x) { - return deep8236(x); - } - - public static boolean deep8236(boolean x) { - return deep8237(x); - } - - public static boolean deep8237(boolean x) { - return deep8238(x); - } - - public static boolean deep8238(boolean x) { - return deep8239(x); - } - - public static boolean deep8239(boolean x) { - return deep8240(x); - } - - public static boolean deep8240(boolean x) { - return deep8241(x); - } - - public static boolean deep8241(boolean x) { - return deep8242(x); - } - - public static boolean deep8242(boolean x) { - return deep8243(x); - } - - public static boolean deep8243(boolean x) { - return deep8244(x); - } - - public static boolean deep8244(boolean x) { - return deep8245(x); - } - - public static boolean deep8245(boolean x) { - return deep8246(x); - } - - public static boolean deep8246(boolean x) { - return deep8247(x); - } - - public static boolean deep8247(boolean x) { - return deep8248(x); - } - - public static boolean deep8248(boolean x) { - return deep8249(x); - } - - public static boolean deep8249(boolean x) { - return deep8250(x); - } - - public static boolean deep8250(boolean x) { - return deep8251(x); - } - - public static boolean deep8251(boolean x) { - return deep8252(x); - } - - public static boolean deep8252(boolean x) { - return deep8253(x); - } - - public static boolean deep8253(boolean x) { - return deep8254(x); - } - - public static boolean deep8254(boolean x) { - return deep8255(x); - } - - public static boolean deep8255(boolean x) { - return deep8256(x); - } - - public static boolean deep8256(boolean x) { - return deep8257(x); - } - - public static boolean deep8257(boolean x) { - return deep8258(x); - } - - public static boolean deep8258(boolean x) { - return deep8259(x); - } - - public static boolean deep8259(boolean x) { - return deep8260(x); - } - - public static boolean deep8260(boolean x) { - return deep8261(x); - } - - public static boolean deep8261(boolean x) { - return deep8262(x); - } - - public static boolean deep8262(boolean x) { - return deep8263(x); - } - - public static boolean deep8263(boolean x) { - return deep8264(x); - } - - public static boolean deep8264(boolean x) { - return deep8265(x); - } - - public static boolean deep8265(boolean x) { - return deep8266(x); - } - - public static boolean deep8266(boolean x) { - return deep8267(x); - } - - public static boolean deep8267(boolean x) { - return deep8268(x); - } - - public static boolean deep8268(boolean x) { - return deep8269(x); - } - - public static boolean deep8269(boolean x) { - return deep8270(x); - } - - public static boolean deep8270(boolean x) { - return deep8271(x); - } - - public static boolean deep8271(boolean x) { - return deep8272(x); - } - - public static boolean deep8272(boolean x) { - return deep8273(x); - } - - public static boolean deep8273(boolean x) { - return deep8274(x); - } - - public static boolean deep8274(boolean x) { - return deep8275(x); - } - - public static boolean deep8275(boolean x) { - return deep8276(x); - } - - public static boolean deep8276(boolean x) { - return deep8277(x); - } - - public static boolean deep8277(boolean x) { - return deep8278(x); - } - - public static boolean deep8278(boolean x) { - return deep8279(x); - } - - public static boolean deep8279(boolean x) { - return deep8280(x); - } - - public static boolean deep8280(boolean x) { - return deep8281(x); - } - - public static boolean deep8281(boolean x) { - return deep8282(x); - } - - public static boolean deep8282(boolean x) { - return deep8283(x); - } - - public static boolean deep8283(boolean x) { - return deep8284(x); - } - - public static boolean deep8284(boolean x) { - return deep8285(x); - } - - public static boolean deep8285(boolean x) { - return deep8286(x); - } - - public static boolean deep8286(boolean x) { - return deep8287(x); - } - - public static boolean deep8287(boolean x) { - return deep8288(x); - } - - public static boolean deep8288(boolean x) { - return deep8289(x); - } - - public static boolean deep8289(boolean x) { - return deep8290(x); - } - - public static boolean deep8290(boolean x) { - return deep8291(x); - } - - public static boolean deep8291(boolean x) { - return deep8292(x); - } - - public static boolean deep8292(boolean x) { - return deep8293(x); - } - - public static boolean deep8293(boolean x) { - return deep8294(x); - } - - public static boolean deep8294(boolean x) { - return deep8295(x); - } - - public static boolean deep8295(boolean x) { - return deep8296(x); - } - - public static boolean deep8296(boolean x) { - return deep8297(x); - } - - public static boolean deep8297(boolean x) { - return deep8298(x); - } - - public static boolean deep8298(boolean x) { - return deep8299(x); - } - - public static boolean deep8299(boolean x) { - return deep8300(x); - } - - public static boolean deep8300(boolean x) { - return deep8301(x); - } - - public static boolean deep8301(boolean x) { - return deep8302(x); - } - - public static boolean deep8302(boolean x) { - return deep8303(x); - } - - public static boolean deep8303(boolean x) { - return deep8304(x); - } - - public static boolean deep8304(boolean x) { - return deep8305(x); - } - - public static boolean deep8305(boolean x) { - return deep8306(x); - } - - public static boolean deep8306(boolean x) { - return deep8307(x); - } - - public static boolean deep8307(boolean x) { - return deep8308(x); - } - - public static boolean deep8308(boolean x) { - return deep8309(x); - } - - public static boolean deep8309(boolean x) { - return deep8310(x); - } - - public static boolean deep8310(boolean x) { - return deep8311(x); - } - - public static boolean deep8311(boolean x) { - return deep8312(x); - } - - public static boolean deep8312(boolean x) { - return deep8313(x); - } - - public static boolean deep8313(boolean x) { - return deep8314(x); - } - - public static boolean deep8314(boolean x) { - return deep8315(x); - } - - public static boolean deep8315(boolean x) { - return deep8316(x); - } - - public static boolean deep8316(boolean x) { - return deep8317(x); - } - - public static boolean deep8317(boolean x) { - return deep8318(x); - } - - public static boolean deep8318(boolean x) { - return deep8319(x); - } - - public static boolean deep8319(boolean x) { - return deep8320(x); - } - - public static boolean deep8320(boolean x) { - return deep8321(x); - } - - public static boolean deep8321(boolean x) { - return deep8322(x); - } - - public static boolean deep8322(boolean x) { - return deep8323(x); - } - - public static boolean deep8323(boolean x) { - return deep8324(x); - } - - public static boolean deep8324(boolean x) { - return deep8325(x); - } - - public static boolean deep8325(boolean x) { - return deep8326(x); - } - - public static boolean deep8326(boolean x) { - return deep8327(x); - } - - public static boolean deep8327(boolean x) { - return deep8328(x); - } - - public static boolean deep8328(boolean x) { - return deep8329(x); - } - - public static boolean deep8329(boolean x) { - return deep8330(x); - } - - public static boolean deep8330(boolean x) { - return deep8331(x); - } - - public static boolean deep8331(boolean x) { - return deep8332(x); - } - - public static boolean deep8332(boolean x) { - return deep8333(x); - } - - public static boolean deep8333(boolean x) { - return deep8334(x); - } - - public static boolean deep8334(boolean x) { - return deep8335(x); - } - - public static boolean deep8335(boolean x) { - return deep8336(x); - } - - public static boolean deep8336(boolean x) { - return deep8337(x); - } - - public static boolean deep8337(boolean x) { - return deep8338(x); - } - - public static boolean deep8338(boolean x) { - return deep8339(x); - } - - public static boolean deep8339(boolean x) { - return deep8340(x); - } - - public static boolean deep8340(boolean x) { - return deep8341(x); - } - - public static boolean deep8341(boolean x) { - return deep8342(x); - } - - public static boolean deep8342(boolean x) { - return deep8343(x); - } - - public static boolean deep8343(boolean x) { - return deep8344(x); - } - - public static boolean deep8344(boolean x) { - return deep8345(x); - } - - public static boolean deep8345(boolean x) { - return deep8346(x); - } - - public static boolean deep8346(boolean x) { - return deep8347(x); - } - - public static boolean deep8347(boolean x) { - return deep8348(x); - } - - public static boolean deep8348(boolean x) { - return deep8349(x); - } - - public static boolean deep8349(boolean x) { - return deep8350(x); - } - - public static boolean deep8350(boolean x) { - return deep8351(x); - } - - public static boolean deep8351(boolean x) { - return deep8352(x); - } - - public static boolean deep8352(boolean x) { - return deep8353(x); - } - - public static boolean deep8353(boolean x) { - return deep8354(x); - } - - public static boolean deep8354(boolean x) { - return deep8355(x); - } - - public static boolean deep8355(boolean x) { - return deep8356(x); - } - - public static boolean deep8356(boolean x) { - return deep8357(x); - } - - public static boolean deep8357(boolean x) { - return deep8358(x); - } - - public static boolean deep8358(boolean x) { - return deep8359(x); - } - - public static boolean deep8359(boolean x) { - return deep8360(x); - } - - public static boolean deep8360(boolean x) { - return deep8361(x); - } - - public static boolean deep8361(boolean x) { - return deep8362(x); - } - - public static boolean deep8362(boolean x) { - return deep8363(x); - } - - public static boolean deep8363(boolean x) { - return deep8364(x); - } - - public static boolean deep8364(boolean x) { - return deep8365(x); - } - - public static boolean deep8365(boolean x) { - return deep8366(x); - } - - public static boolean deep8366(boolean x) { - return deep8367(x); - } - - public static boolean deep8367(boolean x) { - return deep8368(x); - } - - public static boolean deep8368(boolean x) { - return deep8369(x); - } - - public static boolean deep8369(boolean x) { - return deep8370(x); - } - - public static boolean deep8370(boolean x) { - return deep8371(x); - } - - public static boolean deep8371(boolean x) { - return deep8372(x); - } - - public static boolean deep8372(boolean x) { - return deep8373(x); - } - - public static boolean deep8373(boolean x) { - return deep8374(x); - } - - public static boolean deep8374(boolean x) { - return deep8375(x); - } - - public static boolean deep8375(boolean x) { - return deep8376(x); - } - - public static boolean deep8376(boolean x) { - return deep8377(x); - } - - public static boolean deep8377(boolean x) { - return deep8378(x); - } - - public static boolean deep8378(boolean x) { - return deep8379(x); - } - - public static boolean deep8379(boolean x) { - return deep8380(x); - } - - public static boolean deep8380(boolean x) { - return deep8381(x); - } - - public static boolean deep8381(boolean x) { - return deep8382(x); - } - - public static boolean deep8382(boolean x) { - return deep8383(x); - } - - public static boolean deep8383(boolean x) { - return deep8384(x); - } - - public static boolean deep8384(boolean x) { - return deep8385(x); - } - - public static boolean deep8385(boolean x) { - return deep8386(x); - } - - public static boolean deep8386(boolean x) { - return deep8387(x); - } - - public static boolean deep8387(boolean x) { - return deep8388(x); - } - - public static boolean deep8388(boolean x) { - return deep8389(x); - } - - public static boolean deep8389(boolean x) { - return deep8390(x); - } - - public static boolean deep8390(boolean x) { - return deep8391(x); - } - - public static boolean deep8391(boolean x) { - return deep8392(x); - } - - public static boolean deep8392(boolean x) { - return deep8393(x); - } - - public static boolean deep8393(boolean x) { - return deep8394(x); - } - - public static boolean deep8394(boolean x) { - return deep8395(x); - } - - public static boolean deep8395(boolean x) { - return deep8396(x); - } - - public static boolean deep8396(boolean x) { - return deep8397(x); - } - - public static boolean deep8397(boolean x) { - return deep8398(x); - } - - public static boolean deep8398(boolean x) { - return deep8399(x); - } - - public static boolean deep8399(boolean x) { - return deep8400(x); - } - - public static boolean deep8400(boolean x) { - return deep8401(x); - } - - public static boolean deep8401(boolean x) { - return deep8402(x); - } - - public static boolean deep8402(boolean x) { - return deep8403(x); - } - - public static boolean deep8403(boolean x) { - return deep8404(x); - } - - public static boolean deep8404(boolean x) { - return deep8405(x); - } - - public static boolean deep8405(boolean x) { - return deep8406(x); - } - - public static boolean deep8406(boolean x) { - return deep8407(x); - } - - public static boolean deep8407(boolean x) { - return deep8408(x); - } - - public static boolean deep8408(boolean x) { - return deep8409(x); - } - - public static boolean deep8409(boolean x) { - return deep8410(x); - } - - public static boolean deep8410(boolean x) { - return deep8411(x); - } - - public static boolean deep8411(boolean x) { - return deep8412(x); - } - - public static boolean deep8412(boolean x) { - return deep8413(x); - } - - public static boolean deep8413(boolean x) { - return deep8414(x); - } - - public static boolean deep8414(boolean x) { - return deep8415(x); - } - - public static boolean deep8415(boolean x) { - return deep8416(x); - } - - public static boolean deep8416(boolean x) { - return deep8417(x); - } - - public static boolean deep8417(boolean x) { - return deep8418(x); - } - - public static boolean deep8418(boolean x) { - return deep8419(x); - } - - public static boolean deep8419(boolean x) { - return deep8420(x); - } - - public static boolean deep8420(boolean x) { - return deep8421(x); - } - - public static boolean deep8421(boolean x) { - return deep8422(x); - } - - public static boolean deep8422(boolean x) { - return deep8423(x); - } - - public static boolean deep8423(boolean x) { - return deep8424(x); - } - - public static boolean deep8424(boolean x) { - return deep8425(x); - } - - public static boolean deep8425(boolean x) { - return deep8426(x); - } - - public static boolean deep8426(boolean x) { - return deep8427(x); - } - - public static boolean deep8427(boolean x) { - return deep8428(x); - } - - public static boolean deep8428(boolean x) { - return deep8429(x); - } - - public static boolean deep8429(boolean x) { - return deep8430(x); - } - - public static boolean deep8430(boolean x) { - return deep8431(x); - } - - public static boolean deep8431(boolean x) { - return deep8432(x); - } - - public static boolean deep8432(boolean x) { - return deep8433(x); - } - - public static boolean deep8433(boolean x) { - return deep8434(x); - } - - public static boolean deep8434(boolean x) { - return deep8435(x); - } - - public static boolean deep8435(boolean x) { - return deep8436(x); - } - - public static boolean deep8436(boolean x) { - return deep8437(x); - } - - public static boolean deep8437(boolean x) { - return deep8438(x); - } - - public static boolean deep8438(boolean x) { - return deep8439(x); - } - - public static boolean deep8439(boolean x) { - return deep8440(x); - } - - public static boolean deep8440(boolean x) { - return deep8441(x); - } - - public static boolean deep8441(boolean x) { - return deep8442(x); - } - - public static boolean deep8442(boolean x) { - return deep8443(x); - } - - public static boolean deep8443(boolean x) { - return deep8444(x); - } - - public static boolean deep8444(boolean x) { - return deep8445(x); - } - - public static boolean deep8445(boolean x) { - return deep8446(x); - } - - public static boolean deep8446(boolean x) { - return deep8447(x); - } - - public static boolean deep8447(boolean x) { - return deep8448(x); - } - - public static boolean deep8448(boolean x) { - return deep8449(x); - } - - public static boolean deep8449(boolean x) { - return deep8450(x); - } - - public static boolean deep8450(boolean x) { - return deep8451(x); - } - - public static boolean deep8451(boolean x) { - return deep8452(x); - } - - public static boolean deep8452(boolean x) { - return deep8453(x); - } - - public static boolean deep8453(boolean x) { - return deep8454(x); - } - - public static boolean deep8454(boolean x) { - return deep8455(x); - } - - public static boolean deep8455(boolean x) { - return deep8456(x); - } - - public static boolean deep8456(boolean x) { - return deep8457(x); - } - - public static boolean deep8457(boolean x) { - return deep8458(x); - } - - public static boolean deep8458(boolean x) { - return deep8459(x); - } - - public static boolean deep8459(boolean x) { - return deep8460(x); - } - - public static boolean deep8460(boolean x) { - return deep8461(x); - } - - public static boolean deep8461(boolean x) { - return deep8462(x); - } - - public static boolean deep8462(boolean x) { - return deep8463(x); - } - - public static boolean deep8463(boolean x) { - return deep8464(x); - } - - public static boolean deep8464(boolean x) { - return deep8465(x); - } - - public static boolean deep8465(boolean x) { - return deep8466(x); - } - - public static boolean deep8466(boolean x) { - return deep8467(x); - } - - public static boolean deep8467(boolean x) { - return deep8468(x); - } - - public static boolean deep8468(boolean x) { - return deep8469(x); - } - - public static boolean deep8469(boolean x) { - return deep8470(x); - } - - public static boolean deep8470(boolean x) { - return deep8471(x); - } - - public static boolean deep8471(boolean x) { - return deep8472(x); - } - - public static boolean deep8472(boolean x) { - return deep8473(x); - } - - public static boolean deep8473(boolean x) { - return deep8474(x); - } - - public static boolean deep8474(boolean x) { - return deep8475(x); - } - - public static boolean deep8475(boolean x) { - return deep8476(x); - } - - public static boolean deep8476(boolean x) { - return deep8477(x); - } - - public static boolean deep8477(boolean x) { - return deep8478(x); - } - - public static boolean deep8478(boolean x) { - return deep8479(x); - } - - public static boolean deep8479(boolean x) { - return deep8480(x); - } - - public static boolean deep8480(boolean x) { - return deep8481(x); - } - - public static boolean deep8481(boolean x) { - return deep8482(x); - } - - public static boolean deep8482(boolean x) { - return deep8483(x); - } - - public static boolean deep8483(boolean x) { - return deep8484(x); - } - - public static boolean deep8484(boolean x) { - return deep8485(x); - } - - public static boolean deep8485(boolean x) { - return deep8486(x); - } - - public static boolean deep8486(boolean x) { - return deep8487(x); - } - - public static boolean deep8487(boolean x) { - return deep8488(x); - } - - public static boolean deep8488(boolean x) { - return deep8489(x); - } - - public static boolean deep8489(boolean x) { - return deep8490(x); - } - - public static boolean deep8490(boolean x) { - return deep8491(x); - } - - public static boolean deep8491(boolean x) { - return deep8492(x); - } - - public static boolean deep8492(boolean x) { - return deep8493(x); - } - - public static boolean deep8493(boolean x) { - return deep8494(x); - } - - public static boolean deep8494(boolean x) { - return deep8495(x); - } - - public static boolean deep8495(boolean x) { - return deep8496(x); - } - - public static boolean deep8496(boolean x) { - return deep8497(x); - } - - public static boolean deep8497(boolean x) { - return deep8498(x); - } - - public static boolean deep8498(boolean x) { - return deep8499(x); - } - - public static boolean deep8499(boolean x) { - return deep8500(x); - } - - public static boolean deep8500(boolean x) { - return deep8501(x); - } - - public static boolean deep8501(boolean x) { - return deep8502(x); - } - - public static boolean deep8502(boolean x) { - return deep8503(x); - } - - public static boolean deep8503(boolean x) { - return deep8504(x); - } - - public static boolean deep8504(boolean x) { - return deep8505(x); - } - - public static boolean deep8505(boolean x) { - return deep8506(x); - } - - public static boolean deep8506(boolean x) { - return deep8507(x); - } - - public static boolean deep8507(boolean x) { - return deep8508(x); - } - - public static boolean deep8508(boolean x) { - return deep8509(x); - } - - public static boolean deep8509(boolean x) { - return deep8510(x); - } - - public static boolean deep8510(boolean x) { - return deep8511(x); - } - - public static boolean deep8511(boolean x) { - return deep8512(x); - } - - public static boolean deep8512(boolean x) { - return deep8513(x); - } - - public static boolean deep8513(boolean x) { - return deep8514(x); - } - - public static boolean deep8514(boolean x) { - return deep8515(x); - } - - public static boolean deep8515(boolean x) { - return deep8516(x); - } - - public static boolean deep8516(boolean x) { - return deep8517(x); - } - - public static boolean deep8517(boolean x) { - return deep8518(x); - } - - public static boolean deep8518(boolean x) { - return deep8519(x); - } - - public static boolean deep8519(boolean x) { - return deep8520(x); - } - - public static boolean deep8520(boolean x) { - return deep8521(x); - } - - public static boolean deep8521(boolean x) { - return deep8522(x); - } - - public static boolean deep8522(boolean x) { - return deep8523(x); - } - - public static boolean deep8523(boolean x) { - return deep8524(x); - } - - public static boolean deep8524(boolean x) { - return deep8525(x); - } - - public static boolean deep8525(boolean x) { - return deep8526(x); - } - - public static boolean deep8526(boolean x) { - return deep8527(x); - } - - public static boolean deep8527(boolean x) { - return deep8528(x); - } - - public static boolean deep8528(boolean x) { - return deep8529(x); - } - - public static boolean deep8529(boolean x) { - return deep8530(x); - } - - public static boolean deep8530(boolean x) { - return deep8531(x); - } - - public static boolean deep8531(boolean x) { - return deep8532(x); - } - - public static boolean deep8532(boolean x) { - return deep8533(x); - } - - public static boolean deep8533(boolean x) { - return deep8534(x); - } - - public static boolean deep8534(boolean x) { - return deep8535(x); - } - - public static boolean deep8535(boolean x) { - return deep8536(x); - } - - public static boolean deep8536(boolean x) { - return deep8537(x); - } - - public static boolean deep8537(boolean x) { - return deep8538(x); - } - - public static boolean deep8538(boolean x) { - return deep8539(x); - } - - public static boolean deep8539(boolean x) { - return deep8540(x); - } - - public static boolean deep8540(boolean x) { - return deep8541(x); - } - - public static boolean deep8541(boolean x) { - return deep8542(x); - } - - public static boolean deep8542(boolean x) { - return deep8543(x); - } - - public static boolean deep8543(boolean x) { - return deep8544(x); - } - - public static boolean deep8544(boolean x) { - return deep8545(x); - } - - public static boolean deep8545(boolean x) { - return deep8546(x); - } - - public static boolean deep8546(boolean x) { - return deep8547(x); - } - - public static boolean deep8547(boolean x) { - return deep8548(x); - } - - public static boolean deep8548(boolean x) { - return deep8549(x); - } - - public static boolean deep8549(boolean x) { - return deep8550(x); - } - - public static boolean deep8550(boolean x) { - return deep8551(x); - } - - public static boolean deep8551(boolean x) { - return deep8552(x); - } - - public static boolean deep8552(boolean x) { - return deep8553(x); - } - - public static boolean deep8553(boolean x) { - return deep8554(x); - } - - public static boolean deep8554(boolean x) { - return deep8555(x); - } - - public static boolean deep8555(boolean x) { - return deep8556(x); - } - - public static boolean deep8556(boolean x) { - return deep8557(x); - } - - public static boolean deep8557(boolean x) { - return deep8558(x); - } - - public static boolean deep8558(boolean x) { - return deep8559(x); - } - - public static boolean deep8559(boolean x) { - return deep8560(x); - } - - public static boolean deep8560(boolean x) { - return deep8561(x); - } - - public static boolean deep8561(boolean x) { - return deep8562(x); - } - - public static boolean deep8562(boolean x) { - return deep8563(x); - } - - public static boolean deep8563(boolean x) { - return deep8564(x); - } - - public static boolean deep8564(boolean x) { - return deep8565(x); - } - - public static boolean deep8565(boolean x) { - return deep8566(x); - } - - public static boolean deep8566(boolean x) { - return deep8567(x); - } - - public static boolean deep8567(boolean x) { - return deep8568(x); - } - - public static boolean deep8568(boolean x) { - return deep8569(x); - } - - public static boolean deep8569(boolean x) { - return deep8570(x); - } - - public static boolean deep8570(boolean x) { - return deep8571(x); - } - - public static boolean deep8571(boolean x) { - return deep8572(x); - } - - public static boolean deep8572(boolean x) { - return deep8573(x); - } - - public static boolean deep8573(boolean x) { - return deep8574(x); - } - - public static boolean deep8574(boolean x) { - return deep8575(x); - } - - public static boolean deep8575(boolean x) { - return deep8576(x); - } - - public static boolean deep8576(boolean x) { - return deep8577(x); - } - - public static boolean deep8577(boolean x) { - return deep8578(x); - } - - public static boolean deep8578(boolean x) { - return deep8579(x); - } - - public static boolean deep8579(boolean x) { - return deep8580(x); - } - - public static boolean deep8580(boolean x) { - return deep8581(x); - } - - public static boolean deep8581(boolean x) { - return deep8582(x); - } - - public static boolean deep8582(boolean x) { - return deep8583(x); - } - - public static boolean deep8583(boolean x) { - return deep8584(x); - } - - public static boolean deep8584(boolean x) { - return deep8585(x); - } - - public static boolean deep8585(boolean x) { - return deep8586(x); - } - - public static boolean deep8586(boolean x) { - return deep8587(x); - } - - public static boolean deep8587(boolean x) { - return deep8588(x); - } - - public static boolean deep8588(boolean x) { - return deep8589(x); - } - - public static boolean deep8589(boolean x) { - return deep8590(x); - } - - public static boolean deep8590(boolean x) { - return deep8591(x); - } - - public static boolean deep8591(boolean x) { - return deep8592(x); - } - - public static boolean deep8592(boolean x) { - return deep8593(x); - } - - public static boolean deep8593(boolean x) { - return deep8594(x); - } - - public static boolean deep8594(boolean x) { - return deep8595(x); - } - - public static boolean deep8595(boolean x) { - return deep8596(x); - } - - public static boolean deep8596(boolean x) { - return deep8597(x); - } - - public static boolean deep8597(boolean x) { - return deep8598(x); - } - - public static boolean deep8598(boolean x) { - return deep8599(x); - } - - public static boolean deep8599(boolean x) { - return deep8600(x); - } - - public static boolean deep8600(boolean x) { - return deep8601(x); - } - - public static boolean deep8601(boolean x) { - return deep8602(x); - } - - public static boolean deep8602(boolean x) { - return deep8603(x); - } - - public static boolean deep8603(boolean x) { - return deep8604(x); - } - - public static boolean deep8604(boolean x) { - return deep8605(x); - } - - public static boolean deep8605(boolean x) { - return deep8606(x); - } - - public static boolean deep8606(boolean x) { - return deep8607(x); - } - - public static boolean deep8607(boolean x) { - return deep8608(x); - } - - public static boolean deep8608(boolean x) { - return deep8609(x); - } - - public static boolean deep8609(boolean x) { - return deep8610(x); - } - - public static boolean deep8610(boolean x) { - return deep8611(x); - } - - public static boolean deep8611(boolean x) { - return deep8612(x); - } - - public static boolean deep8612(boolean x) { - return deep8613(x); - } - - public static boolean deep8613(boolean x) { - return deep8614(x); - } - - public static boolean deep8614(boolean x) { - return deep8615(x); - } - - public static boolean deep8615(boolean x) { - return deep8616(x); - } - - public static boolean deep8616(boolean x) { - return deep8617(x); - } - - public static boolean deep8617(boolean x) { - return deep8618(x); - } - - public static boolean deep8618(boolean x) { - return deep8619(x); - } - - public static boolean deep8619(boolean x) { - return deep8620(x); - } - - public static boolean deep8620(boolean x) { - return deep8621(x); - } - - public static boolean deep8621(boolean x) { - return deep8622(x); - } - - public static boolean deep8622(boolean x) { - return deep8623(x); - } - - public static boolean deep8623(boolean x) { - return deep8624(x); - } - - public static boolean deep8624(boolean x) { - return deep8625(x); - } - - public static boolean deep8625(boolean x) { - return deep8626(x); - } - - public static boolean deep8626(boolean x) { - return deep8627(x); - } - - public static boolean deep8627(boolean x) { - return deep8628(x); - } - - public static boolean deep8628(boolean x) { - return deep8629(x); - } - - public static boolean deep8629(boolean x) { - return deep8630(x); - } - - public static boolean deep8630(boolean x) { - return deep8631(x); - } - - public static boolean deep8631(boolean x) { - return deep8632(x); - } - - public static boolean deep8632(boolean x) { - return deep8633(x); - } - - public static boolean deep8633(boolean x) { - return deep8634(x); - } - - public static boolean deep8634(boolean x) { - return deep8635(x); - } - - public static boolean deep8635(boolean x) { - return deep8636(x); - } - - public static boolean deep8636(boolean x) { - return deep8637(x); - } - - public static boolean deep8637(boolean x) { - return deep8638(x); - } - - public static boolean deep8638(boolean x) { - return deep8639(x); - } - - public static boolean deep8639(boolean x) { - return deep8640(x); - } - - public static boolean deep8640(boolean x) { - return deep8641(x); - } - - public static boolean deep8641(boolean x) { - return deep8642(x); - } - - public static boolean deep8642(boolean x) { - return deep8643(x); - } - - public static boolean deep8643(boolean x) { - return deep8644(x); - } - - public static boolean deep8644(boolean x) { - return deep8645(x); - } - - public static boolean deep8645(boolean x) { - return deep8646(x); - } - - public static boolean deep8646(boolean x) { - return deep8647(x); - } - - public static boolean deep8647(boolean x) { - return deep8648(x); - } - - public static boolean deep8648(boolean x) { - return deep8649(x); - } - - public static boolean deep8649(boolean x) { - return deep8650(x); - } - - public static boolean deep8650(boolean x) { - return deep8651(x); - } - - public static boolean deep8651(boolean x) { - return deep8652(x); - } - - public static boolean deep8652(boolean x) { - return deep8653(x); - } - - public static boolean deep8653(boolean x) { - return deep8654(x); - } - - public static boolean deep8654(boolean x) { - return deep8655(x); - } - - public static boolean deep8655(boolean x) { - return deep8656(x); - } - - public static boolean deep8656(boolean x) { - return deep8657(x); - } - - public static boolean deep8657(boolean x) { - return deep8658(x); - } - - public static boolean deep8658(boolean x) { - return deep8659(x); - } - - public static boolean deep8659(boolean x) { - return deep8660(x); - } - - public static boolean deep8660(boolean x) { - return deep8661(x); - } - - public static boolean deep8661(boolean x) { - return deep8662(x); - } - - public static boolean deep8662(boolean x) { - return deep8663(x); - } - - public static boolean deep8663(boolean x) { - return deep8664(x); - } - - public static boolean deep8664(boolean x) { - return deep8665(x); - } - - public static boolean deep8665(boolean x) { - return deep8666(x); - } - - public static boolean deep8666(boolean x) { - return deep8667(x); - } - - public static boolean deep8667(boolean x) { - return deep8668(x); - } - - public static boolean deep8668(boolean x) { - return deep8669(x); - } - - public static boolean deep8669(boolean x) { - return deep8670(x); - } - - public static boolean deep8670(boolean x) { - return deep8671(x); - } - - public static boolean deep8671(boolean x) { - return deep8672(x); - } - - public static boolean deep8672(boolean x) { - return deep8673(x); - } - - public static boolean deep8673(boolean x) { - return deep8674(x); - } - - public static boolean deep8674(boolean x) { - return deep8675(x); - } - - public static boolean deep8675(boolean x) { - return deep8676(x); - } - - public static boolean deep8676(boolean x) { - return deep8677(x); - } - - public static boolean deep8677(boolean x) { - return deep8678(x); - } - - public static boolean deep8678(boolean x) { - return deep8679(x); - } - - public static boolean deep8679(boolean x) { - return deep8680(x); - } - - public static boolean deep8680(boolean x) { - return deep8681(x); - } - - public static boolean deep8681(boolean x) { - return deep8682(x); - } - - public static boolean deep8682(boolean x) { - return deep8683(x); - } - - public static boolean deep8683(boolean x) { - return deep8684(x); - } - - public static boolean deep8684(boolean x) { - return deep8685(x); - } - - public static boolean deep8685(boolean x) { - return deep8686(x); - } - - public static boolean deep8686(boolean x) { - return deep8687(x); - } - - public static boolean deep8687(boolean x) { - return deep8688(x); - } - - public static boolean deep8688(boolean x) { - return deep8689(x); - } - - public static boolean deep8689(boolean x) { - return deep8690(x); - } - - public static boolean deep8690(boolean x) { - return deep8691(x); - } - - public static boolean deep8691(boolean x) { - return deep8692(x); - } - - public static boolean deep8692(boolean x) { - return deep8693(x); - } - - public static boolean deep8693(boolean x) { - return deep8694(x); - } - - public static boolean deep8694(boolean x) { - return deep8695(x); - } - - public static boolean deep8695(boolean x) { - return deep8696(x); - } - - public static boolean deep8696(boolean x) { - return deep8697(x); - } - - public static boolean deep8697(boolean x) { - return deep8698(x); - } - - public static boolean deep8698(boolean x) { - return deep8699(x); - } - - public static boolean deep8699(boolean x) { - return deep8700(x); - } - - public static boolean deep8700(boolean x) { - return deep8701(x); - } - - public static boolean deep8701(boolean x) { - return deep8702(x); - } - - public static boolean deep8702(boolean x) { - return deep8703(x); - } - - public static boolean deep8703(boolean x) { - return deep8704(x); - } - - public static boolean deep8704(boolean x) { - return deep8705(x); - } - - public static boolean deep8705(boolean x) { - return deep8706(x); - } - - public static boolean deep8706(boolean x) { - return deep8707(x); - } - - public static boolean deep8707(boolean x) { - return deep8708(x); - } - - public static boolean deep8708(boolean x) { - return deep8709(x); - } - - public static boolean deep8709(boolean x) { - return deep8710(x); - } - - public static boolean deep8710(boolean x) { - return deep8711(x); - } - - public static boolean deep8711(boolean x) { - return deep8712(x); - } - - public static boolean deep8712(boolean x) { - return deep8713(x); - } - - public static boolean deep8713(boolean x) { - return deep8714(x); - } - - public static boolean deep8714(boolean x) { - return deep8715(x); - } - - public static boolean deep8715(boolean x) { - return deep8716(x); - } - - public static boolean deep8716(boolean x) { - return deep8717(x); - } - - public static boolean deep8717(boolean x) { - return deep8718(x); - } - - public static boolean deep8718(boolean x) { - return deep8719(x); - } - - public static boolean deep8719(boolean x) { - return deep8720(x); - } - - public static boolean deep8720(boolean x) { - return deep8721(x); - } - - public static boolean deep8721(boolean x) { - return deep8722(x); - } - - public static boolean deep8722(boolean x) { - return deep8723(x); - } - - public static boolean deep8723(boolean x) { - return deep8724(x); - } - - public static boolean deep8724(boolean x) { - return deep8725(x); - } - - public static boolean deep8725(boolean x) { - return deep8726(x); - } - - public static boolean deep8726(boolean x) { - return deep8727(x); - } - - public static boolean deep8727(boolean x) { - return deep8728(x); - } - - public static boolean deep8728(boolean x) { - return deep8729(x); - } - - public static boolean deep8729(boolean x) { - return deep8730(x); - } - - public static boolean deep8730(boolean x) { - return deep8731(x); - } - - public static boolean deep8731(boolean x) { - return deep8732(x); - } - - public static boolean deep8732(boolean x) { - return deep8733(x); - } - - public static boolean deep8733(boolean x) { - return deep8734(x); - } - - public static boolean deep8734(boolean x) { - return deep8735(x); - } - - public static boolean deep8735(boolean x) { - return deep8736(x); - } - - public static boolean deep8736(boolean x) { - return deep8737(x); - } - - public static boolean deep8737(boolean x) { - return deep8738(x); - } - - public static boolean deep8738(boolean x) { - return deep8739(x); - } - - public static boolean deep8739(boolean x) { - return deep8740(x); - } - - public static boolean deep8740(boolean x) { - return deep8741(x); - } - - public static boolean deep8741(boolean x) { - return deep8742(x); - } - - public static boolean deep8742(boolean x) { - return deep8743(x); - } - - public static boolean deep8743(boolean x) { - return deep8744(x); - } - - public static boolean deep8744(boolean x) { - return deep8745(x); - } - - public static boolean deep8745(boolean x) { - return deep8746(x); - } - - public static boolean deep8746(boolean x) { - return deep8747(x); - } - - public static boolean deep8747(boolean x) { - return deep8748(x); - } - - public static boolean deep8748(boolean x) { - return deep8749(x); - } - - public static boolean deep8749(boolean x) { - return deep8750(x); - } - - public static boolean deep8750(boolean x) { - return deep8751(x); - } - - public static boolean deep8751(boolean x) { - return deep8752(x); - } - - public static boolean deep8752(boolean x) { - return deep8753(x); - } - - public static boolean deep8753(boolean x) { - return deep8754(x); - } - - public static boolean deep8754(boolean x) { - return deep8755(x); - } - - public static boolean deep8755(boolean x) { - return deep8756(x); - } - - public static boolean deep8756(boolean x) { - return deep8757(x); - } - - public static boolean deep8757(boolean x) { - return deep8758(x); - } - - public static boolean deep8758(boolean x) { - return deep8759(x); - } - - public static boolean deep8759(boolean x) { - return deep8760(x); - } - - public static boolean deep8760(boolean x) { - return deep8761(x); - } - - public static boolean deep8761(boolean x) { - return deep8762(x); - } - - public static boolean deep8762(boolean x) { - return deep8763(x); - } - - public static boolean deep8763(boolean x) { - return deep8764(x); - } - - public static boolean deep8764(boolean x) { - return deep8765(x); - } - - public static boolean deep8765(boolean x) { - return deep8766(x); - } - - public static boolean deep8766(boolean x) { - return deep8767(x); - } - - public static boolean deep8767(boolean x) { - return deep8768(x); - } - - public static boolean deep8768(boolean x) { - return deep8769(x); - } - - public static boolean deep8769(boolean x) { - return deep8770(x); - } - - public static boolean deep8770(boolean x) { - return deep8771(x); - } - - public static boolean deep8771(boolean x) { - return deep8772(x); - } - - public static boolean deep8772(boolean x) { - return deep8773(x); - } - - public static boolean deep8773(boolean x) { - return deep8774(x); - } - - public static boolean deep8774(boolean x) { - return deep8775(x); - } - - public static boolean deep8775(boolean x) { - return deep8776(x); - } - - public static boolean deep8776(boolean x) { - return deep8777(x); - } - - public static boolean deep8777(boolean x) { - return deep8778(x); - } - - public static boolean deep8778(boolean x) { - return deep8779(x); - } - - public static boolean deep8779(boolean x) { - return deep8780(x); - } - - public static boolean deep8780(boolean x) { - return deep8781(x); - } - - public static boolean deep8781(boolean x) { - return deep8782(x); - } - - public static boolean deep8782(boolean x) { - return deep8783(x); - } - - public static boolean deep8783(boolean x) { - return deep8784(x); - } - - public static boolean deep8784(boolean x) { - return deep8785(x); - } - - public static boolean deep8785(boolean x) { - return deep8786(x); - } - - public static boolean deep8786(boolean x) { - return deep8787(x); - } - - public static boolean deep8787(boolean x) { - return deep8788(x); - } - - public static boolean deep8788(boolean x) { - return deep8789(x); - } - - public static boolean deep8789(boolean x) { - return deep8790(x); - } - - public static boolean deep8790(boolean x) { - return deep8791(x); - } - - public static boolean deep8791(boolean x) { - return deep8792(x); - } - - public static boolean deep8792(boolean x) { - return deep8793(x); - } - - public static boolean deep8793(boolean x) { - return deep8794(x); - } - - public static boolean deep8794(boolean x) { - return deep8795(x); - } - - public static boolean deep8795(boolean x) { - return deep8796(x); - } - - public static boolean deep8796(boolean x) { - return deep8797(x); - } - - public static boolean deep8797(boolean x) { - return deep8798(x); - } - - public static boolean deep8798(boolean x) { - return deep8799(x); - } - - public static boolean deep8799(boolean x) { - return deep8800(x); - } - - public static boolean deep8800(boolean x) { - return deep8801(x); - } - - public static boolean deep8801(boolean x) { - return deep8802(x); - } - - public static boolean deep8802(boolean x) { - return deep8803(x); - } - - public static boolean deep8803(boolean x) { - return deep8804(x); - } - - public static boolean deep8804(boolean x) { - return deep8805(x); - } - - public static boolean deep8805(boolean x) { - return deep8806(x); - } - - public static boolean deep8806(boolean x) { - return deep8807(x); - } - - public static boolean deep8807(boolean x) { - return deep8808(x); - } - - public static boolean deep8808(boolean x) { - return deep8809(x); - } - - public static boolean deep8809(boolean x) { - return deep8810(x); - } - - public static boolean deep8810(boolean x) { - return deep8811(x); - } - - public static boolean deep8811(boolean x) { - return deep8812(x); - } - - public static boolean deep8812(boolean x) { - return deep8813(x); - } - - public static boolean deep8813(boolean x) { - return deep8814(x); - } - - public static boolean deep8814(boolean x) { - return deep8815(x); - } - - public static boolean deep8815(boolean x) { - return deep8816(x); - } - - public static boolean deep8816(boolean x) { - return deep8817(x); - } - - public static boolean deep8817(boolean x) { - return deep8818(x); - } - - public static boolean deep8818(boolean x) { - return deep8819(x); - } - - public static boolean deep8819(boolean x) { - return deep8820(x); - } - - public static boolean deep8820(boolean x) { - return deep8821(x); - } - - public static boolean deep8821(boolean x) { - return deep8822(x); - } - - public static boolean deep8822(boolean x) { - return deep8823(x); - } - - public static boolean deep8823(boolean x) { - return deep8824(x); - } - - public static boolean deep8824(boolean x) { - return deep8825(x); - } - - public static boolean deep8825(boolean x) { - return deep8826(x); - } - - public static boolean deep8826(boolean x) { - return deep8827(x); - } - - public static boolean deep8827(boolean x) { - return deep8828(x); - } - - public static boolean deep8828(boolean x) { - return deep8829(x); - } - - public static boolean deep8829(boolean x) { - return deep8830(x); - } - - public static boolean deep8830(boolean x) { - return deep8831(x); - } - - public static boolean deep8831(boolean x) { - return deep8832(x); - } - - public static boolean deep8832(boolean x) { - return deep8833(x); - } - - public static boolean deep8833(boolean x) { - return deep8834(x); - } - - public static boolean deep8834(boolean x) { - return deep8835(x); - } - - public static boolean deep8835(boolean x) { - return deep8836(x); - } - - public static boolean deep8836(boolean x) { - return deep8837(x); - } - - public static boolean deep8837(boolean x) { - return deep8838(x); - } - - public static boolean deep8838(boolean x) { - return deep8839(x); - } - - public static boolean deep8839(boolean x) { - return deep8840(x); - } - - public static boolean deep8840(boolean x) { - return deep8841(x); - } - - public static boolean deep8841(boolean x) { - return deep8842(x); - } - - public static boolean deep8842(boolean x) { - return deep8843(x); - } - - public static boolean deep8843(boolean x) { - return deep8844(x); - } - - public static boolean deep8844(boolean x) { - return deep8845(x); - } - - public static boolean deep8845(boolean x) { - return deep8846(x); - } - - public static boolean deep8846(boolean x) { - return deep8847(x); - } - - public static boolean deep8847(boolean x) { - return deep8848(x); - } - - public static boolean deep8848(boolean x) { - return deep8849(x); - } - - public static boolean deep8849(boolean x) { - return deep8850(x); - } - - public static boolean deep8850(boolean x) { - return deep8851(x); - } - - public static boolean deep8851(boolean x) { - return deep8852(x); - } - - public static boolean deep8852(boolean x) { - return deep8853(x); - } - - public static boolean deep8853(boolean x) { - return deep8854(x); - } - - public static boolean deep8854(boolean x) { - return deep8855(x); - } - - public static boolean deep8855(boolean x) { - return deep8856(x); - } - - public static boolean deep8856(boolean x) { - return deep8857(x); - } - - public static boolean deep8857(boolean x) { - return deep8858(x); - } - - public static boolean deep8858(boolean x) { - return deep8859(x); - } - - public static boolean deep8859(boolean x) { - return deep8860(x); - } - - public static boolean deep8860(boolean x) { - return deep8861(x); - } - - public static boolean deep8861(boolean x) { - return deep8862(x); - } - - public static boolean deep8862(boolean x) { - return deep8863(x); - } - - public static boolean deep8863(boolean x) { - return deep8864(x); - } - - public static boolean deep8864(boolean x) { - return deep8865(x); - } - - public static boolean deep8865(boolean x) { - return deep8866(x); - } - - public static boolean deep8866(boolean x) { - return deep8867(x); - } - - public static boolean deep8867(boolean x) { - return deep8868(x); - } - - public static boolean deep8868(boolean x) { - return deep8869(x); - } - - public static boolean deep8869(boolean x) { - return deep8870(x); - } - - public static boolean deep8870(boolean x) { - return deep8871(x); - } - - public static boolean deep8871(boolean x) { - return deep8872(x); - } - - public static boolean deep8872(boolean x) { - return deep8873(x); - } - - public static boolean deep8873(boolean x) { - return deep8874(x); - } - - public static boolean deep8874(boolean x) { - return deep8875(x); - } - - public static boolean deep8875(boolean x) { - return deep8876(x); - } - - public static boolean deep8876(boolean x) { - return deep8877(x); - } - - public static boolean deep8877(boolean x) { - return deep8878(x); - } - - public static boolean deep8878(boolean x) { - return deep8879(x); - } - - public static boolean deep8879(boolean x) { - return deep8880(x); - } - - public static boolean deep8880(boolean x) { - return deep8881(x); - } - - public static boolean deep8881(boolean x) { - return deep8882(x); - } - - public static boolean deep8882(boolean x) { - return deep8883(x); - } - - public static boolean deep8883(boolean x) { - return deep8884(x); - } - - public static boolean deep8884(boolean x) { - return deep8885(x); - } - - public static boolean deep8885(boolean x) { - return deep8886(x); - } - - public static boolean deep8886(boolean x) { - return deep8887(x); - } - - public static boolean deep8887(boolean x) { - return deep8888(x); - } - - public static boolean deep8888(boolean x) { - return deep8889(x); - } - - public static boolean deep8889(boolean x) { - return deep8890(x); - } - - public static boolean deep8890(boolean x) { - return deep8891(x); - } - - public static boolean deep8891(boolean x) { - return deep8892(x); - } - - public static boolean deep8892(boolean x) { - return deep8893(x); - } - - public static boolean deep8893(boolean x) { - return deep8894(x); - } - - public static boolean deep8894(boolean x) { - return deep8895(x); - } - - public static boolean deep8895(boolean x) { - return deep8896(x); - } - - public static boolean deep8896(boolean x) { - return deep8897(x); - } - - public static boolean deep8897(boolean x) { - return deep8898(x); - } - - public static boolean deep8898(boolean x) { - return deep8899(x); - } - - public static boolean deep8899(boolean x) { - return deep8900(x); - } - - public static boolean deep8900(boolean x) { - return deep8901(x); - } - - public static boolean deep8901(boolean x) { - return deep8902(x); - } - - public static boolean deep8902(boolean x) { - return deep8903(x); - } - - public static boolean deep8903(boolean x) { - return deep8904(x); - } - - public static boolean deep8904(boolean x) { - return deep8905(x); - } - - public static boolean deep8905(boolean x) { - return deep8906(x); - } - - public static boolean deep8906(boolean x) { - return deep8907(x); - } - - public static boolean deep8907(boolean x) { - return deep8908(x); - } - - public static boolean deep8908(boolean x) { - return deep8909(x); - } - - public static boolean deep8909(boolean x) { - return deep8910(x); - } - - public static boolean deep8910(boolean x) { - return deep8911(x); - } - - public static boolean deep8911(boolean x) { - return deep8912(x); - } - - public static boolean deep8912(boolean x) { - return deep8913(x); - } - - public static boolean deep8913(boolean x) { - return deep8914(x); - } - - public static boolean deep8914(boolean x) { - return deep8915(x); - } - - public static boolean deep8915(boolean x) { - return deep8916(x); - } - - public static boolean deep8916(boolean x) { - return deep8917(x); - } - - public static boolean deep8917(boolean x) { - return deep8918(x); - } - - public static boolean deep8918(boolean x) { - return deep8919(x); - } - - public static boolean deep8919(boolean x) { - return deep8920(x); - } - - public static boolean deep8920(boolean x) { - return deep8921(x); - } - - public static boolean deep8921(boolean x) { - return deep8922(x); - } - - public static boolean deep8922(boolean x) { - return deep8923(x); - } - - public static boolean deep8923(boolean x) { - return deep8924(x); - } - - public static boolean deep8924(boolean x) { - return deep8925(x); - } - - public static boolean deep8925(boolean x) { - return deep8926(x); - } - - public static boolean deep8926(boolean x) { - return deep8927(x); - } - - public static boolean deep8927(boolean x) { - return deep8928(x); - } - - public static boolean deep8928(boolean x) { - return deep8929(x); - } - - public static boolean deep8929(boolean x) { - return deep8930(x); - } - - public static boolean deep8930(boolean x) { - return deep8931(x); - } - - public static boolean deep8931(boolean x) { - return deep8932(x); - } - - public static boolean deep8932(boolean x) { - return deep8933(x); - } - - public static boolean deep8933(boolean x) { - return deep8934(x); - } - - public static boolean deep8934(boolean x) { - return deep8935(x); - } - - public static boolean deep8935(boolean x) { - return deep8936(x); - } - - public static boolean deep8936(boolean x) { - return deep8937(x); - } - - public static boolean deep8937(boolean x) { - return deep8938(x); - } - - public static boolean deep8938(boolean x) { - return deep8939(x); - } - - public static boolean deep8939(boolean x) { - return deep8940(x); - } - - public static boolean deep8940(boolean x) { - return deep8941(x); - } - - public static boolean deep8941(boolean x) { - return deep8942(x); - } - - public static boolean deep8942(boolean x) { - return deep8943(x); - } - - public static boolean deep8943(boolean x) { - return deep8944(x); - } - - public static boolean deep8944(boolean x) { - return deep8945(x); - } - - public static boolean deep8945(boolean x) { - return deep8946(x); - } - - public static boolean deep8946(boolean x) { - return deep8947(x); - } - - public static boolean deep8947(boolean x) { - return deep8948(x); - } - - public static boolean deep8948(boolean x) { - return deep8949(x); - } - - public static boolean deep8949(boolean x) { - return deep8950(x); - } - - public static boolean deep8950(boolean x) { - return deep8951(x); - } - - public static boolean deep8951(boolean x) { - return deep8952(x); - } - - public static boolean deep8952(boolean x) { - return deep8953(x); - } - - public static boolean deep8953(boolean x) { - return deep8954(x); - } - - public static boolean deep8954(boolean x) { - return deep8955(x); - } - - public static boolean deep8955(boolean x) { - return deep8956(x); - } - - public static boolean deep8956(boolean x) { - return deep8957(x); - } - - public static boolean deep8957(boolean x) { - return deep8958(x); - } - - public static boolean deep8958(boolean x) { - return deep8959(x); - } - - public static boolean deep8959(boolean x) { - return deep8960(x); - } - - public static boolean deep8960(boolean x) { - return deep8961(x); - } - - public static boolean deep8961(boolean x) { - return deep8962(x); - } - - public static boolean deep8962(boolean x) { - return deep8963(x); - } - - public static boolean deep8963(boolean x) { - return deep8964(x); - } - - public static boolean deep8964(boolean x) { - return deep8965(x); - } - - public static boolean deep8965(boolean x) { - return deep8966(x); - } - - public static boolean deep8966(boolean x) { - return deep8967(x); - } - - public static boolean deep8967(boolean x) { - return deep8968(x); - } - - public static boolean deep8968(boolean x) { - return deep8969(x); - } - - public static boolean deep8969(boolean x) { - return deep8970(x); - } - - public static boolean deep8970(boolean x) { - return deep8971(x); - } - - public static boolean deep8971(boolean x) { - return deep8972(x); - } - - public static boolean deep8972(boolean x) { - return deep8973(x); - } - - public static boolean deep8973(boolean x) { - return deep8974(x); - } - - public static boolean deep8974(boolean x) { - return deep8975(x); - } - - public static boolean deep8975(boolean x) { - return deep8976(x); - } - - public static boolean deep8976(boolean x) { - return deep8977(x); - } - - public static boolean deep8977(boolean x) { - return deep8978(x); - } - - public static boolean deep8978(boolean x) { - return deep8979(x); - } - - public static boolean deep8979(boolean x) { - return deep8980(x); - } - - public static boolean deep8980(boolean x) { - return deep8981(x); - } - - public static boolean deep8981(boolean x) { - return deep8982(x); - } - - public static boolean deep8982(boolean x) { - return deep8983(x); - } - - public static boolean deep8983(boolean x) { - return deep8984(x); - } - - public static boolean deep8984(boolean x) { - return deep8985(x); - } - - public static boolean deep8985(boolean x) { - return deep8986(x); - } - - public static boolean deep8986(boolean x) { - return deep8987(x); - } - - public static boolean deep8987(boolean x) { - return deep8988(x); - } - - public static boolean deep8988(boolean x) { - return deep8989(x); - } - - public static boolean deep8989(boolean x) { - return deep8990(x); - } - - public static boolean deep8990(boolean x) { - return deep8991(x); - } - - public static boolean deep8991(boolean x) { - return deep8992(x); - } - - public static boolean deep8992(boolean x) { - return deep8993(x); - } - - public static boolean deep8993(boolean x) { - return deep8994(x); - } - - public static boolean deep8994(boolean x) { - return deep8995(x); - } - - public static boolean deep8995(boolean x) { - return deep8996(x); - } - - public static boolean deep8996(boolean x) { - return deep8997(x); - } - - public static boolean deep8997(boolean x) { - return deep8998(x); - } - - public static boolean deep8998(boolean x) { - return deep8999(x); - } - - public static boolean deep8999(boolean x) { - return deep9000(x); - } - - public static boolean deep9000(boolean x) { - return deep9001(x); - } - - public static boolean deep9001(boolean x) { - return deep9002(x); - } - - public static boolean deep9002(boolean x) { - return deep9003(x); - } - - public static boolean deep9003(boolean x) { - return deep9004(x); - } - - public static boolean deep9004(boolean x) { - return deep9005(x); - } - - public static boolean deep9005(boolean x) { - return deep9006(x); - } - - public static boolean deep9006(boolean x) { - return deep9007(x); - } - - public static boolean deep9007(boolean x) { - return deep9008(x); - } - - public static boolean deep9008(boolean x) { - return deep9009(x); - } - - public static boolean deep9009(boolean x) { - return deep9010(x); - } - - public static boolean deep9010(boolean x) { - return deep9011(x); - } - - public static boolean deep9011(boolean x) { - return deep9012(x); - } - - public static boolean deep9012(boolean x) { - return deep9013(x); - } - - public static boolean deep9013(boolean x) { - return deep9014(x); - } - - public static boolean deep9014(boolean x) { - return deep9015(x); - } - - public static boolean deep9015(boolean x) { - return deep9016(x); - } - - public static boolean deep9016(boolean x) { - return deep9017(x); - } - - public static boolean deep9017(boolean x) { - return deep9018(x); - } - - public static boolean deep9018(boolean x) { - return deep9019(x); - } - - public static boolean deep9019(boolean x) { - return deep9020(x); - } - - public static boolean deep9020(boolean x) { - return deep9021(x); - } - - public static boolean deep9021(boolean x) { - return deep9022(x); - } - - public static boolean deep9022(boolean x) { - return deep9023(x); - } - - public static boolean deep9023(boolean x) { - return deep9024(x); - } - - public static boolean deep9024(boolean x) { - return deep9025(x); - } - - public static boolean deep9025(boolean x) { - return deep9026(x); - } - - public static boolean deep9026(boolean x) { - return deep9027(x); - } - - public static boolean deep9027(boolean x) { - return deep9028(x); - } - - public static boolean deep9028(boolean x) { - return deep9029(x); - } - - public static boolean deep9029(boolean x) { - return deep9030(x); - } - - public static boolean deep9030(boolean x) { - return deep9031(x); - } - - public static boolean deep9031(boolean x) { - return deep9032(x); - } - - public static boolean deep9032(boolean x) { - return deep9033(x); - } - - public static boolean deep9033(boolean x) { - return deep9034(x); - } - - public static boolean deep9034(boolean x) { - return deep9035(x); - } - - public static boolean deep9035(boolean x) { - return deep9036(x); - } - - public static boolean deep9036(boolean x) { - return deep9037(x); - } - - public static boolean deep9037(boolean x) { - return deep9038(x); - } - - public static boolean deep9038(boolean x) { - return deep9039(x); - } - - public static boolean deep9039(boolean x) { - return deep9040(x); - } - - public static boolean deep9040(boolean x) { - return deep9041(x); - } - - public static boolean deep9041(boolean x) { - return deep9042(x); - } - - public static boolean deep9042(boolean x) { - return deep9043(x); - } - - public static boolean deep9043(boolean x) { - return deep9044(x); - } - - public static boolean deep9044(boolean x) { - return deep9045(x); - } - - public static boolean deep9045(boolean x) { - return deep9046(x); - } - - public static boolean deep9046(boolean x) { - return deep9047(x); - } - - public static boolean deep9047(boolean x) { - return deep9048(x); - } - - public static boolean deep9048(boolean x) { - return deep9049(x); - } - - public static boolean deep9049(boolean x) { - return deep9050(x); - } - - public static boolean deep9050(boolean x) { - return deep9051(x); - } - - public static boolean deep9051(boolean x) { - return deep9052(x); - } - - public static boolean deep9052(boolean x) { - return deep9053(x); - } - - public static boolean deep9053(boolean x) { - return deep9054(x); - } - - public static boolean deep9054(boolean x) { - return deep9055(x); - } - - public static boolean deep9055(boolean x) { - return deep9056(x); - } - - public static boolean deep9056(boolean x) { - return deep9057(x); - } - - public static boolean deep9057(boolean x) { - return deep9058(x); - } - - public static boolean deep9058(boolean x) { - return deep9059(x); - } - - public static boolean deep9059(boolean x) { - return deep9060(x); - } - - public static boolean deep9060(boolean x) { - return deep9061(x); - } - - public static boolean deep9061(boolean x) { - return deep9062(x); - } - - public static boolean deep9062(boolean x) { - return deep9063(x); - } - - public static boolean deep9063(boolean x) { - return deep9064(x); - } - - public static boolean deep9064(boolean x) { - return deep9065(x); - } - - public static boolean deep9065(boolean x) { - return deep9066(x); - } - - public static boolean deep9066(boolean x) { - return deep9067(x); - } - - public static boolean deep9067(boolean x) { - return deep9068(x); - } - - public static boolean deep9068(boolean x) { - return deep9069(x); - } - - public static boolean deep9069(boolean x) { - return deep9070(x); - } - - public static boolean deep9070(boolean x) { - return deep9071(x); - } - - public static boolean deep9071(boolean x) { - return deep9072(x); - } - - public static boolean deep9072(boolean x) { - return deep9073(x); - } - - public static boolean deep9073(boolean x) { - return deep9074(x); - } - - public static boolean deep9074(boolean x) { - return deep9075(x); - } - - public static boolean deep9075(boolean x) { - return deep9076(x); - } - - public static boolean deep9076(boolean x) { - return deep9077(x); - } - - public static boolean deep9077(boolean x) { - return deep9078(x); - } - - public static boolean deep9078(boolean x) { - return deep9079(x); - } - - public static boolean deep9079(boolean x) { - return deep9080(x); - } - - public static boolean deep9080(boolean x) { - return deep9081(x); - } - - public static boolean deep9081(boolean x) { - return deep9082(x); - } - - public static boolean deep9082(boolean x) { - return deep9083(x); - } - - public static boolean deep9083(boolean x) { - return deep9084(x); - } - - public static boolean deep9084(boolean x) { - return deep9085(x); - } - - public static boolean deep9085(boolean x) { - return deep9086(x); - } - - public static boolean deep9086(boolean x) { - return deep9087(x); - } - - public static boolean deep9087(boolean x) { - return deep9088(x); - } - - public static boolean deep9088(boolean x) { - return deep9089(x); - } - - public static boolean deep9089(boolean x) { - return deep9090(x); - } - - public static boolean deep9090(boolean x) { - return deep9091(x); - } - - public static boolean deep9091(boolean x) { - return deep9092(x); - } - - public static boolean deep9092(boolean x) { - return deep9093(x); - } - - public static boolean deep9093(boolean x) { - return deep9094(x); - } - - public static boolean deep9094(boolean x) { - return deep9095(x); - } - - public static boolean deep9095(boolean x) { - return deep9096(x); - } - - public static boolean deep9096(boolean x) { - return deep9097(x); - } - - public static boolean deep9097(boolean x) { - return deep9098(x); - } - - public static boolean deep9098(boolean x) { - return deep9099(x); - } - - public static boolean deep9099(boolean x) { - return deep9100(x); - } - - public static boolean deep9100(boolean x) { - return deep9101(x); - } - - public static boolean deep9101(boolean x) { - return deep9102(x); - } - - public static boolean deep9102(boolean x) { - return deep9103(x); - } - - public static boolean deep9103(boolean x) { - return deep9104(x); - } - - public static boolean deep9104(boolean x) { - return deep9105(x); - } - - public static boolean deep9105(boolean x) { - return deep9106(x); - } - - public static boolean deep9106(boolean x) { - return deep9107(x); - } - - public static boolean deep9107(boolean x) { - return deep9108(x); - } - - public static boolean deep9108(boolean x) { - return deep9109(x); - } - - public static boolean deep9109(boolean x) { - return deep9110(x); - } - - public static boolean deep9110(boolean x) { - return deep9111(x); - } - - public static boolean deep9111(boolean x) { - return deep9112(x); - } - - public static boolean deep9112(boolean x) { - return deep9113(x); - } - - public static boolean deep9113(boolean x) { - return deep9114(x); - } - - public static boolean deep9114(boolean x) { - return deep9115(x); - } - - public static boolean deep9115(boolean x) { - return deep9116(x); - } - - public static boolean deep9116(boolean x) { - return deep9117(x); - } - - public static boolean deep9117(boolean x) { - return deep9118(x); - } - - public static boolean deep9118(boolean x) { - return deep9119(x); - } - - public static boolean deep9119(boolean x) { - return deep9120(x); - } - - public static boolean deep9120(boolean x) { - return deep9121(x); - } - - public static boolean deep9121(boolean x) { - return deep9122(x); - } - - public static boolean deep9122(boolean x) { - return deep9123(x); - } - - public static boolean deep9123(boolean x) { - return deep9124(x); - } - - public static boolean deep9124(boolean x) { - return deep9125(x); - } - - public static boolean deep9125(boolean x) { - return deep9126(x); - } - - public static boolean deep9126(boolean x) { - return deep9127(x); - } - - public static boolean deep9127(boolean x) { - return deep9128(x); - } - - public static boolean deep9128(boolean x) { - return deep9129(x); - } - - public static boolean deep9129(boolean x) { - return deep9130(x); - } - - public static boolean deep9130(boolean x) { - return deep9131(x); - } - - public static boolean deep9131(boolean x) { - return deep9132(x); - } - - public static boolean deep9132(boolean x) { - return deep9133(x); - } - - public static boolean deep9133(boolean x) { - return deep9134(x); - } - - public static boolean deep9134(boolean x) { - return deep9135(x); - } - - public static boolean deep9135(boolean x) { - return deep9136(x); - } - - public static boolean deep9136(boolean x) { - return deep9137(x); - } - - public static boolean deep9137(boolean x) { - return deep9138(x); - } - - public static boolean deep9138(boolean x) { - return deep9139(x); - } - - public static boolean deep9139(boolean x) { - return deep9140(x); - } - - public static boolean deep9140(boolean x) { - return deep9141(x); - } - - public static boolean deep9141(boolean x) { - return deep9142(x); - } - - public static boolean deep9142(boolean x) { - return deep9143(x); - } - - public static boolean deep9143(boolean x) { - return deep9144(x); - } - - public static boolean deep9144(boolean x) { - return deep9145(x); - } - - public static boolean deep9145(boolean x) { - return deep9146(x); - } - - public static boolean deep9146(boolean x) { - return deep9147(x); - } - - public static boolean deep9147(boolean x) { - return deep9148(x); - } - - public static boolean deep9148(boolean x) { - return deep9149(x); - } - - public static boolean deep9149(boolean x) { - return deep9150(x); - } - - public static boolean deep9150(boolean x) { - return deep9151(x); - } - - public static boolean deep9151(boolean x) { - return deep9152(x); - } - - public static boolean deep9152(boolean x) { - return deep9153(x); - } - - public static boolean deep9153(boolean x) { - return deep9154(x); - } - - public static boolean deep9154(boolean x) { - return deep9155(x); - } - - public static boolean deep9155(boolean x) { - return deep9156(x); - } - - public static boolean deep9156(boolean x) { - return deep9157(x); - } - - public static boolean deep9157(boolean x) { - return deep9158(x); - } - - public static boolean deep9158(boolean x) { - return deep9159(x); - } - - public static boolean deep9159(boolean x) { - return deep9160(x); - } - - public static boolean deep9160(boolean x) { - return deep9161(x); - } - - public static boolean deep9161(boolean x) { - return deep9162(x); - } - - public static boolean deep9162(boolean x) { - return deep9163(x); - } - - public static boolean deep9163(boolean x) { - return deep9164(x); - } - - public static boolean deep9164(boolean x) { - return deep9165(x); - } - - public static boolean deep9165(boolean x) { - return deep9166(x); - } - - public static boolean deep9166(boolean x) { - return deep9167(x); - } - - public static boolean deep9167(boolean x) { - return deep9168(x); - } - - public static boolean deep9168(boolean x) { - return deep9169(x); - } - - public static boolean deep9169(boolean x) { - return deep9170(x); - } - - public static boolean deep9170(boolean x) { - return deep9171(x); - } - - public static boolean deep9171(boolean x) { - return deep9172(x); - } - - public static boolean deep9172(boolean x) { - return deep9173(x); - } - - public static boolean deep9173(boolean x) { - return deep9174(x); - } - - public static boolean deep9174(boolean x) { - return deep9175(x); - } - - public static boolean deep9175(boolean x) { - return deep9176(x); - } - - public static boolean deep9176(boolean x) { - return deep9177(x); - } - - public static boolean deep9177(boolean x) { - return deep9178(x); - } - - public static boolean deep9178(boolean x) { - return deep9179(x); - } - - public static boolean deep9179(boolean x) { - return deep9180(x); - } - - public static boolean deep9180(boolean x) { - return deep9181(x); - } - - public static boolean deep9181(boolean x) { - return deep9182(x); - } - - public static boolean deep9182(boolean x) { - return deep9183(x); - } - - public static boolean deep9183(boolean x) { - return deep9184(x); - } - - public static boolean deep9184(boolean x) { - return deep9185(x); - } - - public static boolean deep9185(boolean x) { - return deep9186(x); - } - - public static boolean deep9186(boolean x) { - return deep9187(x); - } - - public static boolean deep9187(boolean x) { - return deep9188(x); - } - - public static boolean deep9188(boolean x) { - return deep9189(x); - } - - public static boolean deep9189(boolean x) { - return deep9190(x); - } - - public static boolean deep9190(boolean x) { - return deep9191(x); - } - - public static boolean deep9191(boolean x) { - return deep9192(x); - } - - public static boolean deep9192(boolean x) { - return deep9193(x); - } - - public static boolean deep9193(boolean x) { - return deep9194(x); - } - - public static boolean deep9194(boolean x) { - return deep9195(x); - } - - public static boolean deep9195(boolean x) { - return deep9196(x); - } - - public static boolean deep9196(boolean x) { - return deep9197(x); - } - - public static boolean deep9197(boolean x) { - return deep9198(x); - } - - public static boolean deep9198(boolean x) { - return deep9199(x); - } - - public static boolean deep9199(boolean x) { - return deep9200(x); - } - - public static boolean deep9200(boolean x) { - return deep9201(x); - } - - public static boolean deep9201(boolean x) { - return deep9202(x); - } - - public static boolean deep9202(boolean x) { - return deep9203(x); - } - - public static boolean deep9203(boolean x) { - return deep9204(x); - } - - public static boolean deep9204(boolean x) { - return deep9205(x); - } - - public static boolean deep9205(boolean x) { - return deep9206(x); - } - - public static boolean deep9206(boolean x) { - return deep9207(x); - } - - public static boolean deep9207(boolean x) { - return deep9208(x); - } - - public static boolean deep9208(boolean x) { - return deep9209(x); - } - - public static boolean deep9209(boolean x) { - return deep9210(x); - } - - public static boolean deep9210(boolean x) { - return deep9211(x); - } - - public static boolean deep9211(boolean x) { - return deep9212(x); - } - - public static boolean deep9212(boolean x) { - return deep9213(x); - } - - public static boolean deep9213(boolean x) { - return deep9214(x); - } - - public static boolean deep9214(boolean x) { - return deep9215(x); - } - - public static boolean deep9215(boolean x) { - return deep9216(x); - } - - public static boolean deep9216(boolean x) { - return deep9217(x); - } - - public static boolean deep9217(boolean x) { - return deep9218(x); - } - - public static boolean deep9218(boolean x) { - return deep9219(x); - } - - public static boolean deep9219(boolean x) { - return deep9220(x); - } - - public static boolean deep9220(boolean x) { - return deep9221(x); - } - - public static boolean deep9221(boolean x) { - return deep9222(x); - } - - public static boolean deep9222(boolean x) { - return deep9223(x); - } - - public static boolean deep9223(boolean x) { - return deep9224(x); - } - - public static boolean deep9224(boolean x) { - return deep9225(x); - } - - public static boolean deep9225(boolean x) { - return deep9226(x); - } - - public static boolean deep9226(boolean x) { - return deep9227(x); - } - - public static boolean deep9227(boolean x) { - return deep9228(x); - } - - public static boolean deep9228(boolean x) { - return deep9229(x); - } - - public static boolean deep9229(boolean x) { - return deep9230(x); - } - - public static boolean deep9230(boolean x) { - return deep9231(x); - } - - public static boolean deep9231(boolean x) { - return deep9232(x); - } - - public static boolean deep9232(boolean x) { - return deep9233(x); - } - - public static boolean deep9233(boolean x) { - return deep9234(x); - } - - public static boolean deep9234(boolean x) { - return deep9235(x); - } - - public static boolean deep9235(boolean x) { - return deep9236(x); - } - - public static boolean deep9236(boolean x) { - return deep9237(x); - } - - public static boolean deep9237(boolean x) { - return deep9238(x); - } - - public static boolean deep9238(boolean x) { - return deep9239(x); - } - - public static boolean deep9239(boolean x) { - return deep9240(x); - } - - public static boolean deep9240(boolean x) { - return deep9241(x); - } - - public static boolean deep9241(boolean x) { - return deep9242(x); - } - - public static boolean deep9242(boolean x) { - return deep9243(x); - } - - public static boolean deep9243(boolean x) { - return deep9244(x); - } - - public static boolean deep9244(boolean x) { - return deep9245(x); - } - - public static boolean deep9245(boolean x) { - return deep9246(x); - } - - public static boolean deep9246(boolean x) { - return deep9247(x); - } - - public static boolean deep9247(boolean x) { - return deep9248(x); - } - - public static boolean deep9248(boolean x) { - return deep9249(x); - } - - public static boolean deep9249(boolean x) { - return deep9250(x); - } - - public static boolean deep9250(boolean x) { - return deep9251(x); - } - - public static boolean deep9251(boolean x) { - return deep9252(x); - } - - public static boolean deep9252(boolean x) { - return deep9253(x); - } - - public static boolean deep9253(boolean x) { - return deep9254(x); - } - - public static boolean deep9254(boolean x) { - return deep9255(x); - } - - public static boolean deep9255(boolean x) { - return deep9256(x); - } - - public static boolean deep9256(boolean x) { - return deep9257(x); - } - - public static boolean deep9257(boolean x) { - return deep9258(x); - } - - public static boolean deep9258(boolean x) { - return deep9259(x); - } - - public static boolean deep9259(boolean x) { - return deep9260(x); - } - - public static boolean deep9260(boolean x) { - return deep9261(x); - } - - public static boolean deep9261(boolean x) { - return deep9262(x); - } - - public static boolean deep9262(boolean x) { - return deep9263(x); - } - - public static boolean deep9263(boolean x) { - return deep9264(x); - } - - public static boolean deep9264(boolean x) { - return deep9265(x); - } - - public static boolean deep9265(boolean x) { - return deep9266(x); - } - - public static boolean deep9266(boolean x) { - return deep9267(x); - } - - public static boolean deep9267(boolean x) { - return deep9268(x); - } - - public static boolean deep9268(boolean x) { - return deep9269(x); - } - - public static boolean deep9269(boolean x) { - return deep9270(x); - } - - public static boolean deep9270(boolean x) { - return deep9271(x); - } - - public static boolean deep9271(boolean x) { - return deep9272(x); - } - - public static boolean deep9272(boolean x) { - return deep9273(x); - } - - public static boolean deep9273(boolean x) { - return deep9274(x); - } - - public static boolean deep9274(boolean x) { - return deep9275(x); - } - - public static boolean deep9275(boolean x) { - return deep9276(x); - } - - public static boolean deep9276(boolean x) { - return deep9277(x); - } - - public static boolean deep9277(boolean x) { - return deep9278(x); - } - - public static boolean deep9278(boolean x) { - return deep9279(x); - } - - public static boolean deep9279(boolean x) { - return deep9280(x); - } - - public static boolean deep9280(boolean x) { - return deep9281(x); - } - - public static boolean deep9281(boolean x) { - return deep9282(x); - } - - public static boolean deep9282(boolean x) { - return deep9283(x); - } - - public static boolean deep9283(boolean x) { - return deep9284(x); - } - - public static boolean deep9284(boolean x) { - return deep9285(x); - } - - public static boolean deep9285(boolean x) { - return deep9286(x); - } - - public static boolean deep9286(boolean x) { - return deep9287(x); - } - - public static boolean deep9287(boolean x) { - return deep9288(x); - } - - public static boolean deep9288(boolean x) { - return deep9289(x); - } - - public static boolean deep9289(boolean x) { - return deep9290(x); - } - - public static boolean deep9290(boolean x) { - return deep9291(x); - } - - public static boolean deep9291(boolean x) { - return deep9292(x); - } - - public static boolean deep9292(boolean x) { - return deep9293(x); - } - - public static boolean deep9293(boolean x) { - return deep9294(x); - } - - public static boolean deep9294(boolean x) { - return deep9295(x); - } - - public static boolean deep9295(boolean x) { - return deep9296(x); - } - - public static boolean deep9296(boolean x) { - return deep9297(x); - } - - public static boolean deep9297(boolean x) { - return deep9298(x); - } - - public static boolean deep9298(boolean x) { - return deep9299(x); - } - - public static boolean deep9299(boolean x) { - return deep9300(x); - } - - public static boolean deep9300(boolean x) { - return deep9301(x); - } - - public static boolean deep9301(boolean x) { - return deep9302(x); - } - - public static boolean deep9302(boolean x) { - return deep9303(x); - } - - public static boolean deep9303(boolean x) { - return deep9304(x); - } - - public static boolean deep9304(boolean x) { - return deep9305(x); - } - - public static boolean deep9305(boolean x) { - return deep9306(x); - } - - public static boolean deep9306(boolean x) { - return deep9307(x); - } - - public static boolean deep9307(boolean x) { - return deep9308(x); - } - - public static boolean deep9308(boolean x) { - return deep9309(x); - } - - public static boolean deep9309(boolean x) { - return deep9310(x); - } - - public static boolean deep9310(boolean x) { - return deep9311(x); - } - - public static boolean deep9311(boolean x) { - return deep9312(x); - } - - public static boolean deep9312(boolean x) { - return deep9313(x); - } - - public static boolean deep9313(boolean x) { - return deep9314(x); - } - - public static boolean deep9314(boolean x) { - return deep9315(x); - } - - public static boolean deep9315(boolean x) { - return deep9316(x); - } - - public static boolean deep9316(boolean x) { - return deep9317(x); - } - - public static boolean deep9317(boolean x) { - return deep9318(x); - } - - public static boolean deep9318(boolean x) { - return deep9319(x); - } - - public static boolean deep9319(boolean x) { - return deep9320(x); - } - - public static boolean deep9320(boolean x) { - return deep9321(x); - } - - public static boolean deep9321(boolean x) { - return deep9322(x); - } - - public static boolean deep9322(boolean x) { - return deep9323(x); - } - - public static boolean deep9323(boolean x) { - return deep9324(x); - } - - public static boolean deep9324(boolean x) { - return deep9325(x); - } - - public static boolean deep9325(boolean x) { - return deep9326(x); - } - - public static boolean deep9326(boolean x) { - return deep9327(x); - } - - public static boolean deep9327(boolean x) { - return deep9328(x); - } - - public static boolean deep9328(boolean x) { - return deep9329(x); - } - - public static boolean deep9329(boolean x) { - return deep9330(x); - } - - public static boolean deep9330(boolean x) { - return deep9331(x); - } - - public static boolean deep9331(boolean x) { - return deep9332(x); - } - - public static boolean deep9332(boolean x) { - return deep9333(x); - } - - public static boolean deep9333(boolean x) { - return deep9334(x); - } - - public static boolean deep9334(boolean x) { - return deep9335(x); - } - - public static boolean deep9335(boolean x) { - return deep9336(x); - } - - public static boolean deep9336(boolean x) { - return deep9337(x); - } - - public static boolean deep9337(boolean x) { - return deep9338(x); - } - - public static boolean deep9338(boolean x) { - return deep9339(x); - } - - public static boolean deep9339(boolean x) { - return deep9340(x); - } - - public static boolean deep9340(boolean x) { - return deep9341(x); - } - - public static boolean deep9341(boolean x) { - return deep9342(x); - } - - public static boolean deep9342(boolean x) { - return deep9343(x); - } - - public static boolean deep9343(boolean x) { - return deep9344(x); - } - - public static boolean deep9344(boolean x) { - return deep9345(x); - } - - public static boolean deep9345(boolean x) { - return deep9346(x); - } - - public static boolean deep9346(boolean x) { - return deep9347(x); - } - - public static boolean deep9347(boolean x) { - return deep9348(x); - } - - public static boolean deep9348(boolean x) { - return deep9349(x); - } - - public static boolean deep9349(boolean x) { - return deep9350(x); - } - - public static boolean deep9350(boolean x) { - return deep9351(x); - } - - public static boolean deep9351(boolean x) { - return deep9352(x); - } - - public static boolean deep9352(boolean x) { - return deep9353(x); - } - - public static boolean deep9353(boolean x) { - return deep9354(x); - } - - public static boolean deep9354(boolean x) { - return deep9355(x); - } - - public static boolean deep9355(boolean x) { - return deep9356(x); - } - - public static boolean deep9356(boolean x) { - return deep9357(x); - } - - public static boolean deep9357(boolean x) { - return deep9358(x); - } - - public static boolean deep9358(boolean x) { - return deep9359(x); - } - - public static boolean deep9359(boolean x) { - return deep9360(x); - } - - public static boolean deep9360(boolean x) { - return deep9361(x); - } - - public static boolean deep9361(boolean x) { - return deep9362(x); - } - - public static boolean deep9362(boolean x) { - return deep9363(x); - } - - public static boolean deep9363(boolean x) { - return deep9364(x); - } - - public static boolean deep9364(boolean x) { - return deep9365(x); - } - - public static boolean deep9365(boolean x) { - return deep9366(x); - } - - public static boolean deep9366(boolean x) { - return deep9367(x); - } - - public static boolean deep9367(boolean x) { - return deep9368(x); - } - - public static boolean deep9368(boolean x) { - return deep9369(x); - } - - public static boolean deep9369(boolean x) { - return deep9370(x); - } - - public static boolean deep9370(boolean x) { - return deep9371(x); - } - - public static boolean deep9371(boolean x) { - return deep9372(x); - } - - public static boolean deep9372(boolean x) { - return deep9373(x); - } - - public static boolean deep9373(boolean x) { - return deep9374(x); - } - - public static boolean deep9374(boolean x) { - return deep9375(x); - } - - public static boolean deep9375(boolean x) { - return deep9376(x); - } - - public static boolean deep9376(boolean x) { - return deep9377(x); - } - - public static boolean deep9377(boolean x) { - return deep9378(x); - } - - public static boolean deep9378(boolean x) { - return deep9379(x); - } - - public static boolean deep9379(boolean x) { - return deep9380(x); - } - - public static boolean deep9380(boolean x) { - return deep9381(x); - } - - public static boolean deep9381(boolean x) { - return deep9382(x); - } - - public static boolean deep9382(boolean x) { - return deep9383(x); - } - - public static boolean deep9383(boolean x) { - return deep9384(x); - } - - public static boolean deep9384(boolean x) { - return deep9385(x); - } - - public static boolean deep9385(boolean x) { - return deep9386(x); - } - - public static boolean deep9386(boolean x) { - return deep9387(x); - } - - public static boolean deep9387(boolean x) { - return deep9388(x); - } - - public static boolean deep9388(boolean x) { - return deep9389(x); - } - - public static boolean deep9389(boolean x) { - return deep9390(x); - } - - public static boolean deep9390(boolean x) { - return deep9391(x); - } - - public static boolean deep9391(boolean x) { - return deep9392(x); - } - - public static boolean deep9392(boolean x) { - return deep9393(x); - } - - public static boolean deep9393(boolean x) { - return deep9394(x); - } - - public static boolean deep9394(boolean x) { - return deep9395(x); - } - - public static boolean deep9395(boolean x) { - return deep9396(x); - } - - public static boolean deep9396(boolean x) { - return deep9397(x); - } - - public static boolean deep9397(boolean x) { - return deep9398(x); - } - - public static boolean deep9398(boolean x) { - return deep9399(x); - } - - public static boolean deep9399(boolean x) { - return deep9400(x); - } - - public static boolean deep9400(boolean x) { - return deep9401(x); - } - - public static boolean deep9401(boolean x) { - return deep9402(x); - } - - public static boolean deep9402(boolean x) { - return deep9403(x); - } - - public static boolean deep9403(boolean x) { - return deep9404(x); - } - - public static boolean deep9404(boolean x) { - return deep9405(x); - } - - public static boolean deep9405(boolean x) { - return deep9406(x); - } - - public static boolean deep9406(boolean x) { - return deep9407(x); - } - - public static boolean deep9407(boolean x) { - return deep9408(x); - } - - public static boolean deep9408(boolean x) { - return deep9409(x); - } - - public static boolean deep9409(boolean x) { - return deep9410(x); - } - - public static boolean deep9410(boolean x) { - return deep9411(x); - } - - public static boolean deep9411(boolean x) { - return deep9412(x); - } - - public static boolean deep9412(boolean x) { - return deep9413(x); - } - - public static boolean deep9413(boolean x) { - return deep9414(x); - } - - public static boolean deep9414(boolean x) { - return deep9415(x); - } - - public static boolean deep9415(boolean x) { - return deep9416(x); - } - - public static boolean deep9416(boolean x) { - return deep9417(x); - } - - public static boolean deep9417(boolean x) { - return deep9418(x); - } - - public static boolean deep9418(boolean x) { - return deep9419(x); - } - - public static boolean deep9419(boolean x) { - return deep9420(x); - } - - public static boolean deep9420(boolean x) { - return deep9421(x); - } - - public static boolean deep9421(boolean x) { - return deep9422(x); - } - - public static boolean deep9422(boolean x) { - return deep9423(x); - } - - public static boolean deep9423(boolean x) { - return deep9424(x); - } - - public static boolean deep9424(boolean x) { - return deep9425(x); - } - - public static boolean deep9425(boolean x) { - return deep9426(x); - } - - public static boolean deep9426(boolean x) { - return deep9427(x); - } - - public static boolean deep9427(boolean x) { - return deep9428(x); - } - - public static boolean deep9428(boolean x) { - return deep9429(x); - } - - public static boolean deep9429(boolean x) { - return deep9430(x); - } - - public static boolean deep9430(boolean x) { - return deep9431(x); - } - - public static boolean deep9431(boolean x) { - return deep9432(x); - } - - public static boolean deep9432(boolean x) { - return deep9433(x); - } - - public static boolean deep9433(boolean x) { - return deep9434(x); - } - - public static boolean deep9434(boolean x) { - return deep9435(x); - } - - public static boolean deep9435(boolean x) { - return deep9436(x); - } - - public static boolean deep9436(boolean x) { - return deep9437(x); - } - - public static boolean deep9437(boolean x) { - return deep9438(x); - } - - public static boolean deep9438(boolean x) { - return deep9439(x); - } - - public static boolean deep9439(boolean x) { - return deep9440(x); - } - - public static boolean deep9440(boolean x) { - return deep9441(x); - } - - public static boolean deep9441(boolean x) { - return deep9442(x); - } - - public static boolean deep9442(boolean x) { - return deep9443(x); - } - - public static boolean deep9443(boolean x) { - return deep9444(x); - } - - public static boolean deep9444(boolean x) { - return deep9445(x); - } - - public static boolean deep9445(boolean x) { - return deep9446(x); - } - - public static boolean deep9446(boolean x) { - return deep9447(x); - } - - public static boolean deep9447(boolean x) { - return deep9448(x); - } - - public static boolean deep9448(boolean x) { - return deep9449(x); - } - - public static boolean deep9449(boolean x) { - return deep9450(x); - } - - public static boolean deep9450(boolean x) { - return deep9451(x); - } - - public static boolean deep9451(boolean x) { - return deep9452(x); - } - - public static boolean deep9452(boolean x) { - return deep9453(x); - } - - public static boolean deep9453(boolean x) { - return deep9454(x); - } - - public static boolean deep9454(boolean x) { - return deep9455(x); - } - - public static boolean deep9455(boolean x) { - return deep9456(x); - } - - public static boolean deep9456(boolean x) { - return deep9457(x); - } - - public static boolean deep9457(boolean x) { - return deep9458(x); - } - - public static boolean deep9458(boolean x) { - return deep9459(x); - } - - public static boolean deep9459(boolean x) { - return deep9460(x); - } - - public static boolean deep9460(boolean x) { - return deep9461(x); - } - - public static boolean deep9461(boolean x) { - return deep9462(x); - } - - public static boolean deep9462(boolean x) { - return deep9463(x); - } - - public static boolean deep9463(boolean x) { - return deep9464(x); - } - - public static boolean deep9464(boolean x) { - return deep9465(x); - } - - public static boolean deep9465(boolean x) { - return deep9466(x); - } - - public static boolean deep9466(boolean x) { - return deep9467(x); - } - - public static boolean deep9467(boolean x) { - return deep9468(x); - } - - public static boolean deep9468(boolean x) { - return deep9469(x); - } - - public static boolean deep9469(boolean x) { - return deep9470(x); - } - - public static boolean deep9470(boolean x) { - return deep9471(x); - } - - public static boolean deep9471(boolean x) { - return deep9472(x); - } - - public static boolean deep9472(boolean x) { - return deep9473(x); - } - - public static boolean deep9473(boolean x) { - return deep9474(x); - } - - public static boolean deep9474(boolean x) { - return deep9475(x); - } - - public static boolean deep9475(boolean x) { - return deep9476(x); - } - - public static boolean deep9476(boolean x) { - return deep9477(x); - } - - public static boolean deep9477(boolean x) { - return deep9478(x); - } - - public static boolean deep9478(boolean x) { - return deep9479(x); - } - - public static boolean deep9479(boolean x) { - return deep9480(x); - } - - public static boolean deep9480(boolean x) { - return deep9481(x); - } - - public static boolean deep9481(boolean x) { - return deep9482(x); - } - - public static boolean deep9482(boolean x) { - return deep9483(x); - } - - public static boolean deep9483(boolean x) { - return deep9484(x); - } - - public static boolean deep9484(boolean x) { - return deep9485(x); - } - - public static boolean deep9485(boolean x) { - return deep9486(x); - } - - public static boolean deep9486(boolean x) { - return deep9487(x); - } - - public static boolean deep9487(boolean x) { - return deep9488(x); - } - - public static boolean deep9488(boolean x) { - return deep9489(x); - } - - public static boolean deep9489(boolean x) { - return deep9490(x); - } - - public static boolean deep9490(boolean x) { - return deep9491(x); - } - - public static boolean deep9491(boolean x) { - return deep9492(x); - } - - public static boolean deep9492(boolean x) { - return deep9493(x); - } - - public static boolean deep9493(boolean x) { - return deep9494(x); - } - - public static boolean deep9494(boolean x) { - return deep9495(x); - } - - public static boolean deep9495(boolean x) { - return deep9496(x); - } - - public static boolean deep9496(boolean x) { - return deep9497(x); - } - - public static boolean deep9497(boolean x) { - return deep9498(x); - } - - public static boolean deep9498(boolean x) { - return deep9499(x); - } - - public static boolean deep9499(boolean x) { - return deep9500(x); - } - - public static boolean deep9500(boolean x) { - return deep9501(x); - } - - public static boolean deep9501(boolean x) { - return deep9502(x); - } - - public static boolean deep9502(boolean x) { - return deep9503(x); - } - - public static boolean deep9503(boolean x) { - return deep9504(x); - } - - public static boolean deep9504(boolean x) { - return deep9505(x); - } - - public static boolean deep9505(boolean x) { - return deep9506(x); - } - - public static boolean deep9506(boolean x) { - return deep9507(x); - } - - public static boolean deep9507(boolean x) { - return deep9508(x); - } - - public static boolean deep9508(boolean x) { - return deep9509(x); - } - - public static boolean deep9509(boolean x) { - return deep9510(x); - } - - public static boolean deep9510(boolean x) { - return deep9511(x); - } - - public static boolean deep9511(boolean x) { - return deep9512(x); - } - - public static boolean deep9512(boolean x) { - return deep9513(x); - } - - public static boolean deep9513(boolean x) { - return deep9514(x); - } - - public static boolean deep9514(boolean x) { - return deep9515(x); - } - - public static boolean deep9515(boolean x) { - return deep9516(x); - } - - public static boolean deep9516(boolean x) { - return deep9517(x); - } - - public static boolean deep9517(boolean x) { - return deep9518(x); - } - - public static boolean deep9518(boolean x) { - return deep9519(x); - } - - public static boolean deep9519(boolean x) { - return deep9520(x); - } - - public static boolean deep9520(boolean x) { - return deep9521(x); - } - - public static boolean deep9521(boolean x) { - return deep9522(x); - } - - public static boolean deep9522(boolean x) { - return deep9523(x); - } - - public static boolean deep9523(boolean x) { - return deep9524(x); - } - - public static boolean deep9524(boolean x) { - return deep9525(x); - } - - public static boolean deep9525(boolean x) { - return deep9526(x); - } - - public static boolean deep9526(boolean x) { - return deep9527(x); - } - - public static boolean deep9527(boolean x) { - return deep9528(x); - } - - public static boolean deep9528(boolean x) { - return deep9529(x); - } - - public static boolean deep9529(boolean x) { - return deep9530(x); - } - - public static boolean deep9530(boolean x) { - return deep9531(x); - } - - public static boolean deep9531(boolean x) { - return deep9532(x); - } - - public static boolean deep9532(boolean x) { - return deep9533(x); - } - - public static boolean deep9533(boolean x) { - return deep9534(x); - } - - public static boolean deep9534(boolean x) { - return deep9535(x); - } - - public static boolean deep9535(boolean x) { - return deep9536(x); - } - - public static boolean deep9536(boolean x) { - return deep9537(x); - } - - public static boolean deep9537(boolean x) { - return deep9538(x); - } - - public static boolean deep9538(boolean x) { - return deep9539(x); - } - - public static boolean deep9539(boolean x) { - return deep9540(x); - } - - public static boolean deep9540(boolean x) { - return deep9541(x); - } - - public static boolean deep9541(boolean x) { - return deep9542(x); - } - - public static boolean deep9542(boolean x) { - return deep9543(x); - } - - public static boolean deep9543(boolean x) { - return deep9544(x); - } - - public static boolean deep9544(boolean x) { - return deep9545(x); - } - - public static boolean deep9545(boolean x) { - return deep9546(x); - } - - public static boolean deep9546(boolean x) { - return deep9547(x); - } - - public static boolean deep9547(boolean x) { - return deep9548(x); - } - - public static boolean deep9548(boolean x) { - return deep9549(x); - } - - public static boolean deep9549(boolean x) { - return deep9550(x); - } - - public static boolean deep9550(boolean x) { - return deep9551(x); - } - - public static boolean deep9551(boolean x) { - return deep9552(x); - } - - public static boolean deep9552(boolean x) { - return deep9553(x); - } - - public static boolean deep9553(boolean x) { - return deep9554(x); - } - - public static boolean deep9554(boolean x) { - return deep9555(x); - } - - public static boolean deep9555(boolean x) { - return deep9556(x); - } - - public static boolean deep9556(boolean x) { - return deep9557(x); - } - - public static boolean deep9557(boolean x) { - return deep9558(x); - } - - public static boolean deep9558(boolean x) { - return deep9559(x); - } - - public static boolean deep9559(boolean x) { - return deep9560(x); - } - - public static boolean deep9560(boolean x) { - return deep9561(x); - } - - public static boolean deep9561(boolean x) { - return deep9562(x); - } - - public static boolean deep9562(boolean x) { - return deep9563(x); - } - - public static boolean deep9563(boolean x) { - return deep9564(x); - } - - public static boolean deep9564(boolean x) { - return deep9565(x); - } - - public static boolean deep9565(boolean x) { - return deep9566(x); - } - - public static boolean deep9566(boolean x) { - return deep9567(x); - } - - public static boolean deep9567(boolean x) { - return deep9568(x); - } - - public static boolean deep9568(boolean x) { - return deep9569(x); - } - - public static boolean deep9569(boolean x) { - return deep9570(x); - } - - public static boolean deep9570(boolean x) { - return deep9571(x); - } - - public static boolean deep9571(boolean x) { - return deep9572(x); - } - - public static boolean deep9572(boolean x) { - return deep9573(x); - } - - public static boolean deep9573(boolean x) { - return deep9574(x); - } - - public static boolean deep9574(boolean x) { - return deep9575(x); - } - - public static boolean deep9575(boolean x) { - return deep9576(x); - } - - public static boolean deep9576(boolean x) { - return deep9577(x); - } - - public static boolean deep9577(boolean x) { - return deep9578(x); - } - - public static boolean deep9578(boolean x) { - return deep9579(x); - } - - public static boolean deep9579(boolean x) { - return deep9580(x); - } - - public static boolean deep9580(boolean x) { - return deep9581(x); - } - - public static boolean deep9581(boolean x) { - return deep9582(x); - } - - public static boolean deep9582(boolean x) { - return deep9583(x); - } - - public static boolean deep9583(boolean x) { - return deep9584(x); - } - - public static boolean deep9584(boolean x) { - return deep9585(x); - } - - public static boolean deep9585(boolean x) { - return deep9586(x); - } - - public static boolean deep9586(boolean x) { - return deep9587(x); - } - - public static boolean deep9587(boolean x) { - return deep9588(x); - } - - public static boolean deep9588(boolean x) { - return deep9589(x); - } - - public static boolean deep9589(boolean x) { - return deep9590(x); - } - - public static boolean deep9590(boolean x) { - return deep9591(x); - } - - public static boolean deep9591(boolean x) { - return deep9592(x); - } - - public static boolean deep9592(boolean x) { - return deep9593(x); - } - - public static boolean deep9593(boolean x) { - return deep9594(x); - } - - public static boolean deep9594(boolean x) { - return deep9595(x); - } - - public static boolean deep9595(boolean x) { - return deep9596(x); - } - - public static boolean deep9596(boolean x) { - return deep9597(x); - } - - public static boolean deep9597(boolean x) { - return deep9598(x); - } - - public static boolean deep9598(boolean x) { - return deep9599(x); - } - - public static boolean deep9599(boolean x) { - return deep9600(x); - } - - public static boolean deep9600(boolean x) { - return deep9601(x); - } - - public static boolean deep9601(boolean x) { - return deep9602(x); - } - - public static boolean deep9602(boolean x) { - return deep9603(x); - } - - public static boolean deep9603(boolean x) { - return deep9604(x); - } - - public static boolean deep9604(boolean x) { - return deep9605(x); - } - - public static boolean deep9605(boolean x) { - return deep9606(x); - } - - public static boolean deep9606(boolean x) { - return deep9607(x); - } - - public static boolean deep9607(boolean x) { - return deep9608(x); - } - - public static boolean deep9608(boolean x) { - return deep9609(x); - } - - public static boolean deep9609(boolean x) { - return deep9610(x); - } - - public static boolean deep9610(boolean x) { - return deep9611(x); - } - - public static boolean deep9611(boolean x) { - return deep9612(x); - } - - public static boolean deep9612(boolean x) { - return deep9613(x); - } - - public static boolean deep9613(boolean x) { - return deep9614(x); - } - - public static boolean deep9614(boolean x) { - return deep9615(x); - } - - public static boolean deep9615(boolean x) { - return deep9616(x); - } - - public static boolean deep9616(boolean x) { - return deep9617(x); - } - - public static boolean deep9617(boolean x) { - return deep9618(x); - } - - public static boolean deep9618(boolean x) { - return deep9619(x); - } - - public static boolean deep9619(boolean x) { - return deep9620(x); - } - - public static boolean deep9620(boolean x) { - return deep9621(x); - } - - public static boolean deep9621(boolean x) { - return deep9622(x); - } - - public static boolean deep9622(boolean x) { - return deep9623(x); - } - - public static boolean deep9623(boolean x) { - return deep9624(x); - } - - public static boolean deep9624(boolean x) { - return deep9625(x); - } - - public static boolean deep9625(boolean x) { - return deep9626(x); - } - - public static boolean deep9626(boolean x) { - return deep9627(x); - } - - public static boolean deep9627(boolean x) { - return deep9628(x); - } - - public static boolean deep9628(boolean x) { - return deep9629(x); - } - - public static boolean deep9629(boolean x) { - return deep9630(x); - } - - public static boolean deep9630(boolean x) { - return deep9631(x); - } - - public static boolean deep9631(boolean x) { - return deep9632(x); - } - - public static boolean deep9632(boolean x) { - return deep9633(x); - } - - public static boolean deep9633(boolean x) { - return deep9634(x); - } - - public static boolean deep9634(boolean x) { - return deep9635(x); - } - - public static boolean deep9635(boolean x) { - return deep9636(x); - } - - public static boolean deep9636(boolean x) { - return deep9637(x); - } - - public static boolean deep9637(boolean x) { - return deep9638(x); - } - - public static boolean deep9638(boolean x) { - return deep9639(x); - } - - public static boolean deep9639(boolean x) { - return deep9640(x); - } - - public static boolean deep9640(boolean x) { - return deep9641(x); - } - - public static boolean deep9641(boolean x) { - return deep9642(x); - } - - public static boolean deep9642(boolean x) { - return deep9643(x); - } - - public static boolean deep9643(boolean x) { - return deep9644(x); - } - - public static boolean deep9644(boolean x) { - return deep9645(x); - } - - public static boolean deep9645(boolean x) { - return deep9646(x); - } - - public static boolean deep9646(boolean x) { - return deep9647(x); - } - - public static boolean deep9647(boolean x) { - return deep9648(x); - } - - public static boolean deep9648(boolean x) { - return deep9649(x); - } - - public static boolean deep9649(boolean x) { - return deep9650(x); - } - - public static boolean deep9650(boolean x) { - return deep9651(x); - } - - public static boolean deep9651(boolean x) { - return deep9652(x); - } - - public static boolean deep9652(boolean x) { - return deep9653(x); - } - - public static boolean deep9653(boolean x) { - return deep9654(x); - } - - public static boolean deep9654(boolean x) { - return deep9655(x); - } - - public static boolean deep9655(boolean x) { - return deep9656(x); - } - - public static boolean deep9656(boolean x) { - return deep9657(x); - } - - public static boolean deep9657(boolean x) { - return deep9658(x); - } - - public static boolean deep9658(boolean x) { - return deep9659(x); - } - - public static boolean deep9659(boolean x) { - return deep9660(x); - } - - public static boolean deep9660(boolean x) { - return deep9661(x); - } - - public static boolean deep9661(boolean x) { - return deep9662(x); - } - - public static boolean deep9662(boolean x) { - return deep9663(x); - } - - public static boolean deep9663(boolean x) { - return deep9664(x); - } - - public static boolean deep9664(boolean x) { - return deep9665(x); - } - - public static boolean deep9665(boolean x) { - return deep9666(x); - } - - public static boolean deep9666(boolean x) { - return deep9667(x); - } - - public static boolean deep9667(boolean x) { - return deep9668(x); - } - - public static boolean deep9668(boolean x) { - return deep9669(x); - } - - public static boolean deep9669(boolean x) { - return deep9670(x); - } - - public static boolean deep9670(boolean x) { - return deep9671(x); - } - - public static boolean deep9671(boolean x) { - return deep9672(x); - } - - public static boolean deep9672(boolean x) { - return deep9673(x); - } - - public static boolean deep9673(boolean x) { - return deep9674(x); - } - - public static boolean deep9674(boolean x) { - return deep9675(x); - } - - public static boolean deep9675(boolean x) { - return deep9676(x); - } - - public static boolean deep9676(boolean x) { - return deep9677(x); - } - - public static boolean deep9677(boolean x) { - return deep9678(x); - } - - public static boolean deep9678(boolean x) { - return deep9679(x); - } - - public static boolean deep9679(boolean x) { - return deep9680(x); - } - - public static boolean deep9680(boolean x) { - return deep9681(x); - } - - public static boolean deep9681(boolean x) { - return deep9682(x); - } - - public static boolean deep9682(boolean x) { - return deep9683(x); - } - - public static boolean deep9683(boolean x) { - return deep9684(x); - } - - public static boolean deep9684(boolean x) { - return deep9685(x); - } - - public static boolean deep9685(boolean x) { - return deep9686(x); - } - - public static boolean deep9686(boolean x) { - return deep9687(x); - } - - public static boolean deep9687(boolean x) { - return deep9688(x); - } - - public static boolean deep9688(boolean x) { - return deep9689(x); - } - - public static boolean deep9689(boolean x) { - return deep9690(x); - } - - public static boolean deep9690(boolean x) { - return deep9691(x); - } - - public static boolean deep9691(boolean x) { - return deep9692(x); - } - - public static boolean deep9692(boolean x) { - return deep9693(x); - } - - public static boolean deep9693(boolean x) { - return deep9694(x); - } - - public static boolean deep9694(boolean x) { - return deep9695(x); - } - - public static boolean deep9695(boolean x) { - return deep9696(x); - } - - public static boolean deep9696(boolean x) { - return deep9697(x); - } - - public static boolean deep9697(boolean x) { - return deep9698(x); - } - - public static boolean deep9698(boolean x) { - return deep9699(x); - } - - public static boolean deep9699(boolean x) { - return deep9700(x); - } - - public static boolean deep9700(boolean x) { - return deep9701(x); - } - - public static boolean deep9701(boolean x) { - return deep9702(x); - } - - public static boolean deep9702(boolean x) { - return deep9703(x); - } - - public static boolean deep9703(boolean x) { - return deep9704(x); - } - - public static boolean deep9704(boolean x) { - return deep9705(x); - } - - public static boolean deep9705(boolean x) { - return deep9706(x); - } - - public static boolean deep9706(boolean x) { - return deep9707(x); - } - - public static boolean deep9707(boolean x) { - return deep9708(x); - } - - public static boolean deep9708(boolean x) { - return deep9709(x); - } - - public static boolean deep9709(boolean x) { - return deep9710(x); - } - - public static boolean deep9710(boolean x) { - return deep9711(x); - } - - public static boolean deep9711(boolean x) { - return deep9712(x); - } - - public static boolean deep9712(boolean x) { - return deep9713(x); - } - - public static boolean deep9713(boolean x) { - return deep9714(x); - } - - public static boolean deep9714(boolean x) { - return deep9715(x); - } - - public static boolean deep9715(boolean x) { - return deep9716(x); - } - - public static boolean deep9716(boolean x) { - return deep9717(x); - } - - public static boolean deep9717(boolean x) { - return deep9718(x); - } - - public static boolean deep9718(boolean x) { - return deep9719(x); - } - - public static boolean deep9719(boolean x) { - return deep9720(x); - } - - public static boolean deep9720(boolean x) { - return deep9721(x); - } - - public static boolean deep9721(boolean x) { - return deep9722(x); - } - - public static boolean deep9722(boolean x) { - return deep9723(x); - } - - public static boolean deep9723(boolean x) { - return deep9724(x); - } - - public static boolean deep9724(boolean x) { - return deep9725(x); - } - - public static boolean deep9725(boolean x) { - return deep9726(x); - } - - public static boolean deep9726(boolean x) { - return deep9727(x); - } - - public static boolean deep9727(boolean x) { - return deep9728(x); - } - - public static boolean deep9728(boolean x) { - return deep9729(x); - } - - public static boolean deep9729(boolean x) { - return deep9730(x); - } - - public static boolean deep9730(boolean x) { - return deep9731(x); - } - - public static boolean deep9731(boolean x) { - return deep9732(x); - } - - public static boolean deep9732(boolean x) { - return deep9733(x); - } - - public static boolean deep9733(boolean x) { - return deep9734(x); - } - - public static boolean deep9734(boolean x) { - return deep9735(x); - } - - public static boolean deep9735(boolean x) { - return deep9736(x); - } - - public static boolean deep9736(boolean x) { - return deep9737(x); - } - - public static boolean deep9737(boolean x) { - return deep9738(x); - } - - public static boolean deep9738(boolean x) { - return deep9739(x); - } - - public static boolean deep9739(boolean x) { - return deep9740(x); - } - - public static boolean deep9740(boolean x) { - return deep9741(x); - } - - public static boolean deep9741(boolean x) { - return deep9742(x); - } - - public static boolean deep9742(boolean x) { - return deep9743(x); - } - - public static boolean deep9743(boolean x) { - return deep9744(x); - } - - public static boolean deep9744(boolean x) { - return deep9745(x); - } - - public static boolean deep9745(boolean x) { - return deep9746(x); - } - - public static boolean deep9746(boolean x) { - return deep9747(x); - } - - public static boolean deep9747(boolean x) { - return deep9748(x); - } - - public static boolean deep9748(boolean x) { - return deep9749(x); - } - - public static boolean deep9749(boolean x) { - return deep9750(x); - } - - public static boolean deep9750(boolean x) { - return deep9751(x); - } - - public static boolean deep9751(boolean x) { - return deep9752(x); - } - - public static boolean deep9752(boolean x) { - return deep9753(x); - } - - public static boolean deep9753(boolean x) { - return deep9754(x); - } - - public static boolean deep9754(boolean x) { - return deep9755(x); - } - - public static boolean deep9755(boolean x) { - return deep9756(x); - } - - public static boolean deep9756(boolean x) { - return deep9757(x); - } - - public static boolean deep9757(boolean x) { - return deep9758(x); - } - - public static boolean deep9758(boolean x) { - return deep9759(x); - } - - public static boolean deep9759(boolean x) { - return deep9760(x); - } - - public static boolean deep9760(boolean x) { - return deep9761(x); - } - - public static boolean deep9761(boolean x) { - return deep9762(x); - } - - public static boolean deep9762(boolean x) { - return deep9763(x); - } - - public static boolean deep9763(boolean x) { - return deep9764(x); - } - - public static boolean deep9764(boolean x) { - return deep9765(x); - } - - public static boolean deep9765(boolean x) { - return deep9766(x); - } - - public static boolean deep9766(boolean x) { - return deep9767(x); - } - - public static boolean deep9767(boolean x) { - return deep9768(x); - } - - public static boolean deep9768(boolean x) { - return deep9769(x); - } - - public static boolean deep9769(boolean x) { - return deep9770(x); - } - - public static boolean deep9770(boolean x) { - return deep9771(x); - } - - public static boolean deep9771(boolean x) { - return deep9772(x); - } - - public static boolean deep9772(boolean x) { - return deep9773(x); - } - - public static boolean deep9773(boolean x) { - return deep9774(x); - } - - public static boolean deep9774(boolean x) { - return deep9775(x); - } - - public static boolean deep9775(boolean x) { - return deep9776(x); - } - - public static boolean deep9776(boolean x) { - return deep9777(x); - } - - public static boolean deep9777(boolean x) { - return deep9778(x); - } - - public static boolean deep9778(boolean x) { - return deep9779(x); - } - - public static boolean deep9779(boolean x) { - return deep9780(x); - } - - public static boolean deep9780(boolean x) { - return deep9781(x); - } - - public static boolean deep9781(boolean x) { - return deep9782(x); - } - - public static boolean deep9782(boolean x) { - return deep9783(x); - } - - public static boolean deep9783(boolean x) { - return deep9784(x); - } - - public static boolean deep9784(boolean x) { - return deep9785(x); - } - - public static boolean deep9785(boolean x) { - return deep9786(x); - } - - public static boolean deep9786(boolean x) { - return deep9787(x); - } - - public static boolean deep9787(boolean x) { - return deep9788(x); - } - - public static boolean deep9788(boolean x) { - return deep9789(x); - } - - public static boolean deep9789(boolean x) { - return deep9790(x); - } - - public static boolean deep9790(boolean x) { - return deep9791(x); - } - - public static boolean deep9791(boolean x) { - return deep9792(x); - } - - public static boolean deep9792(boolean x) { - return deep9793(x); - } - - public static boolean deep9793(boolean x) { - return deep9794(x); - } - - public static boolean deep9794(boolean x) { - return deep9795(x); - } - - public static boolean deep9795(boolean x) { - return deep9796(x); - } - - public static boolean deep9796(boolean x) { - return deep9797(x); - } - - public static boolean deep9797(boolean x) { - return deep9798(x); - } - - public static boolean deep9798(boolean x) { - return deep9799(x); - } - - public static boolean deep9799(boolean x) { - return deep9800(x); - } - - public static boolean deep9800(boolean x) { - return deep9801(x); - } - - public static boolean deep9801(boolean x) { - return deep9802(x); - } - - public static boolean deep9802(boolean x) { - return deep9803(x); - } - - public static boolean deep9803(boolean x) { - return deep9804(x); - } - - public static boolean deep9804(boolean x) { - return deep9805(x); - } - - public static boolean deep9805(boolean x) { - return deep9806(x); - } - - public static boolean deep9806(boolean x) { - return deep9807(x); - } - - public static boolean deep9807(boolean x) { - return deep9808(x); - } - - public static boolean deep9808(boolean x) { - return deep9809(x); - } - - public static boolean deep9809(boolean x) { - return deep9810(x); - } - - public static boolean deep9810(boolean x) { - return deep9811(x); - } - - public static boolean deep9811(boolean x) { - return deep9812(x); - } - - public static boolean deep9812(boolean x) { - return deep9813(x); - } - - public static boolean deep9813(boolean x) { - return deep9814(x); - } - - public static boolean deep9814(boolean x) { - return deep9815(x); - } - - public static boolean deep9815(boolean x) { - return deep9816(x); - } - - public static boolean deep9816(boolean x) { - return deep9817(x); - } - - public static boolean deep9817(boolean x) { - return deep9818(x); - } - - public static boolean deep9818(boolean x) { - return deep9819(x); - } - - public static boolean deep9819(boolean x) { - return deep9820(x); - } - - public static boolean deep9820(boolean x) { - return deep9821(x); - } - - public static boolean deep9821(boolean x) { - return deep9822(x); - } - - public static boolean deep9822(boolean x) { - return deep9823(x); - } - - public static boolean deep9823(boolean x) { - return deep9824(x); - } - - public static boolean deep9824(boolean x) { - return deep9825(x); - } - - public static boolean deep9825(boolean x) { - return deep9826(x); - } - - public static boolean deep9826(boolean x) { - return deep9827(x); - } - - public static boolean deep9827(boolean x) { - return deep9828(x); - } - - public static boolean deep9828(boolean x) { - return deep9829(x); - } - - public static boolean deep9829(boolean x) { - return deep9830(x); - } - - public static boolean deep9830(boolean x) { - return deep9831(x); - } - - public static boolean deep9831(boolean x) { - return deep9832(x); - } - - public static boolean deep9832(boolean x) { - return deep9833(x); - } - - public static boolean deep9833(boolean x) { - return deep9834(x); - } - - public static boolean deep9834(boolean x) { - return deep9835(x); - } - - public static boolean deep9835(boolean x) { - return deep9836(x); - } - - public static boolean deep9836(boolean x) { - return deep9837(x); - } - - public static boolean deep9837(boolean x) { - return deep9838(x); - } - - public static boolean deep9838(boolean x) { - return deep9839(x); - } - - public static boolean deep9839(boolean x) { - return deep9840(x); - } - - public static boolean deep9840(boolean x) { - return deep9841(x); - } - - public static boolean deep9841(boolean x) { - return deep9842(x); - } - - public static boolean deep9842(boolean x) { - return deep9843(x); - } - - public static boolean deep9843(boolean x) { - return deep9844(x); - } - - public static boolean deep9844(boolean x) { - return deep9845(x); - } - - public static boolean deep9845(boolean x) { - return deep9846(x); - } - - public static boolean deep9846(boolean x) { - return deep9847(x); - } - - public static boolean deep9847(boolean x) { - return deep9848(x); - } - - public static boolean deep9848(boolean x) { - return deep9849(x); - } - - public static boolean deep9849(boolean x) { - return deep9850(x); - } - - public static boolean deep9850(boolean x) { - return deep9851(x); - } - - public static boolean deep9851(boolean x) { - return deep9852(x); - } - - public static boolean deep9852(boolean x) { - return deep9853(x); - } - - public static boolean deep9853(boolean x) { - return deep9854(x); - } - - public static boolean deep9854(boolean x) { - return deep9855(x); - } - - public static boolean deep9855(boolean x) { - return deep9856(x); - } - - public static boolean deep9856(boolean x) { - return deep9857(x); - } - - public static boolean deep9857(boolean x) { - return deep9858(x); - } - - public static boolean deep9858(boolean x) { - return deep9859(x); - } - - public static boolean deep9859(boolean x) { - return deep9860(x); - } - - public static boolean deep9860(boolean x) { - return deep9861(x); - } - - public static boolean deep9861(boolean x) { - return deep9862(x); - } - - public static boolean deep9862(boolean x) { - return deep9863(x); - } - - public static boolean deep9863(boolean x) { - return deep9864(x); - } - - public static boolean deep9864(boolean x) { - return deep9865(x); - } - - public static boolean deep9865(boolean x) { - return deep9866(x); - } - - public static boolean deep9866(boolean x) { - return deep9867(x); - } - - public static boolean deep9867(boolean x) { - return deep9868(x); - } - - public static boolean deep9868(boolean x) { - return deep9869(x); - } - - public static boolean deep9869(boolean x) { - return deep9870(x); - } - - public static boolean deep9870(boolean x) { - return deep9871(x); - } - - public static boolean deep9871(boolean x) { - return deep9872(x); - } - - public static boolean deep9872(boolean x) { - return deep9873(x); - } - - public static boolean deep9873(boolean x) { - return deep9874(x); - } - - public static boolean deep9874(boolean x) { - return deep9875(x); - } - - public static boolean deep9875(boolean x) { - return deep9876(x); - } - - public static boolean deep9876(boolean x) { - return deep9877(x); - } - - public static boolean deep9877(boolean x) { - return deep9878(x); - } - - public static boolean deep9878(boolean x) { - return deep9879(x); - } - - public static boolean deep9879(boolean x) { - return deep9880(x); - } - - public static boolean deep9880(boolean x) { - return deep9881(x); - } - - public static boolean deep9881(boolean x) { - return deep9882(x); - } - - public static boolean deep9882(boolean x) { - return deep9883(x); - } - - public static boolean deep9883(boolean x) { - return deep9884(x); - } - - public static boolean deep9884(boolean x) { - return deep9885(x); - } - - public static boolean deep9885(boolean x) { - return deep9886(x); - } - - public static boolean deep9886(boolean x) { - return deep9887(x); - } - - public static boolean deep9887(boolean x) { - return deep9888(x); - } - - public static boolean deep9888(boolean x) { - return deep9889(x); - } - - public static boolean deep9889(boolean x) { - return deep9890(x); - } - - public static boolean deep9890(boolean x) { - return deep9891(x); - } - - public static boolean deep9891(boolean x) { - return deep9892(x); - } - - public static boolean deep9892(boolean x) { - return deep9893(x); - } - - public static boolean deep9893(boolean x) { - return deep9894(x); - } - - public static boolean deep9894(boolean x) { - return deep9895(x); - } - - public static boolean deep9895(boolean x) { - return deep9896(x); - } - - public static boolean deep9896(boolean x) { - return deep9897(x); - } - - public static boolean deep9897(boolean x) { - return deep9898(x); - } - - public static boolean deep9898(boolean x) { - return deep9899(x); - } - - public static boolean deep9899(boolean x) { - return deep9900(x); - } - - public static boolean deep9900(boolean x) { - return deep9901(x); - } - - public static boolean deep9901(boolean x) { - return deep9902(x); - } - - public static boolean deep9902(boolean x) { - return deep9903(x); - } - - public static boolean deep9903(boolean x) { - return deep9904(x); - } - - public static boolean deep9904(boolean x) { - return deep9905(x); - } - - public static boolean deep9905(boolean x) { - return deep9906(x); - } - - public static boolean deep9906(boolean x) { - return deep9907(x); - } - - public static boolean deep9907(boolean x) { - return deep9908(x); - } - - public static boolean deep9908(boolean x) { - return deep9909(x); - } - - public static boolean deep9909(boolean x) { - return deep9910(x); - } - - public static boolean deep9910(boolean x) { - return deep9911(x); - } - - public static boolean deep9911(boolean x) { - return deep9912(x); - } - - public static boolean deep9912(boolean x) { - return deep9913(x); - } - - public static boolean deep9913(boolean x) { - return deep9914(x); - } - - public static boolean deep9914(boolean x) { - return deep9915(x); - } - - public static boolean deep9915(boolean x) { - return deep9916(x); - } - - public static boolean deep9916(boolean x) { - return deep9917(x); - } - - public static boolean deep9917(boolean x) { - return deep9918(x); - } - - public static boolean deep9918(boolean x) { - return deep9919(x); - } - - public static boolean deep9919(boolean x) { - return deep9920(x); - } - - public static boolean deep9920(boolean x) { - return deep9921(x); - } - - public static boolean deep9921(boolean x) { - return deep9922(x); - } - - public static boolean deep9922(boolean x) { - return deep9923(x); - } - - public static boolean deep9923(boolean x) { - return deep9924(x); - } - - public static boolean deep9924(boolean x) { - return deep9925(x); - } - - public static boolean deep9925(boolean x) { - return deep9926(x); - } - - public static boolean deep9926(boolean x) { - return deep9927(x); - } - - public static boolean deep9927(boolean x) { - return deep9928(x); - } - - public static boolean deep9928(boolean x) { - return deep9929(x); - } - - public static boolean deep9929(boolean x) { - return deep9930(x); - } - - public static boolean deep9930(boolean x) { - return deep9931(x); - } - - public static boolean deep9931(boolean x) { - return deep9932(x); - } - - public static boolean deep9932(boolean x) { - return deep9933(x); - } - - public static boolean deep9933(boolean x) { - return deep9934(x); - } - - public static boolean deep9934(boolean x) { - return deep9935(x); - } - - public static boolean deep9935(boolean x) { - return deep9936(x); - } - - public static boolean deep9936(boolean x) { - return deep9937(x); - } - - public static boolean deep9937(boolean x) { - return deep9938(x); - } - - public static boolean deep9938(boolean x) { - return deep9939(x); - } - - public static boolean deep9939(boolean x) { - return deep9940(x); - } - - public static boolean deep9940(boolean x) { - return deep9941(x); - } - - public static boolean deep9941(boolean x) { - return deep9942(x); - } - - public static boolean deep9942(boolean x) { - return deep9943(x); - } - - public static boolean deep9943(boolean x) { - return deep9944(x); - } - - public static boolean deep9944(boolean x) { - return deep9945(x); - } - - public static boolean deep9945(boolean x) { - return deep9946(x); - } - - public static boolean deep9946(boolean x) { - return deep9947(x); - } - - public static boolean deep9947(boolean x) { - return deep9948(x); - } - - public static boolean deep9948(boolean x) { - return deep9949(x); - } - - public static boolean deep9949(boolean x) { - return deep9950(x); - } - - public static boolean deep9950(boolean x) { - return deep9951(x); - } - - public static boolean deep9951(boolean x) { - return deep9952(x); - } - - public static boolean deep9952(boolean x) { - return deep9953(x); - } - - public static boolean deep9953(boolean x) { - return deep9954(x); - } - - public static boolean deep9954(boolean x) { - return deep9955(x); - } - - public static boolean deep9955(boolean x) { - return deep9956(x); - } - - public static boolean deep9956(boolean x) { - return deep9957(x); - } - - public static boolean deep9957(boolean x) { - return deep9958(x); - } - - public static boolean deep9958(boolean x) { - return deep9959(x); - } - - public static boolean deep9959(boolean x) { - return deep9960(x); - } - - public static boolean deep9960(boolean x) { - return deep9961(x); - } - - public static boolean deep9961(boolean x) { - return deep9962(x); - } - - public static boolean deep9962(boolean x) { - return deep9963(x); - } - - public static boolean deep9963(boolean x) { - return deep9964(x); - } - - public static boolean deep9964(boolean x) { - return deep9965(x); - } - - public static boolean deep9965(boolean x) { - return deep9966(x); - } - - public static boolean deep9966(boolean x) { - return deep9967(x); - } - - public static boolean deep9967(boolean x) { - return deep9968(x); - } - - public static boolean deep9968(boolean x) { - return deep9969(x); - } - - public static boolean deep9969(boolean x) { - return deep9970(x); - } - - public static boolean deep9970(boolean x) { - return deep9971(x); - } - - public static boolean deep9971(boolean x) { - return deep9972(x); - } - - public static boolean deep9972(boolean x) { - return deep9973(x); - } - - public static boolean deep9973(boolean x) { - return deep9974(x); - } - - public static boolean deep9974(boolean x) { - return deep9975(x); - } - - public static boolean deep9975(boolean x) { - return deep9976(x); - } - - public static boolean deep9976(boolean x) { - return deep9977(x); - } - - public static boolean deep9977(boolean x) { - return deep9978(x); - } - - public static boolean deep9978(boolean x) { - return deep9979(x); - } - - public static boolean deep9979(boolean x) { - return deep9980(x); - } - - public static boolean deep9980(boolean x) { - return deep9981(x); - } - - public static boolean deep9981(boolean x) { - return deep9982(x); - } - - public static boolean deep9982(boolean x) { - return deep9983(x); - } - - public static boolean deep9983(boolean x) { - return deep9984(x); - } - - public static boolean deep9984(boolean x) { - return deep9985(x); - } - - public static boolean deep9985(boolean x) { - return deep9986(x); - } - - public static boolean deep9986(boolean x) { - return deep9987(x); - } - - public static boolean deep9987(boolean x) { - return deep9988(x); - } - - public static boolean deep9988(boolean x) { - return deep9989(x); - } - - public static boolean deep9989(boolean x) { - return deep9990(x); - } - - public static boolean deep9990(boolean x) { - return deep9991(x); - } - - public static boolean deep9991(boolean x) { - return deep9992(x); - } - - public static boolean deep9992(boolean x) { - return deep9993(x); - } - - public static boolean deep9993(boolean x) { - return deep9994(x); - } - - public static boolean deep9994(boolean x) { - return deep9995(x); - } - - public static boolean deep9995(boolean x) { - return deep9996(x); - } - - public static boolean deep9996(boolean x) { - return deep9997(x); - } - - public static boolean deep9997(boolean x) { - return deep9998(x); - } - - public static boolean deep9998(boolean x) { - return deep9999(x); - } - - public static boolean deep9999(boolean x) { - return deep10000(x); - } - - public static boolean deep10000(boolean x) { - return true; - } - - public static void main(String[] args) { - foo(randBool()); - } - - /** Helper method to obtain a random boolean */ - static boolean randBool() { - return System.currentTimeMillis() % 2 == 0; - } - - /** Helper methot to obtain a random integer */ - static int randInt() { - return (int) System.currentTimeMillis(); - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple6.class b/benchmarks/src/test/resources/ifspec/simple/Simple6.class deleted file mode 100644 index c1ffa2b82ecf..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple6.java b/benchmarks/src/test/resources/ifspec/simple/Simple6.java deleted file mode 100644 index a0ed892c93bd..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple6.java +++ /dev/null @@ -1,15 +0,0 @@ -class Simple6 { - - public static void main(String[] args) { - leakyMethod(randInt()); - } - - public static int leakyMethod(int high) { - return high; - } - - /** Helper method to obtain a random integer */ - static int randInt() { - return 42; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple7.class b/benchmarks/src/test/resources/ifspec/simple/Simple7.class deleted file mode 100644 index e9abf7413f03..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple7.java b/benchmarks/src/test/resources/ifspec/simple/Simple7.java deleted file mode 100644 index e0da4db29f31..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple7.java +++ /dev/null @@ -1,16 +0,0 @@ -class Simple7 { - public static void main(String args[]) { - f(randInt(), randInt()); - } - - public static int f(int h, int l) { - l = h; - return l; - } - - /** Helper methot to obtain a random integer */ - static int randInt() { - return 42; - } - -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple8.class b/benchmarks/src/test/resources/ifspec/simple/Simple8.class deleted file mode 100644 index db7bda7b2ad5..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple8.java b/benchmarks/src/test/resources/ifspec/simple/Simple8.java deleted file mode 100644 index 524f6bfb6816..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple8.java +++ /dev/null @@ -1,15 +0,0 @@ -class Simple8 { - - public static void main(String[] args) { - leakyMethod(randInt()); - } - - public static int leakyMethod(int high) { - return 0; - } - - /** Helper methot to obtain a random integer */ - static int randInt() { - return 42; - } -} diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple9.class b/benchmarks/src/test/resources/ifspec/simple/Simple9.class deleted file mode 100644 index 4571a6168c60..000000000000 Binary files a/benchmarks/src/test/resources/ifspec/simple/Simple9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/ifspec/simple/Simple9.java b/benchmarks/src/test/resources/ifspec/simple/Simple9.java deleted file mode 100644 index 411d658b9f23..000000000000 --- a/benchmarks/src/test/resources/ifspec/simple/Simple9.java +++ /dev/null @@ -1,25 +0,0 @@ -class Simple9 { - public static int low; - private static int high; - - public static void main(String[] args) { - Simple9 ifm = new Simple9(); - ifm.secure_if_high_n5_n1(); - } - - void secure_if_high_n5_n1() { - if (high > 0) { - low = n5(high); - } else { - high = -high; - low = n5(high + low); - } - - } - - int n5(int x) { - high = 2 * x; - return 15; - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/basic/Basic1.class b/benchmarks/src/test/resources/jinfoflow/basic/Basic1.class deleted file mode 100644 index 11c5489a7797..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/basic/Basic1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/basic/Basic1.java b/benchmarks/src/test/resources/jinfoflow/basic/Basic1.java deleted file mode 100644 index b68b1cef1195..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/basic/Basic1.java +++ /dev/null @@ -1,20 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Basic1 { - public static void main(String[] args) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader("source")); - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - String input = reader.readLine(); // source - - Object[] stuff = new Object[] { input, "inkling", 23 }; - - - writer.println((String) stuff[0]); // bad - - writer.println((Integer) stuff[0]); // ok, ClassCastException - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/basic/Basic2.class b/benchmarks/src/test/resources/jinfoflow/basic/Basic2.class deleted file mode 100644 index 2a51be4de926..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/basic/Basic2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/basic/Basic2.java b/benchmarks/src/test/resources/jinfoflow/basic/Basic2.java deleted file mode 100644 index ab15b10159ce..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/basic/Basic2.java +++ /dev/null @@ -1,16 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Basic2 { - public static void main(String[] args) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader("source")); - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - String input = reader.readLine(); // source - String out1 = (input.length() < 4) ? "xyz" : "xyw"; - writer.println(out1.substring(0, 1)); // ok - writer.println(input.substring(0, 10).substring(0, 5)); // bad - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1$Box.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1$Box.class deleted file mode 100644 index 93505a75eee5..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1$Box.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.class deleted file mode 100644 index 0ad27a00cac5..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.java b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.java deleted file mode 100644 index 5706dae96f46..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx1.java +++ /dev/null @@ -1,49 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Ctx1 { - - - static class Box { - String o; - - Box(String o) { - this.o = o; - } - - String get() { - return get1(); - } - - String get1() { - return get2(); - } - - String get2() { - return get3(); - } - - String get3() { - return o; - } - - } - - public static String boxGetter(Box box) { - return box.get(); - } - - public static void main(String[] args) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader("source")); - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - - Box box = new Box(reader.readLine()); // source - Box box2 = new Box("Hello world!"); - - writer.println(boxGetter(box)); // bad - writer.println(boxGetter(box2)); // ok - - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box1.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box1.class deleted file mode 100644 index aa892f1be51b..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box2.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box2.class deleted file mode 100644 index 89427ab4c7b5..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2$Box2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.class deleted file mode 100644 index ddf23077afb4..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.java b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.java deleted file mode 100644 index 7ef74ab350f8..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx2.java +++ /dev/null @@ -1,38 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Ctx2 { - static class Box1 { - private Object o; - Box1(Object o) { - this.o = o; - } - Object get() { return o; } - } - - static class Box2 { - private Box1 box1; - Box2(Object o) { - box1 = new Box1(o); - } - - Object get() { - return get1(); - } - - private Object get1() { - return box1.get(); - } - } - - public static void main(String[] args) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader("source")); - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - Box2 box2 = new Box2(reader.readLine()); // source - String out = (String) box2.get(); - writer.println(out); // sink - - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$CensoredPrintWriter.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$CensoredPrintWriter.class deleted file mode 100644 index be96c657c231..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$CensoredPrintWriter.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$UpgradedPrintWriter.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$UpgradedPrintWriter.class deleted file mode 100644 index a60fe143efd2..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3$UpgradedPrintWriter.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.class deleted file mode 100644 index 0de41a0a938a..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.java b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.java deleted file mode 100644 index 581f3aa5befa..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx3.java +++ /dev/null @@ -1,37 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Ctx3 { - static class CensoredPrintWriter extends PrintWriter { - public CensoredPrintWriter(PrintWriter out) { - super(out); - } - - public void println(String st) { - // do nothing - } - } - - static class UpgradedPrintWriter extends PrintWriter { - public UpgradedPrintWriter(PrintWriter out) { - super(out); - } - - public void println(String st) { - super.println(">> " + st); - } - } - - public static void main(String[] args) throws IOException { - PrintWriter writer = new CensoredPrintWriter(new PrintWriter(new FileWriter("sink"))); - PrintWriter writer2 = new UpgradedPrintWriter(new PrintWriter(new FileWriter("sink"))); - - BufferedReader reader = new BufferedReader(new FileReader("source")); - - writer.println(reader.readLine()); // ok - - writer2.println(reader.readLine()); // bad - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$CensoredBufferedReader.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$CensoredBufferedReader.class deleted file mode 100644 index f4957c6da43b..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$CensoredBufferedReader.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$UpgradedBufferedReader.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$UpgradedBufferedReader.class deleted file mode 100644 index ab64fd9bbeb9..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4$UpgradedBufferedReader.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.class deleted file mode 100644 index 76662b5962e6..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.java b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.java deleted file mode 100644 index a8d3ebec1d4f..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx4.java +++ /dev/null @@ -1,36 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Ctx4 { - static class CensoredBufferedReader extends BufferedReader { - public CensoredBufferedReader(Reader in) { - super(in); - } - - public String readLine() { - return "Safe string"; - } - } - - static class UpgradedBufferedReader extends BufferedReader { - public UpgradedBufferedReader(Reader in) { - super(in); - } - - public String readLine() throws IOException { - return ">> " + super.readLine(); - } - } - - public static void main(String[] args) throws IOException { - BufferedReader reader = new CensoredBufferedReader(new FileReader("source")); - BufferedReader reader2 = new UpgradedBufferedReader(new FileReader("source")); - - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - writer.println(reader.readLine()); // ok - - writer.println(reader2.readLine()); // bad - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.class b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.class deleted file mode 100644 index 4d0fea856dd0..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.java b/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.java deleted file mode 100644 index 714b11503ab6..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/ctx/Ctx5.java +++ /dev/null @@ -1,17 +0,0 @@ -import java.io.*; - -/** - * Created by neville on 07/11/2016. - */ -public class Ctx5 { - public static void main(String[] args) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader("source")); - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - writer.println(id(reader.readLine())); // source and sink - writer.println(id("Hello")); // ok - } - - public static String id(String o) { - return o; - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events1.class b/benchmarks/src/test/resources/jinfoflow/events/Events1.class deleted file mode 100644 index 7bf033e404e4..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events1.java b/benchmarks/src/test/resources/jinfoflow/events/Events1.java deleted file mode 100644 index 4284c38569b0..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/Events1.java +++ /dev/null @@ -1,42 +0,0 @@ -import eventframework.EventDriver; -import eventframework.EventHandler; -import events.NewEntityEvent; -import events.NewTransactionEvent; - -import java.io.*; - -/** - * Created by neville on 01/11/2016. - */ -public class Events1 implements EventHandler{ - - PrintWriter writer = null; - - public Events1() throws IOException{ - - writer = new PrintWriter(new FileWriter("sink")); - } - - public static void main(String[] args) throws IOException{ - BufferedReader reader = new BufferedReader(new FileReader("source")); - Events1 app = new Events1(); - EventDriver driver = new EventDriver(); - driver.registerAsEventHandler(app); - NewEntityEvent event = (NewEntityEvent) driver.newEvent("NewEntity"); - NewTransactionEvent event2 = (NewTransactionEvent) driver.newEvent("NewTransaction"); - event.setId(reader.readLine()); - event2.setDestinationEntityId(reader.readLine()); - driver.raiseEvent(event); - driver.raiseEvent(event2); - } - - public void handleNewEntity(NewEntityEvent e) throws IOException { - writer.println(e.getId()); // not ok - writer.flush(); - } - - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - writer.println("foo"); // ok - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events2.class b/benchmarks/src/test/resources/jinfoflow/events/Events2.class deleted file mode 100644 index 7a70f4ffb3c2..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events2.java b/benchmarks/src/test/resources/jinfoflow/events/Events2.java deleted file mode 100644 index 2fb7e70cb9dc..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/Events2.java +++ /dev/null @@ -1,45 +0,0 @@ -import eventframework.Event; -import eventframework.EventDriver; -import eventframework.EventHandler; -import events.NewEntityEvent; -import events.NewTransactionEvent; - -import java.io.*; - -/** - * Created by neville on 01/11/2016. - */ -public class Events2 implements EventHandler{ - - private final String tainted; - PrintWriter writer = null; - EventDriver driver = null; - - public Events2(EventDriver driver, String tainted) throws IOException{ - this.driver = driver; - this.tainted = tainted; - writer = new PrintWriter(new FileWriter("sink")); - driver.registerAsEventHandler(this); - - } - - public static void main(String[] args) throws IOException{ - BufferedReader reader = new BufferedReader(new FileReader("source")); - - EventDriver driver = new EventDriver(); - Events2 app = new Events2(driver, reader.readLine()); - Event event = driver.newEvent("NewEntity"); - driver.raiseEvent(event); - } - - public void handleNewEntity(NewEntityEvent e) throws IOException { - Event e1 = driver.newEvent("NewTransaction"); - e1.setMetaData(tainted); - driver.raiseEvent(e1); - } - - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - writer.println(e.getMetaData()); // bad - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events3.class b/benchmarks/src/test/resources/jinfoflow/events/Events3.class deleted file mode 100644 index 17208a60fc81..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events3.java b/benchmarks/src/test/resources/jinfoflow/events/Events3.java deleted file mode 100644 index f1b32a8a8888..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/Events3.java +++ /dev/null @@ -1,43 +0,0 @@ -import eventframework.*; -import events.NewEntityEvent; -import events.NewTransactionEvent; - -import java.io.*; - -/** - * Created by neville on 01/11/2016. - */ -public class Events3 implements EventHandler{ - - private final EventDriver driver; - PrintWriter writer = null; - - public Events3(EventDriver driver) throws IOException{ - this.driver = driver; - writer = new PrintWriter(new FileWriter("sink")); - } - - public static void main(String[] args) throws IOException{ - BufferedReader reader = new BufferedReader(new FileReader("source")); - - EventDriver driver = new EventDriver(); - Events3 app = new Events3(driver); - - driver.registerAsEventHandler(app); - NewEntityEvent event = (NewEntityEvent) driver.newEvent("NewEntity"); - event.setId(reader.readLine()); - driver.raiseEvent(event); - } - - public void handleNewEntity(NewEntityEvent e) throws IOException { - Event event = driver.newEvent("NewTransaction"); - event.setMetaData(e.getAggregateId()); - driver.raiseEvent(event); - } - - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - writer.println(e.getMetaData()); // bad - writer.println(e.getAggregateId()); // ok - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events4.class b/benchmarks/src/test/resources/jinfoflow/events/Events4.class deleted file mode 100644 index a0fba81fc339..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events4.java b/benchmarks/src/test/resources/jinfoflow/events/Events4.java deleted file mode 100644 index 63c1aea9b243..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/Events4.java +++ /dev/null @@ -1,48 +0,0 @@ -import eventframework.Event; -import eventframework.EventDriver; -import eventframework.EventHandler; -import events.NewEntityEvent; -import events.NewTransactionEvent; -import events.UnusedEvent; - -import java.io.*; - -/** - * Created by neville on 01/11/2016. - */ -public class Events4 implements EventHandler{ - - private final String _tainted; - - private String tainted; - - PrintWriter writer = null; - EventDriver driver = null; - - public Events4(EventDriver driver, String tainted) throws IOException{ - this.driver = driver; - this._tainted = tainted; - writer = new PrintWriter(new FileWriter("sink")); - driver.registerAsEventHandler(this); - } - - public static void main(String[] args) throws IOException{ - BufferedReader reader = new BufferedReader(new FileReader("source")); - EventDriver driver = new EventDriver(); - Events4 app = new Events4(driver, reader.readLine()); - Event event = driver.newEvent("NewEntity"); - event.setMetaData("NewTransaction"); - driver.raiseEvent(event); - driver.raiseEvent(event); - } - - public void handleNewEntity(NewEntityEvent e) throws IOException { - driver.raiseEvent(driver.newEvent(e.getMetaData())); - writer.println(tainted); // not ok second time round - } - - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - this.tainted = _tainted; // ok - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events5$AnotherEventHandler.class b/benchmarks/src/test/resources/jinfoflow/events/Events5$AnotherEventHandler.class deleted file mode 100644 index afab7ee08a57..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events5$AnotherEventHandler.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events5.class b/benchmarks/src/test/resources/jinfoflow/events/Events5.class deleted file mode 100644 index f6a690e1dba2..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/Events5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/Events5.java b/benchmarks/src/test/resources/jinfoflow/events/Events5.java deleted file mode 100644 index f6452e3f5ca8..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/Events5.java +++ /dev/null @@ -1,52 +0,0 @@ -import eventframework.Event; -import eventframework.EventDriver; -import eventframework.EventHandler; -import eventframework.UninitialisedEvent; -import events.NewEntityEvent; -import events.NewTransactionEvent; - -import java.io.*; - -/** - * Created by neville on 01/11/2016. - */ -public class Events5 implements EventHandler{ - - PrintWriter writer = new PrintWriter(new FileWriter("sink")); - BufferedReader reader = new BufferedReader(new FileReader("source")); - - class AnotherEventHandler implements EventHandler { - private PrintWriter writer; - - AnotherEventHandler(PrintWriter writer) { - this.writer = writer; - } - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - writer.println(e.getDestinationEntityId()); // bad - } - } - - public Events5() throws IOException{ - writer = new PrintWriter(new FileWriter("sink")); - reader = new BufferedReader(new FileReader("source")); - } - - public void start() throws IOException { - EventDriver driver = new EventDriver(); - driver.registerAsEventHandler(this); - AnotherEventHandler anotherEventHandler = new AnotherEventHandler(writer); - // succinct way of invoking event - driver.createEvent("NewTransaction").apply("setDestinationEntityId", reader.readLine()).raiseEvent(); - } - - public static void main(String[] args) throws IOException { - Events5 app = new Events5(); - app.start(); - - } - - public void handleNewTransaction(NewTransactionEvent e) throws IOException { - writer.println("foo"); // ok - } - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.class b/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.class deleted file mode 100644 index 1f583af01b98..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.java b/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.java deleted file mode 100644 index 05a8a2ff3ba2..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/eventframework/Event.java +++ /dev/null @@ -1,26 +0,0 @@ -package eventframework; - -import java.io.Serializable; - -/** - * Created by neville on 01/11/2016. - */ -public abstract class Event { - public abstract String getEventName(); - - private String metaData; - - public abstract String getAggregateId(); - - public void setMetaData(String metaData) { - this.metaData = metaData; - } - - public String getMetaData() { - return metaData; - } - - public abstract Event getCopy(); - - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.class b/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.class deleted file mode 100644 index b2cef67de2ea..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.java b/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.java deleted file mode 100644 index 8a3925e16c4e..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventDriver.java +++ /dev/null @@ -1,74 +0,0 @@ -package eventframework; - -import events.NewEntityEvent; -import events.NewTransactionEvent; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; - -/** - * Created by neville on 01/11/2016. - */ -public class EventDriver { - - private Collection eventHandlers = new ArrayList(); - - - public Event newEvent(String eventName) { - Event event; - try { - event = (Event) Class.forName("events." + eventName + "Event").newInstance(); - event.setMetaData(metaData); - } catch (InstantiationException e1) { - e1.printStackTrace(); - return null; - } catch (IllegalAccessException e1) { - e1.printStackTrace(); - return null; - } catch (ClassNotFoundException e1) { - e1.printStackTrace(); - return null; - } - return event; - } - - public UninitialisedEvent createEvent(String eventName) { - return new UninitialisedEvent(this, newEvent(eventName)); - } - - public void raiseEvent(Event event) { - String eventName = "handle" + event.getEventName(); - for (EventHandler eventHandler : eventHandlers) { - Boolean hasHandler = false; - for (Method method: eventHandler.getClass().getMethods()) { - if (method.getName().equals(eventName)) { - hasHandler = true; - break; - } - } - // a fancy way to calling the appropriate event handler - - try { - if (hasHandler) { - Method handlerMethod = eventHandler.getClass().getMethod(eventName, event.getClass()); - handlerMethod.invoke(eventHandler, new Object[] { event }); - } - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } - } - - public void registerAsEventHandler(EventHandler eventHandler) { - eventHandlers.add(eventHandler); - } - - private String metaData; - -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.class b/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.class deleted file mode 100644 index 9b4393f3da30..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.java b/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.java deleted file mode 100644 index 0a52a0c59cc0..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/eventframework/EventHandler.java +++ /dev/null @@ -1,7 +0,0 @@ -package eventframework; - -/** - * Created by neville on 01/11/2016. - */ -public interface EventHandler { -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.class b/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.class deleted file mode 100644 index d877fde22085..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.java b/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.java deleted file mode 100644 index 61b00c6cd46a..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/eventframework/UninitialisedEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -package eventframework; - -import java.lang.reflect.InvocationTargetException; - -/** - * Created by neville on 01/11/2016. - */ -public class UninitialisedEvent { - private final Event event; - private final EventDriver driver; - - public UninitialisedEvent(EventDriver driver, Event event) { - this.driver = driver; - this.event = event; - } - - public UninitialisedEvent apply(String name, Object value) { - try { - event.getClass().getMethod(name, value.getClass()).invoke(event, value); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - return this; - } - - public void raiseEvent() { - driver.raiseEvent(event); - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.class b/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.class deleted file mode 100644 index e1a1f46ed018..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.java b/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.java deleted file mode 100644 index 339ec3915d6f..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/events/NewEntityEvent.java +++ /dev/null @@ -1,55 +0,0 @@ -package events; - -import eventframework.Event; - -import java.math.BigDecimal; - -/** - * Created by neville on 01/11/2016. - */ -public class NewEntityEvent extends Event { - - private String id; - - private String name; - - private BigDecimal balance; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } - - @Override - public String getEventName() { - return "NewEntity"; - } - - @Override - public String getAggregateId() { - return getId(); - } - - public Event getCopy() { - return null; - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.class b/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.class deleted file mode 100644 index 53f1cf61ba7d..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.java b/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.java deleted file mode 100644 index 2d60b1e1143d..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/events/NewTransactionEvent.java +++ /dev/null @@ -1,67 +0,0 @@ -package events; - -import eventframework.Event; - -import java.math.BigDecimal; - -/** - * Created by neville on 01/11/2016. - */ -public class NewTransactionEvent extends Event { - - public static final String EVENT_NAME = "NewTransaction"; - - private String originatorEntityId; - - private String destinationEntityId; - - private BigDecimal amount; - - private String reason; - - public BigDecimal getAmount() { - return amount; - } - - public void setAmount(BigDecimal amount) { - this.amount = amount; - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason; - } - - @Override - public String getEventName() { - return "NewTransaction"; - } - - @Override - public String getAggregateId() { - return originatorEntityId; - } - - public Event getCopy() { - return null; - } - - public String getOriginatorEntityId() { - return originatorEntityId; - } - - public void setOriginatorEntityId(String originatorEntityId) { - this.originatorEntityId = originatorEntityId; - } - - public String getDestinationEntityId() { - return destinationEntityId; - } - - public void setDestinationEntityId(String destinationEntityId) { - this.destinationEntityId = destinationEntityId; - } -} diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.class b/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.class deleted file mode 100644 index 66c3961b5bee..000000000000 Binary files a/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.class and /dev/null differ diff --git a/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.java b/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.java deleted file mode 100644 index 1794d7e42266..000000000000 --- a/benchmarks/src/test/resources/jinfoflow/events/events/UnusedEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package events; - -import eventframework.Event; - -/** - * Created by neville on 08/11/2016. - */ -public class UnusedEvent extends Event { - - public String getEventName() { - return null; - } - - public String getAggregateId() { - return null; - } - - public Event getCopy() { - return null; - } -} diff --git a/benchmarks/src/test/resources/log4j2.xml b/benchmarks/src/test/resources/log4j2.xml deleted file mode 120000 index acfc3e9772b2..000000000000 --- a/benchmarks/src/test/resources/log4j2.xml +++ /dev/null @@ -1 +0,0 @@ -../../../../joern-cli/src/universal/conf/log4j2.xml \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/BasicTestCase.class b/benchmarks/src/test/resources/securibench/micro/BasicTestCase.class deleted file mode 100644 index 144a3edc89f4..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/BasicTestCase.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/BasicTestCase.java b/benchmarks/src/test/resources/securibench/micro/BasicTestCase.java deleted file mode 100644 index 4c03c85c41ef..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/BasicTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - $Id: BasicTestCase.java,v 1.5 2006/04/21 17:14:24 livshits Exp $ -*/ -package securibench.micro; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public abstract class BasicTestCase extends HttpServlet { - protected void doTrace(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException - { - // do nothing - } - - protected void doHead(HttpServletRequest req, HttpServletResponse resp) - throws ServletException, IOException - { - // do nothing - } - - protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { - // do nothing - } - - protected void doDelete(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { - // do nothing - } - - protected void doPut(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { - // do nothing - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/MicroTestCase.class b/benchmarks/src/test/resources/securibench/micro/MicroTestCase.class deleted file mode 100644 index 4e5d21779558..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/MicroTestCase.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/MicroTestCase.java b/benchmarks/src/test/resources/securibench/micro/MicroTestCase.java deleted file mode 100644 index 79b604ea23b2..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/MicroTestCase.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2005 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/* - $Id: MicroTestCase.java,v 1.4 2005/11/26 22:18:19 livshits Exp $ - */ -package securibench.micro; - -/** - * An interface all test cases are supposed to implement this interface. - * - * At the top of you case, place the following two keywords: - * - * \@servlet description="..." - * \@servlet vuln_count = "1" - * - * These values will be used by the test harness. - * */ -public interface MicroTestCase { - public String CONNECTION_STRING = "jdbc:dtF:E. coli;USR=dtfadm;PWD=dtfadm;Create=always;APPL=GIVE;DType=FILE"; - - /** - * A brief textual description of the test case. - * */ - public String getDescription(); - - /** - * Expected number of vulnerabilities in the test case. - * */ - public int getVulnerabilityCount(); -} diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.class deleted file mode 100644 index 1666b8e46055..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.java deleted file mode 100644 index b421cd66370d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing1.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Aliasing1.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple aliasing because of assignment" - * @servlet vuln_count = "1" - * */ -public class Aliasing1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String str = name; - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - } - - public String getDescription() { - return "simple test of field assignment"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.class deleted file mode 100644 index aee4ca9e2cc5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.java deleted file mode 100644 index f4509e6242cd..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing2.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - *//** - @author Benjamin Livshits - - $Id: Aliasing2.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple aliasing false positive" - * @servlet vuln_count = "1" - * */ -public class Aliasing2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String str = "abc"; - name = str; - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* OK */ - } - - public String getDescription() { - return "simple aliasing false positive"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.class deleted file mode 100644 index da2b4538cb41..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.java deleted file mode 100644 index 8774ba2b270f..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing3.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - *//** - @author Benjamin Livshits - - $Id: Aliasing3.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple aliasing of an array element" - * @servlet vuln_count = "1" - * */ -public class Aliasing3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String[] a = new String[10]; - String str = a[5]; - a[5] = name; - name = str; - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - } - - public String getDescription() { - return "simple aliasing of an array element"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.class deleted file mode 100644 index 9fe4f10f6cbc..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.java deleted file mode 100644 index 430402c2263d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing4.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - *//** - @author Benjamin Livshits - - $Id: Aliasing4.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple aliasing with casts" - * @servlet vuln_count = "1" - * */ -public class Aliasing4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - Object o1 = name; - Object o2 = name.concat("abc"); - Object o3 = "anc"; - - PrintWriter writer = resp.getWriter(); - writer.println(o1); /* BAD */ - writer.println(o2); /* BAD */ - writer.println(o3); /* OK */ - } - - public String getDescription() { - return "simple aliasing with casts"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.class deleted file mode 100644 index 9650b063240a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.java deleted file mode 100644 index cdc227e90741..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing5.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - *//** - @author Benjamin Livshits - - $Id: Aliasing5.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="interprocedural argument aliasing" - * @servlet vuln_count = "1" - * */ -public class Aliasing5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - StringBuffer buf = new StringBuffer("abc"); - foo(buf, buf, resp, req); - } - - void foo(StringBuffer buf, StringBuffer buf2, ServletResponse resp, ServletRequest req) throws IOException { - String name = req.getParameter(FIELD_NAME); - buf.append(name); - PrintWriter writer = resp.getWriter(); - writer.println(buf2.toString()); /* BAD */ - } - - public String getDescription() { - return "interprocedural argument aliasing"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.class b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.class deleted file mode 100644 index d64b4addcbd3..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.java b/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.java deleted file mode 100644 index 97193cad94c8..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/aliasing/Aliasing6.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - *//** - @author Benjamin Livshits - - $Id: Aliasing6.java,v 1.1 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.aliasing; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="aliasing with copy propagation" - * @servlet vuln_count = "7" - * */ -public class Aliasing6 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String[] names = req.getParameterValues(FIELD_NAME); - Object - o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18, o19, o20, - o21, o22, o23, o24, o25, o26, o27, o28, o29, o30, o31, o32, o33, o34, o35, o36, o37, o38, o39, o40; - o1 = o2 = o3 = o4 = o5 = o6 = o7 = o8 = o9 = o10 = o11 = o12 = o13 = o14 = o15 = o16 = o17 = o18 = o19 = o20 = - o21 = o22 = o23 = o24 = o25 = o26 = o27 = o28 = o29 = o30 = o31 = o32 = o33 = o34 = o35 = o36 = o37 = o38 = o39 = o40 = - names[0]; - - PrintWriter writer = resp.getWriter(); - writer.println(o1); /* BAD */ - writer.println(o2); /* BAD */ - writer.println(o3); /* BAD */ - writer.println(o4); /* BAD */ - writer.println(o32); /* BAD */ - writer.println(o37); /* BAD */ - writer.println(o40); /* BAD */ - } - - public String getDescription() { - return "aliasing with copy propagation"; - } - - public int getVulnerabilityCount() { - return 7; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.class deleted file mode 100644 index 8549cd65ee24..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.java deleted file mode 100644 index 853ba1f36c42..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays1.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays1.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="a simple array test" - * @servlet vuln_count = "1" - * */ -public class Arrays1 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String[] array = new String[10]; - array[0] = s1; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - } - - public String getDescription() { - return "a simple array test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.class deleted file mode 100644 index 1fca746a8446..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.java deleted file mode 100644 index 8ba22dc7ad42..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays10.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays10.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "comple multidimentional array test" - * @servlet vuln_count = "1" - * */ -public class Arrays10 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[][] array = new String[3][5]; - array[0] = new String[] {name, "abc"}; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0][0]); /* BAD */ - writer.println(array[0][2]); /* OK */ - } - - public String getDescription() { - return "comple multidimentional array test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.class deleted file mode 100644 index 77e540a44182..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.java deleted file mode 100644 index 0e8bc1b003ed..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays2.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays2.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "a more complex array test" - * @servlet vuln_count = "1" - * */ -public class Arrays2 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String[] array = new String[10]; - array[0] = s1; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - writer.println(array[1]); /* OK */ - writer.println(array[2]); /* OK */ - } - - public String getDescription() { - return "a more complex array test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.class deleted file mode 100644 index 413449ee88c5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.java deleted file mode 100644 index 63f02f07abe8..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays3.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays3.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "a more complex array test" - * @servlet vuln_count = "1" - * */ -public class Arrays3 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String[] array1 = new String[10]; - String[] array2 = new String[10]; - - array1[0] = s1; - array2[0] = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(array1[0]); /* BAD */ - writer.println(array2[0]); /* OK */ - } - - public String getDescription() { - return "a more complex array test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.class deleted file mode 100644 index 54d28b48eb29..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.java deleted file mode 100644 index 4c19f37bc925..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays4.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays4.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "a test of array indeces" - * @servlet vuln_count = "1" - * */ -public class Arrays4 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - int n = 15432532; - - String[] array = new String[10]; - array[0] = name; - - PrintWriter writer = resp.getWriter(); - writer.println(array[n-n]); /* BAD */ - } - - public String getDescription() { - return "a test of array indeces"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.class deleted file mode 100644 index 5b7f9eb07c95..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.java deleted file mode 100644 index 217bb0f1b2ba..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays5.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays5.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "strong updates to array elements" - * @servlet vuln_count = "0" - * */ -public class Arrays5 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[] array = new String[10]; - - array[0] = name; - array[0] = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* OK */ - } - - public String getDescription() { - return "strong updates to array elements"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.class deleted file mode 100644 index 222358598d5c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.java deleted file mode 100644 index cd78f7677ce6..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays6.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays6.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "strong updates to array elements" - * @servlet vuln_count = "1" - * */ -public class Arrays6 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[] array = new String[10]; - - array[0] = "abc"; - array[0] = name; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - } - - public String getDescription() { - return "strong updates to array elements"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.class deleted file mode 100644 index 4f72b840693f..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.java deleted file mode 100644 index 11b271308e29..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays7.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays7.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of array initializers" - * @servlet vuln_count = "1" - * */ -public class Arrays7 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[] array = new String[] {name, "abc"}; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - } - - public String getDescription() { - return "test of array initializers"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.class deleted file mode 100644 index 9e029209a7ec..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.java deleted file mode 100644 index 8a2770ac24bb..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays8.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays8.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of array initializers" - * @servlet vuln_count = "1" - * */ -public class Arrays8 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[] array = new String[] {name, "abc"}; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - writer.println(array[1]); /* OK */ - } - - public String getDescription() { - return "test of array initializers"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.class b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.class deleted file mode 100644 index 99e139905e65..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.java b/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.java deleted file mode 100644 index 7718190d8c2a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/arrays/Arrays9.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Arrays9.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.arrays; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "multidimentional arrays" - * @servlet vuln_count = "1" - * */ -public class Arrays9 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - String[][] array = new String[3][5]; - array[0][0] = name; - - PrintWriter writer = resp.getWriter(); - writer.println(array[0][0]); /* BAD */ - } - - public String getDescription() { - return "multidimentional arrays"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic1.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic1.class deleted file mode 100644 index 53d616ccac60..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic1.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic1.java deleted file mode 100644 index 33e7638b0c63..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic1.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic1.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="very simple XSS" - * @servlet vuln_count = "1" - * */ -public class Basic1 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String str = req.getParameter("name"); - PrintWriter writer = resp.getWriter(); - - writer.println(str); /* BAD */ - } - - public String getDescription() { - return "very simple XSS"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic10.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic10.class deleted file mode 100644 index ee62af9299cd..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic10.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic10.java deleted file mode 100644 index 9aa5cf35dcef..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic10.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic10.java,v 1.5 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="chains of value assignments" - * @servlet vuln_count = "1" - * */ -public class Basic10 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1; - String s3 = s2; - String s4 = s3; - StringBuffer b1 = new StringBuffer(s4); - //StringBuffer b2 = b1; - StringBuffer b3 = b1; - String s5 = b3.toString(); - String s6 = s5; - - PrintWriter writer = resp.getWriter(); - writer.println(s6); /* BAD */ - } - - public String getDescription() { - return "chains of value assignments"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic11.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic11.class deleted file mode 100644 index a9c364623d00..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic11.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic11.java deleted file mode 100644 index ca13e5ca5af1..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic11.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic11.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="a simple false positive because of two calls to String.toLowerCase" - * @servlet vuln_count = "2" - * */ -public class Basic11 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = "abc"; - String s3 = s1.toUpperCase(); - String s4 = s2.toUpperCase(); - - PrintWriter writer = resp.getWriter(); - writer.println(s3); /* BAD */ - writer.println(s1 + ";"); /* BAD */ - writer.println(s4); /* OK */ - } - - public String getDescription() { - return "a simple false positive because of two calls to String.toLowerCase"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic12.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic12.class deleted file mode 100644 index c01c474001c5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic12.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic12.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic12.java deleted file mode 100644 index 314ecb0c78ce..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic12.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic12.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="a simple conditional; both branches should be taken" - * @servlet vuln_count = "2" - * */ -public class Basic12 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - PrintWriter writer = resp.getWriter(); - boolean choice = new Random().nextBoolean(); - - if(choice) { - writer.println(s1 + ":"); /* BAD */ - } else{ - writer.println(s1 + ";"); /* BAD */ - } - - writer.println("\n"); /* OK */ - } - - public String getDescription() { - return "a simple conditional; both branches should be taken"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic13.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic13.class deleted file mode 100644 index 952ac4620801..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic13.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic13.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic13.java deleted file mode 100644 index 9650ba6d7de9..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic13.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic13.java,v 1.5 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="use getInitParameter instead" - * @servlet vuln_count = "1" - * */ -public class Basic13 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = getServletConfig().getInitParameter("name"); - PrintWriter writer = resp.getWriter(); - writer.println(s); /* BAD */ - } - - public String getDescription() { - return "use getInitParameterInstead"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic14.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic14.class deleted file mode 100644 index e24b03849edf..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic14.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic14.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic14.java deleted file mode 100644 index c004a3bebcea..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic14.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic14.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="use the servlet context and casts" - * @servlet vuln_count = "1" - * */ -public class Basic14 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - for(Enumeration e = getServletConfig().getInitParameterNames(); e.hasMoreElements(); ) { - String s = (String) e.nextElement(); - PrintWriter writer = resp.getWriter(); - writer.println(s); /* BAD */ - } - } - - public String getDescription() { - return "use the servlet context and casts"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic15.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic15.class deleted file mode 100644 index eb75410e24d2..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic15.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic15.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic15.java deleted file mode 100644 index fc5570fd0e3e..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic15.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic15.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - - -/** - * @servlet description="test casts more exhaustively" - * @servlet vuln_count = "1" - * */ -public class Basic15 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - Object o = s1 + ";"; - String s2 = (String) o; - StringBuffer buf = new StringBuffer(s2); - Object o2 = buf; - String s3 = ((StringBuffer) o2).toString(); - PrintWriter writer = resp.getWriter(); - writer.println(s3); /* BAD */ - } - - public String getDescription() { - return "test casts more exhaustively"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic16$Widget.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic16$Widget.class deleted file mode 100644 index b175f39ded61..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic16$Widget.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic16.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic16.class deleted file mode 100644 index 8e72ec817563..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic16.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic16.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic16.java deleted file mode 100644 index 2a3b2d54412d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic16.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic16.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple heap-allocated data strucure" - * @servlet vuln_count = "1" - * */ -public class Basic16 extends BasicTestCase implements MicroTestCase { - public class Widget { - String contents; - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - Widget w = new Widget(); - w.setContents(s); - - PrintWriter writer = resp.getWriter(); - writer.println(w.getContents()); /* BAD */ - } - - public String getDescription() { - return "simple heap-allocated data strucure"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic17$Widget.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic17$Widget.class deleted file mode 100644 index daba32f70887..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic17$Widget.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic17.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic17.class deleted file mode 100644 index 4d12ff203aee..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic17.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic17.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic17.java deleted file mode 100644 index 6cbcad8ebbe9..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic17.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic17.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple heap-allocated data strucure" - * @servlet vuln_count = "1" - * */ -public class Basic17 extends BasicTestCase implements MicroTestCase { - public class Widget { - String contents; - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - Widget w1 = new Widget(); - w1.setContents(s); - - Widget w2 = new Widget(); - w2.setContents("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(w1.getContents()); /* BAD */ - writer.println(w2.getContents()); /* OK */ - } - - public String getDescription() { - return "simple heap-allocated data strucure"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic18.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic18.class deleted file mode 100644 index b3e515825b95..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic18.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic18.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic18.java deleted file mode 100644 index ba90c5ac1ecd..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic18.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic18.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="protect agains simple loop unrolling" - * @servlet vuln_count = "1" - * */ -public class Basic18 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - - for(int i = 0; i < 100; i++) { - PrintWriter writer = resp.getWriter(); - if(i > 5 && (i % 17 == 0)) { - writer.println(s); /* BAD */ - } - } - } - - public String getDescription() { - return "protect agains simple loop unrolling"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic19.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic19.class deleted file mode 100644 index 9d13cfbb239c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic19.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic19.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic19.java deleted file mode 100644 index 8dd6cdc83afb..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic19.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic19.java,v 1.7 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple SQL injection with prepared statements" - * @servlet vuln_count = "1" - * */ -public class Basic19 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - - Connection con = null; - try { - con = DriverManager.getConnection(MicroTestCase.CONNECTION_STRING); - con.prepareStatement("select * from Users where name=" + name); /* BAD */ - } catch (SQLException e) { - System.err.println("An error occurred"); - } finally { - try { - if(con != null) con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - - public String getDescription() { - return "simple SQL injection with prepared statements"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic2.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic2.class deleted file mode 100644 index 4744d4e29b25..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic2.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic2.java deleted file mode 100644 index a0e669513a09..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic2.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic2.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="XSS combined with a simple conditional" - * @servlet vuln_count = "1" - * */ -public class Basic2 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String str = req.getParameter("name"); - Random r = new Random(); - boolean choice = r.nextBoolean(); - PrintWriter writer = resp.getWriter(); - - if(choice) { - writer.println(str); /* BAD */ - } - } - - public String getDescription() { - return "XSS combined with a simple conditional"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic20.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic20.class deleted file mode 100644 index 96aa72913ce4..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic20.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic20.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic20.java deleted file mode 100644 index 64c8f1fa6ead..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic20.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic20.java,v 1.7 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple SQL injection" - * @servlet vuln_count = "1" - * */ -public class Basic20 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - - Connection con = null; - try { - con = DriverManager.getConnection(MicroTestCase.CONNECTION_STRING); - Statement stmt = con.createStatement(); - stmt.execute("select * from Users where name=" + name); /* BAD */ - } catch (SQLException e) { - System.err.println("An error occurred"); - } finally { - try { - if(con != null) con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - } - - public String getDescription() { - return "simple SQL injection"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic21.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic21.class deleted file mode 100644 index f4d078a7b650..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic21.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic21.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic21.java deleted file mode 100644 index 727105b9a68f..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic21.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic21.java,v 1.7 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="SQL injection with less commonly used methods" - * @servlet vuln_count = "4" - * */ -public class Basic21 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - - Connection con = null; - try { - con = DriverManager.getConnection(MicroTestCase.CONNECTION_STRING); - Statement stmt = con.createStatement(); - stmt.executeUpdate("select * from Users where name=" + name); /* BAD */ - stmt.executeUpdate("select * from Users where name=" + name, 0); /* BAD */ - stmt.executeUpdate("select * from Users where name=" + name, /* BAD */ - new String[] {}); - stmt.executeQuery("select * from Users where name=" + name); /* BAD */ - } catch (SQLException e) { - System.err.println("An error occurred"); - } finally { - try { - if(con != null) con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - - public String getDescription() { - return "SQL injection with less commonly used methods"; - } - - public int getVulnerabilityCount() { - return 4; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic22.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic22.class deleted file mode 100644 index 0f7d7d2dff7c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic22.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic22.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic22.java deleted file mode 100644 index dc8c57138f68..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic22.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic22.java,v 1.5 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.File; -import java.io.IOException; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="basic path traversal" - * @servlet vuln_count = "1" - * */ -public class Basic22 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - - // this is not a problem just yet: it's perhaps okay to create a file file - // a tained filename, but not use it in any way - File f = new File(name); - // this is definitely bad; an error should be flagged either on this or the - // previous line - f.createNewFile(); /* BAD */ - } - - public String getDescription() { - return "basic path traversal"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic23.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic23.class deleted file mode 100644 index 90dad35720db..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic23.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic23.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic23.java deleted file mode 100644 index 433647e5481d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic23.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic23.java,v 1.6 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.FileInputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="path traversal" - * @servlet vuln_count = "3" - * */ -public class Basic23 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - - try { - /* FileWriter fw = */ new FileWriter(name); /* BAD */ - /* FileWriter fr = */ new FileWriter(name); /* BAD */ - /* FileInputStream fis = */ new FileInputStream(name); /* BAD */ - } catch(Throwable e) { - System.err.println("An error occurred"); - } - } - - public String getDescription() { - return "path traversal"; - } - - public int getVulnerabilityCount() { - return 3; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic24.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic24.class deleted file mode 100644 index 3536ad4f3285..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic24.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic24.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic24.java deleted file mode 100644 index ac6e0b5ff4ac..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic24.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic24.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="unsafe redirect" - * @servlet vuln_count = "1" - * */ -public class Basic24 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - - resp.sendRedirect("/user/" + name); /* BAD */ - } - - public String getDescription() { - return "unsafe redirect"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic25.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic25.class deleted file mode 100644 index 6adab395eabc..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic25.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic25.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic25.java deleted file mode 100644 index 661cee7becf5..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic25.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic25.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test getParameterValues" - * @servlet vuln_count = "1" - * */ -public class Basic25 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String[] s = req.getParameterValues(FIELD_NAME); - String name = s[0].toLowerCase(Locale.UK); - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - - public String getDescription() { - return "test getParameterValues"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic26.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic26.class deleted file mode 100644 index 96e3385efb65..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic26.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic26.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic26.java deleted file mode 100644 index 9efae23adb45..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic26.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic26.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test getParameterMap" - * @servlet vuln_count = "1" - * */ -public class Basic26 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Map m = req.getParameterMap(); - for(Iterator iter = m.entrySet().iterator(); iter.hasNext();) { - Map.Entry e = (Entry) iter.next(); - if(e.getKey().equals(FIELD_NAME)) { - PrintWriter writer = resp.getWriter(); - writer.println(e.getValue()); - } - } - } - - public String getDescription() { - return "test getParameterMap"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic27.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic27.class deleted file mode 100644 index 872fbbd3b289..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic27.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic27.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic27.java deleted file mode 100644 index a9a7e1ab558a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic27.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic27.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test getParameterMap" - * @servlet vuln_count = "1" - * */ -public class Basic27 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Enumeration e = req.getParameterNames(); - while(e.hasMoreElements()) { - String name = (String) e.nextElement(); - if(name.equals(FIELD_NAME)) { - PrintWriter writer = resp.getWriter(); - String value = req.getParameter(name); - writer.println("value: " + value); /* BAD */ - } - } - } - - public String getDescription() { - return "test getParameterMap"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic28.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic28.class deleted file mode 100644 index fbe57487d8c0..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic28.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic28.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic28.java deleted file mode 100644 index 4cabc956ea4a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic28.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic28.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="complicated control flow" - * @servlet vuln_count = "2" - */ -public class Basic28 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - boolean b[] = new boolean[3]; - PrintWriter writer = resp.getWriter(); - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - if (b[0]) { - } - } else { - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - writer.println(name); /* BAD */ - } else { - } - } else { - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - } - } else { - } - } else { - } - } - } - } - } else { - if (b[0]) { - if (b[0]) { - if (b[0]) { - writer.println(name); /* BAD */ - } - } else { - } - } else { - } - } - } - - public String getDescription() { - return "complicated control flow"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic29$Node.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic29$Node.class deleted file mode 100644 index d56e0ef126ac..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic29$Node.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic29.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic29.class deleted file mode 100644 index 5fd955a45180..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic29.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic29.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic29.java deleted file mode 100644 index b311d7c790f1..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic29.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - * @author Benjamin Livshits - * - * $Id: Basic29.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="recursive data structures" - * @servlet vuln_count = "2" - */ -public class Basic29 extends BasicTestCase implements MicroTestCase { - class Node { - String value; - Node next = null; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - Node head = new Node(); - Node next = new Node(); - head.next = next; - next.value = name; - - PrintWriter writer = resp.getWriter(); - writer.println(next.value); /* BAD */ - writer.println(head.next.value); /* BAD */ - writer.println(head.value); /* OK */ - } - - public String getDescription() { - return "recursive data structures"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic3.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic3.class deleted file mode 100644 index c4981794766b..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic3.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic3.java deleted file mode 100644 index bf10eb073091..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic3.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic3.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple derived string test" - * @servlet vuln_count = "1" - * */ -public class Basic3 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String str = req.getParameter("name"); - PrintWriter writer = resp.getWriter(); - String s2 = str.toLowerCase(); - - writer.println(s2); /* BAD */ - } - - public String getDescription() { - return "simple derived string test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic30$Data.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic30$Data.class deleted file mode 100644 index 8c968840d1b7..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic30$Data.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic30.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic30.class deleted file mode 100644 index 1a278a459bd5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic30.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic30.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic30.java deleted file mode 100644 index 66d2b74cf5e7..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic30.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic30.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="field sensitivity" - * @servlet vuln_count = "1" - */ -public class Basic30 extends BasicTestCase implements MicroTestCase { - class Data { - String value1; - String value2; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter("name"); - Data d = new Data(); - d.value2 = name; - d.value1 = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(d.value1); /* OK */ - writer.println(d.value2); /* BAD */ - } - - public String getDescription() { - return "field sensitivity"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic31$Data.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic31$Data.class deleted file mode 100644 index d5e236e2a5e4..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic31$Data.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic31.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic31.class deleted file mode 100644 index 11a86e66f7a2..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic31.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic31.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic31.java deleted file mode 100644 index 5433192aa8b3..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic31.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic31.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from cookies" - * @servlet vuln_count = "2" - */ -public class Basic31 extends BasicTestCase implements MicroTestCase { - class Data { - String value1; - String value2; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Cookie[] cookies = req.getCookies(); - - String name = cookies[0].getName(); - String value = cookies[0].getValue(); - String comment = cookies[0].getComment(); - - PrintWriter writer = resp.getWriter(); - - if(name != null) { - writer.println(name); /* BAD */ - } - if(value != null) { - writer.println(value); /* BAD */ - } - if(comment != null) { - writer.println(comment); /* BAD */ - } - } - - public String getDescription() { - return "values obtained from cookies"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic32.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic32.class deleted file mode 100644 index 8c532fbf3e46..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic32.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic32.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic32.java deleted file mode 100644 index c3165514ec79..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic32.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic32.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from headers" - * @servlet vuln_count = "1" - */ -public class Basic32 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String header = req.getHeader("Accept-Language"); - - PrintWriter writer = resp.getWriter(); - - writer.println(header); /* BAD */ - } - - public String getDescription() { - return "values obtained from headers"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic33.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic33.class deleted file mode 100644 index fff8bcc593ac..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic33.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic33.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic33.java deleted file mode 100644 index 5323e27f2a73..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic33.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic33.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from headers" - * @servlet vuln_count = "1" - */ -public class Basic33 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Enumeration e = req.getHeaders("Accept-Language"); - while(e.hasMoreElements()) { - String header = (String) e.nextElement(); - - PrintWriter writer = resp.getWriter(); - writer.println(header); /* BAD */ - } - } - - public String getDescription() { - return "values obtained from headers"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic34.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic34.class deleted file mode 100644 index fc9fc3c14c66..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic34.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic34.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic34.java deleted file mode 100644 index be49a3956458..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic34.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic34.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from headers" - * @servlet vuln_count = "2" - */ -public class Basic34 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Enumeration e = req.getHeaderNames(); - while(e.hasMoreElements()) { - String headerName = (String) e.nextElement(); - String headerValue = (String) req.getHeader(headerName); - - PrintWriter writer = resp.getWriter(); - // I believe arbitrary header names can be forged - // TODO: double-check this - writer.println(headerName); /* BAD */ - writer.println(headerValue); /* BAD */ - } - } - - public String getDescription() { - return "values obtained from headers"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic35.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic35.class deleted file mode 100644 index 3cc9a6c2f376..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic35.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic35.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic35.java deleted file mode 100644 index 74c70dc6c00a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic35.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic35.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from HttpServletRequest" - * @servlet vuln_count = "6" - */ -public class Basic35 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Enumeration e = req.getHeaderNames(); - while(e.hasMoreElements()) { - PrintWriter writer = resp.getWriter(); - // I believe these can be forged also - // TODO: double-check this - writer.println(req.getProtocol()); /* BAD */ - writer.println(req.getScheme()); /* BAD */ - writer.println(req.getAuthType()); /* BAD */ - writer.println(req.getQueryString()); /* BAD */ - writer.println(req.getRemoteUser()); /* BAD */ - writer.println(req.getRequestURL()); /* BAD */ - } - } - - public String getDescription() { - return "values obtained from headers"; - } - - public int getVulnerabilityCount() { - return 6; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic36.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic36.class deleted file mode 100644 index d6cb4f686f6c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic36.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic36.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic36.java deleted file mode 100644 index 6ee66dd0c667..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic36.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic36.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import javax.servlet.ServletInputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="values obtained from HttpServletRequest input stream" - * @servlet vuln_count = "1" - */ -public class Basic36 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - ServletInputStream in = req.getInputStream(); - BufferedReader r = new BufferedReader(new InputStreamReader(in)); - String line = r.readLine(); - - PrintWriter writer = resp.getWriter(); - writer.println(line); /* BAD */ - } - - public String getDescription() { - return "values obtained from HttpServletRequest input stream"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic37.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic37.class deleted file mode 100644 index adccee12ba52..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic37.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic37.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic37.java deleted file mode 100644 index ad2121c63bc0..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic37.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic37.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.StringTokenizer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="StringTokenizer test" - * @servlet vuln_count = "1" - */ -public class Basic37 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - StringTokenizer tok = new StringTokenizer(name, "\t"); - while(tok.hasMoreTokens()) { - PrintWriter writer = resp.getWriter(); - writer.println(tok.nextToken()); /* BAD */ - } - } - - public String getDescription() { - return "StringTokenizer test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic38.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic38.class deleted file mode 100644 index ac20d999e448..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic38.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic38.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic38.java deleted file mode 100644 index 681db9dd4932..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic38.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic38.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.StringTokenizer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="StringTokenizer test with a false positive" - * @servlet vuln_count = "1" - */ -public class Basic38 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - StringTokenizer tok1 = new StringTokenizer(name, "\t"); - StringTokenizer tok2 = new StringTokenizer("abc\tdef", "\t"); - - while(tok1.hasMoreTokens() && tok2.hasMoreElements()) { - PrintWriter writer = resp.getWriter(); - writer.println(tok1.nextToken()); /* BAD */ - writer.println(tok2.nextToken()); /* OK */ - } - } - - public String getDescription() { - return "StringTokenizer test with a false positive"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic39.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic39.class deleted file mode 100644 index de4ba7208908..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic39.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic39.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic39.java deleted file mode 100644 index 081f6d527c05..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic39.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic39.java,v 1.2 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.StringTokenizer; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="StringTokenizer test" - * @servlet vuln_count = "1" - */ -public class Basic39 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - StringTokenizer tok = new StringTokenizer(name, "\t"); - while(tok.hasMoreElements()) { - PrintWriter writer = resp.getWriter(); - writer.println(tok.nextElement()); /* BAD */ - } - } - - public String getDescription() { - return "StringTokenizer test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic4.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic4.class deleted file mode 100644 index ad044616f01d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic4.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic4.java deleted file mode 100644 index c7da0d31c4e3..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic4.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic4.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test path sensitivity just a bit" - * @servlet vuln_count = "1" - * */ -public class Basic4 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String str = req.getParameter("name"); - Random r = new Random(); - int choice = r.nextInt(); - PrintWriter writer = resp.getWriter(); - - switch (choice) { - case 1: break; - case 2: break; - case 3: - writer.println(str); /* BAD */ - break; - default: - } - } - - public String getDescription() { - return "test path sensitivity just a bit"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic40.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic40.class deleted file mode 100644 index f1bc625600c5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic40.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic40.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic40.java deleted file mode 100644 index d1cead776154..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic40.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic40.java,v 1.3 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; -import com.oreilly.servlet.MultipartRequest; - -/** - * @servlet description="MultipartRequest test" - * @servlet vuln_count = "1" - */ -public class Basic40 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - // TODO: this expects multipart input - MultipartRequest mreq = new MultipartRequest(req, System.getenv("HOME")); - String name = mreq.getParameter(FIELD_NAME); - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - - - public String getDescription() { - return "MultipartRequest test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic41.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic41.class deleted file mode 100644 index 5a651715e15a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic41.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic41.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic41.java deleted file mode 100644 index 1accf5ae7528..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic41.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id$ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="use getInitParameter instead" - * @servlet vuln_count = "1" - * */ -public class Basic41 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = getServletConfig().getServletContext().getInitParameter("name"); - PrintWriter writer = resp.getWriter(); - writer.println(s); /* BAD */ - } - - public String getDescription() { - return "use getInitParameter instead"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic42.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic42.class deleted file mode 100644 index ec54151c2ca3..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic42.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic42.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic42.java deleted file mode 100644 index f60155b078be..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic42.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id$ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="use getInitParameterNames" - * @servlet vuln_count = "1" - * */ -public class Basic42 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - ServletContext context = getServletConfig().getServletContext(); - Enumeration e = context.getInitParameterNames(); - while(e.hasMoreElements()) { - String name = (String) e.nextElement(); - Object value = context.getInitParameter(name); - PrintWriter writer = resp.getWriter(); - writer.println(value.toString()); /* BAD */ - } - } - - public String getDescription() { - return "use getInitParameterNames"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic5.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic5.class deleted file mode 100644 index 58b32af6ff35..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic5.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic5.java deleted file mode 100644 index 1651070e6299..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic5.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic5.java,v 1.5 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="moderately complex test of derived strings" - * @servlet vuln_count = "3" - * */ -public class Basic5 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1.toUpperCase(); - String s3 = s2.concat(";"); - String s4 = s3.replace(';', '.'); - String s5 = s4.trim(); - PrintWriter writer = resp.getWriter(); - - writer.println(s3); /* BAD */ - writer.println(s4); /* BAD */ - writer.println(s5); /* BAD */ - } - - public String getDescription() { - return "moderately complex test of derived strings"; - } - - public int getVulnerabilityCount() { - return 3; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic6.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic6.class deleted file mode 100644 index 445ffc7485b9..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic6.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic6.java deleted file mode 100644 index 317fb0e1e0c0..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic6.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic6.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="complex test of derived strings" - * @servlet vuln_count = "1" - * */ -public class Basic6 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1.toUpperCase(); - String s3 = s2.concat(";"); - String s4 = s3.replace(';', '.'); - String s5 = ":" + s4 + ":"; - String s6 = s5.substring(s5.length() - 1); - - PrintWriter writer = resp.getWriter(); - - writer.println(s6); /* BAD */ - } - - public String getDescription() { - return "complex test of derived strings"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic7.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic7.class deleted file mode 100644 index b8acf18df7c9..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic7.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic7.java deleted file mode 100644 index 05f62419c224..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic7.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic7.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="complex test of derived strings involving a string buffer" - * @servlet vuln_count = "1" - * */ -public class Basic7 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1.toUpperCase(); - StringBuffer buf = new StringBuffer(s2); - buf.append("abcdefgh"); - buf.insert(3, 's'); - String s3 = buf.toString(); - - PrintWriter writer = resp.getWriter(); - - writer.println(s3); /* BAD */ - } - - public String getDescription() { - return "complex test of derived strings involving a string buffer"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic8.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic8.class deleted file mode 100644 index fba78fe3325b..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic8.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic8.java deleted file mode 100644 index 767c142534e8..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic8.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic8.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.BitSet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test of complex conditionals" - * @servlet vuln_count = "1" - * */ -public class Basic8 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String str = req.getParameter("name"); - BitSet bs = new BitSet(10); - - if(bs.get(0)) { - if(bs.get(1)) { - if(bs.get(2)) { - if(bs.get(3)) { - if(bs.get(4)) { - - } - } else { - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - } - } - } - } - } - - public String getDescription() { - return "test of complex conditionals"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic9.class b/benchmarks/src/test/resources/securibench/micro/basic/Basic9.class deleted file mode 100644 index d3a2e1c261c5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/basic/Basic9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/basic/Basic9.java b/benchmarks/src/test/resources/securibench/micro/basic/Basic9.java deleted file mode 100644 index 262c99c67d81..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/basic/Basic9.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Basic9.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.basic; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="chains of value assignments" - * @servlet vuln_count = "1" - * */ -public class Basic9 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - Random r = new Random(); - boolean choice = r.nextBoolean(); - String s2 = s1; - String s3 = s2; - //String s4 = s1; - String s5 = choice ? s3 : s2; - String s6 = s5; - - PrintWriter writer = resp.getWriter(); - writer.println(s6); /* BAD */ - } - - public String getDescription() { - return "chains of value assignments"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections1.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections1.class deleted file mode 100644 index e8f8eecf2b05..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections1.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections1.java deleted file mode 100644 index 79f2bd8aff46..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections1.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections1.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "simple collection deposit/retrieve" - * @servlet vuln_count = "1" - * */ -public class Collections1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList ll = new LinkedList(); - ll.addLast(s1); - String s2 = (String) ll.getLast(); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - } - - public String getDescription() { - return "simple collection deposit/retrieve"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections10.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections10.class deleted file mode 100644 index 813659452ffd..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections10.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections10.java deleted file mode 100644 index 120e16dccddd..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections10.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections10.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "more complex collection copying" - * @servlet vuln_count = "0" - * */ -public class Collections10 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - ArrayList c2 = new ArrayList(); - c2.add("abc"); - - Iterator iter = c1.iterator(); - PrintWriter writer = resp.getWriter(); - while(iter.hasNext()){ - String str = (String) iter.next(); - - writer.println(str); /* BAD */ - } - - iter = c2.iterator(); - while(iter.hasNext()){ - String str = (String) iter.next(); - - writer.println(str); /* OK */ - } - } - - public String getDescription() { - return "more complex collection copying"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections11.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections11.class deleted file mode 100644 index 13bf34e6dfc7..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections11.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections11.java deleted file mode 100644 index 920bc106b93d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections11.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections11.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "interprocedural collection passing" - * @servlet vuln_count = "1" - * */ -public class Collections11 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - Collections11b c11b = new Collections11b(); - c11b.foo(c1, resp); - } - - public String getDescription() { - return "interprocedural collection passing"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.class deleted file mode 100644 index 256e6edeca2c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.java deleted file mode 100644 index 502815590baf..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections11b.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections11b.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Collection; - -import javax.servlet.ServletResponse; - -/** - * @servlet description = "simple collection deposit/retrieve" - * @servlet vuln_count = "1" - * */ -class Collections11b { - protected void foo(Object o, ServletResponse resp) throws IOException { - Collection c = (Collection) o; - String str = c.toString(); - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections12.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections12.class deleted file mode 100644 index 39bb84ae8d5c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections12.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections12.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections12.java deleted file mode 100644 index f701b1270f05..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections12.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections12.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "collection copying through an array" - * @servlet vuln_count = "1" - * */ -public class Collections12 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - Object[] array = c1.toArray(); - - PrintWriter writer = resp.getWriter(); - writer.println(array[0]); /* BAD */ - } - - public String getDescription() { - return "collection copying through an array"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections13.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections13.class deleted file mode 100644 index f488b2162c31..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections13.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections13.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections13.java deleted file mode 100644 index 901e830de60c..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections13.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections13.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "more complex collection copying through an array" - * @servlet vuln_count = "1" - * */ -public class Collections13 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - c1.addFirst("x"); - Object[] array = c1.toArray(); - List c2 = java.util.Arrays.asList(array); - List c3 = java.util.Arrays.asList(new String[]{new String("xyz")}); - List c4 = java.util.Arrays.asList(new String[]{new String(s1)}); - - PrintWriter writer = resp.getWriter(); - writer.println(c2.get(0)); /* BAD */ - writer.println(c3.get(0)); /* OK */ - writer.println(c4.get(0)); /* OK */ - } - - public String getDescription() { - return "more complex collection copying through an array"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections14.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections14.class deleted file mode 100644 index 2eb63aa51e72..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections14.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections14.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections14.java deleted file mode 100644 index 0840e4c483ab..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections14.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections14.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; -import java.util.List; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "more complex collection copying through an array" - * @servlet vuln_count = "1" - * */ -public class Collections14 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c = new LinkedList(); - for(int i = 0; i < 3000; i++){ - c.addFirst("i: " + i); - } - c.addLast(s1); - - PrintWriter writer = resp.getWriter(); - writer.println(c.getLast()); /* BAD */ - } - - public String getDescription() { - return "more complex collection copying through an array"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections2.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections2.class deleted file mode 100644 index 8660f016f259..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections2.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections2.java deleted file mode 100644 index a2aba1eed341..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections2.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections2.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "collection deposit/retrieve, check for false positives" - * @servlet vuln_count = "1" - * */ -public class Collections2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList ll1 = new LinkedList(); - ll1.addLast(s1); - - LinkedList ll2 = new LinkedList(); - ll1.addLast("abc"); - - String s2 = (String) ll1.getLast(); - String s3 = (String) ll2.getLast(); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - public String getDescription() { - return "simple collection deposit/retrieve"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections3.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections3.class deleted file mode 100644 index 0b82008041c7..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections3.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections3.java deleted file mode 100644 index 0224bf977618..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections3.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections3.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.LinkedList; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "collection of collections" - * @servlet vuln_count = "2" - * */ -public class Collections3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList ll1 = new LinkedList(); - LinkedList ll2 = new LinkedList(); - ll2.addLast(s1); - ll2.addLast(ll1); - - LinkedList c = (LinkedList) ll2.getLast(); - String s2 = (String) c.getLast(); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - // this is because the print out of c includes the test of s1 - writer.println(c); /* BAD */ - } - - public String getDescription() { - return "collection of collections"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections4.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections4.class deleted file mode 100644 index 34821f73e3da..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections4.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections4.java deleted file mode 100644 index a3af3b34f74c..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections4.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections4.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Iterator; -import java.util.LinkedList; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of iterators" - * @servlet vuln_count = "1" - * */ -public class Collections4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - LinkedList ll = new LinkedList(); - ll.addLast(name); - - for(Iterator iter = ll.iterator(); iter.hasNext();) { - PrintWriter writer = resp.getWriter(); - Object o = iter.next(); - - writer.println(o); /* BAD */ - } - } - - public String getDescription() { - return "test of iterators"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections5.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections5.class deleted file mode 100644 index 7e205d20367c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections5.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections5.java deleted file mode 100644 index f64c8a0691ac..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections5.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections5.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Iterator; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of iterators" - * @servlet vuln_count = "1" - * */ -public class Collections5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - ArrayList ll = new ArrayList(); - ll.add(name); - - for(Iterator iter = ll.iterator(); iter.hasNext();) { - PrintWriter writer = resp.getWriter(); - Object o = iter.next(); - - writer.println(o); /* BAD */ - } - } - - public String getDescription() { - return "test of iterators"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections6.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections6.class deleted file mode 100644 index 63d21038e0fd..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections6.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections6.java deleted file mode 100644 index 75d99f8f2ab4..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections6.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections6.java,v 1.4 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of maps" - * @servlet vuln_count = "1" - * */ -public class Collections6 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - Map m = new HashMap(); - m.put("a", name); - String s1 = (String) m.get("b"); - String s2 = (String) m.get("a"); - - PrintWriter writer = resp.getWriter(); - writer.println(s1); /* OK */ - writer.println(s2); /* BAD */ - } - - public String getDescription() { - return "test of maps"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections7.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections7.class deleted file mode 100644 index 5ce2b38e6eae..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections7.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections7.java deleted file mode 100644 index a587eb779311..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections7.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections7.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "test of map iterators" - * @servlet vuln_count = "1" - * */ -public class Collections7 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - Map m = new HashMap(); - m.put("a", name); - for(Iterator iter = m.entrySet().iterator(); iter.hasNext();) { - Map.Entry e = (Entry) iter.next(); - - PrintWriter writer = resp.getWriter(); - writer.println(e.getKey()); /* OK */ - writer.println(e.getValue()); /* BAD */ - } - } - - public String getDescription() { - return "test of map iterators"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections8.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections8.class deleted file mode 100644 index f3414e6c45f5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections8.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections8.java deleted file mode 100644 index 76acbfa209d2..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections8.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections8.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "collection copying" - * @servlet vuln_count = "1" - * */ -public class Collections8 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - ArrayList c2 = new ArrayList(); - c2.add("abc"); - c2.addAll(c1); - String s2 = (String) c2.get(0); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - } - - public String getDescription() { - return "collection copying"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections9.class b/benchmarks/src/test/resources/securibench/micro/collections/Collections9.class deleted file mode 100644 index 07d7cf32c4a5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/collections/Collections9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/collections/Collections9.java b/benchmarks/src/test/resources/securibench/micro/collections/Collections9.java deleted file mode 100644 index 215c392e5325..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/collections/Collections9.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -/** - @author Benjamin Livshits - - $Id: Collections9.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.collections; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "more complex collection copying" - * @servlet vuln_count = "0" - * */ -public class Collections9 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - LinkedList c1 = new LinkedList(); - c1.addLast(s1); - ArrayList c2 = new ArrayList(); - c2.add("abc"); - c2.retainAll(c1); - String s2 = (String) c2.get(0); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* OK */ - } - - public String getDescription() { - return "more complex collection copying"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1$C.class deleted file mode 100644 index 55486bed277d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.class deleted file mode 100644 index d2bec6eadf32..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.java deleted file mode 100644 index 3db0c8fdbd40..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures1.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures1.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple test of field assignment" - * @servlet vuln_count = "1" - * */ -public class Datastructures1 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - private String tag = "abc"; - - public String getData(){return this.str;} - public String getTag(){return this.str;} - public void setData(String str){this.str = str;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c = new C(); - c.setData(name); - String str = c.getData(); - String tag = c.getTag(); - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - writer.println(tag); /* OK */ - } - - public String getDescription() { - return "simple test of field assignment"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2$C.class deleted file mode 100644 index 58d3b2cce22a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.class deleted file mode 100644 index 8bbdee4e28b7..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.java deleted file mode 100644 index 611eb50929ec..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures2.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures2.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="multiple objects of the same type" - * @servlet vuln_count = "1" - * */ -public class Datastructures2 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - public String getData(){return this.str;} - public String getTag(){return this.str;} - public void setData(String str){this.str = str;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c1 = new C(); - c1.setData("def"); - - C c2 = new C(); - c2.setData(name); - - String str1 = c1.getData(); - String str2 = c2.getData(); - - PrintWriter writer = resp.getWriter(); - writer.println(str1); /* OK */ - writer.println(str2); /* BAD */ - } - - public String getDescription() { - return "simple test of field assignment"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3$C.class deleted file mode 100644 index 887ee030e422..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.class deleted file mode 100644 index 4004a67a9edd..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.java deleted file mode 100644 index d34ff5765c67..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures3.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures3.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple nexted data" - * @servlet vuln_count = "1" - * */ -public class Datastructures3 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - private C next; - - public String getData(){return this.str;} - public void setData(String str){this.str = str;} - public void setNext(C next){this.next = next;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c1 = new C(); - c1.setData("anbc"); - - C c2 = new C(); - c2.setData(name); - c1.setNext(c2); - - String str = c1.next.str; - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - } - - public String getDescription() { - return "simple nexted data"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4$C.class deleted file mode 100644 index 946b1e41fccd..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.class deleted file mode 100644 index 3429e331e2db..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.java deleted file mode 100644 index 8f4e84ecf6c4..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures4.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures4.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple nexted data (false positive)" - * @servlet vuln_count = "1" - * */ -public class Datastructures4 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - private C next; - - public String getData(){return this.str;} - public void setData(String str){this.str = str;} - public void setNext(C next){this.next = next;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c1 = new C(); - c1.setData(name); - - C c2 = new C(); - c2.setData("abc"); - c1.setNext(c2); - - String str = c1.next.str; - - PrintWriter writer = resp.getWriter(); - writer.println(str); /* OK */ - } - - public String getDescription() { - return "simple nexted data"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5$C.class deleted file mode 100644 index 2fc21326579a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.class deleted file mode 100644 index 657eb924eaa5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.java deleted file mode 100644 index 1c8bea91979e..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures5.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures5.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="nested data in a loop" - * @servlet vuln_count = "1" - * */ -public class Datastructures5 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - private C next; - - public String getData(){return this.str;} - public void setData(String str){this.str = str;} - public void setNext(C next){this.next = next;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c1 = new C(); - c1.setData("abc"); - - C c2 = new C(); - c2.setData("def"); - c1.setNext(c2); - - C c3 = new C(); - c3.setData(name.toUpperCase()); - c2.setNext(c3); - - C c = c1; - while (c != null) { - String str = c.getData(); - PrintWriter writer = resp.getWriter(); - writer.println(str); /* BAD */ - c = c.next; - } - } - - public String getDescription() { - return "nested data in a loop"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6$C.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6$C.class deleted file mode 100644 index 369c9146fbdc..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6$C.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.class b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.class deleted file mode 100644 index ea8e09e614a2..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.java b/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.java deleted file mode 100644 index e6e1c585eb24..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/datastructures/Datastructures6.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Datastructures6.java,v 1.1 2006/04/21 17:14:24 livshits Exp $ - */ -package securibench.micro.datastructures; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="nested data in a loop" - * @servlet vuln_count = "1" - * */ -public class Datastructures6 extends BasicTestCase implements MicroTestCase { - public class C { - private String str; - private C next; - - public String getData(){return this.str;} - public void setData(String str){this.str = str;} - public void setNext(C next){this.next = next;} - } - - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - C c = new C(); - C head = c; - for(int i = 0; i < 1600; i++){ - C next = new C(); - c.setNext(next); - c = next; - } - c.setData(name); - c = head; - while(c != null) { - PrintWriter writer = resp.getWriter(); - writer.println(c.getData()); /* BAD */ - - c = c.next; - } - } - - public String getDescription() { - return "nested data in a loop"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories1.class b/benchmarks/src/test/resources/securibench/micro/factories/Factories1.class deleted file mode 100644 index 3186613e8beb..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/factories/Factories1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories1.java b/benchmarks/src/test/resources/securibench/micro/factories/Factories1.java deleted file mode 100644 index 10b9dc94f3e7..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/factories/Factories1.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Factories1.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.factories; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple factory problem with toLowerCase" - * @servlet vuln_count = "1" - * */ -public class Factories1 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1.toLowerCase(); - String s3 = "abc".toLowerCase(); - - PrintWriter writer = resp.getWriter(); - - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - public String getDescription() { - return "simple factory problem with toLowerCase"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories2.class b/benchmarks/src/test/resources/securibench/micro/factories/Factories2.class deleted file mode 100644 index 5f787490be1d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/factories/Factories2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories2.java b/benchmarks/src/test/resources/securibench/micro/factories/Factories2.java deleted file mode 100644 index c11116ca966c..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/factories/Factories2.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Factories2.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.factories; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple factory problem with String.toString" - * @servlet vuln_count = "1" - * */ -public class Factories2 extends BasicTestCase implements MicroTestCase { - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - String s2 = s1.toString(); - String s3 = "abc".toString(); - - PrintWriter writer = resp.getWriter(); - - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - public String getDescription() { - return "simple factory problem with String.toString"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories3$StringWrapper.class b/benchmarks/src/test/resources/securibench/micro/factories/Factories3$StringWrapper.class deleted file mode 100644 index 989b88d3f108..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/factories/Factories3$StringWrapper.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories3.class b/benchmarks/src/test/resources/securibench/micro/factories/Factories3.class deleted file mode 100644 index 8c31ee5b5800..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/factories/Factories3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/factories/Factories3.java b/benchmarks/src/test/resources/securibench/micro/factories/Factories3.java deleted file mode 100644 index 74600fe668b4..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/factories/Factories3.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Factories3.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.factories; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "factory problem with a string wrapper" - * @servlet vuln_count = "1" - * */ -public class Factories3 extends BasicTestCase implements MicroTestCase { - class StringWrapper { - StringWrapper(String value){ - this.value = value; - } - public String toString() { - return value; - } - - protected String value; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter("name"); - - StringWrapper w1 = new StringWrapper(s1); - StringWrapper w2 = new StringWrapper("abc"); - - PrintWriter writer = resp.getWriter(); - - writer.println(w1.toString()); /* BAD */ - writer.println(w2.toString()); /* OK */ - } - - public String getDescription() { - return "factory problem with a string wrapper"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter1.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter1.class deleted file mode 100644 index 38e87ebf3a08..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter1.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter1.java deleted file mode 100644 index 128a47c6a37e..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter1.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter1.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple id method call" - * @servlet vuln_count = "1" - * */ -public class Inter1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - String s2 = id(s1); - String s3 = id("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - private String id(String string) { - return string; - } - - public String getDescription() { - return "simple id method call"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter10.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter10.class deleted file mode 100644 index 6ce06aac5822..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter10.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter10.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter10.java deleted file mode 100644 index d11eb1381c8d..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter10.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter10.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="more complex object sensitivity" - * @servlet vuln_count = "2" - * */ -public class Inter10 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - String s2 = foo(s1); - String s3 = foo("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - private String foo(String s1) { - return s1.toLowerCase().substring(0, s1.length()-1); - } - - public String getDescription() { - return "more complex object sensitivity"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter11.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter11.class deleted file mode 100644 index 4bbff90f561f..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter11.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter11.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter11.java deleted file mode 100644 index b42c85998f18..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter11.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter11.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="object sensitivity and context sensitivity combined" - * @servlet vuln_count = "1" - * */ -public class Inter11 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - String s2 = id(foo(s1)); - String s3 = id(foo("abc")); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - private String id(String string) { - return string; - } - - private String foo(String s1) { - return s1.toUpperCase(); - } - - public String getDescription() { - return "object sensitivity and context sensitivity combined"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter12.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter12.class deleted file mode 100644 index 56356c14377c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter12.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter12.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter12.java deleted file mode 100644 index e3f465025439..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter12.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter12.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Collection; -import java.util.LinkedList; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="collection as a static field" - * @servlet vuln_count = "1" - * */ -public class Inter12 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - static final Collection COLLECTION1 = new LinkedList(); - static final Collection COLLECTION2 = new LinkedList(); - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - foo("abc"); - bar(s1); - - PrintWriter writer = resp.getWriter(); - String s2 = (String) COLLECTION1.iterator().next(); - String s3 = (String) COLLECTION2.iterator().next(); - - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - private void foo(Object s) { - COLLECTION2.add(s); - } - - private void bar(Object s) { - COLLECTION1.add(s); - } - - public String getDescription() { - return "collection as a static field"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter13.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter13.class deleted file mode 100644 index 6a92558d7092..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter13.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter13.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter13.java deleted file mode 100644 index bfec8de2844f..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter13.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter13.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="recursive case" - * @servlet vuln_count = "1" - * */ -public class Inter13 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - f(s1, 1000, resp); - } - - private void f(String s1, int i, ServletResponse resp) throws IOException { - if(i != 0) { - f(s1, i-1, resp); - } else { - PrintWriter writer = resp.getWriter(); - writer.println(s1); /* BAD */ - } - - - } - - public String getDescription() { - return "recursive case"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter14.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter14.class deleted file mode 100644 index 55221213eb89..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter14.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter14.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter14.java deleted file mode 100644 index b169d485e6d1..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter14.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter14.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="interprocedural loop" - * @servlet vuln_count = "1" - * */ -public class Inter14 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - for(int i = 0; i < 1500; i++){ - if(i > 1000 && i < 1200 && (i % 7 == 3)){ - f(s1, 1000, resp); - } - } - } - - private void f(String s1, int i, ServletResponse resp) throws IOException { - if(i != 0) { - PrintWriter writer = resp.getWriter(); - writer.println(s1); /* BAD */ - } - } - - public String getDescription() { - return "interprocedural loop"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter2.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter2.class deleted file mode 100644 index 5062466891a8..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter2.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter2.java deleted file mode 100644 index 627cb9858709..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter2.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter2.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple id method call" - * @servlet vuln_count = "2" - * */ -public class Inter2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - PrintWriter writer = resp.getWriter(); - String s2 = id(s1, writer); - String s3 = id("abc", writer); - writer.println(s2); /* BAD */ // Is this double-reporting?.. - writer.println(s3); /* OK */ - } - - private String id(String string, PrintWriter writer) { - writer.println(string); /* BAD */ - - return string; - } - - public String getDescription() { - return "simple id method call"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter3.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter3.class deleted file mode 100644 index 3199386d09c7..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter3.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter3.java deleted file mode 100644 index f30268c880bc..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter3.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter3.java,v 1.6 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="chains of method calls" - * @servlet vuln_count = "1" - * */ -public class Inter3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private PrintWriter writer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - - writer = resp.getWriter(); - f1(name); - } - - private void f1(String name) { - f2(name); - } - - private void f2(String name) { - f3(name); - f3("ade".concat(name)); - } - - private void f3(String name) { - f4(name); - } - - private void f4(String name) { - f5(name); - } - - private void f5(String name) { - f6(name); - } - - private void f6(String name) { - f7(name); - f7(name + "abc"); - f8("adsf "+ name + "abc"); - f8("adsf "+ name + "abc"); - - } - - private void f7(String name) { - f8(name); - } - - private void f8(String name) { - f9(name); - } - - // reachable code - private void f9(String name) { - writer.println(name); /* BAD */ - } - - // dead code - public void f0(String name) { - writer.println(name); /* OK */ - } - - public String id(String string, PrintWriter writer) { - writer.println(string); /* OK */ - - return string; - } - - public String getDescription() { - return "chains of method calls"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter4.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter4.class deleted file mode 100644 index c891eea35436..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter4.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter4.java deleted file mode 100644 index 8824155a2685..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter4.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter4.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="store stuff in a field" - * @servlet vuln_count = "1" - * */ -public class Inter4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private String name; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - - f(resp); - } - - private void f(ServletResponse resp) throws IOException { - PrintWriter writer = resp.getWriter(); - writer.println(this.name); /* BAD */ - } - - public String getDescription() { - return "store stuff in a field"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter5.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter5.class deleted file mode 100644 index 9fa39c8fa324..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter5.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter5.java deleted file mode 100644 index 730209f4f98a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter5.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter5.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="store stuff in a field" - * @servlet vuln_count = "1" - * */ -public class Inter5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - - String s1 = id(name); - String s2 = id("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(s1); /* BAD */ - writer.println(s2); /* OK */ - } - - private String id(String in) throws IOException { - return in.toLowerCase(); - } - - public String getDescription() { - return "store stuff in a field"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter6$ReflectivelyCreated.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter6$ReflectivelyCreated.class deleted file mode 100644 index cd7ea151a88f..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter6$ReflectivelyCreated.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter6.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter6.class deleted file mode 100644 index 3c7d0e3653b2..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter6.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter6.java deleted file mode 100644 index c38e80747589..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter6.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter6.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "bug in class initializer" - * @servlet vuln_count = "1" - * */ -public class Inter6 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private static String name; - private static PrintWriter writer; - - static class ReflectivelyCreated { - static { - writer.println(name); /* BAD */ - } - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - writer = resp.getWriter(); - - new ReflectivelyCreated(); - } - - public String getDescription() { - return "bug in class initializer"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter7$Base.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter7$Base.class deleted file mode 100644 index 9cfce0561f0d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter7$Base.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter7$ReflectivelyCreated.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter7$ReflectivelyCreated.class deleted file mode 100644 index 31e044560958..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter7$ReflectivelyCreated.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter7.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter7.class deleted file mode 100644 index 58cecad717e4..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter7.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter7.java deleted file mode 100644 index 1b2f8a8f9f4b..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter7.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter7.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "bug in class initializer" - * @servlet vuln_count = "1" - * */ -public class Inter7 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private static String name; - private static PrintWriter writer; - - static class Base { - public Base(String value) { - this.value = value; - foo(); - } - private void foo() { - writer.println(this.value); /* BAD */ - } - public String toString() { - return value; - } - - String value; - } - - static class ReflectivelyCreated extends Base { - ReflectivelyCreated(String value){ - super(value); - } - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - writer = resp.getWriter(); - - new ReflectivelyCreated(name); - } - - public String getDescription() { - return "bug in class initializer"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter8.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter8.class deleted file mode 100644 index 9f8f6977201a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter8.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter8.java deleted file mode 100644 index 5979b1721621..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter8.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter8.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="multi-level context sensitivity test" - * @servlet vuln_count = "1" - * */ -public class Inter8 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - String s2 = foo(s1); - String s3 = bar("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - private String foo(String s1) { - return id(s1); - } - - private String bar(String string) { - return id(string); - } - - private String id(String string) { - return id2(string); - } - - private String id2(String string) { - return string; - } - - public String getDescription() { - return "multi-level context sensitivity test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter9.class b/benchmarks/src/test/resources/securibench/micro/inter/Inter9.class deleted file mode 100644 index 83d42b1d406a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/inter/Inter9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/inter/Inter9.java b/benchmarks/src/test/resources/securibench/micro/inter/Inter9.java deleted file mode 100644 index cdc05478a1f2..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/inter/Inter9.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Inter9.java,v 1.1 2006/04/21 17:14:26 livshits Exp $ - */ -package securibench.micro.inter; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Locale; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple object sensitivity" - * @servlet vuln_count = "2" - * */ -public class Inter9 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - - String s2 = foo(s1); - String s3 = foo("abc"); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - - String s4 = bar(s1); - String s5 = bar("abc"); - - writer.println(s4); /* BAD */ - writer.println(s5); /* OK */ - } - - private String foo(String s1) { - return s1.toLowerCase(); - } - - private String bar(String s1) { - return s1.toLowerCase(Locale.ENGLISH); - } - - public String getDescription() { - return "simple object sensitivity"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred1.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred1.class deleted file mode 100644 index 0a4922584f6c..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred1.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred1.java deleted file mode 100644 index 1d8d8cca008b..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred1.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred1.java,v 1.5 2006/04/21 17:14:26 livshits Exp $ -*/ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple if(false) test" - * @servlet vuln_count = "0" - * */ -public class Pred1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - if(false) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ - } - } - - public String getDescription() { - return "simple if(false) test"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred2.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred2.class deleted file mode 100644 index 2fba0d126eb8..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred2.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred2.java deleted file mode 100644 index b05943578965..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred2.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred2.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple correlated tests" - * @servlet vuln_count = "0" - * */ -public class Pred2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - boolean choice = new Random().nextBoolean(); - String name = "abc"; - - if(choice) { - name = req.getParameter(FIELD_NAME); - } - - if(choice) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - } - - public String getDescription() { - return "simple correlated tests"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred3.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred3.class deleted file mode 100644 index d5546c0d74d4..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred3.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred3.java deleted file mode 100644 index 650ca1fd4b89..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred3.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred3.java,v 1.5 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Random; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple correlated tests" - * @servlet vuln_count = "0" - * */ -public class Pred3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - boolean choice = new Random().nextBoolean(); - String name = "abc"; - - if(choice) { - name = req.getParameter(FIELD_NAME); - } - - if(!choice) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ // nothing bad gets here - } - } - - public String getDescription() { - return "simple correlated tests"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred4.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred4.class deleted file mode 100644 index 1d5a93cc68d5..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred4.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred4.java deleted file mode 100644 index 654280d65699..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred4.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred4.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="correlated test with an int variable" - * @servlet vuln_count = "1" - * */ -public class Pred4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - int x = 3; - - String name = req.getParameter(FIELD_NAME); - - if(x == 3) { // should always be taken - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ // nothing bad gets here - } - } - - public String getDescription() { - return "correlated test with an int variable"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred5.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred5.class deleted file mode 100644 index 3518f5d18db6..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred5.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred5.java deleted file mode 100644 index 4a21db8110e8..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred5.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred5.java,v 1.4 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="correlated test with a complex conditional" - * @servlet vuln_count = "1" - * */ -public class Pred5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - int x = 3; - - String name = req.getParameter(FIELD_NAME); - - if ( ((x > 5) && (x % 7 == 29) ) || (x == 3) ) { // should always be taken - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - } - - public String getDescription() { - return "correlated test with a complex conditional"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred6.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred6.class deleted file mode 100644 index 8a4a651cdc8e..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred6.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred6.java deleted file mode 100644 index 81130e221fbd..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred6.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred6.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="correlated test with addition" - * @servlet vuln_count = "0" - * */ -public class Pred6 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - int x = 2; - x++; - - String name = req.getParameter(FIELD_NAME); - - if(x == 2) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ // nothing bad gets here - } - } - - public String getDescription() { - return "correlated test with addition"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred7.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred7.class deleted file mode 100644 index a076125672c9..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred7.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred7.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred7.java deleted file mode 100644 index bcd368d0c3ef..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred7.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred7.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="correlated test with multiple variables" - * @servlet vuln_count = "0" - * */ -public class Pred7 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - int x = 2; - int y = 9; - x++; - y-= 2; - - String name = req.getParameter(FIELD_NAME); - - if(x + y == 11) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ // nothing bad gets here - } - } - - public String getDescription() { - return "correlated test with multiple variables"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred8.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred8.class deleted file mode 100644 index 75128e340521..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred8.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred8.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred8.java deleted file mode 100644 index aec3e0509a02..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred8.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred8.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="using an array element as in a predicate" - * @servlet vuln_count = "1" - * */ -public class Pred8 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String array[] = new String[] {"abc", name}; - - if(array[1].equals(name)) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - } - - public String getDescription() { - return "using an array element as in a predicate"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred9.class b/benchmarks/src/test/resources/securibench/micro/pred/Pred9.class deleted file mode 100644 index 7d2e5a33728a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/pred/Pred9.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/pred/Pred9.java b/benchmarks/src/test/resources/securibench/micro/pred/Pred9.java deleted file mode 100644 index 524ebdfbf82b..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/pred/Pred9.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Pred9.java,v 1.3 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.pred; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="using an array element as in a predicate" - * @servlet vuln_count = "1" - * */ -public class Pred9 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String array[] = new String[] {name, "abc"}; - - if(array[1].equals(name)) { - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ // could be equal - } - } - - public String getDescription() { - return "using an array element as in a predicate"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl1.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl1.class deleted file mode 100644 index 7abd92a8f88d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl1.java b/benchmarks/src/test/resources/securibench/micro/refl/Refl1.java deleted file mode 100644 index d6943b789a89..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/refl/Refl1.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Refl1.java,v 1.4 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.reflection; - -import java.io.IOException; -import java.io.PrintWriter; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="reflective call of a method" - * @servlet vuln_count = "1" - * */ -public class Refl1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s1 = req.getParameter(FIELD_NAME); - PrintWriter writer = resp.getWriter(); - - Method idMethod = null; - try { - Class clazz = Class.forName("securibench.micro.reflection.Refl1"); - Method methods[] = clazz.getMethods(); - for(int i = 0; i < methods.length; i++) { - Method method = methods[i]; - if(method.getName().equals("id")) { - idMethod = method; - break; - } - } - // a fancy way to call id(s1, writer) - Object o = idMethod.invoke(this, new Object[] {s1, writer}); - String s2 = (String) o; - writer.println(s2); /* BAD */ - } catch( ClassNotFoundException e ) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } - - public String id(String string, PrintWriter writer) { - return string; - } - - public String getDescription() { - return "reflective call of a method"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl2.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl2.class deleted file mode 100644 index 10d350d8252b..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl2.java b/benchmarks/src/test/resources/securibench/micro/refl/Refl2.java deleted file mode 100644 index 255f594453b4..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/refl/Refl2.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Refl2.java,v 1.6 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.reflection; - -import java.io.IOException; -import java.io.PrintWriter; -import java.lang.reflect.Field; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="reflectively access a field" - * @servlet vuln_count = "1" - * */ -public class Refl2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - public String name; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - - try { - f(resp); - } catch(Exception e) { - System.err.println("An error occurred"); - } - } - - private void f(ServletResponse resp) throws IOException, SecurityException, NoSuchFieldException, ClassNotFoundException, IllegalArgumentException, IllegalAccessException { - PrintWriter writer = resp.getWriter(); - Field field = Class.forName("securibench.micro.reflection.Refl2").getField("name"); - String myName = (String) field.get(this); - - writer.println(myName); /* BAD */ - } - - public String getDescription() { - return "reflectively access a field"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl3$ReflectivelyCreated.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl3$ReflectivelyCreated.class deleted file mode 100644 index 9df863effad8..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl3$ReflectivelyCreated.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl3.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl3.class deleted file mode 100644 index 5f8c8ac54a72..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl3.java b/benchmarks/src/test/resources/securibench/micro/refl/Refl3.java deleted file mode 100644 index 217dada37c96..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/refl/Refl3.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Refl3.java,v 1.6 2006/04/04 20:00:40 livshits Exp $ - */ -package securibench.micro.reflection; - -import java.io.IOException; -import java.io.PrintWriter; -import java.lang.reflect.Field; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "reflectively create a class and access its field" - * @servlet vuln_count = "1" - * */ -public class Refl3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private String name; - - public static class ReflectivelyCreated { - public String value; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - PrintWriter writer = resp.getWriter(); - - try { - Class clazz = Class.forName("securibench.micro.reflection.Refl3$ReflectivelyCreated"); - ReflectivelyCreated rc = (ReflectivelyCreated) clazz.newInstance(); - Field field = clazz.getField("value"); - field.set(rc, name); - - writer.println(rc.value); /* BAD */ - } catch (ClassNotFoundException e) { - System.err.println("An error occurred (1)"); - } catch (InstantiationException e) { - System.err.println("An error occurred (2)"); - } catch (IllegalAccessException e) { - System.err.println("An error occurred (3)"); - } catch (SecurityException e) { - System.err.println("An error occurred (4)"); - } catch (NoSuchFieldException e) { - System.err.println("An error occurred (5)"); - } - } - - public String getDescription() { - return "reflectively create a class and access its field"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl4$ReflectivelyCreated.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl4$ReflectivelyCreated.class deleted file mode 100644 index 71309517bb2f..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl4$ReflectivelyCreated.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl4.class b/benchmarks/src/test/resources/securibench/micro/refl/Refl4.class deleted file mode 100644 index 8b306c66ad4e..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/refl/Refl4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/refl/Refl4.java b/benchmarks/src/test/resources/securibench/micro/refl/Refl4.java deleted file mode 100644 index 5d0bea98dc30..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/refl/Refl4.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Refl4.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.reflection; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description = "bug in class initializer" - * @servlet vuln_count = "1" - * */ -public class Refl4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private static String name; - private static PrintWriter writer; - - static class ReflectivelyCreated { - static { - writer.println(name); /* BAD */ - - } - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - writer = resp.getWriter(); - - try { - // this invokes the class initializer - Class.forName("securibench.micro.reflection.Refl4$ReflectivelyCreated"); - } catch (ClassNotFoundException e) { - System.err.println("An error occurred (1)"); - } catch (SecurityException e) { - System.err.println("An error occurred (2)"); - } - } - - public String getDescription() { - return "bug in class initializer"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.class deleted file mode 100644 index 6131bf861f42..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.java deleted file mode 100644 index 521211bee2fd..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers1.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers1.java,v 1.9 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple sanitization check" - * @servlet vuln_count = "1" - * */ -public class Sanitizers1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private PrintWriter writer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String clean = clean(name); - - writer = resp.getWriter(); - resp.setContentType("text/html"); - - writer.println(""); - writer.println("" + name + ""); /* BAD */ - writer.println("" + clean + ""); /* OK */ - writer.println(""); - - } - - /** - * @sanitizer - * javascript sanitization routine - * */ - private String clean(String name) { - StringBuffer buf = new StringBuffer(); - for(int i = 0; i < name.length(); i++) { - char ch = name.charAt(i); - switch (ch) { - case '<': - buf.append("<"); break; - case '>': - buf.append(">"); break; - case '&': - buf.append("&"); break; - default: - if(Character.isLetter(ch) || Character.isDigit(ch) || ch == '_') { - buf.append(ch); - } else { - buf.append('?'); - } - } - } - - return buf.toString(); - } - - public String getDescription() { - return "simple sanitization check"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.class deleted file mode 100644 index a66b56a61ddc..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.java deleted file mode 100644 index 5f35ae9c6a16..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers2.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers2.java,v 1.7 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple sanitization check" - * @servlet vuln_count = "0" - * */ -public class Sanitizers2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private PrintWriter writer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String clean = clean(name); - - writer = resp.getWriter(); - resp.setContentType("text/html"); - - writer.println("" + clean + ""); /* OK */ - - } - - /** - * @sanitizer - * javascript sanitization routine - * */ - private String clean(String name) { - StringBuffer buf = new StringBuffer(); - for(int i = 0; i < name.length(); i++) { - char ch = name.charAt(i); - switch (ch) { - case '<': - buf.append("<"); break; - case '>': - buf.append(">"); break; - case '&': - buf.append("&"); break; - default: - if(Character.isLetter(ch) || Character.isDigit(ch) || ch == '_') { - buf.append(ch); - } else { - buf.append('?'); - } - } - } - - return buf.toString(); - } - - public String getDescription() { - return "simple sanitization check"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.class deleted file mode 100644 index 613c6acc1236..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.java deleted file mode 100644 index 832269180799..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers3.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers3.java,v 1.4 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.net.URLEncoder; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="safe redirect" - * @servlet vuln_count = "0" - * */ -public class Sanitizers3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - - resp.sendRedirect(URLEncoder.encode("/user/" + name, "UTF-8")); /* OK */ - } - - public String getDescription() { - return "safe redirect"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.class deleted file mode 100644 index aa2102b33e1a..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.java deleted file mode 100644 index b9def9fe9327..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers4.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers4.java,v 1.6 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="buggy sanitizer" - * @servlet vuln_count = "2" - * */ -public class Sanitizers4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private PrintWriter writer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String clean = clean(name); - - writer = resp.getWriter(); - resp.setContentType("text/html"); - - writer.println("" + name + ""); /* BAD */ - writer.println("" + clean + ""); /* BAD */ - } - - /** - * buggy javascript sanitization routine - * */ - private String clean(String name) { - StringBuffer buf = new StringBuffer(); - for(int i = 0; i < name.length(); i++) { - char ch = name.charAt(i); - switch (ch) { - case '&': - buf.append("&"); break; - default: - buf.append(ch); break; - } - } - - return buf.toString(); - } - - public String getDescription() { - return "buggy sanitizer"; - } - - public int getVulnerabilityCount() { - return 2; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.class deleted file mode 100644 index 369b0c68fbaf..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.java deleted file mode 100644 index ae97830f1bc2..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers5.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers5.java,v 1.5 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="encode and then decode" - * @servlet vuln_count = "1" - * */ -public class Sanitizers5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String s = req.getParameter(FIELD_NAME); - String name = s.toLowerCase(Locale.UK); - String enc = URLEncoder.encode("/user/" + name, "UTF-8"); - String dec = URLDecoder.decode(enc, "UTF-8"); - - resp.sendRedirect(dec); /* BAD */ - resp.sendRedirect(enc); /* OK */ - } - - public String getDescription() { - return "encode and then decode"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.class b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.class deleted file mode 100644 index b447477097f9..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.java b/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.java deleted file mode 100644 index 564624dd4c3a..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/sanitizers/Sanitizers6.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Sanitizers6.java,v 1.4 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.sanitizers; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="sanitizers for directory traversal" - * @servlet vuln_count = "0" - * */ -public class Sanitizers6 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private PrintWriter writer; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - String clean = clean(name); - - writer = resp.getWriter(); - resp.setContentType("text/html"); - - writer.println("" + clean + ""); /* OK */ - } - - /** - * @sanitizer - * sanitization routine for removing . and /\ characters from strings. - * This routine performs white-listing by only allowing letters and digits through. - * */ - private static String clean(String name) { - StringBuffer buf = new StringBuffer(); - for(int i = 0; i < name.length(); i++) { - char ch = name.charAt(i); - - if(Character.isLetter(ch) || Character.isDigit(ch) || ch == '_') { - buf.append(ch); - } else { - buf.append('?'); - } - } - - return buf.toString(); - } - - public String getDescription() { - return "simple sanitization check"; - } - - public int getVulnerabilityCount() { - return 1; - } - - public static void main(String[] args) { - System.out.println(clean("xx/../yy")); // xx????yy - System.out.println(clean("~xx")); // ?xx - System.out.println(clean("xx_yy")); // xx_yy - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session1.class b/benchmarks/src/test/resources/securibench/micro/session/Session1.class deleted file mode 100644 index c58a40126f54..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/session/Session1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session1.java b/benchmarks/src/test/resources/securibench/micro/session/Session1.java deleted file mode 100644 index a2a8cfbb0901..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/session/Session1.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Session1.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.session; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple session test" - * @servlet vuln_count = "1" - * */ -public class Session1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - HttpSession session = req.getSession(); - session.setAttribute("name", name); - String s2 = (String) session.getAttribute("name"); - - PrintWriter writer = resp.getWriter(); - writer.println(s2); /* BAD */ - } - - public String getDescription() { - return "simple session test"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session2.class b/benchmarks/src/test/resources/securibench/micro/session/Session2.class deleted file mode 100644 index 563c623e31cf..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/session/Session2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session2.java b/benchmarks/src/test/resources/securibench/micro/session/Session2.java deleted file mode 100644 index ef9228f6c6f6..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/session/Session2.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Session2.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.session; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test of session false positives" - * @servlet vuln_count = "1" - * */ -public class Session2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - HttpSession session = req.getSession(); - session.setAttribute("name", name); - String s2 = (String) session.getAttribute("name"); - String s3 = (String) session.getAttribute("nonsense"); - PrintWriter writer = resp.getWriter(); - - writer.println(s2); /* BAD */ - writer.println(s3); /* OK */ - } - - public String getDescription() { - return "test of session false positives"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session3.class b/benchmarks/src/test/resources/securibench/micro/session/Session3.class deleted file mode 100644 index 3119b7e14eae..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/session/Session3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/session/Session3.java b/benchmarks/src/test/resources/securibench/micro/session/Session3.java deleted file mode 100644 index 64416b4ab0e8..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/session/Session3.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: Session3.java,v 1.3 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.session; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Enumeration; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="test of session enumeration" - * @servlet vuln_count = "1" - * */ -public class Session3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - HttpSession session = req.getSession(); - session.setAttribute("name", name); - Enumeration e = session.getAttributeNames(); - while(e.hasMoreElements()) { - String attrName = (String) e.nextElement(); - String attrValue = (String) session.getAttribute(attrName); - - PrintWriter writer = resp.getWriter(); - writer.println(attrValue); /* BAD */ - } - } - - public String getDescription() { - return "test of session enumeration"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.class deleted file mode 100644 index 387ffcab767e..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.java b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.java deleted file mode 100644 index 44eb56597986..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates1.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: StrongUpdates1.java,v 1.5 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.strong_updates; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple test of strong updates" - * @servlet vuln_count = "0" - * */ -public class StrongUpdates1 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - name = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ - } - - public String getDescription() { - return "simple test of strong updates"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.class deleted file mode 100644 index 0aa53522bff8..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.java b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.java deleted file mode 100644 index 8b9da7f7cc01..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates2.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: StrongUpdates2.java,v 1.4 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.strong_updates; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="simple test of strong updates" - * @servlet vuln_count = "0" - * */ -public class StrongUpdates2 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - name = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ - } - - public String getDescription() { - return "simple test of strong updates"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3$Widget.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3$Widget.class deleted file mode 100644 index 293157fe7ac3..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3$Widget.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.class deleted file mode 100644 index da071211733d..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.java b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.java deleted file mode 100644 index 41b88ee98f67..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates3.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: StrongUpdates3.java,v 1.4 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.strong_updates; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="strong updates in data structures" - * @servlet vuln_count = "0" - * */ -public class StrongUpdates3 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - - class Widget { - String value = null; - } - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - String name = req.getParameter(FIELD_NAME); - Widget w = new Widget(); - w.value = name; - w.value = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(w.value); /* OK */ - } - - public String getDescription() { - return "strong updates in data structures"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.class deleted file mode 100644 index f05f0ef73cf9..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.java b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.java deleted file mode 100644 index aeb3ee2138a5..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates4.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: StrongUpdates4.java,v 1.2 2006/04/04 20:00:41 livshits Exp $ - */ -package securibench.micro.strong_updates; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="a more tricky test of when we can't assume a strong update with multiple variables that are not thread-local" - * @servlet vuln_count = "1" - * */ -public class StrongUpdates4 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - /* This is really tricky because the field is shared across multiple users of the same servlet. - * So, depending on the user interaction, we can have a data race with two users accessing field - * "name". Therefore, when u1 sets it, u1 resets it, u2 sets it, u1 reads it, we can still have a problem. - * */ - private String name; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - name = req.getParameter(FIELD_NAME); - name = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* BAD */ - } - - public String getDescription() { - return - "a more tricky test of when we can't assume a strong " + - "update with multiple variables that are not thread-local"; - } - - public int getVulnerabilityCount() { - return 1; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.class b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.class deleted file mode 100644 index 289e808b5d94..000000000000 Binary files a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.class and /dev/null differ diff --git a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.java b/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.java deleted file mode 100644 index 0fba15744c6c..000000000000 --- a/benchmarks/src/test/resources/securibench/micro/strongupdates/StrongUpdates5.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2006 Benjamin Livshits - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -/** - @author Benjamin Livshits - - $Id: StrongUpdates5.java,v 1.3 2006/04/21 17:14:27 livshits Exp $ - */ -package securibench.micro.strong_updates; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import securibench.micro.BasicTestCase; -import securibench.micro.MicroTestCase; - -/** - * @servlet description="making a shared servlet field thread-local" - * @servlet vuln_count = "0" - * */ -public class StrongUpdates5 extends BasicTestCase implements MicroTestCase { - private static final String FIELD_NAME = "name"; - private String name; - - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - // access to this.name is protected within the block, so we are safe - synchronized (this.name) { - name = req.getParameter(FIELD_NAME); - name = "abc"; - - PrintWriter writer = resp.getWriter(); - writer.println(name); /* OK */ - } - } - - public String getDescription() { - return "making a shared servlet field thread-local"; - } - - public int getVulnerabilityCount() { - return 0; - } -} \ No newline at end of file diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/BenchmarkTags.scala b/benchmarks/src/test/scala/io/joern/benchmarks/BenchmarkTags.scala deleted file mode 100644 index 1fb77921bdca..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/BenchmarkTags.scala +++ /dev/null @@ -1,115 +0,0 @@ -package io.joern.benchmarks - -import org.scalatest.Tag - -import java.io.{File, PrintStream} -import scala.collection.mutable - -object BenchmarkTags { - - val resultsOut: PrintStream = Option(System.getenv("JOERN_BENCHMARK_RESULT_FILE")) match { - case Some(filePath) => - val f = new File(filePath) - f.getParentFile.mkdirs() - f.createNewFile() - new PrintStream(f) - case None => System.out - } - - object Aliasing extends Tag("Aliasing") - object Arrays extends Tag("Arrays") - object Basic extends Tag("Basic") - object Collections extends Tag("Collections") - object DataStructures extends Tag("Data Structures") - object Factories extends Tag("Factories") - object Inter extends Tag("Inter-procedural") - object Pred extends Tag("Predicates") - object Refl extends Tag("Reflection") - object Sanitizers extends Tag("Sanitizers") - object Session extends Tag("Session") - object StrongUpdates extends Tag("Strong Updates") - // Additional tags for IFSPEC - object Casting extends Tag("Casting") - object ClassInitializer extends Tag("Class Initializer") - object HighConditional extends Tag("High Conditional") - object ImplicitFlows extends Tag("Implicit Flows") - object Exceptions extends Tag("Exceptions") - object ExplicitFlows extends Tag("Explicit Flows") - object Library extends Tag("Library") - object Simple extends Tag("Simple") - // Additional tags for JInfoFlow - object Context extends Tag("Context") - object Events extends Tag("Event") - - def TAGS: Seq[String] = Seq( - Aliasing.name, - Arrays.name, - Basic.name, - Collections.name, - DataStructures.name, - Factories.name, - Inter.name, - Pred.name, - Refl.name, - Sanitizers.name, - Session.name, - StrongUpdates.name, - Casting.name, - ClassInitializer.name, - HighConditional.name, - ImplicitFlows.name, - Exceptions.name, - ExplicitFlows.name, - Library.name, - Simple.name, - Context.name, - Events.name - ) - - val confusionMatrix = mutable.Map.empty[String, Array[Int]] - val FP = 0 - val TP = 1 - val TN = 2 - val FN = 3 - - TAGS.foreach { tag => - confusionMatrix.put(tag, Array.ofDim[Int](4)) - } - - private def finalResults(): Unit = { - val catWhiteSpaceCount = TAGS.maxBy(_.length).length - val catWhiteSpace = for (_ <- 0 until (catWhiteSpaceCount - "Category".length)) yield ' ' - resultsOut.println(s"| Category ${catWhiteSpace.mkString} | # | FP | TP | TN | FN |") - resultsOut.println( - s"| ${(for (_ <- 0 to catWhiteSpaceCount) yield '-').mkString} | ---- | ---- | ---- | ---- | ---- |" - ) - TAGS.filter { tag => confusionMatrix(tag).sum > 0 }.foreach { tag => - val m = confusionMatrix(tag) - resultsOut.println(s"| $tag ${(for (_ <- 0 until (catWhiteSpaceCount - tag.length)) - yield ' ').mkString} | ${m.sum} | ${m(FP)} | ${m(TP)} | ${m(TN)} | ${m(FN)} |") - } - val (totalTests, fps, tps, tns, fns) = getTotalTests - resultsOut.println(s"| *Total* ${(for (_ <- 0 until (catWhiteSpaceCount - "*Total*".length)) - yield ' ').mkString} | *$totalTests* | *$fps* | *$tps* | *$tns* | *$fns* |\n") - resultsOut.println(s"Total accuracy: ${String.format("%.3f", (tns + tps + 0.0) / totalTests * 100.0)}%") - } - - private def getTotalTests: (Int, Int, Int, Int, Int) = { - val impl = confusionMatrix.getOrElse(ImplicitFlows.name, Array.ofDim[Int](4)) - val expl = confusionMatrix.getOrElse(ExplicitFlows.name, Array.ofDim[Int](4)) - if (impl.sum > 0 || expl.sum > 0) { - // running IFSpec so this means there is a 1-many relationship with tests-categories - (impl.sum + expl.sum, impl(FP) + expl(FP), impl(TP) + expl(TP), impl(TN) + expl(TN), impl(FN) + expl(FN)) - } else { - ( - confusionMatrix.map(_._2.sum).sum, - confusionMatrix.map(_._2(FP)).sum, - confusionMatrix.map(_._2(TP)).sum, - confusionMatrix.map(_._2(TN)).sum, - confusionMatrix.map(_._2(FN)).sum - ) - } - } - - sys.addShutdownHook(finalResults()) -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/AliasingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/AliasingBenchmark.scala deleted file mode 100644 index 05ad67ed6945..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/AliasingBenchmark.scala +++ /dev/null @@ -1,105 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{Aliasing, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecAliasingFixture -import io.shiftleft.semanticcpg.language._ - -// AliasingControlFlowInsecure -class AliasingBenchmark1 extends IfspecAliasingFixture(JAVA_EXT, 1) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingControlFlowSecure -class AliasingBenchmark2 extends IfspecAliasingFixture(JAVA_EXT, 2) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingInterProceduralInsecure -class AliasingBenchmark3 extends IfspecAliasingFixture(JAVA_EXT, 3) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingInterProceduralSecure -class AliasingBenchmark4 extends IfspecAliasingFixture(JAVA_EXT, 4) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingNestedInsecure -class AliasingBenchmark5 extends IfspecAliasingFixture(JAVA_EXT, 5) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingNestedSecure -class AliasingBenchmark6 extends IfspecAliasingFixture(JAVA_EXT, 6) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingSimpleInsecure -class AliasingBenchmark7 extends IfspecAliasingFixture(JAVA_EXT, 7) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.method.call(".*test.*").argument(1), cpg.method("test").ast.isReturn) - } - -} - -// AliasingSimpleSecure -class AliasingBenchmark8 extends IfspecAliasingFixture(JAVA_EXT, 8) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.method.call(".*test.*").argument(1), cpg.method("test").ast.isReturn) - } - -} - -// AliasingStrongUpdateSecure -class AliasingBenchmark9 extends IfspecAliasingFixture(JAVA_EXT, 9) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// DeepAlias1 -class AliasingBenchmark10 extends IfspecAliasingFixture(JAVA_EXT, 10) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").ast.isReturn) - } - -} - -// DeepAlias2 -class AliasingBenchmark11 extends IfspecAliasingFixture(JAVA_EXT, 11) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").ast.isReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ArraysBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ArraysBenchmark.scala deleted file mode 100644 index 772e9ec13466..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ArraysBenchmark.scala +++ /dev/null @@ -1,96 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{Arrays, Exceptions, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecArraysFixture -import io.shiftleft.semanticcpg.language._ - -// ArrayCopyDirectLeak -class ArraysBenchmark1 extends IfspecArraysFixture(JAVA_EXT, 1) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argumentIndex(1, 3), cpg.method("f").methodReturn) - } - -} - -// ArrayIndexExceptionInsecure -class ArraysBenchmark2 extends IfspecArraysFixture(JAVA_EXT, 2) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ImplicitFlows, Exceptions) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArrayIndexExceptionSecure -class ArraysBenchmark3 extends IfspecArraysFixture(JAVA_EXT, 3) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ImplicitFlows, Exceptions) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArrayIndexSensitivitySecure -class ArraysBenchmark4 extends IfspecArraysFixture(JAVA_EXT, 4) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.method("foo").parameter, cpg.method("foo").methodReturn) - } - -} - -// ArraysImplicitLeakInsecure -class ArraysBenchmark5 extends IfspecArraysFixture(JAVA_EXT, 5) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArraysImplicitLeakSecure -class ArraysBenchmark6 extends IfspecArraysFixture(JAVA_EXT, 6) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArraySizeStrongUpdate -class ArraysBenchmark7 extends IfspecArraysFixture(JAVA_EXT, 7) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// SimpleArraySize -class ArraysBenchmark8 extends IfspecArraysFixture(JAVA_EXT, 8) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*arraySizeLeak.*").argument(1), cpg.method("arraySizeLeak").methodReturn) - } - -} - -// Webstore1 -class ArraysBenchmark9 extends IfspecArraysFixture(JAVA_EXT, 9) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.call(".*buyProduct.*").argument, cpg.method("buyProduct").methodReturn) - } - -} - -// Webstore2 -class ArraysBenchmark10 extends IfspecArraysFixture(JAVA_EXT, 10) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*vPrime.*"), cpg.method("seePreview").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/CastingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/CastingBenchmark.scala deleted file mode 100644 index 977befcdecb6..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/CastingBenchmark.scala +++ /dev/null @@ -1,24 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{Casting, Exceptions, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecCastingFixture -import io.shiftleft.semanticcpg.language._ - -// LostInCast -class CastingBenchmark1 extends IfspecCastingFixture(JAVA_EXT, 1) { - - s"Casting$benchmarkNo" should "report secure" taggedAs (Casting, ExplicitFlows) in { - assertIsSecure(cpg.call(".*doIt.*").argument(1), cpg.method("doIt").methodReturn) - } - -} - -// SimpleTypesCastingError -class CastingBenchmark2 extends IfspecCastingFixture(JAVA_EXT, 2) { - - s"Casting$benchmarkNo" should "report insecure" taggedAs (Exceptions, Casting, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ClassInitializerBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ClassInitializerBenchmark.scala deleted file mode 100644 index 1395ef8d6f54..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ClassInitializerBenchmark.scala +++ /dev/null @@ -1,69 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{Arrays, ClassInitializer, ExplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecClassInitializerFixture -import io.shiftleft.semanticcpg.language._ - -// StaticInitializersArrayAccessInsecure -class ClassInitializerBenchmark1 extends IfspecClassInitializerFixture(JAVA_EXT, 1) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (Arrays, ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersArrayAccessSecure -class ClassInitializerBenchmark2 extends IfspecClassInitializerFixture(JAVA_EXT, 2) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (Arrays, ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersHighAccessInsecure -class ClassInitializerBenchmark3 extends IfspecClassInitializerFixture(JAVA_EXT, 3) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersHighAccessSecure -class ClassInitializerBenchmark4 extends IfspecClassInitializerFixture(JAVA_EXT, 4) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersLeak -class ClassInitializerBenchmark5 extends IfspecClassInitializerFixture(JAVA_EXT, 5) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*h.*"), cpg.fieldAccess.code(".*l.*")) - } - -} - -// StaticInitializersNoLeak -class ClassInitializerBenchmark6 extends IfspecClassInitializerFixture(JAVA_EXT, 6) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*h.*"), cpg.fieldAccess.code(".*l.*")) - } - -} - -// StaticInitializersNotCalled -class ClassInitializerBenchmark7 extends IfspecClassInitializerFixture(JAVA_EXT, 7) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ExceptionsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ExceptionsBenchmark.scala deleted file mode 100644 index ccfaa7218894..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/ExceptionsBenchmark.scala +++ /dev/null @@ -1,63 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{Exceptions, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecExceptionsFixture -import io.shiftleft.semanticcpg.language._ - -// ConditionalLeakage -class ExceptionsBenchmark1 extends IfspecExceptionsFixture(JAVA_EXT, 1) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*divide.*").argument(2), cpg.method(".*divide.*").call(".*println.*").argument(1)) - } - -} - -// ExceptionalControlFlow1Insecure -class ExceptionsBenchmark2 extends IfspecExceptionsFixture(JAVA_EXT, 2) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionalControlFlow1Secure -class ExceptionsBenchmark3 extends IfspecExceptionsFixture(JAVA_EXT, 3) { - - s"Exceptions$benchmarkNo" should "report secure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionalControlFlow2Secure -class ExceptionsBenchmark4 extends IfspecExceptionsFixture(JAVA_EXT, 4) { - - s"Exceptions$benchmarkNo" should "report secure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionDivZero -class ExceptionsBenchmark5 extends IfspecExceptionsFixture(JAVA_EXT, 5) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure( - cpg.call(".*nextInt.*").receiver, - cpg.call.methodFullName(".*writeToDisk.*", ".*writeToDB.*").argument(1) - ) - } - -} - -// ExceptionHandling -class ExceptionsBenchmark6 extends IfspecExceptionsFixture(JAVA_EXT, 6) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument(1), cpg.method("f").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/HighConditionalBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/HighConditionalBenchmark.scala deleted file mode 100644 index 3f2d4110196a..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/HighConditionalBenchmark.scala +++ /dev/null @@ -1,116 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, HighConditional, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecHighConditionalFixture -import io.shiftleft.semanticcpg.language._ - -// HighConditionalIncrementalLeakInsecure -class HighConditionalBenchmark1 extends IfspecHighConditionalFixture(JAVA_EXT, 1) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument, cpg.method("f").methodReturn) - } - -} - -// HighConditionalIncrementalLeakSecure -class HighConditionalBenchmark2 extends IfspecHighConditionalFixture(JAVA_EXT, 2) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.method("f").parameter.code(".*h.*"), cpg.method("f").methodReturn) - assertIsSecure(cpg.method("f").parameter.code(".*l.*"), cpg.method("f").parameter.code(".*h.*")) - } - -} - -// IFLoop1 -class HighConditionalBenchmark3 extends IfspecHighConditionalFixture(JAVA_EXT, 3) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ExplicitFlows) in { - assertIsSecure(cpg.method("secure_ifl").call(".*secure_ifl.*").argument(1), cpg.method("secure_ifl").methodReturn) - } - -} - -// IFLoop2 -class HighConditionalBenchmark4 extends IfspecHighConditionalFixture(JAVA_EXT, 4) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*high.*"), cpg.fieldAccess.code(".*low.*")) - } - -} - -// ScenarioBankingInsecure -class HighConditionalBenchmark5 extends IfspecHighConditionalFixture(JAVA_EXT, 5) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*balance.*"), cpg.call(".*log.*").argument) - } - -} - -// ScenarioBankingSecure -class HighConditionalBenchmark6 extends IfspecHighConditionalFixture(JAVA_EXT, 6) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*balance.*"), cpg.call(".*log.*").argument) - } - -} - -// ScenarioPasswordInsecure -class HighConditionalBenchmark7 extends IfspecHighConditionalFixture(JAVA_EXT, 7) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*[password|loggedIn|invalidTries].*"), cpg.call(".*println.*").argument) - } - -} - -// ScenarioPasswordSecure -class HighConditionalBenchmark8 extends IfspecHighConditionalFixture(JAVA_EXT, 8) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*[password|loggedIn|invalidTries].*"), cpg.call(".*println.*").argument) - } - -} - -// SimpleConditionalAssignmentEqual -class HighConditionalBenchmark9 extends IfspecHighConditionalFixture(JAVA_EXT, 9) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} - -// SimpleErasureByConditionalChecks -class HighConditionalBenchmark10 extends IfspecHighConditionalFixture(JAVA_EXT, 10) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.call(".*computeSecretly.*").argument(1), cpg.method("computeSecretly").methodReturn) - } - -} - -// SimpleTypes -class HighConditionalBenchmark11 extends IfspecHighConditionalFixture(JAVA_EXT, 11) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} - -// Webstore4 -class HighConditionalBenchmark12 extends IfspecHighConditionalFixture(JAVA_EXT, 12) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*[vPrime|street].*"), cpg.method("seePreview").methodReturn) - assertIsSecure(cpg.call(".*reinit.*").argument, cpg.method("seePreview").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/LibraryBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/LibraryBenchmark.scala deleted file mode 100644 index e47599bf00f2..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/LibraryBenchmark.scala +++ /dev/null @@ -1,69 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, ImplicitFlows, Library} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecLibraryFixture -import io.shiftleft.semanticcpg.language._ - -// ImplicitListSizeLeak -class LibraryBenchmark1 extends IfspecLibraryFixture(JAVA_EXT, 1) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// ImplicitListSizeNoLeak -class LibraryBenchmark2 extends IfspecLibraryFixture(JAVA_EXT, 2) { - - s"Library$benchmarkNo" should "report secure" taggedAs (Library, ImplicitFlows) in { - assertIsSecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// PasswordChecker -class LibraryBenchmark3 extends IfspecLibraryFixture(JAVA_EXT, 3) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*nextLine.*").receiver, cpg.call(".*println.*").argument(0)) - } - -} - -// SimpleListSize -class LibraryBenchmark4 extends IfspecLibraryFixture(JAVA_EXT, 4) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// SimpleListToArraySize -class LibraryBenchmark5 extends IfspecLibraryFixture(JAVA_EXT, 5) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listArraySizeLeak.*").argument, cpg.method("listArraySizeLeak").methodReturn) - } - -} - -// StringIntern -class LibraryBenchmark6 extends IfspecLibraryFixture(JAVA_EXT, 6) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument, cpg.method("foo").methodReturn) - } - -} - -// TimeBomb -class LibraryBenchmark7 extends IfspecLibraryFixture(JAVA_EXT, 7) { - - s"Library$benchmarkNo" should "report secure" taggedAs (Library, ExplicitFlows) in { - assertIsSecure(cpg.call(".*noLeak.*").argument, cpg.method("noLeak").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/SimpleBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/SimpleBenchmark.scala deleted file mode 100644 index f9b7819e05a7..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/java/SimpleBenchmark.scala +++ /dev/null @@ -1,168 +0,0 @@ -package io.joern.benchmarks.ifspec.java - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, ImplicitFlows, Simple} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecSimpleFixture -import io.shiftleft.semanticcpg.language._ - -// BooleanOperationsInsecure -class SimpleBenchmark1 extends IfspecSimpleFixture(JAVA_EXT, 1) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.method("leakyMethod").parameter, cpg.method("leakyMethod").methodReturn) - } - -} - -// BooleanOperationsSecure -class SimpleBenchmark2 extends IfspecSimpleFixture(JAVA_EXT, 2) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.method("leakyMethod").parameter, cpg.method("leakyMethod").methodReturn) - } - -} - -// CallContext -class SimpleBenchmark3 extends IfspecSimpleFixture(JAVA_EXT, 3) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DeepCall1 -class SimpleBenchmark4 extends IfspecSimpleFixture(JAVA_EXT, 4) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DeepCall2 -class SimpleBenchmark5 extends IfspecSimpleFixture(JAVA_EXT, 5) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DirectAssignment -class SimpleBenchmark6 extends IfspecSimpleFixture(JAVA_EXT, 6) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*leakyMethod.*").argument(1), cpg.method("leakyMethod").methodReturn) - } - -} - -// DirectAssignmentLeak -class SimpleBenchmark7 extends IfspecSimpleFixture(JAVA_EXT, 7) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument(1), cpg.method("f").methodReturn) - } - -} - -// DirectAssignmentSecure -class SimpleBenchmark8 extends IfspecSimpleFixture(JAVA_EXT, 8) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*leakyMethod.*").argument(1), cpg.method("leakyMethod").methodReturn) - } - -} - -// IFMethodContract1 -class SimpleBenchmark9 extends IfspecSimpleFixture(JAVA_EXT, 9) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*high.*"), cpg.fieldAccess.code(".*low.*")) - } - -} - -// IFMethodContract2 -class SimpleBenchmark10 extends IfspecSimpleFixture(JAVA_EXT, 10) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.method("insecure_if_high_n1").parameter.code(".*high.*"), cpg.method("insecure_if_high_n1")) - } - -} - -// ObjectSensLeak -class SimpleBenchmark11 extends IfspecSimpleFixture(JAVA_EXT, 11) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*test.*").argument, cpg.method("test").methodReturn) - } - -} - -// Polynomial -class SimpleBenchmark12 extends IfspecSimpleFixture(JAVA_EXT, 12) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ImplicitFlows) in { - assertIsSecure(cpg.call(".*compute.*").argument(1), cpg.method("compute").methodReturn) - } - -} - -// ReviewerAnonymityLeak -class SimpleBenchmark13 extends IfspecSimpleFixture(JAVA_EXT, 13) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*addReview.*").argument, cpg.call("println").argument) - } - -} - -// ReviewerAnonymityNoLeak -class SimpleBenchmark14 extends IfspecSimpleFixture(JAVA_EXT, 14) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*addReview.*").argument(1), cpg.call("println").argument) - } - -} - -// SimpleRandomErasure1 -class SimpleBenchmark15 extends IfspecSimpleFixture(JAVA_EXT, 15) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call("println").argument) - } - -} - -// SimpleRandomErasure2 -class SimpleBenchmark16 extends IfspecSimpleFixture(JAVA_EXT, 16) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call("println").argument) - } - -} - -// StaticDispatching -class SimpleBenchmark17 extends IfspecSimpleFixture(JAVA_EXT, 17) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*[h|l].*"), cpg.fieldAccess.code(".*[hsink|lsink].*")) - } - -} - -// Webstore3 -class SimpleBenchmark18 extends IfspecSimpleFixture(JAVA_EXT, 18) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*setDeliveryAdr.*").argument, cpg.fieldAccess.code(".*[name|street].*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/AliasingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/AliasingBenchmark.scala deleted file mode 100644 index c6f236675797..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/AliasingBenchmark.scala +++ /dev/null @@ -1,105 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{Aliasing, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecAliasingFixture -import io.shiftleft.semanticcpg.language._ - -// AliasingControlFlowInsecure -class AliasingBenchmark1 extends IfspecAliasingFixture(JVM_EXT, 1) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingControlFlowSecure -class AliasingBenchmark2 extends IfspecAliasingFixture(JVM_EXT, 2) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingInterProceduralInsecure -class AliasingBenchmark3 extends IfspecAliasingFixture(JVM_EXT, 3) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingInterProceduralSecure -class AliasingBenchmark4 extends IfspecAliasingFixture(JVM_EXT, 4) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingNestedInsecure -class AliasingBenchmark5 extends IfspecAliasingFixture(JVM_EXT, 5) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingNestedSecure -class AliasingBenchmark6 extends IfspecAliasingFixture(JVM_EXT, 6) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// AliasingSimpleInsecure -class AliasingBenchmark7 extends IfspecAliasingFixture(JVM_EXT, 7) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.method.call(".*test.*").argument(1), cpg.method("test").ast.isReturn) - } - -} - -// AliasingSimpleSecure -class AliasingBenchmark8 extends IfspecAliasingFixture(JVM_EXT, 8) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.method.call(".*test.*").argument(1), cpg.method("test").ast.isReturn) - } - -} - -// AliasingStrongUpdateSecure -class AliasingBenchmark9 extends IfspecAliasingFixture(JVM_EXT, 9) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// DeepAlias1 -class AliasingBenchmark10 extends IfspecAliasingFixture(JVM_EXT, 10) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").ast.isReturn) - } - -} - -// DeepAlias2 -class AliasingBenchmark11 extends IfspecAliasingFixture(JVM_EXT, 11) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs (Aliasing, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").ast.isReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ArraysBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ArraysBenchmark.scala deleted file mode 100644 index f855acb60162..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ArraysBenchmark.scala +++ /dev/null @@ -1,96 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{Arrays, Exceptions, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecArraysFixture -import io.shiftleft.semanticcpg.language._ - -// ArrayCopyDirectLeak -class ArraysBenchmark1 extends IfspecArraysFixture(JVM_EXT, 1) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argumentIndex(1, 3), cpg.method("f").methodReturn) - } - -} - -// ArrayIndexExceptionInsecure -class ArraysBenchmark2 extends IfspecArraysFixture(JVM_EXT, 2) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ImplicitFlows, Exceptions) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArrayIndexExceptionSecure -class ArraysBenchmark3 extends IfspecArraysFixture(JVM_EXT, 3) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ImplicitFlows, Exceptions) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArrayIndexSensitivitySecure -class ArraysBenchmark4 extends IfspecArraysFixture(JVM_EXT, 4) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.method("foo").parameter, cpg.method("foo").methodReturn) - } - -} - -// ArraysImplicitLeakInsecure -class ArraysBenchmark5 extends IfspecArraysFixture(JVM_EXT, 5) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArraysImplicitLeakSecure -class ArraysBenchmark6 extends IfspecArraysFixture(JVM_EXT, 6) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// ArraySizeStrongUpdate -class ArraysBenchmark7 extends IfspecArraysFixture(JVM_EXT, 7) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} - -// SimpleArraySize -class ArraysBenchmark8 extends IfspecArraysFixture(JVM_EXT, 8) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs (Arrays, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*arraySizeLeak.*").argument(1), cpg.method("arraySizeLeak").methodReturn) - } - -} - -// Webstore1 -class ArraysBenchmark9 extends IfspecArraysFixture(JVM_EXT, 9) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.call(".*buyProduct.*").argument, cpg.method("buyProduct").methodReturn) - } - -} - -// Webstore2 -class ArraysBenchmark10 extends IfspecArraysFixture(JVM_EXT, 10) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs (Arrays, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*vPrime.*"), cpg.method("seePreview").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/CastingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/CastingBenchmark.scala deleted file mode 100644 index da6d2727bcce..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/CastingBenchmark.scala +++ /dev/null @@ -1,24 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{Casting, Exceptions, ExplicitFlows, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecCastingFixture -import io.shiftleft.semanticcpg.language._ - -// LostInCast -class CastingBenchmark1 extends IfspecCastingFixture(JVM_EXT, 1) { - - s"Casting$benchmarkNo" should "report secure" taggedAs (Casting, ExplicitFlows) in { - assertIsSecure(cpg.call(".*doIt.*").argument(1), cpg.method("doIt").methodReturn) - } - -} - -// SimpleTypesCastingError -class CastingBenchmark2 extends IfspecCastingFixture(JVM_EXT, 2) { - - s"Casting$benchmarkNo" should "report insecure" taggedAs (Exceptions, Casting, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ClassInitializerBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ClassInitializerBenchmark.scala deleted file mode 100644 index d423cc74cff7..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ClassInitializerBenchmark.scala +++ /dev/null @@ -1,69 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{Arrays, ClassInitializer, ExplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecClassInitializerFixture -import io.shiftleft.semanticcpg.language._ - -// StaticInitializersArrayAccessInsecure -class ClassInitializerBenchmark1 extends IfspecClassInitializerFixture(JVM_EXT, 1) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (Arrays, ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersArrayAccessSecure -class ClassInitializerBenchmark2 extends IfspecClassInitializerFixture(JVM_EXT, 2) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (Arrays, ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersHighAccessInsecure -class ClassInitializerBenchmark3 extends IfspecClassInitializerFixture(JVM_EXT, 3) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersHighAccessSecure -class ClassInitializerBenchmark4 extends IfspecClassInitializerFixture(JVM_EXT, 4) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call(".*println.*").argument(1)) - } - -} - -// StaticInitializersLeak -class ClassInitializerBenchmark5 extends IfspecClassInitializerFixture(JVM_EXT, 5) { - - s"ClassInitializer$benchmarkNo" should "report insecure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*h.*"), cpg.fieldAccess.code(".*l.*")) - } - -} - -// StaticInitializersNoLeak -class ClassInitializerBenchmark6 extends IfspecClassInitializerFixture(JVM_EXT, 6) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*h.*"), cpg.fieldAccess.code(".*l.*")) - } - -} - -// StaticInitializersNotCalled -class ClassInitializerBenchmark7 extends IfspecClassInitializerFixture(JVM_EXT, 7) { - - s"ClassInitializer$benchmarkNo" should "report secure" taggedAs (ClassInitializer, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret"), cpg.call(".*println.*").argument(1)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ExceptionsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ExceptionsBenchmark.scala deleted file mode 100644 index fa2e5df8ea4e..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/ExceptionsBenchmark.scala +++ /dev/null @@ -1,63 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{Exceptions, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecExceptionsFixture -import io.shiftleft.semanticcpg.language._ - -// ConditionalLeakage -class ExceptionsBenchmark1 extends IfspecExceptionsFixture(JVM_EXT, 1) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*divide.*").argument(2), cpg.method(".*divide.*").call(".*println.*").argument(1)) - } - -} - -// ExceptionalControlFlow1Insecure -class ExceptionsBenchmark2 extends IfspecExceptionsFixture(JVM_EXT, 2) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionalControlFlow1Secure -class ExceptionsBenchmark3 extends IfspecExceptionsFixture(JVM_EXT, 3) { - - s"Exceptions$benchmarkNo" should "report secure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionalControlFlow2Secure -class ExceptionsBenchmark4 extends IfspecExceptionsFixture(JVM_EXT, 4) { - - s"Exceptions$benchmarkNo" should "report secure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// ExceptionDivZero -class ExceptionsBenchmark5 extends IfspecExceptionsFixture(JVM_EXT, 5) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure( - cpg.call(".*nextInt.*").receiver, - cpg.call.methodFullName(".*writeToDisk.*", ".*writeToDB.*").argument(1) - ) - } - -} - -// ExceptionHandling -class ExceptionsBenchmark6 extends IfspecExceptionsFixture(JVM_EXT, 6) { - - s"Exceptions$benchmarkNo" should "report insecure" taggedAs (Exceptions, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument(1), cpg.method("f").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/HighConditionalBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/HighConditionalBenchmark.scala deleted file mode 100644 index 91f8a2573764..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/HighConditionalBenchmark.scala +++ /dev/null @@ -1,116 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, HighConditional, ImplicitFlows} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecHighConditionalFixture -import io.shiftleft.semanticcpg.language._ - -// HighConditionalIncrementalLeakInsecure -class HighConditionalBenchmark1 extends IfspecHighConditionalFixture(JVM_EXT, 1) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument, cpg.method("f").methodReturn) - } - -} - -// HighConditionalIncrementalLeakSecure -class HighConditionalBenchmark2 extends IfspecHighConditionalFixture(JVM_EXT, 2) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.method("f").parameter.code(".*h.*"), cpg.method("f").methodReturn) - assertIsSecure(cpg.method("f").parameter.code(".*l.*"), cpg.method("f").parameter.code(".*h.*")) - } - -} - -// IFLoop1 -class HighConditionalBenchmark3 extends IfspecHighConditionalFixture(JVM_EXT, 3) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ExplicitFlows) in { - assertIsSecure(cpg.method("secure_ifl").call(".*secure_ifl.*").argument(1), cpg.method("secure_ifl").methodReturn) - } - -} - -// IFLoop2 -class HighConditionalBenchmark4 extends IfspecHighConditionalFixture(JVM_EXT, 4) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*high.*"), cpg.fieldAccess.code(".*low.*")) - } - -} - -// ScenarioBankingInsecure -class HighConditionalBenchmark5 extends IfspecHighConditionalFixture(JVM_EXT, 5) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*balance.*"), cpg.call(".*log.*").argument) - } - -} - -// ScenarioBankingSecure -class HighConditionalBenchmark6 extends IfspecHighConditionalFixture(JVM_EXT, 6) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*balance.*"), cpg.call(".*log.*").argument) - } - -} - -// ScenarioPasswordInsecure -class HighConditionalBenchmark7 extends IfspecHighConditionalFixture(JVM_EXT, 7) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*[password|loggedIn|invalidTries].*"), cpg.call(".*println.*").argument) - } - -} - -// ScenarioPasswordSecure -class HighConditionalBenchmark8 extends IfspecHighConditionalFixture(JVM_EXT, 8) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*[password|loggedIn|invalidTries].*"), cpg.call(".*println.*").argument) - } - -} - -// SimpleConditionalAssignmentEqual -class HighConditionalBenchmark9 extends IfspecHighConditionalFixture(JVM_EXT, 9) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} - -// SimpleErasureByConditionalChecks -class HighConditionalBenchmark10 extends IfspecHighConditionalFixture(JVM_EXT, 10) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.call(".*computeSecretly.*").argument(1), cpg.method("computeSecretly").methodReturn) - } - -} - -// SimpleTypes -class HighConditionalBenchmark11 extends IfspecHighConditionalFixture(JVM_EXT, 11) { - - s"HighConditional$benchmarkNo" should "report insecure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.method("test").methodReturn) - } - -} - -// Webstore4 -class HighConditionalBenchmark12 extends IfspecHighConditionalFixture(JVM_EXT, 12) { - - s"HighConditional$benchmarkNo" should "report secure" taggedAs (HighConditional, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*[vPrime|street].*"), cpg.method("seePreview").methodReturn) - assertIsSecure(cpg.call(".*reinit.*").argument, cpg.method("seePreview").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/LibraryBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/LibraryBenchmark.scala deleted file mode 100644 index 08133d4882b3..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/LibraryBenchmark.scala +++ /dev/null @@ -1,69 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, ImplicitFlows, Library} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecLibraryFixture -import io.shiftleft.semanticcpg.language._ - -// ImplicitListSizeLeak -class LibraryBenchmark1 extends IfspecLibraryFixture(JVM_EXT, 1) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// ImplicitListSizeNoLeak -class LibraryBenchmark2 extends IfspecLibraryFixture(JVM_EXT, 2) { - - s"Library$benchmarkNo" should "report secure" taggedAs (Library, ImplicitFlows) in { - assertIsSecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// PasswordChecker -class LibraryBenchmark3 extends IfspecLibraryFixture(JVM_EXT, 3) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*nextLine.*").receiver, cpg.call(".*println.*").argument(0)) - } - -} - -// SimpleListSize -class LibraryBenchmark4 extends IfspecLibraryFixture(JVM_EXT, 4) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listSizeLeak.*").argument(1), cpg.method("listSizeLeak").methodReturn) - } - -} - -// SimpleListToArraySize -class LibraryBenchmark5 extends IfspecLibraryFixture(JVM_EXT, 5) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ImplicitFlows) in { - assertIsInsecure(cpg.call(".*listArraySizeLeak.*").argument, cpg.method("listArraySizeLeak").methodReturn) - } - -} - -// StringIntern -class LibraryBenchmark6 extends IfspecLibraryFixture(JVM_EXT, 6) { - - s"Library$benchmarkNo" should "report insecure" taggedAs (Library, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument, cpg.method("foo").methodReturn) - } - -} - -// TimeBomb -class LibraryBenchmark7 extends IfspecLibraryFixture(JVM_EXT, 7) { - - s"Library$benchmarkNo" should "report secure" taggedAs (Library, ExplicitFlows) in { - assertIsSecure(cpg.call(".*noLeak.*").argument, cpg.method("noLeak").methodReturn) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/SimpleBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/SimpleBenchmark.scala deleted file mode 100644 index 8acd03d5d402..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/ifspec/jvm/SimpleBenchmark.scala +++ /dev/null @@ -1,168 +0,0 @@ -package io.joern.benchmarks.ifspec.jvm - -import io.joern.benchmarks.BenchmarkTags.{ExplicitFlows, ImplicitFlows, Simple} -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.IfspecSimpleFixture -import io.shiftleft.semanticcpg.language._ - -// BooleanOperationsInsecure -class SimpleBenchmark1 extends IfspecSimpleFixture(JVM_EXT, 1) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.method("leakyMethod").parameter, cpg.method("leakyMethod").methodReturn) - } - -} - -// BooleanOperationsSecure -class SimpleBenchmark2 extends IfspecSimpleFixture(JVM_EXT, 2) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.method("leakyMethod").parameter, cpg.method("leakyMethod").methodReturn) - } - -} - -// CallContext -class SimpleBenchmark3 extends IfspecSimpleFixture(JVM_EXT, 3) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DeepCall1 -class SimpleBenchmark4 extends IfspecSimpleFixture(JVM_EXT, 4) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DeepCall2 -class SimpleBenchmark5 extends IfspecSimpleFixture(JVM_EXT, 5) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*foo.*").argument(1), cpg.method("foo").methodReturn) - } - -} - -// DirectAssignment -class SimpleBenchmark6 extends IfspecSimpleFixture(JVM_EXT, 6) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*leakyMethod.*").argument(1), cpg.method("leakyMethod").methodReturn) - } - -} - -// DirectAssignmentLeak -class SimpleBenchmark7 extends IfspecSimpleFixture(JVM_EXT, 7) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*f.*").argument(1), cpg.method("f").methodReturn) - } - -} - -// DirectAssignmentSecure -class SimpleBenchmark8 extends IfspecSimpleFixture(JVM_EXT, 8) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*leakyMethod.*").argument(1), cpg.method("leakyMethod").methodReturn) - } - -} - -// IFMethodContract1 -class SimpleBenchmark9 extends IfspecSimpleFixture(JVM_EXT, 9) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*high.*"), cpg.fieldAccess.code(".*low.*")) - } - -} - -// IFMethodContract2 -class SimpleBenchmark10 extends IfspecSimpleFixture(JVM_EXT, 10) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.method("insecure_if_high_n1").parameter.code(".*high.*"), cpg.method("insecure_if_high_n1")) - } - -} - -// ObjectSensLeak -class SimpleBenchmark11 extends IfspecSimpleFixture(JVM_EXT, 11) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*test.*").argument, cpg.method("test").methodReturn) - } - -} - -// Polynomial -class SimpleBenchmark12 extends IfspecSimpleFixture(JVM_EXT, 12) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ImplicitFlows) in { - assertIsSecure(cpg.call(".*compute.*").argument(1), cpg.method("compute").methodReturn) - } - -} - -// ReviewerAnonymityLeak -class SimpleBenchmark13 extends IfspecSimpleFixture(JVM_EXT, 13) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.call(".*addReview.*").argument, cpg.call("println").argument) - } - -} - -// ReviewerAnonymityNoLeak -class SimpleBenchmark14 extends IfspecSimpleFixture(JVM_EXT, 14) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*addReview.*").argument(1), cpg.call("println").argument) - } - -} - -// SimpleRandomErasure1 -class SimpleBenchmark15 extends IfspecSimpleFixture(JVM_EXT, 15) { - - s"Simple$benchmarkNo" should "report insecure" taggedAs (Simple, ImplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*secret.*"), cpg.call("println").argument) - } - -} - -// SimpleRandomErasure2 -class SimpleBenchmark16 extends IfspecSimpleFixture(JVM_EXT, 16) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ImplicitFlows) in { - assertIsSecure(cpg.fieldAccess.code(".*secret.*"), cpg.call("println").argument) - } - -} - -// StaticDispatching -class SimpleBenchmark17 extends IfspecSimpleFixture(JVM_EXT, 17) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsInsecure(cpg.fieldAccess.code(".*[h|l].*"), cpg.fieldAccess.code(".*[hsink|lsink].*")) - } - -} - -// Webstore3 -class SimpleBenchmark18 extends IfspecSimpleFixture(JVM_EXT, 18) { - - s"Simple$benchmarkNo" should "report secure" taggedAs (Simple, ExplicitFlows) in { - assertIsSecure(cpg.call(".*setDeliveryAdr.*").argument, cpg.fieldAccess.code(".*[name|street].*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/BasicBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/BasicBenchmark.scala deleted file mode 100644 index 67d93b50bf86..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/BasicBenchmark.scala +++ /dev/null @@ -1,32 +0,0 @@ -package io.joern.benchmarks.jinfoflow.java - -import io.joern.benchmarks.BenchmarkTags.Basic -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowBasicFixture -import io.shiftleft.semanticcpg.language._ - -// Arrays -class BasicBenchmark1 extends JInfoFlowBasicFixture(JAVA_EXT, 1) { - - s"Basic$benchmarkNo line 17" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(17)) - } - - s"Basic$benchmarkNo line 19" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(19)) - } - -} - -// Substrings -class BasicBenchmark2 extends JInfoFlowBasicFixture(JAVA_EXT, 2) { - - s"Basic$benchmarkNo line 14" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(14)) - } - - s"Basic$benchmarkNo line 15" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(15)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/CtxBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/CtxBenchmark.scala deleted file mode 100644 index c16239446acd..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/CtxBenchmark.scala +++ /dev/null @@ -1,63 +0,0 @@ -package io.joern.benchmarks.jinfoflow.java - -import io.joern.benchmarks.BenchmarkTags.Context -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowCtxFixture -import io.shiftleft.semanticcpg.language._ - -// InstanceAndStaticMethods -class CtxBenchmark1 extends JInfoFlowCtxFixture(JAVA_EXT, 1) { - - s"Ctx$benchmarkNo line 47" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Ctx$benchmarkNo line 48" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -// InstanceMethods -class CtxBenchmark2 extends JInfoFlowCtxFixture(JAVA_EXT, 2) { - - s"Ctx$benchmarkNo" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -// OverwriteSinks -class CtxBenchmark3 extends JInfoFlowCtxFixture(JAVA_EXT, 3) { - - s"Ctx$benchmarkNo line 35" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(35)) - } - - s"Ctx$benchmarkNo line 37" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(37)) - } - -} - -// OverwriteSources -class CtxBenchmark4 extends JInfoFlowCtxFixture(JAVA_EXT, 4) { - - s"Ctx$benchmarkNo line 34" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(34)) - } - - s"Ctx$benchmarkNo line 36" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(36)) - } - -} - -// StaticMethods -class CtxBenchmark5 extends JInfoFlowCtxFixture(JAVA_EXT, 5) { - - s"Ctx$benchmarkNo" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/EventsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/EventsBenchmark.scala deleted file mode 100644 index 0b7144743b9b..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/java/EventsBenchmark.scala +++ /dev/null @@ -1,58 +0,0 @@ -package io.joern.benchmarks.jinfoflow.java - -import io.joern.benchmarks.BenchmarkTags.Events -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowEventsFixture -import io.shiftleft.semanticcpg.language._ - -class EventsBenchmark1 extends JInfoFlowEventsFixture(JAVA_EXT, 1) { - - s"Events$benchmarkNo line 36" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(36)) - } - - s"Events$benchmarkNo line 41" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(41)) - } - -} - -class EventsBenchmark2 extends JInfoFlowEventsFixture(JAVA_EXT, 2) { - - s"Events$benchmarkNo" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -class EventsBenchmark3 extends JInfoFlowEventsFixture(JAVA_EXT, 3) { - - s"Events$benchmarkNo line 41" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(41)) - } - - s"Events$benchmarkNo line 42" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(42)) - } - -} - -class EventsBenchmark4 extends JInfoFlowEventsFixture(JAVA_EXT, 4) { - - s"Events$benchmarkNo" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -class EventsBenchmark5 extends JInfoFlowEventsFixture(JAVA_EXT, 5) { - - s"Events$benchmarkNo line 27" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(27)) - } - - s"Events$benchmarkNo line 51" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(51)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/BasicBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/BasicBenchmark.scala deleted file mode 100644 index 91b08342f796..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/BasicBenchmark.scala +++ /dev/null @@ -1,32 +0,0 @@ -package io.joern.benchmarks.jinfoflow.jvm - -import io.joern.benchmarks.BenchmarkTags.Basic -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowBasicFixture -import io.shiftleft.semanticcpg.language._ - -// Arrays -class BasicBenchmark1 extends JInfoFlowBasicFixture(JVM_EXT, 1) { - - s"Basic$benchmarkNo line 17" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(17)) - } - - s"Basic$benchmarkNo line 19" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(19)) - } - -} - -// Substrings -class BasicBenchmark2 extends JInfoFlowBasicFixture(JVM_EXT, 2) { - - s"Basic$benchmarkNo line 14" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(14)) - } - - s"Basic$benchmarkNo line 15" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(15)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/CtxBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/CtxBenchmark.scala deleted file mode 100644 index c2f02e980963..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/CtxBenchmark.scala +++ /dev/null @@ -1,63 +0,0 @@ -package io.joern.benchmarks.jinfoflow.jvm - -import io.joern.benchmarks.BenchmarkTags.Context -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowCtxFixture -import io.shiftleft.semanticcpg.language._ - -// InstanceAndStaticMethods -class CtxBenchmark1 extends JInfoFlowCtxFixture(JVM_EXT, 1) { - - s"Ctx$benchmarkNo line 47" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Ctx$benchmarkNo line 48" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -// InstanceMethods -class CtxBenchmark2 extends JInfoFlowCtxFixture(JVM_EXT, 2) { - - s"Ctx$benchmarkNo" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -// OverwriteSinks -class CtxBenchmark3 extends JInfoFlowCtxFixture(JVM_EXT, 3) { - - s"Ctx$benchmarkNo line 35" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(35)) - } - - s"Ctx$benchmarkNo line 37" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(37)) - } - -} - -// OverwriteSources -class CtxBenchmark4 extends JInfoFlowCtxFixture(JVM_EXT, 4) { - - s"Ctx$benchmarkNo line 34" should "report secure" taggedAs Context in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(34)) - } - - s"Ctx$benchmarkNo line 36" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(36)) - } - -} - -// StaticMethods -class CtxBenchmark5 extends JInfoFlowCtxFixture(JVM_EXT, 5) { - - s"Ctx$benchmarkNo" should "report insecure" taggedAs Context in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/EventsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/EventsBenchmark.scala deleted file mode 100644 index ae2009f55349..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/jinfoflow/jvm/EventsBenchmark.scala +++ /dev/null @@ -1,58 +0,0 @@ -package io.joern.benchmarks.jinfoflow.jvm - -import io.joern.benchmarks.BenchmarkTags.Events -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.JInfoFlowEventsFixture -import io.shiftleft.semanticcpg.language._ - -class EventsBenchmark1 extends JInfoFlowEventsFixture(JVM_EXT, 1) { - - s"Events$benchmarkNo line 36" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(36)) - } - - s"Events$benchmarkNo line 41" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*"), cpg.call(".*println.*").lineNumber(41)) - } - -} - -class EventsBenchmark2 extends JInfoFlowEventsFixture(JVM_EXT, 2) { - - s"Events$benchmarkNo" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -class EventsBenchmark3 extends JInfoFlowEventsFixture(JVM_EXT, 3) { - - s"Events$benchmarkNo line 41" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(41)) - } - - s"Events$benchmarkNo line 42" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(42)) - } - -} - -class EventsBenchmark4 extends JInfoFlowEventsFixture(JVM_EXT, 4) { - - s"Events$benchmarkNo" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*")) - } - -} - -class EventsBenchmark5 extends JInfoFlowEventsFixture(JVM_EXT, 5) { - - s"Events$benchmarkNo line 27" should "report insecure" taggedAs Events in { - assertIsInsecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(27)) - } - - s"Events$benchmarkNo line 51" should "report secure" taggedAs Events in { - assertIsSecure(cpg.call(".*readLine.*").receiver, cpg.call(".*println.*").lineNumber(51)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/AliasingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/AliasingBenchmark.scala deleted file mode 100644 index 51f5c6670f8c..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/AliasingBenchmark.scala +++ /dev/null @@ -1,87 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Aliasing -import io.joern.benchmarks.testfixtures.SecuribenchMicroAliasingFixture -import io.shiftleft.semanticcpg.language._ -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ - -class AliasingBenchmark1 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 1) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark2 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 2) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs Aliasing in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark3 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 3) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark4 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 4) { - - s"Aliasing$benchmarkNo line 45" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Aliasing$benchmarkNo line 46" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - - s"Aliasing$benchmarkNo line 47" should "report secure" taggedAs Aliasing in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class AliasingBenchmark5 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 5) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark6 extends SecuribenchMicroAliasingFixture(JAVA_EXT, 6) { - - s"Aliasing$benchmarkNo line 48" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Aliasing$benchmarkNo line 49" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Aliasing$benchmarkNo line 50" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(50)) - } - - s"Aliasing$benchmarkNo line 51" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(51)) - } - - s"Aliasing$benchmarkNo line 52" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(52)) - } - - s"Aliasing$benchmarkNo line 53" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(53)) - } - - // This passes since this is the root of the alias propagation - s"Aliasing$benchmarkNo line 54" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ArrayBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ArrayBenchmark.scala deleted file mode 100644 index c5a098749621..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ArrayBenchmark.scala +++ /dev/null @@ -1,106 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Arrays -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroArraysFixture -import io.shiftleft.semanticcpg.language._ - -class ArraysBenchmark1 extends SecuribenchMicroArraysFixture(JAVA_EXT, 1) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark2 extends SecuribenchMicroArraysFixture(JAVA_EXT, 2) { - - s"Arrays$benchmarkNo line 42" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Arrays$benchmarkNo line 43" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Arrays$benchmarkNo line 44" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class ArraysBenchmark3 extends SecuribenchMicroArraysFixture(JAVA_EXT, 3) { - - s"Arrays$benchmarkNo line 45" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Arrays$benchmarkNo line 46" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class ArraysBenchmark4 extends SecuribenchMicroArraysFixture(JAVA_EXT, 4) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark5 extends SecuribenchMicroArraysFixture(JAVA_EXT, 5) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark6 extends SecuribenchMicroArraysFixture(JAVA_EXT, 6) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark7 extends SecuribenchMicroArraysFixture(JAVA_EXT, 7) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark8 extends SecuribenchMicroArraysFixture(JAVA_EXT, 8) { - - s"Arrays$benchmarkNo line 41" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(41)) - } - - s"Arrays$benchmarkNo line 42" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - -} - -class ArraysBenchmark9 extends SecuribenchMicroArraysFixture(JAVA_EXT, 9) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark10 extends SecuribenchMicroArraysFixture(JAVA_EXT, 10) { - - s"Arrays$benchmarkNo line 42" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Arrays$benchmarkNo line 43" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/BasicBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/BasicBenchmark.scala deleted file mode 100644 index 1bdd5c0c3eb4..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/BasicBenchmark.scala +++ /dev/null @@ -1,452 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Basic -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroBasicFixture -import io.shiftleft.semanticcpg.language._ - -class BasicBenchmark1 extends SecuribenchMicroBasicFixture(JAVA_EXT, 1) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark2 extends SecuribenchMicroBasicFixture(JAVA_EXT, 2) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark3 extends SecuribenchMicroBasicFixture(JAVA_EXT, 3) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark4 extends SecuribenchMicroBasicFixture(JAVA_EXT, 4) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark5 extends SecuribenchMicroBasicFixture(JAVA_EXT, 5) { - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - -} - -class BasicBenchmark6 extends SecuribenchMicroBasicFixture(JAVA_EXT, 6) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark7 extends SecuribenchMicroBasicFixture(JAVA_EXT, 7) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark8 extends SecuribenchMicroBasicFixture(JAVA_EXT, 8) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark9 extends SecuribenchMicroBasicFixture(JAVA_EXT, 9) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark10 extends SecuribenchMicroBasicFixture(JAVA_EXT, 10) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark11 extends SecuribenchMicroBasicFixture(JAVA_EXT, 11) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class BasicBenchmark12 extends SecuribenchMicroBasicFixture(JAVA_EXT, 12) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 47" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class BasicBenchmark13 extends SecuribenchMicroBasicFixture(JAVA_EXT, 13) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark14 extends SecuribenchMicroBasicFixture(JAVA_EXT, 14) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getServletConfig.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark15 extends SecuribenchMicroBasicFixture(JAVA_EXT, 15) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark16 extends SecuribenchMicroBasicFixture(JAVA_EXT, 16) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark17 extends SecuribenchMicroBasicFixture(JAVA_EXT, 17) { - - s"Basic$benchmarkNo line 58" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(58)) - } - - s"Basic$benchmarkNo line 59" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(59)) - } - -} - -class BasicBenchmark18 extends SecuribenchMicroBasicFixture(JAVA_EXT, 18) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark19 extends SecuribenchMicroBasicFixture(JAVA_EXT, 19) { - - // If this went into argument two it would be safe - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*prepareStatement.*").argument(1)) - } - -} - -class BasicBenchmark20 extends SecuribenchMicroBasicFixture(JAVA_EXT, 20) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*execute.*").argument(1)) - } - -} - -class BasicBenchmark21 extends SecuribenchMicroBasicFixture(JAVA_EXT, 21) { - - s"Basic$benchmarkNo line 49" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(49)) - } - - s"Basic$benchmarkNo line 50" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(50)) - } - - s"Basic$benchmarkNo line 51" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(51)) - } - - s"Basic$benchmarkNo line 53" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*executeQuery.*").argument(1).lineNumber(53)) - } - -} - -class BasicBenchmark22 extends SecuribenchMicroBasicFixture(JAVA_EXT, 22) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*createNewFile.*")) - } - -} - -class BasicBenchmark23 extends SecuribenchMicroBasicFixture(JAVA_EXT, 23) { - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.fieldAccess.code(".*FIELD_NAME.*"), - cpg.call.nameExact("").code(".*FileWriter.*").argument(1).lineNumber(44) - ) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.fieldAccess.code(".*FIELD_NAME.*"), - cpg.call.nameExact("").code(".*FileWriter.*").argument(1).lineNumber(45) - ) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.fieldAccess.code(".*FIELD_NAME.*"), - cpg.call.nameExact("").code(".*FileInputStream.*").argument(1).lineNumber(46) - ) - } - -} - -class BasicBenchmark24 extends SecuribenchMicroBasicFixture(JAVA_EXT, 24) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*sendRedirect.*").argument(1)) - } - -} - -class BasicBenchmark25 extends SecuribenchMicroBasicFixture(JAVA_EXT, 25) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark26 extends SecuribenchMicroBasicFixture(JAVA_EXT, 26) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark27 extends SecuribenchMicroBasicFixture(JAVA_EXT, 27) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark28 extends SecuribenchMicroBasicFixture(JAVA_EXT, 28) { - - s"Basic$benchmarkNo line 72" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").argument(1).lineNumber(72)) - } - - s"Basic$benchmarkNo line 140" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").argument(1).lineNumber(140)) - } - -} - -class BasicBenchmark29 extends SecuribenchMicroBasicFixture(JAVA_EXT, 29) { - - s"Basic$benchmarkNo line 48" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Basic$benchmarkNo line 49" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Basic$benchmarkNo line 50" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(50)) - } - -} - -class BasicBenchmark30 extends SecuribenchMicroBasicFixture(JAVA_EXT, 30) { - - s"Basic$benchmarkNo line 47" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Basic$benchmarkNo line 48" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class BasicBenchmark31 extends SecuribenchMicroBasicFixture(JAVA_EXT, 31) { - - s"Basic$benchmarkNo line 51" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(51)) - } - - s"Basic$benchmarkNo line 54" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(54)) - } - - s"Basic$benchmarkNo line 57" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(57)) - } - -} - -class BasicBenchmark32 extends SecuribenchMicroBasicFixture(JAVA_EXT, 32) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark33 extends SecuribenchMicroBasicFixture(JAVA_EXT, 33) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark34 extends SecuribenchMicroBasicFixture(JAVA_EXT, 34) { - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*").lineNumber(46)) - } - -} - -class BasicBenchmark35 extends SecuribenchMicroBasicFixture(JAVA_EXT, 35) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(46)) - } - - s"Basic$benchmarkNo line 47" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(47)) - } - -} - -class BasicBenchmark36 extends SecuribenchMicroBasicFixture(JAVA_EXT, 36) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getInputStream.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark37 extends SecuribenchMicroBasicFixture(JAVA_EXT, 37) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark38 extends SecuribenchMicroBasicFixture(JAVA_EXT, 38) { - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class BasicBenchmark39 extends SecuribenchMicroBasicFixture(JAVA_EXT, 39) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark40 extends SecuribenchMicroBasicFixture(JAVA_EXT, 40) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark41 extends SecuribenchMicroBasicFixture(JAVA_EXT, 41) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark42 extends SecuribenchMicroBasicFixture(JAVA_EXT, 42) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getInitParameterNames.*").receiver, cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/CollectionsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/CollectionsBenchmark.scala deleted file mode 100644 index fb6f59569fdb..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/CollectionsBenchmark.scala +++ /dev/null @@ -1,154 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Collections -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroCollectionsFixture -import io.shiftleft.semanticcpg.language._ - -class CollectionsBenchmark1 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "1") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark2 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "2") { - - s"Collections$benchmarkNo line 50" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(50)) - } - - s"Collections$benchmarkNo line 51" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(51)) - } - -} - -class CollectionsBenchmark3 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "3") { - - s"Collections$benchmarkNo line 49" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Collections$benchmarkNo line 51" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(51)) - } - -} - -class CollectionsBenchmark4 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "4") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark5 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "5") { - - s"Collections$benchmarkNo" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark6 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "6") { - - s"Collections$benchmarkNo line 47" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Collections$benchmarkNo line 48" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class CollectionsBenchmark7 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "7") { - - s"Collections$benchmarkNo line 49" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Collections$benchmarkNo line 50" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(50)) - } - -} - -class CollectionsBenchmark8 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "8") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark9 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "9") { - - s"Collections$benchmarkNo" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark10 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "10") { - - s"Collections$benchmarkNo line 54" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - - s"Collections$benchmarkNo line 61" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(61)) - } - -} - -class CollectionsBenchmark11 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "11") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*foo.*")) - } - -} - -class CollectionsBenchmark11b extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "11b") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.identifier("o"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark12 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "12") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark13 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "13") { - - s"Collections$benchmarkNo line 52" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(52)) - } - - s"Collections$benchmarkNo line 53" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(53)) - } - - s"Collections$benchmarkNo line 54" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} - -class CollectionsBenchmark14 extends SecuribenchMicroCollectionsFixture(JAVA_EXT, "14") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/DataStructuresBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/DataStructuresBenchmark.scala deleted file mode 100644 index 2b828bd103e5..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/DataStructuresBenchmark.scala +++ /dev/null @@ -1,62 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.DataStructures -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroDatastructuresFixture -import io.shiftleft.semanticcpg.language._ - -class DataStructuresBenchmark1 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 1) { - - s"DataStructures$benchmarkNo line 57" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(57)) - } - - s"DataStructures$benchmarkNo line 58" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(58)) - } - -} - -class DataStructuresBenchmark2 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 2) { - - s"DataStructures$benchmarkNo line 59" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(59)) - } - - s"DataStructures$benchmarkNo line 60" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(60)) - } - -} - -class DataStructuresBenchmark3 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 3) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark4 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 4) { - - s"DataStructures$benchmarkNo" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark5 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 5) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark6 extends SecuribenchMicroDatastructuresFixture(JAVA_EXT, 6) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/FactoriesBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/FactoriesBenchmark.scala deleted file mode 100644 index 01c5dbb3382e..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/FactoriesBenchmark.scala +++ /dev/null @@ -1,42 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Factories -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroFactoriesFixture -import io.shiftleft.semanticcpg.language._ - -class FactoriesBenchmark1 extends SecuribenchMicroFactoriesFixture(JAVA_EXT, 1) { - - s"DataStructures$benchmarkNo line 43" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"DataStructures$benchmarkNo line 44" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class FactoriesBenchmark2 extends SecuribenchMicroFactoriesFixture(JAVA_EXT, 2) { - - s"DataStructures$benchmarkNo line 43" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"DataStructures$benchmarkNo line 44" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class FactoriesBenchmark3 extends SecuribenchMicroFactoriesFixture(JAVA_EXT, 3) { - - s"DataStructures$benchmarkNo line 55" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(55)) - } - - s"DataStructures$benchmarkNo line 56" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(56)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/InterBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/InterBenchmark.scala deleted file mode 100644 index f2009a5faced..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/InterBenchmark.scala +++ /dev/null @@ -1,162 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Inter -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroInterFixture -import io.shiftleft.semanticcpg.language._ - -class InterBenchmark1 extends SecuribenchMicroInterFixture(JAVA_EXT, 1) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark2 extends SecuribenchMicroInterFixture(JAVA_EXT, 2) { - - s"Inter$benchmarkNo line 44" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Inter$benchmarkNo line 45" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - -} - -class InterBenchmark3 extends SecuribenchMicroInterFixture(JAVA_EXT, 3) { - - s"Inter$benchmarkNo line 84" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(84)) - } - - s"Inter$benchmarkNo line 94" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(94)) - } - -} - -class InterBenchmark4 extends SecuribenchMicroInterFixture(JAVA_EXT, 4) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark5 extends SecuribenchMicroInterFixture(JAVA_EXT, 5) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark6 extends SecuribenchMicroInterFixture(JAVA_EXT, 6) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark7 extends SecuribenchMicroInterFixture(JAVA_EXT, 7) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark8 extends SecuribenchMicroInterFixture(JAVA_EXT, 8) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark9 extends SecuribenchMicroInterFixture(JAVA_EXT, 9) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Inter$benchmarkNo line 53" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(53)) - } - - s"Inter$benchmarkNo line 54" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} - -class InterBenchmark10 extends SecuribenchMicroInterFixture(JAVA_EXT, 10) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class InterBenchmark11 extends SecuribenchMicroInterFixture(JAVA_EXT, 11) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class InterBenchmark12 extends SecuribenchMicroInterFixture(JAVA_EXT, 12) { - - s"Inter$benchmarkNo line 54" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - - s"Inter$benchmarkNo line 55" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(55)) - } - -} - -class InterBenchmark13 extends SecuribenchMicroInterFixture(JAVA_EXT, 13) { - - s"Inter$benchmarkNo line 52" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(52)) - } - -} - -class InterBenchmark14 extends SecuribenchMicroInterFixture(JAVA_EXT, 14) { - - s"Inter$benchmarkNo line 54" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/PredBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/PredBenchmark.scala deleted file mode 100644 index 2801a189f524..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/PredBenchmark.scala +++ /dev/null @@ -1,78 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Pred -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroPredFixture -import io.shiftleft.semanticcpg.language._ - -class PredBenchmark1 extends SecuribenchMicroPredFixture(JAVA_EXT, 1) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark2 extends SecuribenchMicroPredFixture(JAVA_EXT, 2) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark3 extends SecuribenchMicroPredFixture(JAVA_EXT, 3) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark4 extends SecuribenchMicroPredFixture(JAVA_EXT, 4) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark5 extends SecuribenchMicroPredFixture(JAVA_EXT, 5) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark6 extends SecuribenchMicroPredFixture(JAVA_EXT, 6) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark7 extends SecuribenchMicroPredFixture(JAVA_EXT, 7) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark8 extends SecuribenchMicroPredFixture(JAVA_EXT, 8) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark9 extends SecuribenchMicroPredFixture(JAVA_EXT, 9) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ReflBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ReflBenchmark.scala deleted file mode 100644 index eaf4c19f4046..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/ReflBenchmark.scala +++ /dev/null @@ -1,38 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Refl -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroReflectionFixture -import io.shiftleft.semanticcpg.language._ - -class ReflBenchmark1 extends SecuribenchMicroReflectionFixture(JAVA_EXT, 1) { - - s"Refl$benchmarkNo" should "report secure" taggedAs Refl in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark2 extends SecuribenchMicroReflectionFixture(JAVA_EXT, 2) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark3 extends SecuribenchMicroReflectionFixture(JAVA_EXT, 3) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark4 extends SecuribenchMicroReflectionFixture(JAVA_EXT, 4) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SanitizersBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SanitizersBenchmark.scala deleted file mode 100644 index f23239ad956b..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SanitizersBenchmark.scala +++ /dev/null @@ -1,66 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Sanitizers -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroSanitizersFixture -import io.shiftleft.semanticcpg.language._ - -class SanitizersBenchmark1 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 1) { - - s"Sanitizers$benchmarkNo line 47" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Sanitizers$benchmarkNo line 48" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class SanitizersBenchmark2 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 2) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class SanitizersBenchmark3 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 3) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class SanitizersBenchmark4 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 4) { - - s"Sanitizers$benchmarkNo line 45" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Sanitizers$benchmarkNo line 46" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class SanitizersBenchmark5 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 5) { - - s"Sanitizers$benchmarkNo line 46" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(46)) - } - - s"Sanitizers$benchmarkNo line 47" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class SanitizersBenchmark6 extends SecuribenchMicroSanitizersFixture(JAVA_EXT, 6) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SessionBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SessionBenchmark.scala deleted file mode 100644 index fe1e164e126c..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/SessionBenchmark.scala +++ /dev/null @@ -1,34 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.Session -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroSessionFixture -import io.shiftleft.semanticcpg.language._ - -class SessionBenchmark1 extends SecuribenchMicroSessionFixture(JAVA_EXT, 1) { - - s"Session$benchmarkNo" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class SessionBenchmark2 extends SecuribenchMicroSessionFixture(JAVA_EXT, 2) { - - s"Session$benchmarkNo line 47" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Session$benchmarkNo line 48" should "report secure" taggedAs Session in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class SessionBenchmark3 extends SecuribenchMicroSessionFixture(JAVA_EXT, 3) { - - s"Session$benchmarkNo" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/StrongUpdatesBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/StrongUpdatesBenchmark.scala deleted file mode 100644 index a493b8053799..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/java/StrongUpdatesBenchmark.scala +++ /dev/null @@ -1,46 +0,0 @@ -package io.joern.benchmarks.securibench.micro.java - -import io.joern.benchmarks.BenchmarkTags.StrongUpdates -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroStrongUpdatesFixture -import io.shiftleft.semanticcpg.language._ - -class StrongUpdatesBenchmark1 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 1) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark2 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 2) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark3 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 3) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark4 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 4) { - - s"StrongUpdates$benchmarkNo" should "report insecure" taggedAs StrongUpdates in { - assertIsInsecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark5 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 3) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.fieldAccess.code(".*FIELD_NAME.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/AliasingBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/AliasingBenchmark.scala deleted file mode 100644 index e37f9f3e75d2..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/AliasingBenchmark.scala +++ /dev/null @@ -1,93 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Aliasing -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroAliasingFixture -import io.shiftleft.semanticcpg.language._ - -/** During all the tests our class files have propagated the field constant so we need to look for the literal and not - * the field. - */ -class AliasingBenchmark1 extends SecuribenchMicroAliasingFixture(JVM_EXT, 1) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark2 extends SecuribenchMicroAliasingFixture(JVM_EXT, 2) { - - s"Aliasing$benchmarkNo" should "report secure" taggedAs Aliasing in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark3 extends SecuribenchMicroAliasingFixture(JVM_EXT, 3) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class AliasingBenchmark4 extends SecuribenchMicroAliasingFixture(JVM_EXT, 4) { - - s"Aliasing$benchmarkNo line 45" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Aliasing$benchmarkNo line 46" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - - s"Aliasing$benchmarkNo line 47" should "report secure" taggedAs Aliasing in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class AliasingBenchmark5 extends SecuribenchMicroAliasingFixture(JVM_EXT, 5) { - - s"Aliasing$benchmarkNo" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -/** We do well here since the deep copy propagation is converted to three address bytecode that simplifies the aliasing - * chain. - */ -class AliasingBenchmark6 extends SecuribenchMicroAliasingFixture(JVM_EXT, 6) { - - s"Aliasing$benchmarkNo line 48" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Aliasing$benchmarkNo line 49" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Aliasing$benchmarkNo line 50" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(50)) - } - - s"Aliasing$benchmarkNo line 51" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(51)) - } - - s"Aliasing$benchmarkNo line 52" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(52)) - } - - s"Aliasing$benchmarkNo line 53" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(53)) - } - - // This passes since this is the root of the alias propagation - s"Aliasing$benchmarkNo line 54" should "report insecure" taggedAs Aliasing in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ArrayBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ArrayBenchmark.scala deleted file mode 100644 index e5c3c846714c..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ArrayBenchmark.scala +++ /dev/null @@ -1,106 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Arrays -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroArraysFixture -import io.shiftleft.semanticcpg.language._ - -class ArraysBenchmark1 extends SecuribenchMicroArraysFixture(JVM_EXT, 1) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark2 extends SecuribenchMicroArraysFixture(JVM_EXT, 2) { - - s"Arrays$benchmarkNo line 42" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Arrays$benchmarkNo line 43" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Arrays$benchmarkNo line 44" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class ArraysBenchmark3 extends SecuribenchMicroArraysFixture(JVM_EXT, 3) { - - s"Arrays$benchmarkNo line 45" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Arrays$benchmarkNo line 46" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class ArraysBenchmark4 extends SecuribenchMicroArraysFixture(JVM_EXT, 4) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark5 extends SecuribenchMicroArraysFixture(JVM_EXT, 5) { - - s"Arrays$benchmarkNo" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark6 extends SecuribenchMicroArraysFixture(JVM_EXT, 6) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark7 extends SecuribenchMicroArraysFixture(JVM_EXT, 7) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark8 extends SecuribenchMicroArraysFixture(JVM_EXT, 8) { - - s"Arrays$benchmarkNo line 41" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(41)) - } - - s"Arrays$benchmarkNo line 42" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - -} - -class ArraysBenchmark9 extends SecuribenchMicroArraysFixture(JVM_EXT, 9) { - - s"Arrays$benchmarkNo" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ArraysBenchmark10 extends SecuribenchMicroArraysFixture(JVM_EXT, 10) { - - s"Arrays$benchmarkNo line 42" should "report insecure" taggedAs Arrays in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Arrays$benchmarkNo line 43" should "report secure" taggedAs Arrays in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/BasicBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/BasicBenchmark.scala deleted file mode 100644 index fcdbd6e38186..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/BasicBenchmark.scala +++ /dev/null @@ -1,452 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Basic -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroBasicFixture -import io.shiftleft.semanticcpg.language._ - -class BasicBenchmark1 extends SecuribenchMicroBasicFixture(JVM_EXT, 1) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark2 extends SecuribenchMicroBasicFixture(JVM_EXT, 2) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark3 extends SecuribenchMicroBasicFixture(JVM_EXT, 3) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark4 extends SecuribenchMicroBasicFixture(JVM_EXT, 4) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark5 extends SecuribenchMicroBasicFixture(JVM_EXT, 5) { - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - -} - -class BasicBenchmark6 extends SecuribenchMicroBasicFixture(JVM_EXT, 6) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark7 extends SecuribenchMicroBasicFixture(JVM_EXT, 7) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark8 extends SecuribenchMicroBasicFixture(JVM_EXT, 8) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark9 extends SecuribenchMicroBasicFixture(JVM_EXT, 9) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark10 extends SecuribenchMicroBasicFixture(JVM_EXT, 10) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark11 extends SecuribenchMicroBasicFixture(JVM_EXT, 11) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class BasicBenchmark12 extends SecuribenchMicroBasicFixture(JVM_EXT, 12) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 47" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class BasicBenchmark13 extends SecuribenchMicroBasicFixture(JVM_EXT, 13) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark14 extends SecuribenchMicroBasicFixture(JVM_EXT, 14) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getServletConfig.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark15 extends SecuribenchMicroBasicFixture(JVM_EXT, 15) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark16 extends SecuribenchMicroBasicFixture(JVM_EXT, 16) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark17 extends SecuribenchMicroBasicFixture(JVM_EXT, 17) { - - s"Basic$benchmarkNo line 58" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(58)) - } - - s"Basic$benchmarkNo line 59" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(59)) - } - -} - -class BasicBenchmark18 extends SecuribenchMicroBasicFixture(JVM_EXT, 18) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark19 extends SecuribenchMicroBasicFixture(JVM_EXT, 19) { - - // If this went into argument two it would be safe - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*prepareStatement.*").argument(1)) - } - -} - -class BasicBenchmark20 extends SecuribenchMicroBasicFixture(JVM_EXT, 20) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*execute.*").argument(1)) - } - -} - -class BasicBenchmark21 extends SecuribenchMicroBasicFixture(JVM_EXT, 21) { - - s"Basic$benchmarkNo line 49" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(49)) - } - - s"Basic$benchmarkNo line 50" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(50)) - } - - s"Basic$benchmarkNo line 51" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*executeUpdate.*").argument(1).lineNumber(51)) - } - - s"Basic$benchmarkNo line 53" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*executeQuery.*").argument(1).lineNumber(53)) - } - -} - -class BasicBenchmark22 extends SecuribenchMicroBasicFixture(JVM_EXT, 22) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*createNewFile.*")) - } - -} - -class BasicBenchmark23 extends SecuribenchMicroBasicFixture(JVM_EXT, 23) { - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.literal.code(".*name.*"), - cpg.call.nameExact("").code(".*FileWriter.*").argument(1).lineNumber(44) - ) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.literal.code(".*name.*"), - cpg.call.nameExact("").code(".*FileWriter.*").argument(1).lineNumber(45) - ) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure( - cpg.literal.code(".*name.*"), - cpg.call.nameExact("").code(".*FileInputStream.*").argument(1).lineNumber(46) - ) - } - -} - -class BasicBenchmark24 extends SecuribenchMicroBasicFixture(JVM_EXT, 24) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*sendRedirect.*").argument(1)) - } - -} - -class BasicBenchmark25 extends SecuribenchMicroBasicFixture(JVM_EXT, 25) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark26 extends SecuribenchMicroBasicFixture(JVM_EXT, 26) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark27 extends SecuribenchMicroBasicFixture(JVM_EXT, 27) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark28 extends SecuribenchMicroBasicFixture(JVM_EXT, 28) { - - s"Basic$benchmarkNo line 72" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").argument(1).lineNumber(72)) - } - - s"Basic$benchmarkNo line 140" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").argument(1).lineNumber(140)) - } - -} - -class BasicBenchmark29 extends SecuribenchMicroBasicFixture(JVM_EXT, 29) { - - s"Basic$benchmarkNo line 48" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Basic$benchmarkNo line 49" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Basic$benchmarkNo line 50" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(50)) - } - -} - -class BasicBenchmark30 extends SecuribenchMicroBasicFixture(JVM_EXT, 30) { - - s"Basic$benchmarkNo line 47" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Basic$benchmarkNo line 48" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class BasicBenchmark31 extends SecuribenchMicroBasicFixture(JVM_EXT, 31) { - - s"Basic$benchmarkNo line 51" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(51)) - } - - s"Basic$benchmarkNo line 54" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(54)) - } - - s"Basic$benchmarkNo line 57" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getCookies.*").receiver, cpg.call(".*println.*").lineNumber(57)) - } - -} - -class BasicBenchmark32 extends SecuribenchMicroBasicFixture(JVM_EXT, 32) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark33 extends SecuribenchMicroBasicFixture(JVM_EXT, 33) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark34 extends SecuribenchMicroBasicFixture(JVM_EXT, 34) { - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeader.*").receiver, cpg.call(".*println.*").lineNumber(46)) - } - -} - -class BasicBenchmark35 extends SecuribenchMicroBasicFixture(JVM_EXT, 35) { - - s"Basic$benchmarkNo line 42" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(42)) - } - - s"Basic$benchmarkNo line 43" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(43)) - } - - s"Basic$benchmarkNo line 44" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(44)) - } - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(46)) - } - - s"Basic$benchmarkNo line 47" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getHeaderNames.*").receiver, cpg.call(".*println.*").lineNumber(47)) - } - -} - -class BasicBenchmark36 extends SecuribenchMicroBasicFixture(JVM_EXT, 36) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getInputStream.*").receiver, cpg.call(".*println.*")) - } - -} - -class BasicBenchmark37 extends SecuribenchMicroBasicFixture(JVM_EXT, 37) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark38 extends SecuribenchMicroBasicFixture(JVM_EXT, 38) { - - s"Basic$benchmarkNo line 45" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Basic$benchmarkNo line 46" should "report secure" taggedAs Basic in { - assertIsSecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class BasicBenchmark39 extends SecuribenchMicroBasicFixture(JVM_EXT, 39) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark40 extends SecuribenchMicroBasicFixture(JVM_EXT, 40) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark41 extends SecuribenchMicroBasicFixture(JVM_EXT, 41) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.literal.code(".*name.*"), cpg.call(".*println.*")) - } - -} - -class BasicBenchmark42 extends SecuribenchMicroBasicFixture(JVM_EXT, 42) { - - s"Basic$benchmarkNo" should "report insecure" taggedAs Basic in { - assertIsInsecure(cpg.call(".*getInitParameterNames.*").receiver, cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/CollectionsBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/CollectionsBenchmark.scala deleted file mode 100644 index bde6f687e9bb..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/CollectionsBenchmark.scala +++ /dev/null @@ -1,154 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Collections -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroCollectionsFixture -import io.shiftleft.semanticcpg.language._ - -class CollectionsBenchmark1 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "1") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark2 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "2") { - - s"Collections$benchmarkNo line 50" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(50)) - } - - s"Collections$benchmarkNo line 51" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(51)) - } - -} - -class CollectionsBenchmark3 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "3") { - - s"Collections$benchmarkNo line 49" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Collections$benchmarkNo line 51" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(51)) - } - -} - -class CollectionsBenchmark4 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "4") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark5 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "5") { - - s"Collections$benchmarkNo" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark6 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "6") { - - s"Collections$benchmarkNo line 47" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Collections$benchmarkNo line 48" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class CollectionsBenchmark7 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "7") { - - s"Collections$benchmarkNo line 49" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(49)) - } - - s"Collections$benchmarkNo line 50" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(50)) - } - -} - -class CollectionsBenchmark8 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "8") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark9 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "9") { - - s"Collections$benchmarkNo" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark10 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "10") { - - s"Collections$benchmarkNo line 54" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - - s"Collections$benchmarkNo line 61" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(61)) - } - -} - -class CollectionsBenchmark11 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "11") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*foo.*")) - } - -} - -class CollectionsBenchmark11b extends SecuribenchMicroCollectionsFixture(JVM_EXT, "11b") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.identifier("o"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark12 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "12") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class CollectionsBenchmark13 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "13") { - - s"Collections$benchmarkNo line 52" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(52)) - } - - s"Collections$benchmarkNo line 53" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(53)) - } - - s"Collections$benchmarkNo line 54" should "report secure" taggedAs Collections in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} - -class CollectionsBenchmark14 extends SecuribenchMicroCollectionsFixture(JVM_EXT, "14") { - - s"Collections$benchmarkNo" should "report insecure" taggedAs Collections in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/DataStructuresBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/DataStructuresBenchmark.scala deleted file mode 100644 index 047e9ab3a14d..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/DataStructuresBenchmark.scala +++ /dev/null @@ -1,62 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.DataStructures -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroDatastructuresFixture -import io.shiftleft.semanticcpg.language._ - -class DataStructuresBenchmark1 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 1) { - - s"DataStructures$benchmarkNo line 57" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(57)) - } - - s"DataStructures$benchmarkNo line 58" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(58)) - } - -} - -class DataStructuresBenchmark2 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 2) { - - s"DataStructures$benchmarkNo line 59" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(59)) - } - - s"DataStructures$benchmarkNo line 60" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(60)) - } - -} - -class DataStructuresBenchmark3 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 3) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark4 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 4) { - - s"DataStructures$benchmarkNo" should "report secure" taggedAs DataStructures in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark5 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 5) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class DataStructuresBenchmark6 extends SecuribenchMicroDatastructuresFixture(JVM_EXT, 6) { - - s"DataStructures$benchmarkNo" should "report insecure" taggedAs DataStructures in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/FactoriesBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/FactoriesBenchmark.scala deleted file mode 100644 index 1089ab9a1619..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/FactoriesBenchmark.scala +++ /dev/null @@ -1,42 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Factories -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroFactoriesFixture -import io.shiftleft.semanticcpg.language._ - -class FactoriesBenchmark1 extends SecuribenchMicroFactoriesFixture(JVM_EXT, 1) { - - s"DataStructures$benchmarkNo line 43" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"DataStructures$benchmarkNo line 44" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class FactoriesBenchmark2 extends SecuribenchMicroFactoriesFixture(JVM_EXT, 2) { - - s"DataStructures$benchmarkNo line 43" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(43)) - } - - s"DataStructures$benchmarkNo line 44" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - -} - -class FactoriesBenchmark3 extends SecuribenchMicroFactoriesFixture(JVM_EXT, 3) { - - s"DataStructures$benchmarkNo line 55" should "report insecure" taggedAs Factories in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(55)) - } - - s"DataStructures$benchmarkNo line 56" should "report secure" taggedAs Factories in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(56)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/InterBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/InterBenchmark.scala deleted file mode 100644 index 7267368d6e2f..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/InterBenchmark.scala +++ /dev/null @@ -1,162 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Inter -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroInterFixture -import io.shiftleft.semanticcpg.language._ - -class InterBenchmark1 extends SecuribenchMicroInterFixture(JVM_EXT, 1) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark2 extends SecuribenchMicroInterFixture(JVM_EXT, 2) { - - s"Inter$benchmarkNo line 44" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(44)) - } - - s"Inter$benchmarkNo line 45" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - -} - -class InterBenchmark3 extends SecuribenchMicroInterFixture(JVM_EXT, 3) { - - s"Inter$benchmarkNo line 84" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(84)) - } - - s"Inter$benchmarkNo line 94" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(94)) - } - -} - -class InterBenchmark4 extends SecuribenchMicroInterFixture(JVM_EXT, 4) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark5 extends SecuribenchMicroInterFixture(JVM_EXT, 5) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark6 extends SecuribenchMicroInterFixture(JVM_EXT, 6) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark7 extends SecuribenchMicroInterFixture(JVM_EXT, 7) { - - s"Inter$benchmarkNo" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class InterBenchmark8 extends SecuribenchMicroInterFixture(JVM_EXT, 8) { - - s"Inter$benchmarkNo line 45" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Inter$benchmarkNo line 46" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class InterBenchmark9 extends SecuribenchMicroInterFixture(JVM_EXT, 9) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - - s"Inter$benchmarkNo line 53" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(53)) - } - - s"Inter$benchmarkNo line 54" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} - -class InterBenchmark10 extends SecuribenchMicroInterFixture(JAVA_EXT, 10) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class InterBenchmark11 extends SecuribenchMicroInterFixture(JAVA_EXT, 11) { - - s"Inter$benchmarkNo line 47" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Inter$benchmarkNo line 48" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class InterBenchmark12 extends SecuribenchMicroInterFixture(JAVA_EXT, 12) { - - s"Inter$benchmarkNo line 54" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - - s"Inter$benchmarkNo line 55" should "report secure" taggedAs Inter in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(55)) - } - -} - -class InterBenchmark13 extends SecuribenchMicroInterFixture(JAVA_EXT, 13) { - - s"Inter$benchmarkNo line 52" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(52)) - } - -} - -class InterBenchmark14 extends SecuribenchMicroInterFixture(JAVA_EXT, 14) { - - s"Inter$benchmarkNo line 54" should "report insecure" taggedAs Inter in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(54)) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/PredBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/PredBenchmark.scala deleted file mode 100644 index c1e9a3fa3510..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/PredBenchmark.scala +++ /dev/null @@ -1,78 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Pred -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroPredFixture -import io.shiftleft.semanticcpg.language._ - -class PredBenchmark1 extends SecuribenchMicroPredFixture(JVM_EXT, 1) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark2 extends SecuribenchMicroPredFixture(JVM_EXT, 2) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark3 extends SecuribenchMicroPredFixture(JVM_EXT, 3) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark4 extends SecuribenchMicroPredFixture(JVM_EXT, 4) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark5 extends SecuribenchMicroPredFixture(JVM_EXT, 5) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark6 extends SecuribenchMicroPredFixture(JVM_EXT, 6) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark7 extends SecuribenchMicroPredFixture(JVM_EXT, 7) { - - s"Pred$benchmarkNo" should "report secure" taggedAs Pred in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark8 extends SecuribenchMicroPredFixture(JVM_EXT, 8) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class PredBenchmark9 extends SecuribenchMicroPredFixture(JVM_EXT, 9) { - - s"Pred$benchmarkNo" should "report insecure" taggedAs Pred in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ReflBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ReflBenchmark.scala deleted file mode 100644 index e37ff0918c95..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/ReflBenchmark.scala +++ /dev/null @@ -1,38 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Refl -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroReflectionFixture -import io.shiftleft.semanticcpg.language._ - -class ReflBenchmark1 extends SecuribenchMicroReflectionFixture(JVM_EXT, 1) { - - s"Refl$benchmarkNo" should "report secure" taggedAs Refl in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark2 extends SecuribenchMicroReflectionFixture(JVM_EXT, 2) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark3 extends SecuribenchMicroReflectionFixture(JVM_EXT, 3) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class ReflBenchmark4 extends SecuribenchMicroReflectionFixture(JVM_EXT, 4) { - - s"Refl$benchmarkNo" should "report insecure" taggedAs Refl in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SanitizersBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SanitizersBenchmark.scala deleted file mode 100644 index 341f1490ab9f..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SanitizersBenchmark.scala +++ /dev/null @@ -1,66 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Sanitizers -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroSanitizersFixture -import io.shiftleft.semanticcpg.language._ - -class SanitizersBenchmark1 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 1) { - - s"Sanitizers$benchmarkNo line 47" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Sanitizers$benchmarkNo line 48" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class SanitizersBenchmark2 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 2) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class SanitizersBenchmark3 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 3) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class SanitizersBenchmark4 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 4) { - - s"Sanitizers$benchmarkNo line 45" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(45)) - } - - s"Sanitizers$benchmarkNo line 46" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - -} - -class SanitizersBenchmark5 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 5) { - - s"Sanitizers$benchmarkNo line 46" should "report insecure" taggedAs Sanitizers in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(46)) - } - - s"Sanitizers$benchmarkNo line 47" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - -} - -class SanitizersBenchmark6 extends SecuribenchMicroSanitizersFixture(JVM_EXT, 6) { - - s"Sanitizers$benchmarkNo" should "report secure" taggedAs Sanitizers in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SessionBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SessionBenchmark.scala deleted file mode 100644 index 7e66b402cebe..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/SessionBenchmark.scala +++ /dev/null @@ -1,34 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.Session -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroSessionFixture -import io.shiftleft.semanticcpg.language._ - -class SessionBenchmark1 extends SecuribenchMicroSessionFixture(JVM_EXT, 1) { - - s"Session$benchmarkNo" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class SessionBenchmark2 extends SecuribenchMicroSessionFixture(JVM_EXT, 2) { - - s"Session$benchmarkNo line 47" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(47)) - } - - s"Session$benchmarkNo line 48" should "report secure" taggedAs Session in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*").lineNumber(48)) - } - -} - -class SessionBenchmark3 extends SecuribenchMicroSessionFixture(JVM_EXT, 3) { - - s"Session$benchmarkNo" should "report insecure" taggedAs Session in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/StrongUpdatesBenchmark.scala b/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/StrongUpdatesBenchmark.scala deleted file mode 100644 index ef619e61209d..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/securibench/micro/jvm/StrongUpdatesBenchmark.scala +++ /dev/null @@ -1,46 +0,0 @@ -package io.joern.benchmarks.securibench.micro.jvm - -import io.joern.benchmarks.BenchmarkTags.StrongUpdates -import io.joern.benchmarks.testfixtures.BenchmarkFixture._ -import io.joern.benchmarks.testfixtures.SecuribenchMicroStrongUpdatesFixture -import io.shiftleft.semanticcpg.language._ - -class StrongUpdatesBenchmark1 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 1) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark2 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 2) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark3 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 3) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark4 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 4) { - - s"StrongUpdates$benchmarkNo" should "report insecure" taggedAs StrongUpdates in { - assertIsInsecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} - -class StrongUpdatesBenchmark5 extends SecuribenchMicroStrongUpdatesFixture(JAVA_EXT, 3) { - - s"StrongUpdates$benchmarkNo" should "report secure" taggedAs StrongUpdates in { - assertIsSecure(cpg.literal(".*name.*"), cpg.call(".*println.*")) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/BenchmarkFixture.scala b/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/BenchmarkFixture.scala deleted file mode 100644 index 2bf279a0a49a..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/BenchmarkFixture.scala +++ /dev/null @@ -1,163 +0,0 @@ -package io.joern.benchmarks.testfixtures - -import io.joern.benchmarks.BenchmarkTags._ -import io.joern.console.cpgcreation.guessLanguage -import io.joern.dataflowengineoss.DefaultSemantics -import io.joern.dataflowengineoss.language._ -import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} -import io.joern.dataflowengineoss.queryengine.EngineContext -import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.javasrc2cpg.{JavaSrc2Cpg, Config => JavaSrcConfig} -import io.joern.jimple2cpg.{Jimple2Cpg, Config => JimpleConfig} -import io.shiftleft.codepropertygraph.generated.nodes.CfgNode -import io.shiftleft.codepropertygraph.generated.{Cpg, Languages} -import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} -import io.shiftleft.semanticcpg.layers.LayerCreatorContext -import io.shiftleft.utils.ProjectRoot -import org.scalatest._ -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers - -import scala.util.Failure - -abstract class BenchmarkFixture( - val pkg: String = "", - val category: String = "", - val benchmarkNo: String = "1", - val fileExt: String = "" -) extends AnyFlatSpec - with Matchers - with BeforeAndAfterAll { - - lazy val defaultSemantics: Semantics = DefaultSemantics() - implicit val resolver: ICallResolver = NoResolve - implicit lazy val engineContext: EngineContext = EngineContext(defaultSemantics) - - private lazy val targetFiles = getListOfFiles(ProjectRoot.relativise(constructTargetFilePath)) - private lazy val targetDir = moveToTempDir(targetFiles) - lazy val cpg: Cpg = BenchmarkCpgContext.buildCpg(targetDir) - - def constructTargetFilePath: String = - s"benchmarks/src/test/resources/$pkg/${category.toLowerCase}" - - protected def getListOfFiles(dir: String): List[java.io.File] = { - val d = new java.io.File(dir) - // Regex is useful for class files containing subclasses - val regex = s".*$category$benchmarkNo(?:\\$$[A-Za-z]*)?$fileExt" - if (d.exists && d.isDirectory) { - d.listFiles.filter(f => f.isFile && f.getAbsolutePath.matches(regex)).toList - } else { - List.empty - } - } - - private def moveToTempDir(files: List[java.io.File]): String = { - val tgt = java.nio.file.Files.createTempDirectory("benchmarks") - files.foreach { f => - java.nio.file.Files.copy(f.toPath, java.nio.file.Paths.get(s"$tgt${java.io.File.separator}${f.getName}")) - } - tgt.toAbsolutePath.toString - } - - /** Makes sure there are flows between the source and the sink - */ - def assertIsInsecure(source: Iterator[CfgNode], sink: Iterator[CfgNode]): Assertion = - if (sink.reachableBy(source).isEmpty) { - fail("[False Negative] Source was not found to taint the sink") - } else { - succeed - } - - /** Makes sure there are no flows between the source and the sink. - */ - def assertIsSecure(source: Iterator[CfgNode], sink: Iterator[CfgNode]): Assertion = - if (sink.reachableBy(source).nonEmpty) { - fail("[False positive] Source was found to taint the sink") - } else { - succeed - } - - override protected def withFixture(test: NoArgTest): Outcome = { - val outcome = super.withFixture(test) - val idxToInc = outcome match { - case Failed(_) => - val falseNegative = test.text.contains("insecure") - if (falseNegative) - Some(FN) - else - Some(FP) - case Succeeded => - val truePositive = test.text.contains("insecure") - if (truePositive) - Some(TP) - else - Some(TN) - case _ => None - } - - test.tags.foreach { tag => - val arr: Array[Int] = confusionMatrix(tag) - idxToInc match { - case Some(idx) => arr(idx) += 1 - case None => - } - } - - outcome - } - - override def afterAll(): Unit = { - cpg.close() - } - -} - -object BenchmarkFixture { - val JAVA_EXT = ".java" - val JVM_EXT = ".class" - val C_EXT = ".c" - val CPP_EXT = ".cpp" - val PYTHON_EXT = ".py" - val JAVASCRIPT_EXT = ".js" -} - -object BenchmarkCpgContext { - - def buildCpg(codePath: String): Cpg = { - new BenchmarkCpgContext() - .withSource(codePath) - .buildCpg() - } -} - -class BenchmarkCpgContext { - private var inputPath: String = "" - - def buildCpg(): Cpg = { - val cpgPath = java.io.File.createTempFile("benchmark", ".odb").getAbsolutePath - val cpg = guessLanguage(inputPath) match { - case Some(language: String) => - language match { - case Languages.JAVASRC => - JavaSrc2Cpg().createCpgWithOverlays(JavaSrcConfig().withInputPath(inputPath).withOutputPath(cpgPath)) - case Languages.JAVA => - Jimple2Cpg().createCpgWithOverlays(JimpleConfig().withInputPath(inputPath).withOutputPath(cpgPath)) - case _ => Failure(new RuntimeException(s"No supported language frontend for the benchmark at '$inputPath'")) - } - case None => - Failure( - new RuntimeException(s"Unable to guess which language frontend to use to parse the benchmark at '$inputPath'") - ) - } - val context = new LayerCreatorContext(cpg.get) - val options = new OssDataFlowOptions() - lazy val defaultSemantics: Semantics = DefaultSemantics() - new OssDataFlow(options)(defaultSemantics).run(context) - cpg.get - } - - private def withSource(codePath: String): BenchmarkCpgContext = { - this.inputPath = codePath - this - } -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/IfspecFixture.scala b/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/IfspecFixture.scala deleted file mode 100644 index 495e71eb1c61..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/IfspecFixture.scala +++ /dev/null @@ -1,28 +0,0 @@ -package io.joern.benchmarks.testfixtures - -class IfspecFixture(category: String, fileExt: String, benchmarkNo: String) - extends BenchmarkFixture(pkg = "ifspec", category = category, fileExt = fileExt, benchmarkNo = benchmarkNo) - -class IfspecAliasingFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Aliasing", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecArraysFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Arrays", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecCastingFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Casting", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecClassInitializerFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "ClassInitializer", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecExceptionsFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Exceptions", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecHighConditionalFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "HighConditional", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecLibraryFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Library", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class IfspecSimpleFixture(fileExt: String, benchmarkNo: Int) - extends IfspecFixture(category = "Simple", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/JInfoFlowFixture.scala b/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/JInfoFlowFixture.scala deleted file mode 100644 index fbe30a8df3b6..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/JInfoFlowFixture.scala +++ /dev/null @@ -1,24 +0,0 @@ -package io.joern.benchmarks.testfixtures -import java.io.File - -class JInfoFlowFixture(category: String, fileExt: String, benchmarkNo: String) - extends BenchmarkFixture(pkg = "jinfoflow", category = category, fileExt = fileExt, benchmarkNo = benchmarkNo) - -class JInfoFlowBasicFixture(fileExt: String, benchmarkNo: Int) - extends JInfoFlowFixture(category = "Basic", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class JInfoFlowCtxFixture(fileExt: String, benchmarkNo: Int) - extends JInfoFlowFixture(category = "Ctx", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class JInfoFlowEventsFixture(fileExt: String, benchmarkNo: Int) - extends JInfoFlowFixture(category = "Events", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) { - - override protected def getListOfFiles(dir: String): List[File] = { - val targetFiles = super.getListOfFiles(dir) - val eventFramework = new java.io.File(s"$dir${java.io.File.separator}eventframework") - val events = new java.io.File(s"$dir${java.io.File.separator}events") - val supportingFiles = eventFramework.listFiles() ++ events.listFiles() - targetFiles ++ supportingFiles.filter(_.isFile) - } - -} diff --git a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/SecuribenchMicroFixture.scala b/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/SecuribenchMicroFixture.scala deleted file mode 100644 index 627995ec609d..000000000000 --- a/benchmarks/src/test/scala/io/joern/benchmarks/testfixtures/SecuribenchMicroFixture.scala +++ /dev/null @@ -1,45 +0,0 @@ -package io.joern.benchmarks.testfixtures - -class SecuribenchMicroFixture(category: String, fileExt: String, benchmarkNo: String) - extends BenchmarkFixture( - pkg = "securibench/micro", - category = category, - fileExt = fileExt, - benchmarkNo = benchmarkNo - ) - -class SecuribenchMicroAliasingFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Aliasing", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroArraysFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Arrays", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroBasicFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Basic", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroCollectionsFixture(fileExt: String, benchmarkNo: String) - extends SecuribenchMicroFixture(category = "Collections", fileExt = fileExt, benchmarkNo = benchmarkNo) - -class SecuribenchMicroDatastructuresFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Datastructures", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroFactoriesFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Factories", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroInterFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Inter", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroPredFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Pred", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroReflectionFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Refl", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroSanitizersFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Sanitizers", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroSessionFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "Session", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) - -class SecuribenchMicroStrongUpdatesFixture(fileExt: String, benchmarkNo: Int) - extends SecuribenchMicroFixture(category = "StrongUpdates", fileExt = fileExt, benchmarkNo = benchmarkNo.toString) diff --git a/build.sbt b/build.sbt index 49c9ffeffc8d..57fac42d0359 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "joern" ThisBuild / organization := "io.joern" ThisBuild / scalaVersion := "3.4.2" -val cpgVersion = "0.1.6" +val cpgVersion = "0.1.10" lazy val joerncli = Projects.joerncli lazy val querydb = Projects.querydb @@ -10,7 +10,6 @@ lazy val console = Projects.console lazy val dataflowengineoss = Projects.dataflowengineoss lazy val macros = Projects.macros lazy val semanticcpg = Projects.semanticcpg -lazy val benchmarks = Projects.benchmarks lazy val c2cpg = Projects.c2cpg lazy val ghidra2cpg = Projects.ghidra2cpg lazy val x2cpg = Projects.x2cpg @@ -25,28 +24,6 @@ lazy val gosrc2cpg = Projects.gosrc2cpg lazy val swiftsrc2cpg = Projects.swiftsrc2cpg lazy val csharpsrc2cpg = Projects.csharpsrc2cpg -lazy val aggregatedProjects: Seq[ProjectReference] = Seq( - joerncli, - querydb, - console, - dataflowengineoss, - macros, - semanticcpg, - c2cpg, - x2cpg, - pysrc2cpg, - php2cpg, - ghidra2cpg, - jssrc2cpg, - javasrc2cpg, - jimple2cpg, - kotlin2cpg, - rubysrc2cpg, - gosrc2cpg, - swiftsrc2cpg, - csharpsrc2cpg -) - ThisBuild / libraryDependencies ++= Seq( "org.slf4j" % "slf4j-api" % Versions.slf4j, "org.apache.logging.log4j" % "log4j-slf4j2-impl" % Versions.log4j % Optional, @@ -108,11 +85,6 @@ ThisBuild / developers := List( publish / skip := true // don't publish the root project -// Avoids running root tasks on the benchmarks project -lazy val root = project - .in(file(".")) - .aggregate(aggregatedProjects *) - ThisBuild / Test / packageBin / publishArtifact := true githubOwner := "Privado-Inc" diff --git a/changelog/4.0.0-flatgraph.md b/changelog/4.0.0-flatgraph.md new file mode 100644 index 000000000000..2e3de7ed0de7 --- /dev/null +++ b/changelog/4.0.0-flatgraph.md @@ -0,0 +1,43 @@ +# 4.0.x: Migration to flatgraph + +Joern uses the domain-specific classes from codepropertygraph, which (up to joern 2.x) were generated by overflowdb (specifically https://github.com/ShiftLeftSecurity/overflowdb and https://github.com/ShiftLeftSecurity/overflowdb-codegen). +As of joern 4.0.x we replaced overflowdb with it's successor, [flatgraph](https://github.com/joernio/flatgraph). The most important PRs paving the way for flatgraph are https://github.com/ShiftLeftSecurity/codepropertygraph/pull/1769 and https://github.com/joernio/joern/pull/4630. + +### Why the change? +Most importantly, flatgraph brings us about 40% less memory usage as well as faster traversals. The reduced memory footprint is achieved by flatgraph's efficient columnar layout, essentially we hold everything in few (albeit very large) arrays. +The faster traversals account for about 40% performance improvement for many joern use-cases, e.g. running the default passes while importing a large cpg into joern. Some numbers for Linux 4, as an example for a very large codebase. Numbers are based on my workstation and just rough measurements. + +Linux 4.1.16, cpg created with c2cpg after `importCpg` into joern: +* 48M nodes with 630M properties (mostly `String` and `Integer`) +* 431M edges with 115M properties (all `String`) + +| | joern 2 (overflowdb) | joern 4 (flatgraph) | +| --------------------------------------------|----------------------|-------------------- | +| heap after import (after garbage collection)| 33g | 20g | +| minimum required heap (Xmx) for import | 80g | 30g | +| time for importCpg | 18 minutes | 11 minutes | +| file size on disk | 2600M | 400m | + +Linux 5 and 6 are considerably larger, so I wasn't able to import them into joern 2 on my workstation (which has 128G physical memory). With joern 4 it works just fine with `./joern -J-Xmx90g` for linux6 😀 + +Also worth noting: one of overflowdb's features was the overflowing-to-disk mechanism. While it sounds nice to be able to handle graphs larger than the available memory, in practice it was too slow to be useful, so we didn't reimplement it in flatgraph. + +### API changes / upgrade guide +We tried to minimise the joern-user-facing API changes, and depending on your usage you may not notice anything at all. That being said, if your code makes use of the `overflowdb` namespace then you will have to make some changes. In most cases, it's simply a namespace change to `flatgraph`. Since hopefully no joern user used the overflowdb api (with one exception listed below), I won't list the changes here, instead please look at the [joern migration PR](https://github.com/joernio/joern/pull/4630/files) and/or ask us on [discord](https://discord.com/channels/832209896089976854/842699104383533076). + +Most relevant changes: +1) `overflowdb.BatchedUpdate.applyDiff` -> `flatgraph.DiffGraphApplier.applyDiff` +1) `io.shiftleft.passes.IntervalKeyPool` -> `io.joern.x2cpg.utils.IntervalKeyPool` + +1) `StoredNode.propertyOption` now returns an `Option` rather than a `java.util.Optional` - the API is almost identical, and there's builtin conversions both ways (`.toScala|.toJava` via `import scala.jdk.OptionConverters.*`). + +1) the arrow syntax for quickly constructing graphs, e.g. `v0 --- "CFG" --> v1`, quite useful for testing, doesn't exist in flatgraph yet. You'll need to create a diffgraph instead. There's plenty of examples in the [joern migration PR](https://github.com/joernio/joern/pull/4630/files). + +1) Edges can only have zero or one properties. Since the codepropertygraph schema never defined more than one property per edge type, this should not affect you as a joern user, unless you've extended the cpg schema... + +### Credits and kudos +Flatgraph is based on [@bbrehm](https://github.com/bbrehm)'s great ideas for a memory efficient columnar layout on the jvm. He built a working prototype with very promising benchmarks that convinced us that the effort to migrate is worth-while, and that turned out to be true. + +### Why did we leave out version 3? +I'm glad you asked! Version 3 is typically a source for trouble, you know... just look at Gnome 3, Python 3 and many more. The only exception is Scala 3, of course - ymmv :) + diff --git a/console/build.sbt b/console/build.sbt index afba2c961cc4..93e38d97b200 100644 --- a/console/build.sbt +++ b/console/build.sbt @@ -5,12 +5,7 @@ enablePlugins(JavaAppPackaging) dependsOn( Projects.semanticcpg, Projects.macros, - Projects.javasrc2cpg, - Projects.jssrc2cpg, - Projects.php2cpg, - Projects.pysrc2cpg, Projects.rubysrc2cpg, - Projects.swiftsrc2cpg, Projects.x2cpg % "compile->compile;test->test" ) diff --git a/console/src/main/scala/io/joern/console/Commit.scala b/console/src/main/scala/io/joern/console/Commit.scala index 890ecb71bc88..cfc8ec8ec667 100644 --- a/console/src/main/scala/io/joern/console/Commit.scala +++ b/console/src/main/scala/io/joern/console/Commit.scala @@ -1,13 +1,14 @@ package io.joern.console +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder object Commit { val overlayName: String = "commit" val description: String = "Apply current custom diffgraph" - def defaultOpts = new CommitOptions(new DiffGraphBuilder) + def defaultOpts = new CommitOptions(Cpg.newDiffGraphBuilder) } class CommitOptions(var diffGraphBuilder: DiffGraphBuilder) extends LayerCreatorOptions @@ -26,7 +27,7 @@ class Commit(opts: CommitOptions) extends LayerCreator { } } runPass(pass, context) - opts.diffGraphBuilder = new DiffGraphBuilder + opts.diffGraphBuilder = Cpg.newDiffGraphBuilder } } diff --git a/console/src/main/scala/io/joern/console/Console.scala b/console/src/main/scala/io/joern/console/Console.scala index 45457e8bf7c4..63236e5de1e2 100644 --- a/console/src/main/scala/io/joern/console/Console.scala +++ b/console/src/main/scala/io/joern/console/Console.scala @@ -2,18 +2,18 @@ package io.joern.console import better.files.File import dotty.tools.repl.State -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.cpgloading.CpgLoader import io.joern.console.cpgcreation.ImportCode import io.joern.console.workspacehandling.{Project, WorkspaceLoader, WorkspaceManager} import io.joern.x2cpg.X2Cpg.defaultOverlayCreators -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.cpgloading.CpgLoader import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.dotextension.ImageViewer import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext} -import overflowdb.traversal.help.Doc -import overflowdb.traversal.help.Table.AvailableWidthProvider +import io.shiftleft.codepropertygraph.generated.help.Doc +import flatgraph.help.Table.AvailableWidthProvider import scala.sys.process.Process import scala.util.control.NoStackTrace @@ -349,10 +349,14 @@ class Console[T <: Project](loader: WorkspaceLoader[T], baseDir: File = File.cur val cpgDestinationPath = cpgDestinationPathOpt.get - if (CpgLoader.isLegacyCpg(cpgFile)) { - report("You have provided a legacy proto CPG. Attempting conversion.") + val isProtoFormat = CpgLoader.isProtoFormat(cpgFile.path) + val isOverflowDbFormat = CpgLoader.isOverflowDbFormat(cpgFile.path) + if (isProtoFormat || isOverflowDbFormat) { + if (isProtoFormat) report("You have provided a legacy proto CPG. Attempting conversion.") + else if (isOverflowDbFormat) report("You have provided a legacy overflowdb CPG. Attempting conversion.") try { - CpgConverter.convertProtoCpgToOverflowDb(cpgFile.path.toString, cpgDestinationPath.toString) + val cpg = CpgLoader.load(cpgFile.path, cpgDestinationPath) + cpg.close() } catch { case exc: Exception => report("Error converting legacy CPG: " + exc.getMessage) diff --git a/console/src/main/scala/io/joern/console/ConsoleConfig.scala b/console/src/main/scala/io/joern/console/ConsoleConfig.scala index a5b4ea738f95..fc86ca54d857 100644 --- a/console/src/main/scala/io/joern/console/ConsoleConfig.scala +++ b/console/src/main/scala/io/joern/console/ConsoleConfig.scala @@ -1,6 +1,6 @@ package io.joern.console -import better.files._ +import better.files.* import scala.annotation.tailrec import scala.collection.mutable diff --git a/console/src/main/scala/io/joern/console/CpgConverter.scala b/console/src/main/scala/io/joern/console/CpgConverter.scala index 3019e65ab816..7ce22c6bb670 100644 --- a/console/src/main/scala/io/joern/console/CpgConverter.scala +++ b/console/src/main/scala/io/joern/console/CpgConverter.scala @@ -1,14 +1,18 @@ package io.joern.console -import io.shiftleft.codepropertygraph.cpgloading.{CpgLoader, CpgLoaderConfig} -import overflowdb.Config +import io.shiftleft.codepropertygraph.cpgloading.{CpgLoader, ProtoCpgLoader} + +import java.nio.file.Paths object CpgConverter { - def convertProtoCpgToOverflowDb(srcFilename: String, dstFilename: String): Unit = { - val odbConfig = Config.withDefaults.withStorageLocation(dstFilename) - val config = CpgLoaderConfig.withDefaults.doNotCreateIndexesOnLoad.withOverflowConfig(odbConfig) - CpgLoader.load(srcFilename, config).close + def convertProtoCpgToFlatgraph(srcFilename: String, dstFilename: String): Unit = { + val cpg = ProtoCpgLoader.loadFromProtoZip(srcFilename, Option(Paths.get(dstFilename))) + cpg.close() } + @deprecated("method got renamed to `convertProtoCpgToFlatgraph, please use that instead", "joern v3") + def convertProtoCpgToOverflowDb(srcFilename: String, dstFilename: String): Unit = + convertProtoCpgToFlatgraph(srcFilename, dstFilename) + } diff --git a/console/src/main/scala/io/joern/console/Help.scala b/console/src/main/scala/io/joern/console/Help.scala index a1b3e017709b..b45739f88f42 100644 --- a/console/src/main/scala/io/joern/console/Help.scala +++ b/console/src/main/scala/io/joern/console/Help.scala @@ -1,8 +1,8 @@ package io.joern.console -import overflowdb.traversal.help.DocFinder.* -import overflowdb.traversal.help.Table.AvailableWidthProvider -import overflowdb.traversal.help.{DocFinder, Table} +import flatgraph.help.DocFinder.* +import flatgraph.help.Table.AvailableWidthProvider +import flatgraph.help.{DocFinder, Table} object Help { diff --git a/console/src/main/scala/io/joern/console/PluginManager.scala b/console/src/main/scala/io/joern/console/PluginManager.scala index 0d049a1ab640..0666355bc429 100644 --- a/console/src/main/scala/io/joern/console/PluginManager.scala +++ b/console/src/main/scala/io/joern/console/PluginManager.scala @@ -1,5 +1,5 @@ package io.joern.console -import better.files.Dsl._ +import better.files.Dsl.* import better.files.File import better.files.File.apply diff --git a/console/src/main/scala/io/joern/console/Run.scala b/console/src/main/scala/io/joern/console/Run.scala index 5dfe92451f25..7ca248d2b670 100644 --- a/console/src/main/scala/io/joern/console/Run.scala +++ b/console/src/main/scala/io/joern/console/Run.scala @@ -6,7 +6,7 @@ import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext} import org.reflections8.Reflections import org.reflections8.util.{ClasspathHelper, ConfigurationBuilder} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object Run { @@ -64,7 +64,7 @@ object Run { | |val opts = new OptsDynamic() | - | import _root_.overflowdb.BatchedUpdate.DiffGraphBuilder + | import _root_.io.shiftleft.codepropertygraph.generated.DiffGraphBuilder | implicit def _diffGraph: DiffGraphBuilder = opts.commit.diffGraphBuilder | def diffGraph = _diffGraph |""".stripMargin @@ -75,7 +75,7 @@ object Run { val toStringCode = s""" - | import overflowdb.traversal.help.Table + | import flatgraph.help.Table | override def toString() : String = { | val columnNames = List("name", "description") | val rows = diff --git a/console/src/main/scala/io/joern/console/cpgcreation/CpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/CpgGenerator.scala index 382b910751d0..6a816135227f 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/CpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/CpgGenerator.scala @@ -1,9 +1,9 @@ package io.joern.console.cpgcreation import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg -import scala.sys.process._ +import scala.sys.process.* import scala.util.Try /** A CpgGenerator generates Code Property Graphs from code. Each supported language implements a Generator, e.g., diff --git a/console/src/main/scala/io/joern/console/cpgcreation/CpgGeneratorFactory.scala b/console/src/main/scala/io/joern/console/cpgcreation/CpgGeneratorFactory.scala index 710ba95363dc..37362dfad732 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/CpgGeneratorFactory.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/CpgGeneratorFactory.scala @@ -1,11 +1,10 @@ package io.joern.console.cpgcreation -import better.files.Dsl._ +import better.files.Dsl.* import better.files.File -import io.shiftleft.codepropertygraph.cpgloading.{CpgLoader, CpgLoaderConfig} +import io.shiftleft.codepropertygraph.cpgloading.CpgLoader import io.shiftleft.codepropertygraph.generated.Languages -import io.joern.console.ConsoleConfig -import overflowdb.Config +import io.joern.console.{ConsoleConfig, CpgConverter} import java.nio.file.Path import scala.util.Try @@ -60,12 +59,12 @@ class CpgGeneratorFactory(config: ConsoleConfig) { generator.generate(inputPath, outputPath).map(File(_)) outputFileOpt.map { outFile => val parentPath = outFile.parent.path.toAbsolutePath - if (isZipFile(outFile)) { + if (CpgLoader.isProtoFormat(outFile.path)) { report("Creating database from bin.zip") val srcFilename = outFile.path.toAbsolutePath.toString val dstFilename = parentPath.resolve("cpg.bin").toAbsolutePath.toString // MemoryHelper.hintForInsufficientMemory(srcFilename).map(report) - convertProtoCpgToOverflowDb(srcFilename, dstFilename) + convertProtoCpgToFlatgraph(srcFilename, dstFilename) } else { report("moving cpg.bin.zip to cpg.bin because it is already a database file") val srcPath = parentPath.resolve("cpg.bin.zip") @@ -77,18 +76,13 @@ class CpgGeneratorFactory(config: ConsoleConfig) { } } - def convertProtoCpgToOverflowDb(srcFilename: String, dstFilename: String): Unit = { - val odbConfig = Config.withDefaults.withStorageLocation(dstFilename) - val config = CpgLoaderConfig.withDefaults.doNotCreateIndexesOnLoad.withOverflowConfig(odbConfig) - CpgLoader.load(srcFilename, config).close - File(srcFilename).delete() - } + @deprecated("method got renamed to `convertProtoCpgToFlatgraph, please use that instead", "joern v3") + def convertProtoCpgToOverflowDb(srcFilename: String, dstFilename: String): Unit = + convertProtoCpgToFlatgraph(srcFilename, dstFilename) - def isZipFile(file: File): Boolean = { - val bytes = file.bytes - Try { - bytes.next() == 'P' && bytes.next() == 'K' - }.getOrElse(false) + def convertProtoCpgToFlatgraph(srcFilename: String, dstFilename: String): Unit = { + CpgConverter.convertProtoCpgToFlatgraph(srcFilename, dstFilename) + File(srcFilename).delete() } private def report(str: String): Unit = System.err.println(str) diff --git a/console/src/main/scala/io/joern/console/cpgcreation/ImportCode.scala b/console/src/main/scala/io/joern/console/cpgcreation/ImportCode.scala index c081cb4a12b6..a84aad1712f5 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/ImportCode.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/ImportCode.scala @@ -3,10 +3,10 @@ package io.joern.console.cpgcreation import better.files.File import io.joern.console.workspacehandling.Project import io.joern.console.{ConsoleException, FrontendConfig, Reporting} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages -import overflowdb.traversal.help.Table -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table +import flatgraph.help.Table.AvailableWidthProvider import java.nio.file.Path import scala.util.{Failure, Success, Try} diff --git a/console/src/main/scala/io/joern/console/cpgcreation/JavaCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/JavaCpgGenerator.scala index 1d9277902471..307a4d1793b7 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/JavaCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/JavaCpgGenerator.scala @@ -3,7 +3,7 @@ package io.joern.console.cpgcreation import io.joern.console.FrontendConfig import java.nio.file.Path -import scala.sys.process._ +import scala.sys.process.* import scala.util.{Failure, Try} /** Language frontend for Java archives (JAR files). Translates Java archives into code property graphs. diff --git a/console/src/main/scala/io/joern/console/cpgcreation/JavaSrcCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/JavaSrcCpgGenerator.scala index c943ea34e128..769a6e15cfd7 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/JavaSrcCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/JavaSrcCpgGenerator.scala @@ -1,9 +1,9 @@ package io.joern.console.cpgcreation import io.joern.console.FrontendConfig -import io.joern.javasrc2cpg.{JavaSrc2Cpg, Main, Config} -import io.joern.x2cpg.X2Cpg -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.javasrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path import scala.util.Try @@ -12,19 +12,20 @@ import scala.util.Try */ case class JavaSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { private lazy val command: Path = if (isWin) rootPath.resolve("javasrc2cpg.bat") else rootPath.resolve("javasrc2cpg") - private var javaConfig: Option[Config] = None + private lazy val cmdLineArgs = config.cmdLineParams.toSeq + private lazy val enableTypeRecovery = cmdLineArgs.exists(_ == s"--${javasrc2cpg.ParameterNames.EnableTypeRecovery}") + private lazy val typeRecoveryConfig = XTypeRecoveryConfig.parse(cmdLineArgs) /** Generate a CPG for the given input path. Returns the output path, or None, if no CPG was generated. */ override def generate(inputPath: String, outputPath: String = "cpg.bin"): Try[String] = { - val arguments = config.cmdLineParams.toSeq ++ Seq(inputPath, "--output", outputPath) - javaConfig = X2Cpg.parseCommandLine(arguments.toArray, Main.getCmdLineParser, Config()) + val arguments = cmdLineArgs ++ Seq(inputPath, "--output", outputPath) runShellCommand(command.toString, arguments).map(_ => outputPath) } override def applyPostProcessingPasses(cpg: Cpg): Cpg = { - if (javaConfig.exists(_.enableTypeRecovery)) - JavaSrc2Cpg.typeRecoveryPasses(cpg, javaConfig).foreach(_.createAndApply()) + if (enableTypeRecovery) + javasrc2cpg.typeRecoveryPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) super.applyPostProcessingPasses(cpg) } diff --git a/console/src/main/scala/io/joern/console/cpgcreation/JsSrcCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/JsSrcCpgGenerator.scala index 9e9d7ee0dfb9..0ec4347ba392 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/JsSrcCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/JsSrcCpgGenerator.scala @@ -2,16 +2,16 @@ package io.joern.console.cpgcreation import better.files.File import io.joern.console.FrontendConfig -import io.joern.jssrc2cpg.{Config, Frontend, JsSrc2Cpg} -import io.joern.x2cpg.X2Cpg -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.jssrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path import scala.util.Try case class JsSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { private lazy val command: Path = if (isWin) rootPath.resolve("jssrc2cpg.bat") else rootPath.resolve("jssrc2cpg.sh") - private var jsConfig: Option[Config] = None + private lazy val typeRecoveryConfig = XTypeRecoveryConfig.parse(config.cmdLineParams.toSeq) /** Generate a CPG for the given input path. Returns the output path, or None, if no CPG was generated. */ @@ -27,7 +27,6 @@ case class JsSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends Cpg private def invoke(inputPath: String, outputPath: String): Try[String] = { val arguments = Seq(inputPath, "--output", outputPath) ++ config.cmdLineParams - jsConfig = X2Cpg.parseCommandLine(arguments.toArray, Frontend.cmdLineParser, Config()) runShellCommand(command.toString, arguments).map(_ => outputPath) } @@ -35,7 +34,7 @@ case class JsSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends Cpg command.toFile.exists override def applyPostProcessingPasses(cpg: Cpg): Cpg = { - JsSrc2Cpg.postProcessingPasses(cpg, jsConfig).foreach(_.createAndApply()) + jssrc2cpg.postProcessingPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) cpg } diff --git a/console/src/main/scala/io/joern/console/cpgcreation/PhpCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/PhpCpgGenerator.scala index aaf18fd0c297..a570751769e0 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/PhpCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/PhpCpgGenerator.scala @@ -1,21 +1,30 @@ package io.joern.console.cpgcreation import io.joern.console.FrontendConfig -import io.joern.php2cpg.{Config, Frontend, Php2Cpg} -import io.joern.x2cpg.X2Cpg -import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.php2cpg +import io.joern.x2cpg.passes.frontend.{XTypeRecoveryConfig, XTypeStubsParser, XTypeStubsParserConfig} +import io.shiftleft.codepropertygraph.generated.Cpg +import scopt.OParser import java.nio.file.Path import scala.util.Try case class PhpCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { - private lazy val command: Path = if (isWin) rootPath.resolve("php2cpg.bat") else rootPath.resolve("php2cpg") - private var phpConfig: Option[Config] = None + private lazy val command: Path = if (isWin) rootPath.resolve("php2cpg.bat") else rootPath.resolve("php2cpg") + private lazy val cmdLineArgs = config.cmdLineParams.toSeq + private lazy val typeRecoveryConfig = XTypeRecoveryConfig.parse(cmdLineArgs) + private lazy val setKnownTypesConfig: XTypeStubsParserConfig = { + OParser + .parse(XTypeStubsParser.parserOptions2, cmdLineArgs, XTypeStubsParserConfig()) + .getOrElse( + throw new RuntimeException( + s"unable to parse XTypeStubsParserConfig from commandline arguments ${cmdLineArgs.mkString(" ")}" + ) + ) + } override def generate(inputPath: String, outputPath: String): Try[String] = { val arguments = List(inputPath) ++ Seq("-o", outputPath) ++ config.cmdLineParams - phpConfig = X2Cpg.parseCommandLine(arguments.toArray, Frontend.cmdLineParser, Config()) runShellCommand(command.toString, arguments).map(_ => outputPath) } @@ -25,7 +34,7 @@ case class PhpCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGe override def isJvmBased = true override def applyPostProcessingPasses(cpg: Cpg): Cpg = { - Php2Cpg.postProcessingPasses(cpg, phpConfig).foreach(_.createAndApply()) + php2cpg.postProcessingPasses(cpg, typeRecoveryConfig, setKnownTypesConfig).foreach(_.createAndApply()) cpg } } diff --git a/console/src/main/scala/io/joern/console/cpgcreation/PythonSrcCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/PythonSrcCpgGenerator.scala index 98d5851cfa16..e77d8643dd23 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/PythonSrcCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/PythonSrcCpgGenerator.scala @@ -1,25 +1,26 @@ package io.joern.console.cpgcreation import io.joern.console.FrontendConfig -import io.joern.pysrc2cpg.* import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.pysrc2cpg +import io.joern.x2cpg.frontendspecific.pysrc2cpg.* import io.joern.x2cpg.passes.base.AstLinkerPass import io.joern.x2cpg.passes.callgraph.NaiveCallLinker import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path import scala.util.Try +import scala.compiletime.uninitialized case class PythonSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { - private lazy val command: Path = if (isWin) rootPath.resolve("pysrc2cpg.bat") else rootPath.resolve("pysrc2cpg") - private var pyConfig: Option[Py2CpgOnFileSystemConfig] = None + private lazy val command: Path = if (isWin) rootPath.resolve("pysrc2cpg.bat") else rootPath.resolve("pysrc2cpg") + private lazy val typeRecoveryConfig = XTypeRecoveryConfig.parse(config.cmdLineParams.toSeq) /** Generate a CPG for the given input path. Returns the output path, or None, if no CPG was generated. */ override def generate(inputPath: String, outputPath: String = "cpg.bin.zip"): Try[String] = { val arguments = Seq(inputPath, "-o", outputPath) ++ config.cmdLineParams - pyConfig = X2Cpg.parseCommandLine(arguments.toArray, NewMain.getCmdLineParser, Py2CpgOnFileSystemConfig()) runShellCommand(command.toString, arguments).map(_ => outputPath) } @@ -27,21 +28,7 @@ case class PythonSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends command.toFile.exists override def applyPostProcessingPasses(cpg: Cpg): Cpg = { - new ImportsPass(cpg).createAndApply() - new PythonImportResolverPass(cpg).createAndApply() - new DynamicTypeHintFullNamePass(cpg).createAndApply() - new PythonInheritanceNamePass(cpg).createAndApply() - val typeRecoveryConfig = pyConfig match - case Some(config) => XTypeRecoveryConfig(config.typePropagationIterations, !config.disableDummyTypes) - case None => XTypeRecoveryConfig() - new PythonTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate().foreach(_.createAndApply()) - new PythonTypeHintCallLinker(cpg).createAndApply() - new NaiveCallLinker(cpg).createAndApply() - - // Some of passes above create new methods, so, we - // need to run the ASTLinkerPass one more time - new AstLinkerPass(cpg).createAndApply() - + pysrc2cpg.postProcessingPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) cpg } diff --git a/console/src/main/scala/io/joern/console/cpgcreation/RubyCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/RubyCpgGenerator.scala index d93e24f96176..72fd425b9fb7 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/RubyCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/RubyCpgGenerator.scala @@ -2,7 +2,7 @@ package io.joern.console.cpgcreation import io.joern.console.FrontendConfig import io.joern.rubysrc2cpg.{Config, RubySrc2Cpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path import scala.util.Try diff --git a/console/src/main/scala/io/joern/console/cpgcreation/SwiftSrcCpgGenerator.scala b/console/src/main/scala/io/joern/console/cpgcreation/SwiftSrcCpgGenerator.scala index 0d98161f8f77..504750f4ef62 100644 --- a/console/src/main/scala/io/joern/console/cpgcreation/SwiftSrcCpgGenerator.scala +++ b/console/src/main/scala/io/joern/console/cpgcreation/SwiftSrcCpgGenerator.scala @@ -2,9 +2,9 @@ package io.joern.console.cpgcreation import better.files.File import io.joern.console.FrontendConfig -import io.joern.swiftsrc2cpg.{Config, Frontend, SwiftSrc2Cpg} -import io.joern.x2cpg.X2Cpg -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path import scala.util.Try @@ -12,7 +12,8 @@ import scala.util.Try case class SwiftSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends CpgGenerator { private lazy val command: Path = if (isWin) rootPath.resolve("swiftsrc2cpg.bat") else rootPath.resolve("swiftsrc2cpg.sh") - private var swiftConfig: Option[Config] = None + + private lazy val typeRecoveryConfig = XTypeRecoveryConfig.parse(config.cmdLineParams.toSeq) /** Generate a CPG for the given input path. Returns the output path, or None, if no CPG was generated. */ @@ -28,7 +29,6 @@ case class SwiftSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends private def invoke(inputPath: String, outputPath: String): Try[String] = { val arguments = Seq(inputPath, "--output", outputPath) ++ config.cmdLineParams - swiftConfig = X2Cpg.parseCommandLine(arguments.toArray, Frontend.cmdLineParser, Config()) runShellCommand(command.toString, arguments).map(_ => outputPath) } @@ -36,7 +36,7 @@ case class SwiftSrcCpgGenerator(config: FrontendConfig, rootPath: Path) extends command.toFile.exists override def applyPostProcessingPasses(cpg: Cpg): Cpg = { - SwiftSrc2Cpg.postProcessingPasses(cpg, swiftConfig).foreach(_.createAndApply()) + swiftsrc2cpg.postProcessingPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) cpg } diff --git a/console/src/main/scala/io/joern/console/package.scala b/console/src/main/scala/io/joern/console/package.scala index a29435afba29..958f26202bde 100644 --- a/console/src/main/scala/io/joern/console/package.scala +++ b/console/src/main/scala/io/joern/console/package.scala @@ -1,6 +1,6 @@ package io.joern -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table.AvailableWidthProvider import replpp.Operators.* import replpp.Colors diff --git a/console/src/main/scala/io/joern/console/scan/ScanPass.scala b/console/src/main/scala/io/joern/console/scan/ScanPass.scala index bdfa65d31eb5..1b75a3f600b3 100644 --- a/console/src/main/scala/io/joern/console/scan/ScanPass.scala +++ b/console/src/main/scala/io/joern/console/scan/ScanPass.scala @@ -1,11 +1,11 @@ package io.joern.console.scan import io.joern.console.Query -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPass /** Each query runs the data-flow engine, which is already parallelized. Another layer of parallelism causes undefined - * behaviour on the underlying database. This is why we use `CpgPass` instead of `ConcurrentWriterCpgPass` or similar. + * behaviour on the underlying database. This is why we use `CpgPass` instead of `ForkJoinParallelCpgPass` or similar. */ class ScanPass(cpg: Cpg, queries: List[Query]) extends CpgPass(cpg) { diff --git a/console/src/main/scala/io/joern/console/scan/package.scala b/console/src/main/scala/io/joern/console/scan/package.scala index 7dee62bd2bbd..31230076bb8d 100644 --- a/console/src/main/scala/io/joern/console/scan/package.scala +++ b/console/src/main/scala/io/joern/console/scan/package.scala @@ -1,7 +1,7 @@ package io.joern.console import io.joern.console.Query -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* @@ -11,11 +11,6 @@ package object scan { private val logger: Logger = LoggerFactory.getLogger(this.getClass) - implicit class ScannerStarters(val cpg: Cpg) extends AnyVal { - def finding: Iterator[Finding] = - overflowdb.traversal.InitialTraversal.from[Finding](cpg.graph, NodeTypes.FINDING) - } - implicit class QueryWrapper(q: Query) { /** Obtain list of findings by running query on CPG diff --git a/console/src/main/scala/io/joern/console/workspacehandling/Project.scala b/console/src/main/scala/io/joern/console/workspacehandling/Project.scala index 1bee29a97999..68d2ddc8780e 100644 --- a/console/src/main/scala/io/joern/console/workspacehandling/Project.scala +++ b/console/src/main/scala/io/joern/console/workspacehandling/Project.scala @@ -1,8 +1,8 @@ package io.joern.console.workspacehandling -import better.files.Dsl._ +import better.files.Dsl.* import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.Overlays import java.nio.file.Path diff --git a/console/src/main/scala/io/joern/console/workspacehandling/Workspace.scala b/console/src/main/scala/io/joern/console/workspacehandling/Workspace.scala index 0d3a068d4bc2..82caaff7897b 100644 --- a/console/src/main/scala/io/joern/console/workspacehandling/Workspace.scala +++ b/console/src/main/scala/io/joern/console/workspacehandling/Workspace.scala @@ -1,8 +1,8 @@ package io.joern.console.workspacehandling import io.joern.console.defaultAvailableWidthProvider -import overflowdb.traversal.help.Table -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table +import flatgraph.help.Table.AvailableWidthProvider import scala.collection.mutable.ListBuffer diff --git a/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceLoader.scala b/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceLoader.scala index c0297fb43551..4d7d943db5e1 100644 --- a/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceLoader.scala +++ b/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceLoader.scala @@ -2,7 +2,7 @@ package io.joern.console.workspacehandling import better.files.Dsl.mkdirs import better.files.File -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table.AvailableWidthProvider import java.nio.file.Path import scala.collection.mutable.ListBuffer diff --git a/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceManager.scala b/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceManager.scala index 26b404d5efc0..3beb2345060a 100644 --- a/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceManager.scala +++ b/console/src/main/scala/io/joern/console/workspacehandling/WorkspaceManager.scala @@ -1,18 +1,17 @@ package io.joern.console.workspacehandling -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.joern.console import io.joern.console.defaultAvailableWidthProvider import io.joern.console.Reporting -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.cpgloading.{CpgLoader, CpgLoaderConfig} +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.cpgloading.CpgLoader import org.json4s.DefaultFormats -import org.json4s.native.Serialization.{write => jsonWrite} -import overflowdb.Config +import org.json4s.native.Serialization.write as jsonWrite import java.net.URLEncoder -import java.nio.file.Path +import java.nio.file.{Path, Paths} import scala.collection.mutable.ListBuffer import scala.util.{Failure, Success, Try} @@ -305,17 +304,12 @@ class WorkspaceManager[ProjectType <: Project](path: String, loader: WorkspaceLo private def loadCpgRaw(cpgFilename: String): Option[Cpg] = { Try { - val odbConfig = Config.withDefaults.withStorageLocation(cpgFilename) - val config = - CpgLoaderConfig.withDefaults.doNotCreateIndexesOnLoad.withOverflowConfig(odbConfig) - val newCpg = CpgLoader.loadFromOverflowDb(config) - CpgLoader.createIndexes(newCpg) - newCpg + CpgLoader.load(cpgFilename) } match { case Success(v) => Some(v) case Failure(ex) => System.err.println("Error loading CPG") - System.err.println(ex) + ex.printStackTrace() None } } diff --git a/console/src/test/scala/io/joern/console/ConsoleTests.scala b/console/src/test/scala/io/joern/console/ConsoleTests.scala index 1114558d56fb..728a83d55331 100644 --- a/console/src/test/scala/io/joern/console/ConsoleTests.scala +++ b/console/src/test/scala/io/joern/console/ConsoleTests.scala @@ -1,11 +1,11 @@ package io.joern.console -import better.files.Dsl._ -import better.files._ -import io.joern.console.testing._ +import better.files.Dsl.* +import better.files.* +import io.joern.console.testing.* import io.joern.x2cpg.X2Cpg.defaultOverlayCreators import io.joern.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec @@ -428,7 +428,7 @@ class ConsoleTests extends AnyWordSpec with Matchers { "cpg" should { "provide .help command" in ConsoleFixture() { (console, codeDir) => // part of Predefined.shared, which makes the below work in the repl without separate import - import io.shiftleft.codepropertygraph.Cpg.docSearchPackages + import io.shiftleft.semanticcpg.language.docSearchPackages import io.joern.console.testing.availableWidthProvider console.importCode(codeDir.toString) diff --git a/console/src/test/scala/io/joern/console/LanguageHelperTests.scala b/console/src/test/scala/io/joern/console/LanguageHelperTests.scala index 80b145767aea..afe860453215 100644 --- a/console/src/test/scala/io/joern/console/LanguageHelperTests.scala +++ b/console/src/test/scala/io/joern/console/LanguageHelperTests.scala @@ -1,7 +1,7 @@ package io.joern.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.shiftleft.codepropertygraph.generated.Languages import io.joern.console.cpgcreation.{guessLanguage, LlvmCpgGenerator} import org.scalatest.matchers.should.Matchers diff --git a/console/src/test/scala/io/joern/console/PluginManagerTests.scala b/console/src/test/scala/io/joern/console/PluginManagerTests.scala index 9a0957769c27..63eb5d2b933c 100644 --- a/console/src/test/scala/io/joern/console/PluginManagerTests.scala +++ b/console/src/test/scala/io/joern/console/PluginManagerTests.scala @@ -1,7 +1,7 @@ package io.joern.console -import better.files.Dsl._ -import better.files._ +import better.files.Dsl.* +import better.files.* import io.shiftleft.utils.ProjectRoot import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/console/src/test/scala/io/joern/console/testing/package.scala b/console/src/test/scala/io/joern/console/testing/package.scala index 897bb9e9633c..1b2053d82a7c 100644 --- a/console/src/test/scala/io/joern/console/testing/package.scala +++ b/console/src/test/scala/io/joern/console/testing/package.scala @@ -3,7 +3,7 @@ package io.joern.console import better.files.Dsl.* import better.files.* import io.joern.console.workspacehandling.Project -import overflowdb.traversal.help.Table.{AvailableWidthProvider, ConstantWidth} +import flatgraph.help.Table.{AvailableWidthProvider, ConstantWidth} import scala.util.Try diff --git a/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceManagerTests.scala b/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceManagerTests.scala index 009f850b1419..867f2e4cfd06 100644 --- a/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceManagerTests.scala +++ b/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceManagerTests.scala @@ -1,7 +1,7 @@ package io.joern.console.workspacehandling -import better.files._ -import io.shiftleft.codepropertygraph.Cpg +import better.files.* +import io.shiftleft.codepropertygraph.generated.Cpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec @@ -92,7 +92,7 @@ class WorkspaceManagerTests extends AnyWordSpec with Matchers { projectName, (fileName: String) => { fileName.endsWith("cpg.bin.tmp") shouldBe true - Some(Cpg.emptyCpg) + Some(Cpg.empty) } ) @@ -176,7 +176,7 @@ class WorkspaceManagerTests extends AnyWordSpec with Matchers { def createFakeProjectAndOpen(workspaceFile: File, projectName: String): WorkspaceManager[Project] = { WorkspaceTests.createFakeProject(workspaceFile, projectName) val manager = new WorkspaceManager[Project](workspaceFile.toString) - manager.openProject(projectName, (_: String) => Some(Cpg.emptyCpg)) + manager.openProject(projectName, (_: String) => Some(Cpg.empty)) manager } diff --git a/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceTests.scala b/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceTests.scala index 0abe2f0887d2..9d1b5f48b3ef 100644 --- a/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceTests.scala +++ b/console/src/test/scala/io/joern/console/workspacehandling/WorkspaceTests.scala @@ -1,6 +1,6 @@ package io.joern.console.workspacehandling -import better.files.Dsl._ +import better.files.Dsl.* import better.files.File import io.joern.console.testing.availableWidthProvider import io.shiftleft.semanticcpg.testing.MockCpg diff --git a/console/src/test/scala/io/shiftleft/codepropertygraph/cpgloading/TestProtoCpg.scala b/console/src/test/scala/io/shiftleft/codepropertygraph/cpgloading/TestProtoCpg.scala deleted file mode 100644 index 7649f012eccd..000000000000 --- a/console/src/test/scala/io/shiftleft/codepropertygraph/cpgloading/TestProtoCpg.scala +++ /dev/null @@ -1,45 +0,0 @@ -package io.shiftleft.codepropertygraph.cpgloading - -import better.files.File -import io.shiftleft.proto.cpg.Cpg -import io.shiftleft.proto.cpg.Cpg.CpgStruct - -import java.io.FileOutputStream - -object TestProtoCpg { - - def createTestProtoCpg: File = { - val outDir = better.files.File.newTemporaryDirectory("cpgloadertests") - val outStream = new FileOutputStream((outDir / "1.proto").pathAsString) - CpgStruct - .newBuilder() - .addNode( - CpgStruct.Node - .newBuilder() - .setKey(1) - .setType(CpgStruct.Node.NodeType.valueOf("METHOD")) - .addProperty( - CpgStruct.Node.Property - .newBuilder() - .setName(Cpg.NodePropertyName.valueOf("FULL_NAME")) - .setValue( - Cpg.PropertyValue - .newBuilder() - .setStringValue("foo") - .build() - ) - .build - ) - .build() - ) - .build() - .writeTo(outStream) - outStream.close() - - val zipFile = better.files.File.newTemporaryFile("cpgloadertests", ".bin.zip") - outDir.zipTo(zipFile) - outDir.delete() - zipFile - } - -} diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/dotgenerator/DdgGenerator.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/dotgenerator/DdgGenerator.scala index cb47cc2d51e1..ca007968914d 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/dotgenerator/DdgGenerator.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/dotgenerator/DdgGenerator.scala @@ -1,15 +1,13 @@ package io.joern.dataflowengineoss.dotgenerator import io.joern.dataflowengineoss.DefaultSemantics -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Properties} -import io.joern.dataflowengineoss.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.EdgeTypes +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.semanticsloader.Semantics import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.{Edge, Graph} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.utils.MemberAccess.isGenericMemberAccessName -import overflowdb.Node -import overflowdb.traversal.jIteratortoTraversal import scala.collection.mutable @@ -59,7 +57,7 @@ class DdgGenerator { } } - private def shouldBeDisplayed(v: Node): Boolean = !( + private def shouldBeDisplayed(v: StoredNode): Boolean = !( v.isInstanceOf[ControlStructure] || v.isInstanceOf[JumpTarget] ) @@ -91,7 +89,16 @@ class DdgGenerator { val allInEdges = v .inE(EdgeTypes.REACHING_DEF) .map(x => - Edge(x.outNode.asInstanceOf[StoredNode], v, srcVisible = true, x.property(Properties.VARIABLE), edgeType) + // note: this looks strange, but let me explain... + // in overflowdb, edges were allowed multiple properties and this used to be `x.property(Properties.VARIABLE)` + // in flatgraph an edge may have zero or one properties and they're not named... + // in this case we know that we're dealing with ReachingDef edges which has the `variable` property + val variablePropertyMaybe = x.property match { + case null => null + case variableProperty: String => variableProperty + case _ => null + } + Edge(x.src.asInstanceOf[StoredNode], v, srcVisible = true, variablePropertyMaybe, edgeType) ) v match { diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/Path.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/Path.scala index 2f8170847ad3..981b054ec657 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/Path.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/Path.scala @@ -3,11 +3,11 @@ package io.joern.dataflowengineoss.language import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, CfgNode, Member, MethodParameterIn} import io.shiftleft.semanticcpg import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Table -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table +import flatgraph.help.Table.AvailableWidthProvider case class Path(elements: List[AstNode]) { - def resultPairs(): List[(String, Option[Integer])] = { + def resultPairs(): List[(String, Option[Int])] = { val pairs = elements.map { case point: MethodParameterIn => val method = point.method diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/package.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/package.scala index 842ce65d0d74..7101c872177f 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/package.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/language/package.scala @@ -4,7 +4,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import io.joern.dataflowengineoss.language.dotextension.DdgNodeDot import io.joern.dataflowengineoss.language.nodemethods.{ExpressionMethods, ExtendedCfgNodeMethods} -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc import scala.language.implicitConversions diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpCpg14.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpCpg14.scala index 16ea1b420cb0..4575fba5ab9b 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpCpg14.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpCpg14.scala @@ -2,9 +2,9 @@ package io.joern.dataflowengineoss.layers.dataflows import better.files.File import io.joern.dataflowengineoss.DefaultSemantics -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class Cpg14DumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpDdg.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpDdg.scala index ec5db89d16c6..c76e5b9275d5 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpDdg.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpDdg.scala @@ -2,9 +2,9 @@ package io.joern.dataflowengineoss.layers.dataflows import better.files.File import io.joern.dataflowengineoss.DefaultSemantics -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class DdgDumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpPdg.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpPdg.scala index 2221a5372c8d..3b3dc6d24d30 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpPdg.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/layers/dataflows/DumpPdg.scala @@ -2,9 +2,9 @@ package io.joern.dataflowengineoss.layers.dataflows import better.files.File import io.joern.dataflowengineoss.DefaultSemantics -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class PdgDumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/package.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/package.scala index 0652d87bbf8c..7c7417a3506a 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/package.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/package.scala @@ -2,6 +2,8 @@ package io.joern import io.shiftleft.codepropertygraph.generated.nodes.{Declaration, Expression, Identifier, Literal} import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment +import io.shiftleft.semanticcpg.utils.MemberAccess.isFieldAccess package object dataflowengineoss { @@ -14,10 +16,23 @@ package object dataflowengineoss { * @return * the LHS of the assignment */ - def globalFromLiteral(lit: Literal, recursive: Boolean = true): Iterator[Expression] = lit.start - .where(_.method.isModule) - .flatMap(t => if (recursive) t.inAssignment else t.inCall.assignment) - .target + def globalFromLiteral(lit: Literal, recursive: Boolean = true): Iterator[Expression] = { + + /** Frontends often create three-address code representations of compound literals, e.g. in pysrc2cpg the dictionary + * literal `{"x": y}` is lowered as a block `{tmp0 = {}; tmp0["x"] = y; tmp0}`. + * + * In an assignment `foo = {"x": "y"}`, if [[lit]] is "y", we don't want to pick the intermediate assignment + * `tmp0["x"] = "y"`, since `tmp0` is never a global/module-level variable. Instead, we want to pick `foo`. + */ + def skipLowLevelAssignments(assignments: Iterator[Assignment]): Iterator[Assignment] = { + assignments.repeat(_.parentBlock.inCall.isAssignment)(_.emit).lastOption.fold(assignments)(_.iterator) + } + + lit.start + .where(_.method.isModule) + .flatMap(t => if (recursive) t.inAssignment else skipLowLevelAssignments(t.inCall.isAssignment)) + .target + } def identifierToFirstUsages(node: Identifier): List[Identifier] = node.refsTo.flatMap(identifiersFromCapturedScopes).l diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/DdgGenerator.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/DdgGenerator.scala index 887531648c7e..7693f28757ff 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/DdgGenerator.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/DdgGenerator.scala @@ -4,10 +4,10 @@ import io.joern.dataflowengineoss.{globalFromLiteral, identifierToFirstUsages} import io.joern.dataflowengineoss.queryengine.AccessPathUsage.toTrackedBaseAndAccessPathSimple import io.joern.dataflowengineoss.semanticsloader.Semantics import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Operators} import io.shiftleft.semanticcpg.accesspath.MatchResult import io.shiftleft.semanticcpg.language.* -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import scala.collection.{Set, mutable} @@ -132,7 +132,7 @@ class DdgGenerator(semantics: Semantics) { // There is always an edge from the method input parameter // to the corresponding method output parameter as modifications // of the input parameter only affect a copy. - paramOut.paramIn.foreach { paramIn => + paramOut.start.paramIn.foreach { paramIn => addEdge(paramIn, paramOut, paramIn.name) } usageAnalyzer.usedIncomingDefs(paramOut).foreach { case (_, inElements) => @@ -224,7 +224,7 @@ class DdgGenerator(semantics: Semantics) { (fromNode, toNode) match { case (parentNode: CfgNode, childNode: CfgNode) if EdgeValidator.isValidEdge(childNode, parentNode) => - dstGraph.addEdge(fromNode, toNode, EdgeTypes.REACHING_DEF, PropertyNames.VARIABLE, variable) + dstGraph.addEdge(fromNode, toNode, EdgeTypes.REACHING_DEF, variable) case _ => } diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefPass.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefPass.scala index 6644015c552b..d82df4d5f596 100755 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefPass.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefPass.scala @@ -1,10 +1,10 @@ package io.joern.dataflowengineoss.passes.reachingdef import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.passes.ForkJoinParallelCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} import scala.collection.mutable diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefProblem.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefProblem.scala index 936f43ef4b9f..e06bb34447e0 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefProblem.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/passes/reachingdef/ReachingDefProblem.scala @@ -167,7 +167,7 @@ class ReachingDefTransferFunction(flowGraph: ReachingDefFlowGraph) val gen: Map[StoredNode, mutable.BitSet] = initGen(method).withDefaultValue(mutable.BitSet()) - val kill: Map[StoredNode, Set[Definition]] = + val kill: Map[StoredNode, mutable.BitSet] = initKill(method, gen).withDefaultValue(mutable.BitSet()) /** For a given flow graph node `n` and set of definitions, apply the transfer function to obtain the updated set of @@ -224,7 +224,7 @@ class ReachingDefTransferFunction(flowGraph: ReachingDefFlowGraph) * All operations in our graph are represented by calls and non-operations such as identifiers or field-identifiers * have empty gen and kill sets, meaning that they just pass on definitions unaltered. */ - private def initKill(method: Method, gen: Map[StoredNode, Set[Definition]]): Map[StoredNode, Set[Definition]] = { + private def initKill(method: Method, gen: Map[StoredNode, mutable.BitSet]): Map[StoredNode, mutable.BitSet] = { val allIdentifiers: Map[String, List[CfgNode]] = { val results = mutable.Map.empty[String, List[CfgNode]] @@ -259,42 +259,44 @@ class ReachingDefTransferFunction(flowGraph: ReachingDefFlowGraph) * calculate kill(call) based on gen(call). */ private def killsForGens( - genOfCall: Set[Definition], + genOfCall: mutable.BitSet, allIdentifiers: Map[String, List[CfgNode]], allCalls: Map[String, List[Call]] - ): Set[Definition] = { + ): mutable.BitSet = { - def definitionsOfSameVariable(definition: Definition): Set[Definition] = { + def definitionsOfSameVariable(definition: Definition): Iterator[Definition] = { val definedNodes = flowGraph.numberToNode(definition) match { case param: MethodParameterIn => - allIdentifiers(param.name) + allIdentifiers(param.name).iterator .filter(x => x.id != param.id) case identifier: Identifier => - val sameIdentifiers = allIdentifiers(identifier.name) + val sameIdentifiers = allIdentifiers(identifier.name).iterator .filter(x => x.id != identifier.id) /** Killing an identifier should also kill field accesses on that identifier. For example, a reassignment `x = * new Box()` should kill any previous calls to `x.value`, `x.length()`, etc. */ - val sameObjects: Iterable[Call] = allCalls.values.flatten + val sameObjects: Iterator[Call] = allCalls.valuesIterator.flatten .filter(_.name == Operators.fieldAccess) .filter(_.ast.isIdentifier.nameExact(identifier.name).nonEmpty) sameIdentifiers ++ sameObjects case call: Call => - allCalls(call.code) + allCalls(call.code).iterator .filter(x => x.id != call.id) - case _ => Set() + case _ => Iterator.empty } definedNodes // It can happen that the CFG is broken and contains isolated nodes, // in which case they are not in `nodeToNumber`. Let's filter those. - .collect { case x if nodeToNumber.contains(x) => Definition.fromNode(x, nodeToNumber) }.toSet + .collect { case x if nodeToNumber.contains(x) => Definition.fromNode(x, nodeToNumber) } } - genOfCall.flatMap { definition => - definitionsOfSameVariable(definition) + val res = mutable.BitSet() + for (definition <- genOfCall) { + res.addAll(definitionsOfSameVariable(definition)) } + res } } diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsage.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsage.scala index 341f29621d53..534b8bb565b8 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsage.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsage.scala @@ -1,8 +1,8 @@ package io.joern.dataflowengineoss.queryengine -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.accesspath._ -import io.shiftleft.semanticcpg.language.{AccessPathHandling, toCallMethods} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.accesspath.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.utils.MemberAccess import org.slf4j.LoggerFactory diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala index 9d3a4afe1933..91f63efd25a3 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/Engine.scala @@ -1,14 +1,14 @@ package io.joern.dataflowengineoss.queryengine +import flatgraph.Edge import io.joern.dataflowengineoss.DefaultSemantics import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.passes.reachingdef.EdgeValidator import io.joern.dataflowengineoss.semanticsloader.{FlowSemantic, Semantics} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Properties} +import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.Edge import java.util.concurrent.* import scala.collection.mutable @@ -205,9 +205,11 @@ object Engine { private def elemForEdge(e: Edge, callSiteStack: List[Call] = List())(implicit semantics: Semantics ): Option[PathElement] = { - val curNode = e.inNode().asInstanceOf[CfgNode] - val parNode = e.outNode().asInstanceOf[CfgNode] - val outLabel = Some(e.property(Properties.VARIABLE)).getOrElse("") + val curNode = e.dst.asInstanceOf[CfgNode] + val parNode = e.src.asInstanceOf[CfgNode] + // note: flatgraph only allows at most one property per edge, and since we know :tm: that this is a ReachingDef edge it must be the Variable property... + val variablePropertyMaybe = Option(e.property).map(_.asInstanceOf[String]) + val outLabel = variablePropertyMaybe.getOrElse("") if (!EdgeValidator.isValidEdge(curNode, parNode)) { return None @@ -254,9 +256,8 @@ object Engine { private def ddgInE(node: CfgNode, path: Vector[PathElement], callSiteStack: List[Call] = List()): Vector[Edge] = { node .inE(EdgeTypes.REACHING_DEF) - .asScala .filter { e => - e.outNode() match { + e.src match { case srcNode: CfgNode => !srcNode.isInstanceOf[Method] && !path .map(x => x.node) diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/HeldTaskCompletion.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/HeldTaskCompletion.scala index f0b0cf5fc9e1..46326fbc0e6c 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/HeldTaskCompletion.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/HeldTaskCompletion.scala @@ -1,7 +1,7 @@ package io.joern.dataflowengineoss.queryengine import scala.collection.mutable -import scala.collection.parallel.CollectionConverters._ +import scala.collection.parallel.CollectionConverters.* /** Complete held tasks using the result table. The result table is modified in the process. * diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/SourcesToStartingPoints.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/SourcesToStartingPoints.scala index 8a8fd121d931..c686271ea0f6 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/SourcesToStartingPoints.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/SourcesToStartingPoints.scala @@ -2,7 +2,7 @@ package io.joern.dataflowengineoss.queryengine import io.joern.dataflowengineoss.globalFromLiteral import io.joern.x2cpg.Defines -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.allAssignmentTypes @@ -32,7 +32,7 @@ object SourcesToStartingPoints { .map(src => { // We need to get Cpg wrapper from graph. Hence we are taking head element from source iterator. // This will also ensure if the source list is empty then these tasks are invoked. - val cpg = Cpg(src.graph()) + val cpg = Cpg(src.graph) val (startingPoints, methodTasks) = calculateStartingPoints(sources, executorService) val startingPointFromUsageInOtherClasses = calculateStatingPointsWithUsageInOtherClasses(methodTasks, cpg, executorService) @@ -189,12 +189,13 @@ abstract class BaseSourceToStartingPoints extends Callable[Unit] { protected def sourceToStartingPoints(src: StoredNode): (List[CfgNode], List[UsageInput]) = { src match { case methodReturn: MethodReturn => - (methodReturn.method.callIn.l, Nil) + // n.b. there's a generated `callIn` step that we really want to use, but it's shadowed by `MethodTraversal.callIn` + (methodReturn.method._callIn.cast[Call].l, Nil) case lit: Literal => val usageInput = targetsToClassIdentifierPair(literalToInitializedMembers(lit), src) val uses = usages(usageInput) val globals = globalFromLiteral(lit, recursive = false).flatMap { - case x: Identifier if x.isModuleVariable => x :: moduleVariableToFirstUsagesAcrossProgram(x) + case x: Identifier if x.isModuleVariable => moduleVariableToFirstUsagesAcrossProgram(x) case x => x :: Nil } (lit :: (uses ++ globals), usageInput) diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskCreator.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskCreator.scala index 5609514077e8..5c8713e505c8 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskCreator.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskCreator.scala @@ -1,7 +1,7 @@ package io.joern.dataflowengineoss.queryengine import io.joern.dataflowengineoss.queryengine.Engine.argToOutputParams -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{ Call, Expression, @@ -100,7 +100,7 @@ class TaskCreator(context: EngineContext) { */ private def paramToMethodRefCallReceivers(param: MethodParameterIn): List[Expression] = - new Cpg(param.graph()).methodRef.methodFullNameExact(param.method.fullName).inCall.argument(0).l + new Cpg(param.graph).methodRef.methodFullNameExact(param.method.fullName).inCall.argument(0).l /** Create new tasks from all results that end in an output argument, including return arguments. In this case, we * want to traverse to corresponding method output parameters and method return nodes respectively. diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskSolver.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskSolver.scala index 263251775694..b363112c358a 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskSolver.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/queryengine/TaskSolver.scala @@ -2,7 +2,7 @@ package io.joern.dataflowengineoss.queryengine import io.joern.dataflowengineoss.queryengine.QueryEngineStatistics.{PATH_CACHE_HITS, PATH_CACHE_MISSES} import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.{toCfgNodeMethods, toExpressionMethods, _} import java.util.concurrent.Callable diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/semanticsloader/Parser.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/semanticsloader/Parser.scala index 1d49af90c7ed..e3c4796791a4 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/semanticsloader/Parser.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/semanticsloader/Parser.scala @@ -2,12 +2,12 @@ package io.joern.dataflowengineoss.semanticsloader import io.joern.dataflowengineoss.SemanticsParser.MappingContext import io.joern.dataflowengineoss.{SemanticsBaseListener, SemanticsLexer, SemanticsParser} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import org.antlr.v4.runtime.tree.ParseTreeWalker import org.antlr.v4.runtime.{CharStream, CharStreams, CommonTokenStream} import scala.collection.mutable -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object Semantics { diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/DataFlowSlicing.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/DataFlowSlicing.scala index 338843fe9346..e1c64e8a5694 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/DataFlowSlicing.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/DataFlowSlicing.scala @@ -2,8 +2,7 @@ package io.joern.dataflowengineoss.slicing import io.joern.dataflowengineoss.language.* import io.joern.x2cpg.utils.ConcurrentTaskUtil -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, Properties} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory @@ -48,9 +47,9 @@ object DataFlowSlicing { val sliceNodesIdSet = sliceNodes.id.toSet // Lazily set up the rest if the filters are satisfied lazy val sliceEdges = sliceNodes - .flatMap(_.outE) - .filter(x => sliceNodesIdSet.contains(x.inNode().id())) - .map { e => SliceEdge(e.outNode().id(), e.inNode().id(), e.label()) } + .inE(EdgeTypes.REACHING_DEF) + .filter(x => sliceNodesIdSet.contains(x.src.id())) + .map { e => SliceEdge(e.src.id(), e.dst.id(), e.label) } .toSet lazy val slice = Option(DataFlowSlice(sliceNodes.map(cfgNodeToSliceNode).toSet, sliceEdges)) @@ -82,8 +81,8 @@ object DataFlowSlicing { case n: TypeRef => sliceNode.copy(name = n.typeFullName, code = n.code) case n => sliceNode.copy( - name = n.property(PropertyNames.NAME, ""), - typeFullName = n.property(PropertyNames.TYPE_FULL_NAME, "") + name = n.propertyOption(Properties.Name).getOrElse(""), + typeFullName = n.propertyOption(Properties.TypeFullName).getOrElse("") ) } } diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/UsageSlicing.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/UsageSlicing.scala index 41896509c2c5..a95974c2e57f 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/UsageSlicing.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/UsageSlicing.scala @@ -1,9 +1,9 @@ package io.joern.dataflowengineoss.slicing import io.joern.x2cpg.utils.ConcurrentTaskUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Operators, Properties} import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory @@ -182,15 +182,12 @@ object UsageSlicing { .getOrElse(Iterator.empty) else baseCall.argument) .collect { case n: Expression if n.argumentIndex > 0 => n } - .flatMap { - case _: MethodRef => Option("LAMBDA") + .map { + case _: MethodRef => "LAMBDA" case x => - Option( - x.property( - PropertyNames.TYPE_FULL_NAME, - x.property(PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq("ANY")).headOption - ) - ) + x.propertyOption(Properties.TypeFullName) + .orElse(x.property(Properties.DynamicTypeHintFullName).headOption) + .getOrElse("ANY") } .collect { case x: String => x } .toList diff --git a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/package.scala b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/package.scala index 5e387803a228..6025f8a83517 100644 --- a/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/package.scala +++ b/dataflowengineoss/src/main/scala/io/joern/dataflowengineoss/slicing/package.scala @@ -1,11 +1,10 @@ package io.joern.dataflowengineoss import better.files.File -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.Properties import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory -import overflowdb.PropertyKey import upickle.default.* import java.util.concurrent.{ExecutorService, Executors} @@ -161,8 +160,8 @@ package object slicing { typeFullName: String = "", parentMethod: String = "", parentFile: String = "", - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ) derives ReadWriter case class SliceEdge(src: Long, dst: Long, label: String) derives ReadWriter @@ -332,13 +331,15 @@ package object slicing { * extracted. */ def fromNode(node: StoredNode, typeMap: Map[String, String] = Map.empty[String, String]): DefComponent = { - val nodeType = (node.property(PropertyNames.TYPE_FULL_NAME, "ANY") +: node.property( - PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, - Seq.empty[String] - )).filterNot(_.matches("(ANY|UNKNOWN)")).headOption.getOrElse("ANY") + val typeFullNameProperty = node.propertyOption(Properties.TypeFullName).getOrElse("ANY") + val dynamicTypeHintFullNamesProperty = node.property(Properties.DynamicTypeHintFullName) + val nodeType = (typeFullNameProperty +: dynamicTypeHintFullNamesProperty) + .filterNot(_.matches("(ANY|UNKNOWN)")) + .headOption + .getOrElse("ANY") val typeFullName = typeMap.getOrElse(nodeType, nodeType) - val lineNumber = Option(node.property(new PropertyKey[Integer](PropertyNames.LINE_NUMBER))).map(_.toInt) - val columnNumber = Option(node.property(new PropertyKey[Integer](PropertyNames.COLUMN_NUMBER))).map(_.toInt) + val lineNumber = node.propertyOption(Properties.LineNumber) + val columnNumber = node.propertyOption(Properties.ColumnNumber) node match { case x: MethodParameterIn => ParamDef(x.name, typeFullName, x.index, lineNumber, columnNumber) case x: Call if x.code.startsWith("new ") => diff --git a/dataflowengineoss/src/test/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsageTests.scala b/dataflowengineoss/src/test/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsageTests.scala index ac03b236a49b..9749294a9984 100644 --- a/dataflowengineoss/src/test/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsageTests.scala +++ b/dataflowengineoss/src/test/scala/io/joern/dataflowengineoss/queryengine/AccessPathUsageTests.scala @@ -1,13 +1,14 @@ package io.joern.dataflowengineoss.queryengine -import io.shiftleft.OverflowDbTestInstance -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, Operators, Properties} +import flatgraph.{GNode, Graph} +import flatgraph.misc.TestUtils.* +import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes, Operators} import io.joern.dataflowengineoss.queryengine.AccessPathUsage.toTrackedBaseAndAccessPathSimple -import io.shiftleft.semanticcpg.accesspath._ -import org.scalatest.matchers.should.Matchers._ +import io.shiftleft.semanticcpg.accesspath.* +import org.scalatest.matchers.should.Matchers.* import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ class AccessPathUsageTests extends AnyWordSpec { @@ -22,35 +23,28 @@ class AccessPathUsageTests extends AnyWordSpec { private val VS = VariablePointerShift private val S = PointerShift - private val g = OverflowDbTestInstance.create + private val g = Cpg.empty.graph - private def genCALL(graph: Graph, op: String, args: Node*): Call = { - val ret = graph + NodeTypes.CALL // (NodeTypes.CALL, Properties.NAME -> op) - ret.setProperty(Properties.NAME, op) + private def genCALL(graph: Graph, op: String, args: GNode*): Call = { + val diffGraphBuilder = Cpg.newDiffGraphBuilder + val newCall = NewCall().name(op) + diffGraphBuilder.addNode(newCall) args.reverse.zipWithIndex.foreach { case (arg, idx) => - ret --- EdgeTypes.ARGUMENT --> arg - arg.setProperty(Properties.ARGUMENT_INDEX, idx + 1) + diffGraphBuilder.setNodeProperty(arg, PropertyNames.ARGUMENT_INDEX, idx + 1) + diffGraphBuilder.addEdge(newCall, arg, EdgeTypes.ARGUMENT) } - ret.asInstanceOf[Call] + diffGraphBuilder.apply(graph) + newCall.storedRef.get } - private def genLit(graph: Graph, payload: String): Literal = { - val ret = graph + NodeTypes.LITERAL - ret.setProperty(Properties.CODE, payload) - ret.asInstanceOf[Literal] - } + private def genLit(graph: Graph, payload: String): Literal = + graph.addNode(NewLiteral().code(payload)) - private def genID(graph: Graph, payload: String): Identifier = { - val ret = graph + NodeTypes.IDENTIFIER - ret.setProperty(Properties.NAME, payload) - ret.asInstanceOf[Identifier] - } + private def genID(graph: Graph, payload: String): Identifier = + graph.addNode(NewIdentifier().name(payload)) - private def genFID(graph: Graph, payload: String): FieldIdentifier = { - val ret = graph + NodeTypes.FIELD_IDENTIFIER - ret.setProperty(Properties.CANONICAL_NAME, payload) - ret.asInstanceOf[FieldIdentifier] - } + private def genFID(graph: Graph, payload: String): FieldIdentifier = + graph.addNode(NewFieldIdentifier().canonicalName(payload)) private def toTrackedAccessPath(node: StoredNode): AccessPath = toTrackedBaseAndAccessPathSimple(node)._2 diff --git a/joern-benchmarks b/joern-benchmarks deleted file mode 100755 index 6ff46c3b767d..000000000000 --- a/joern-benchmarks +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -README="$PWD/benchmarks/README.md" - -# Clear README -> $README - -echo " -### Securibench Micro - -Securibench Micro is a series of small test cases designed to exercise different parts of a static security analyzer. -Securibench Micro may be used to compare the effectiveness of runtime techniques such as penetration testing tools. - -* Java source: \`sbt \"benchmarks / testOnly *.securibench.micro.java.*\"\` -* JVM bytecode: \`sbt \"benchmarks / testOnly *.securibench.micro.jvm.*\"\` -" >> $README - -echo "#### Java Source Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/securibench_micro_java.txt" -sbt "benchmarks / testOnly *.securibench.micro.java.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -echo "#### JVM Bytecode Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/securibench_micro_jvm.txt" -sbt "benchmarks / testOnly *.securibench.micro.jvm.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -echo " -### IFSpec - -IFSpec contains a diverse set of information flow benchmarks for Java programs. - -* Java source: \`sbt \"benchmarks / testOnly *.ifspec.java.*\"\` -* JVM bytecode: \`sbt \"benchmarks / testOnly *.ifspec.jvm.*\"\` -" >> $README - -echo "#### Java Source Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/ifspec_java.txt" -sbt "benchmarks / testOnly *.ifspec.java.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -echo "#### JVM Bytecode Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/ifspec_jvm.txt" -sbt "benchmarks / testOnly *.ifspec.jvm.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -echo " -### JInfoFlow - -JInfoFlow-bench is a taint analysis benchmark suite containing 12 plain Java benchmarks exercising reflection, -event-driven architecture, and popular software engineering patterns. - -* Java source: \`sbt \"benchmarks / testOnly *.jinfoflow.java.*\"\` -* JVM bytecode: \`sbt \"benchmarks / testOnly *.jinfoflow.jvm.*\"\` -" >> $README - -echo "#### Java Source Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/jinfoflow_java.txt" -sbt "benchmarks / testOnly *.jinfoflow.java.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -echo "#### JVM Bytecode Results" >> $README - -export JOERN_BENCHMARK_RESULT_FILE="$PWD/jinfoflow_jvm.txt" -sbt "benchmarks / testOnly *.jinfoflow.jvm.*" -cat $JOERN_BENCHMARK_RESULT_FILE >> $README - -# Clean up -rm *.txt \ No newline at end of file diff --git a/joern-cli/build.sbt b/joern-cli/build.sbt index 26d88d577a48..37593c301099 100644 --- a/joern-cli/build.sbt +++ b/joern-cli/build.sbt @@ -131,6 +131,28 @@ generateScaladocs := { Universal / packageBin / mappings ++= sbt.Path.directory(new File("joern-cli/src/main/resources/scripts")) +lazy val removeModuleInfoFromJars = taskKey[Unit]("remove module-info.class from dependency jars - a hacky workaround for a scala3 compiler bug https://github.com/scala/scala3/issues/20421") +removeModuleInfoFromJars := { + import java.nio.file.{Files, FileSystems} + val logger = streams.value.log + val libDir = (Universal/stagingDirectory).value / "lib" + + // remove all `/module-info.class` from all jars + Files.walk(libDir.toPath) + .filter(_.toString.endsWith(".jar")) + .forEach { jar => + val zipFs = FileSystems.newFileSystem(jar) + zipFs.getRootDirectories.forEach { zipRootDir => + Files.list(zipRootDir).filter(_.toString == "/module-info.class").forEach { moduleInfoClass => + logger.info(s"workaround for scala completion bug: deleting $moduleInfoClass from $jar") + Files.delete(moduleInfoClass) + } + } + zipFs.close() + } +} +removeModuleInfoFromJars := removeModuleInfoFromJars.triggeredBy(Universal/stage).value + maintainer := "fabs@shiftleft.io" githubOwner := "Privado-Inc" diff --git a/joern-cli/frontends/c2cpg/c2cpg.sh b/joern-cli/frontends/c2cpg/c2cpg.sh index aa265a898d9d..f40dce9d42b2 100755 --- a/joern-cli/frontends/c2cpg/c2cpg.sh +++ b/joern-cli/frontends/c2cpg/c2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/c2cpg.sh $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/c2cpg.sh" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/C2Cpg.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/C2Cpg.scala index 3cb4f9a2e71d..b0ea9e00caff 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/C2Cpg.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/C2Cpg.scala @@ -1,7 +1,8 @@ package io.joern.c2cpg import io.joern.c2cpg.passes.{AstCreationPass, PreprocessorPass, TypeDeclNodePass} -import io.shiftleft.codepropertygraph.Cpg +import io.joern.c2cpg.passes.FunctionDeclNodePass +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass} import io.joern.x2cpg.X2Cpg.withNewEmptyCpg @@ -21,6 +22,8 @@ class C2Cpg extends X2CpgFrontend[Config] { new MetaDataPass(cpg, Languages.NEWC, config.inputPath).createAndApply() val astCreationPass = new AstCreationPass(cpg, config, report) astCreationPass.createAndApply() + new FunctionDeclNodePass(cpg, astCreationPass.unhandledMethodDeclarations())(config.schemaValidation) + .createAndApply() TypeNodePass.withRegisteredTypes(astCreationPass.typesSeen(), cpg).createAndApply() new TypeDeclNodePass(cpg)(config.schemaValidation).createAndApply() report.print() diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/Main.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/Main.scala index a909449c96ac..923e6683c97b 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/Main.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/Main.scala @@ -1,6 +1,6 @@ package io.joern.c2cpg -import io.joern.c2cpg.Frontend._ +import io.joern.c2cpg.Frontend.* import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} import org.slf4j.LoggerFactory import scopt.OParser diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreator.scala index 6bd2ce172ad4..c2deefda3673 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreator.scala @@ -4,13 +4,12 @@ import io.joern.c2cpg.Config import io.joern.x2cpg.datastructures.Scope import io.joern.x2cpg.datastructures.Stack.* import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode, AstNodeBuilder as X2CpgAstNodeBuilder} -import io.joern.x2cpg.datastructures.Global import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.eclipse.cdt.core.dom.ast.{IASTNode, IASTTranslationUnit} import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import java.util.concurrent.ConcurrentHashMap import scala.collection.mutable @@ -19,7 +18,7 @@ import scala.collection.mutable */ class AstCreator( val filename: String, - val global: Global, + val global: CGlobal, val config: Config, val cdtAst: IASTTranslationUnit, val file2OffsetTable: ConcurrentHashMap[String, Array[Int]] @@ -32,6 +31,7 @@ class AstCreator( with AstForExpressionsCreator with AstNodeBuilder with AstCreatorHelper + with FullNameProvider with MacroHandler with X2CpgAstNodeBuilder[IASTNode, AstCreator] { @@ -82,12 +82,12 @@ class AstCreator( methodAstParentStack.push(fakeGlobalMethod) scope.pushNewScope(fakeGlobalMethod) - val blockNode_ = blockNode(iASTTranslationUnit, Defines.empty, registerType(Defines.anyTypeName)) + val blockNode_ = blockNode(iASTTranslationUnit) val declsAsts = allDecls.flatMap(astsForDeclaration) setArgumentIndices(declsAsts) - val methodReturn = newMethodReturnNode(iASTTranslationUnit, Defines.anyTypeName) + val methodReturn = methodReturnNode(iASTTranslationUnit, Defines.Any) Ast(fakeGlobalTypeDecl).withChild( methodAst(fakeGlobalMethod, Seq.empty, blockAst(blockNode_, declsAsts), methodReturn) ) @@ -95,21 +95,21 @@ class AstCreator( override protected def code(node: IASTNode): String = shortenCode(nodeSignature(node)) - override protected def line(node: IASTNode): Option[Integer] = { + override protected def line(node: IASTNode): Option[Int] = { nullSafeFileLocation(node).map(_.getStartingLineNumber) } - override protected def lineEnd(node: IASTNode): Option[Integer] = { - nullSafeFileLocation(node).map(_.getEndingLineNumber) + override protected def lineEnd(node: IASTNode): Option[Int] = { + nullSafeFileLocationLast(node).map(_.getEndingLineNumber) } - protected def column(node: IASTNode): Option[Integer] = { + protected def column(node: IASTNode): Option[Int] = { nodeOffsets(node).map { case (startOffset, _) => offsetToColumn(node, startOffset) } } - protected def columnEnd(node: IASTNode): Option[Integer] = { + protected def columnEnd(node: IASTNode): Option[Int] = { nodeOffsets(node).map { case (_, endOffset) => offsetToColumn(node, endOffset - 1) } diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreatorHelper.scala index 6ef1776a7612..c4d724453dde 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstCreatorHelper.scala @@ -1,28 +1,39 @@ package io.joern.c2cpg.astcreation -import io.shiftleft.codepropertygraph.generated.nodes.{ExpressionNew, NewNode} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.joern.x2cpg.{Ast, SourceFiles, ValidationMode} +import io.joern.x2cpg.Ast +import io.joern.x2cpg.SourceFiles +import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.Defines as X2CpgDefines import io.joern.x2cpg.utils.NodeBuilders.newDependencyNode +import io.shiftleft.codepropertygraph.generated.DispatchTypes +import io.shiftleft.codepropertygraph.generated.Operators +import io.shiftleft.codepropertygraph.generated.nodes.ExpressionNew +import io.shiftleft.codepropertygraph.generated.nodes.NewCall +import io.shiftleft.codepropertygraph.generated.nodes.NewNode import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.utils.IOUtils import org.apache.commons.lang3.StringUtils import org.eclipse.cdt.core.dom.ast.* -import org.eclipse.cdt.core.dom.ast.c.{ICASTArrayDesignator, ICASTDesignatedInitializer, ICASTFieldDesignator} +import org.eclipse.cdt.core.dom.ast.c.ICASTArrayDesignator +import org.eclipse.cdt.core.dom.ast.c.ICASTDesignatedInitializer +import org.eclipse.cdt.core.dom.ast.c.ICASTFieldDesignator import org.eclipse.cdt.core.dom.ast.cpp.* import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator import org.eclipse.cdt.internal.core.dom.parser.c.CASTArrayRangeDesignator -import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinding -import org.eclipse.cdt.internal.core.dom.parser.cpp.{CPPASTIdExpression, CPPFunction} import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayRangeDesignator -import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFieldReference +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPMethod +import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation +import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinding +import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess import org.eclipse.cdt.internal.core.model.ASTStringUtil -import java.nio.file.{Path, Paths} +import java.nio.file.Path +import java.nio.file.Paths import scala.annotation.nowarn import scala.collection.mutable +import scala.util.Try object AstCreatorHelper { @@ -40,8 +51,6 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As private var usedVariablePostfix: Int = 0 - private val IncludeKeyword = "include" - protected def isIncludedNode(node: IASTNode): Boolean = fileName(node) != filename protected def uniqueName(target: String, name: String, fullName: String): (String, String) = { @@ -74,6 +83,8 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As protected def nullSafeFileLocation(node: IASTNode): Option[IASTFileLocation] = Option(cdtAst.flattenLocationsToFile(node.getNodeLocations)).map(_.asFileLocation()) + protected def nullSafeFileLocationLast(node: IASTNode): Option[IASTFileLocation] = + Option(cdtAst.flattenLocationsToFile(node.getNodeLocations.lastOption.toArray)).map(_.asFileLocation()) protected def fileName(node: IASTNode): String = { val path = nullSafeFileLocation(node).map(_.getFileName).getOrElse(filename) @@ -99,12 +110,19 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As fixedTypeName } + protected def registerMethodDeclaration(fullName: String, methodInfo: CGlobal.MethodInfo): Unit = { + global.methodDeclarations.putIfAbsent(fullName, methodInfo) + } + + protected def registerMethodDefinition(fullName: String): Unit = { + global.methodDefinitions.putIfAbsent(fullName, true) + } + // Sadly, there is no predefined List / Enum of this within Eclipse CDT: - private val reservedTypeKeywords: List[String] = + private val ReservedTypeKeywords: List[String] = List( "const", "static", - "volatile", "restrict", "extern", "typedef", @@ -118,99 +136,143 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As "class" ) + private val KeepTypeKeywords: List[String] = List("unsigned", "volatile") + protected def cleanType(rawType: String, stripKeywords: Boolean = true): String = { + if (rawType == Defines.Any) return rawType val tpe = if (stripKeywords) { - reservedTypeKeywords.foldLeft(rawType) { (cur, repl) => - if (cur.contains(s"$repl ")) { - dereferenceTypeFullName(cur.replace(s"$repl ", "")) - } else { - cur - } + ReservedTypeKeywords.foldLeft(rawType) { (cur, repl) => + if (cur.contains(s"$repl ")) cur.replace(s"$repl ", "") else cur } } else { rawType } StringUtils.normalizeSpace(tpe) match { - case "" => Defines.anyTypeName - case t if t.contains("org.eclipse.cdt.internal.core.dom.parser.ProblemType") => Defines.anyTypeName - case t if t.contains(" ->") && t.contains("}::") => - fixQualifiedName(t.substring(t.indexOf("}::") + 3, t.indexOf(" ->"))) - case t if t.contains(" ->") => - fixQualifiedName(t.substring(0, t.indexOf(" ->"))) - case t if t.contains("( ") => - fixQualifiedName(t.substring(0, t.indexOf("( "))) - case t if t.contains("?") => Defines.anyTypeName - case t if t.contains("#") => Defines.anyTypeName - case t if t.contains("{") && t.contains("}") => - val anonType = - s"${uniqueName("type", "", "")._1}${t.substring(0, t.indexOf("{"))}${t.substring(t.indexOf("}") + 1)}" - anonType.replace(" ", "") - case t if t.startsWith("[") && t.endsWith("]") => Defines.anyTypeName - case t if t.contains(Defines.qualifiedNameSeparator) => - fixQualifiedName(t).split(".").lastOption.getOrElse(Defines.anyTypeName) - case t if t.startsWith("unsigned ") => "unsigned " + t.substring(9).replace(" ", "") - case t if t.contains("[") && t.contains("]") => t.replace(" ", "") - case t if t.contains("*") => t.replace(" ", "") - case someType => someType + case "" => Defines.Any + case t if t.startsWith("[") && t.endsWith("]") => Defines.Array + case t if t.contains("->") => Defines.Function + case t if t.contains("?") => Defines.Any + case t if t.contains("#") => Defines.Any + case t if t.contains("::{") || t.contains("}::") => Defines.Any + case t if t.contains("{") || t.contains("}") => Defines.Any + case t if t.contains("org.eclipse.cdt.internal.core.dom.parser.ProblemType") => Defines.Any + case t if t.contains("( ") => replaceWhitespaceAfterTypeKeyword(fixQualifiedName(t.substring(0, t.indexOf("( ")))) + case t if t.contains(Defines.QualifiedNameSeparator) => replaceWhitespaceAfterTypeKeyword(fixQualifiedName(t)) + case t if KeepTypeKeywords.exists(k => t.startsWith(s"$k ")) => replaceWhitespaceAfterTypeKeyword(t) + case t if t.contains("[") && t.contains("]") => replaceWhitespaceAfterTypeKeyword(t) + case t if t.contains("*") => replaceWhitespaceAfterTypeKeyword(t) + case someType => someType + } + } + + private def replaceWhitespaceAfterTypeKeyword(tpe: String): String = { + if (KeepTypeKeywords.exists(k => tpe.startsWith(s"$k "))) { + KeepTypeKeywords.foldLeft(tpe) { (cur, repl) => + val prefix = s"$repl " + if (cur.startsWith(prefix)) { + prefix + cur.substring(prefix.length).replace(" ", "") + } else { + cur + } + } + } else { + tpe.replace(" ", "") + } + } + + protected def safeGetEvaluation(expr: ICPPASTExpression): Option[ICPPEvaluation] = { + // In case of unresolved includes etc. this may fail throwing an unrecoverable exception + Try(expr.getEvaluation).toOption + } + + protected def safeGetType(tpe: IType): String = { + // In case of unresolved includes etc. this may fail throwing an unrecoverable exception + Try(ASTTypeUtil.getType(tpe)).getOrElse(Defines.Any) + } + + private def safeGetNodeType(node: IASTNode): String = { + // In case of unresolved includes etc. this may fail throwing an unrecoverable exception + Try(ASTTypeUtil.getNodeType(node)).getOrElse(Defines.Any) + } + + private def typeForCPPASTFieldReference(f: CPPASTFieldReference, stripKeywords: Boolean = true): String = { + safeGetEvaluation(f.getFieldOwner) match { + case Some(evaluation: EvalBinding) => cleanType(evaluation.getType.toString, stripKeywords) + case _ => cleanType(safeGetType(f.getFieldOwner.getExpressionType), stripKeywords) } } @nowarn - protected def typeFor(node: IASTNode, stripKeywords: Boolean = true): String = { + private def typeForIASTArrayDeclarator(a: IASTArrayDeclarator, stripKeywords: Boolean = true): String = { import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil.getNodeSignature - node match { - case f: CPPASTFieldReference => - f.getFieldOwner.getEvaluation match { - case evaluation: EvalBinding => cleanType(evaluation.getType.toString, stripKeywords) - case _ => cleanType(ASTTypeUtil.getType(f.getFieldOwner.getExpressionType), stripKeywords) - } - case f: IASTFieldReference => - cleanType(ASTTypeUtil.getType(f.getFieldOwner.getExpressionType), stripKeywords) - case a: IASTArrayDeclarator if ASTTypeUtil.getNodeType(a).startsWith("? ") => - val tpe = getNodeSignature(a).replace("[]", "").strip() - val arr = ASTTypeUtil.getNodeType(a).replace("? ", "") - s"$tpe$arr" - case a: IASTArrayDeclarator - if ASTTypeUtil.getNodeType(a).contains("} ") || ASTTypeUtil.getNodeType(a).contains(" [") => - val tpe = getNodeSignature(a).replace("[]", "").strip() - val arr = a.getArrayModifiers.map { - case m if m.getConstantExpression != null => s"[${nodeSignature(m.getConstantExpression)}]" - case _ if a.getInitializer != null => - a.getInitializer match { - case l: IASTInitializerList => s"[${l.getSize}]" - case _ => "[]" - } - case _ => "[]" - }.mkString - s"$tpe$arr" - case s: CPPASTIdExpression => - s.getEvaluation match { - case evaluation: EvalMemberAccess => - cleanType(evaluation.getOwnerType.toString, stripKeywords) - case evalBinding: EvalBinding => - evalBinding.getBinding match { - case m: CPPMethod => cleanType(fullName(m.getDefinition)) - case _ => cleanType(ASTTypeUtil.getNodeType(s), stripKeywords) - } - case _ => cleanType(ASTTypeUtil.getNodeType(s), stripKeywords) + if (safeGetNodeType(a).startsWith("? ")) { + val tpe = getNodeSignature(a).replace("[]", "").strip() + val arr = safeGetNodeType(a).replace("? ", "") + s"$tpe$arr" + } else if (safeGetNodeType(a).contains("} ") || safeGetNodeType(a).contains(" [")) { + val tpe = getNodeSignature(a).replace("[]", "").strip() + val arr = a.getArrayModifiers.map { + case m if m.getConstantExpression != null => s"[${nodeSignature(m.getConstantExpression)}]" + case _ if a.getInitializer != null => + a.getInitializer match { + case l: IASTInitializerList => s"[${l.getSize}]" + case _ => "[]" + } + case _ => "[]" + }.mkString + s"$tpe$arr" + } else { + cleanType(safeGetNodeType(a), stripKeywords) + } + } + + private def typeForCPPASTIdExpression(s: CPPASTIdExpression, stripKeywords: Boolean = true): String = { + safeGetEvaluation(s) match { + case Some(evaluation: EvalMemberAccess) => + val deref = if (evaluation.isPointerDeref) "*" else "" + cleanType(evaluation.getOwnerType.toString + deref, stripKeywords) + case Some(evalBinding: EvalBinding) => + evalBinding.getBinding match { + case m: CPPMethod => cleanType(fullName(m.getDefinition)) + case _ => cleanType(safeGetNodeType(s), stripKeywords) } - case _: IASTIdExpression | _: IASTName | _: IASTDeclarator => - cleanType(ASTTypeUtil.getNodeType(node), stripKeywords) - case s: IASTNamedTypeSpecifier => - cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) - case s: IASTCompositeTypeSpecifier => - cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) - case s: IASTEnumerationSpecifier => - cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) - case s: IASTElaboratedTypeSpecifier => - cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) - case l: IASTLiteralExpression => - cleanType(ASTTypeUtil.getType(l.getExpressionType)) - case e: IASTExpression => - cleanType(ASTTypeUtil.getNodeType(e), stripKeywords) + case _ => cleanType(safeGetNodeType(s), stripKeywords) + } + } + + @nowarn + private def typeForICPPASTConstructorInitializer( + c: ICPPASTConstructorInitializer, + stripKeywords: Boolean = true + ): String = { + import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil.getNodeSignature + c.getParent match { + case initializer: ICPPASTConstructorChainInitializer => + val fullName_ = fullName(initializer.getMemberInitializerId) + cleanType(fullName_, stripKeywords) case _ => - cleanType(getNodeSignature(node), stripKeywords) + cleanType(getNodeSignature(c), stripKeywords) + } + } + + @nowarn + protected def typeFor(node: IASTNode, stripKeywords: Boolean = true): String = { + import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil.getNodeSignature + node match { + case f: CPPASTFieldReference => typeForCPPASTFieldReference(f) + case f: IASTFieldReference => cleanType(safeGetType(f.getFieldOwner.getExpressionType), stripKeywords) + case a: IASTArrayDeclarator => typeForIASTArrayDeclarator(a) + case s: CPPASTIdExpression => typeForCPPASTIdExpression(s) + case _: IASTIdExpression | _: IASTName | _: IASTDeclarator => cleanType(safeGetNodeType(node), stripKeywords) + case s: IASTNamedTypeSpecifier => cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) + case s: IASTCompositeTypeSpecifier => cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) + case s: IASTEnumerationSpecifier => cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) + case s: IASTElaboratedTypeSpecifier => cleanType(ASTStringUtil.getReturnTypeString(s, null), stripKeywords) + case l: IASTLiteralExpression => cleanType(safeGetType(l.getExpressionType)) + case e: IASTExpression => cleanType(safeGetNodeType(e), stripKeywords) + case c: ICPPASTConstructorInitializer => typeForICPPASTConstructorInitializer(c) + case _ => cleanType(getNodeSignature(node), stripKeywords) } } @@ -253,117 +315,10 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As Option(node).map(astsForStatement(_, argIndex)).getOrElse(Seq.empty) } - protected def dereferenceTypeFullName(fullName: String): String = - fullName.replace("*", "") - - protected def fixQualifiedName(name: String): String = - name.stripPrefix(Defines.qualifiedNameSeparator).replace(Defines.qualifiedNameSeparator, ".") - - protected def isQualifiedName(name: String): Boolean = - name.startsWith(Defines.qualifiedNameSeparator) - - protected def lastNameOfQualifiedName(name: String): String = { - val cleanedName = if (name.contains("<") && name.contains(">")) { - name.substring(0, name.indexOf("<")) - } else { - name - } - cleanedName.split(Defines.qualifiedNameSeparator).lastOption.getOrElse(cleanedName) - } - - protected def fullName(node: IASTNode): String = { - val qualifiedName: String = node match { - case d: CPPASTIdExpression if d.getEvaluation.isInstanceOf[EvalBinding] => - val evaluation = d.getEvaluation.asInstanceOf[EvalBinding] - evaluation.getBinding match { - case f: CPPFunction if f.getDeclarations != null => - f.getDeclarations.headOption.map(n => s"${fullName(n)}").getOrElse(f.getName) - case f: CPPFunction if f.getDefinition != null => - s"${fullName(f.getDefinition)}" - case other => - other.getName - } - case alias: ICPPASTNamespaceAlias => alias.getMappingName.toString - case namespace: ICPPASTNamespaceDefinition if ASTStringUtil.getSimpleName(namespace.getName).nonEmpty => - s"${fullName(namespace.getParent)}.${ASTStringUtil.getSimpleName(namespace.getName)}" - case namespace: ICPPASTNamespaceDefinition if ASTStringUtil.getSimpleName(namespace.getName).isEmpty => - s"${fullName(namespace.getParent)}.${uniqueName("namespace", "", "")._1}" - case compType: IASTCompositeTypeSpecifier if ASTStringUtil.getSimpleName(compType.getName).nonEmpty => - s"${fullName(compType.getParent)}.${ASTStringUtil.getSimpleName(compType.getName)}" - case compType: IASTCompositeTypeSpecifier if ASTStringUtil.getSimpleName(compType.getName).isEmpty => - val name = compType.getParent match { - case decl: IASTSimpleDeclaration => - decl.getDeclarators.headOption - .map(n => ASTStringUtil.getSimpleName(n.getName)) - .getOrElse(uniqueName("composite_type", "", "")._1) - case _ => uniqueName("composite_type", "", "")._1 - } - s"${fullName(compType.getParent)}.$name" - case enumSpecifier: IASTEnumerationSpecifier => - s"${fullName(enumSpecifier.getParent)}.${ASTStringUtil.getSimpleName(enumSpecifier.getName)}" - case f: ICPPASTLambdaExpression => - s"${fullName(f.getParent)}." - case f: IASTFunctionDeclarator - if ASTStringUtil.getSimpleName(f.getName).isEmpty && f.getNestedDeclarator != null => - s"${fullName(f.getParent)}.${shortName(f.getNestedDeclarator)}" - case f: IASTFunctionDeclarator if f.getParent.isInstanceOf[IASTFunctionDefinition] => - s"${fullName(f.getParent)}" - case f: IASTFunctionDeclarator => - s"${fullName(f.getParent)}.${ASTStringUtil.getSimpleName(f.getName)}" - case f: IASTFunctionDefinition if f.getDeclarator != null => - s"${fullName(f.getParent)}.${ASTStringUtil.getQualifiedName(f.getDeclarator.getName)}" - case f: IASTFunctionDefinition => - s"${fullName(f.getParent)}.${shortName(f)}" - case e: IASTElaboratedTypeSpecifier => - s"${fullName(e.getParent)}.${ASTStringUtil.getSimpleName(e.getName)}" - case d: IASTIdExpression => ASTStringUtil.getSimpleName(d.getName) - case _: IASTTranslationUnit => "" - case u: IASTUnaryExpression => code(u.getOperand) - case other if other != null && other.getParent != null => fullName(other.getParent) - case other if other != null => notHandledYet(other); "" - case null => "" - } - fixQualifiedName(qualifiedName).stripPrefix(".") - } - - protected def shortName(node: IASTNode): String = { - val name = node match { - case d: IASTDeclarator if ASTStringUtil.getSimpleName(d.getName).isEmpty && d.getNestedDeclarator != null => - shortName(d.getNestedDeclarator) - case d: IASTDeclarator => ASTStringUtil.getSimpleName(d.getName) - case f: ICPPASTFunctionDefinition - if ASTStringUtil - .getSimpleName(f.getDeclarator.getName) - .isEmpty && f.getDeclarator.getNestedDeclarator != null => - shortName(f.getDeclarator.getNestedDeclarator) - case f: ICPPASTFunctionDefinition => lastNameOfQualifiedName(ASTStringUtil.getSimpleName(f.getDeclarator.getName)) - case f: IASTFunctionDefinition - if ASTStringUtil - .getSimpleName(f.getDeclarator.getName) - .isEmpty && f.getDeclarator.getNestedDeclarator != null => - shortName(f.getDeclarator.getNestedDeclarator) - case f: IASTFunctionDefinition => ASTStringUtil.getSimpleName(f.getDeclarator.getName) - case d: CPPASTIdExpression if d.getEvaluation.isInstanceOf[EvalBinding] => - val evaluation = d.getEvaluation.asInstanceOf[EvalBinding] - evaluation.getBinding match { - case f: CPPFunction if f.getDeclarations != null => - f.getDeclarations.headOption.map(n => ASTStringUtil.getSimpleName(n.getName)).getOrElse(f.getName) - case f: CPPFunction if f.getDefinition != null => - ASTStringUtil.getSimpleName(f.getDefinition.getName) - case other => - other.getName - } - case d: IASTIdExpression => lastNameOfQualifiedName(ASTStringUtil.getSimpleName(d.getName)) - case u: IASTUnaryExpression => shortName(u.getOperand) - case c: IASTFunctionCallExpression => shortName(c.getFunctionNameExpression) - case s: IASTSimpleDeclSpecifier => s.getRawSignature - case e: IASTEnumerationSpecifier => ASTStringUtil.getSimpleName(e.getName) - case c: IASTCompositeTypeSpecifier => ASTStringUtil.getSimpleName(c.getName) - case e: IASTElaboratedTypeSpecifier => ASTStringUtil.getSimpleName(e.getName) - case s: IASTNamedTypeSpecifier => ASTStringUtil.getSimpleName(s.getName) - case other => notHandledYet(other); "" - } - name + protected def functionTypeToSignature(typ: IFunctionType): String = { + val returnType = cleanType(safeGetType(typ.getReturnType)) + val parameterTypes = typ.getParameterTypes.map(t => cleanType(safeGetType(t))) + StringUtils.normalizeSpace(s"$returnType(${parameterTypes.mkString(",")})") } private def pointersAsString(spec: IASTDeclSpecifier, parentDecl: IASTDeclarator, stripKeywords: Boolean): String = { @@ -384,7 +339,7 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As val allIncludes = iASTTranslationUnit.getIncludeDirectives.toList.filterNot(isIncludedNode) allIncludes.map { include => val name = include.getName.toString - val _dependencyNode = newDependencyNode(name, name, IncludeKeyword) + val _dependencyNode = newDependencyNode(name, name, "include") val importNode = newImportNode(code(include), name, name, include) diffGraph.addNode(_dependencyNode) diffGraph.addEdge(importNode, _dependencyNode, EdgeTypes.IMPORTS) @@ -401,19 +356,19 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As } private def astForDecltypeSpecifier(decl: ICPPASTDecltypeSpecifier): Ast = { - val op = ".typeOf" - val cpgUnary = callNode(decl, code(decl), op, op, DispatchTypes.STATIC_DISPATCH) + val op = Defines.OperatorTypeOf + val cpgUnary = callNode(decl, code(decl), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val operand = nullSafeAst(decl.getDecltypeExpression) callAst(cpgUnary, List(operand)) } private def astForCASTDesignatedInitializer(d: ICASTDesignatedInitializer): Ast = { - val node = blockNode(d, Defines.empty, Defines.voidTypeName) + val node = blockNode(d, Defines.Empty, Defines.Void) scope.pushNewScope(node) val op = Operators.assignment val calls = withIndex(d.getDesignators) { (des, o) => val callNode_ = - callNode(d, code(d), op, op, DispatchTypes.STATIC_DISPATCH) + callNode(d, code(d), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) .argumentIndex(o) val left = astForNode(des) val right = astForNode(d.getOperand) @@ -424,12 +379,12 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As } private def astForCPPASTDesignatedInitializer(d: ICPPASTDesignatedInitializer): Ast = { - val node = blockNode(d, Defines.empty, Defines.voidTypeName) + val node = blockNode(d, Defines.Empty, Defines.Void) scope.pushNewScope(node) val op = Operators.assignment val calls = withIndex(d.getDesignators) { (des, o) => val callNode_ = - callNode(d, code(d), op, op, DispatchTypes.STATIC_DISPATCH) + callNode(d, code(d), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) .argumentIndex(o) val left = astForNode(des) val right = astForNode(d.getOperand) @@ -440,16 +395,15 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As } private def astForCPPASTConstructorInitializer(c: ICPPASTConstructorInitializer): Ast = { - val name = ".constructorInitializer" - val callNode_ = - callNode(c, code(c), name, name, DispatchTypes.STATIC_DISPATCH) - val args = c.getArguments.toList.map(a => astForNode(a)) + val name = Defines.OperatorConstructorInitializer + val callNode_ = callNode(c, code(c), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) + val args = c.getArguments.toList.map(a => astForNode(a)) callAst(callNode_, args) } private def astForCASTArrayRangeDesignator(des: CASTArrayRangeDesignator): Ast = { val op = Operators.arrayInitializer - val callNode_ = callNode(des, code(des), op, op, DispatchTypes.STATIC_DISPATCH) + val callNode_ = callNode(des, code(des), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val floorAst = nullSafeAst(des.getRangeFloor) val ceilingAst = nullSafeAst(des.getRangeCeiling) callAst(callNode_, List(floorAst, ceilingAst)) @@ -457,7 +411,7 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As private def astForCPPASTArrayRangeDesignator(des: CPPASTArrayRangeDesignator): Ast = { val op = Operators.arrayInitializer - val callNode_ = callNode(des, code(des), op, op, DispatchTypes.STATIC_DISPATCH) + val callNode_ = callNode(des, code(des), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val floorAst = nullSafeAst(des.getRangeFloor) val ceilingAst = nullSafeAst(des.getRangeCeiling) callAst(callNode_, List(floorAst, ceilingAst)) @@ -506,7 +460,8 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As case s: IASTNamedTypeSpecifier if s.getParent.isInstanceOf[IASTSimpleDeclaration] => val parentDecl = s.getParent.asInstanceOf[IASTSimpleDeclaration].getDeclarators.toList(index) pointersAsString(s, parentDecl, stripKeywords) - case s: IASTNamedTypeSpecifier => ASTStringUtil.getSimpleName(s.getName) + case s: IASTNamedTypeSpecifier => + ASTStringUtil.getSimpleName(s.getName) case s: IASTCompositeTypeSpecifier if s.getParent.isInstanceOf[IASTSimpleDeclaration] => val parentDecl = s.getParent.asInstanceOf[IASTSimpleDeclaration].getDeclarators.toList(index) pointersAsString(s, parentDecl, stripKeywords) @@ -523,9 +478,49 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As pointersAsString(s, parentDecl, stripKeywords) case s: IASTElaboratedTypeSpecifier => ASTStringUtil.getSignatureString(s, null) // TODO: handle other types of IASTDeclSpecifier - case _ => Defines.anyTypeName + case _ => Defines.Any } - if (tpe.isEmpty) Defines.anyTypeName else tpe + if (tpe.isEmpty) Defines.Any else tpe } + // We use our own call ast creation function since the version in x2cpg treats + // base as receiver if no receiver is given which does not fit the needs of this + // frontend. + def createCallAst( + callNode: NewCall, + arguments: Seq[Ast] = List(), + base: Option[Ast] = None, + receiver: Option[Ast] = None + ): Ast = { + + setArgumentIndices(arguments) + + val baseRoot = base.flatMap(_.root).toList + val bse = base.getOrElse(Ast()) + baseRoot match { + case List(x: ExpressionNew) => + x.argumentIndex = 0 + case _ => + } + + var ast = + Ast(callNode) + .withChild(bse) + + if (receiver.isDefined && receiver != base) { + receiver.get.root.get.asInstanceOf[ExpressionNew].argumentIndex = -1 + ast = ast.withChild(receiver.get) + } + + ast = ast + .withChildren(arguments) + .withArgEdges(callNode, baseRoot) + .withArgEdges(callNode, arguments.flatMap(_.root)) + + if (receiver.isDefined) { + ast = ast.withReceiverEdge(callNode, receiver.get.root.get) + } + + ast + } } diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForExpressionsCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForExpressionsCreator.scala index 4336480c4b2b..f4bfb89d328a 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForExpressionsCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForExpressionsCreator.scala @@ -1,12 +1,24 @@ package io.joern.c2cpg.astcreation -import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewIdentifier, NewMethodRef} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.Ast +import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.Defines as X2CpgDefines +import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, DispatchTypes, Operators} +import org.apache.commons.lang3.StringUtils +import org.eclipse.cdt.core.dom.ast import org.eclipse.cdt.core.dom.ast.* import org.eclipse.cdt.core.dom.ast.cpp.* import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression +import org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionCallExpression +import org.eclipse.cdt.internal.core.dom.parser.c.CASTIdExpression +import org.eclipse.cdt.internal.core.dom.parser.c.CFunctionType +import org.eclipse.cdt.internal.core.dom.parser.c.CPointerType +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClosureType +import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFunctionCall + +import scala.util.Try trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => @@ -43,89 +55,288 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { case IASTBinaryExpression.op_notequals => Operators.notEquals case IASTBinaryExpression.op_pmdot => Operators.indirectFieldAccess case IASTBinaryExpression.op_pmarrow => Operators.indirectFieldAccess - case IASTBinaryExpression.op_max => ".max" - case IASTBinaryExpression.op_min => ".min" - case IASTBinaryExpression.op_ellipses => ".op_ellipses" - case _ => ".unknown" + case IASTBinaryExpression.op_max => Defines.OperatorMax + case IASTBinaryExpression.op_min => Defines.OperatorMin + case IASTBinaryExpression.op_ellipses => Defines.OperatorEllipses + case _ => Defines.OperatorUnknown } - val callNode_ = callNode(bin, code(bin), op, op, DispatchTypes.STATIC_DISPATCH) + val callNode_ = callNode(bin, code(bin), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val left = nullSafeAst(bin.getOperand1) val right = nullSafeAst(bin.getOperand2) callAst(callNode_, List(left, right)) } private def astForExpressionList(exprList: IASTExpressionList): Ast = { - val name = ".expressionList" + val name = Defines.OperatorExpressionList val callNode_ = - callNode(exprList, code(exprList), name, name, DispatchTypes.STATIC_DISPATCH) + callNode(exprList, code(exprList), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val childAsts = exprList.getExpressions.map(nullSafeAst) callAst(callNode_, childAsts.toIndexedSeq) } - private def astForCallExpression(call: IASTFunctionCallExpression): Ast = { - val rec = call.getFunctionNameExpression match { - case unaryExpression: IASTUnaryExpression if unaryExpression.getOperand.isInstanceOf[IASTBinaryExpression] => - astForBinaryExpression(unaryExpression.getOperand.asInstanceOf[IASTBinaryExpression]) - case unaryExpression: IASTUnaryExpression if unaryExpression.getOperand.isInstanceOf[IASTFieldReference] => - astForFieldReference(unaryExpression.getOperand.asInstanceOf[IASTFieldReference]) - case unaryExpression: IASTUnaryExpression - if unaryExpression.getOperand.isInstanceOf[IASTArraySubscriptExpression] => - astForArrayIndexExpression(unaryExpression.getOperand.asInstanceOf[IASTArraySubscriptExpression]) - case unaryExpression: IASTUnaryExpression if unaryExpression.getOperand.isInstanceOf[IASTConditionalExpression] => - astForUnaryExpression(unaryExpression) - case unaryExpression: IASTUnaryExpression if unaryExpression.getOperand.isInstanceOf[IASTUnaryExpression] => - astForUnaryExpression(unaryExpression.getOperand.asInstanceOf[IASTUnaryExpression]) - case lambdaExpression: ICPPASTLambdaExpression => - astForMethodRefForLambda(lambdaExpression) - case other => astForExpression(other) + private def astForCppCallExpression(call: ICPPASTFunctionCallExpression): Ast = { + val functionNameExpr = call.getFunctionNameExpression + val typ = functionNameExpr.getExpressionType + typ match { + case pointerType: IPointerType => + createPointerCallAst(call, cleanType(safeGetType(call.getExpressionType))) + case functionType: ICPPFunctionType => + functionNameExpr match { + case idExpr: CPPASTIdExpression if idExpr.getName.getBinding.isInstanceOf[ICPPFunction] => + val function = idExpr.getName.getBinding.asInstanceOf[ICPPFunction] + val name = idExpr.getName.getLastName.toString + val signature = + if (function.isExternC) { + "" + } else { + functionTypeToSignature(functionType) + } + + val fullName = + if (function.isExternC) { + StringUtils.normalizeSpace(name) + } else { + val fullNameNoSig = StringUtils.normalizeSpace(function.getQualifiedName.mkString(".")) + s"$fullNameNoSig:$signature" + } + + val dispatchType = DispatchTypes.STATIC_DISPATCH + + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + dispatchType, + Some(signature), + Some(registerType(cleanType(safeGetType(call.getExpressionType)))) + ) + val args = call.getArguments.toList.map(a => astForNode(a)) + + createCallAst(callCpgNode, args) + case fieldRefExpr: ICPPASTFieldReference => + val instanceAst = astForExpression(fieldRefExpr.getFieldOwner) + val args = call.getArguments.toList.map(a => astForNode(a)) + + // TODO This wont do if the name is a reference. + val name = fieldRefExpr.getFieldName.toString + val signature = functionTypeToSignature(functionType) + + val classFullName = cleanType(safeGetType(fieldRefExpr.getFieldOwnerType)) + val fullName = s"$classFullName.$name:$signature" + + fieldRefExpr.getFieldName.resolveBinding() + val method = fieldRefExpr.getFieldName.getBinding.asInstanceOf[ICPPMethod] + val (dispatchType, receiver) = + if (method.isVirtual || method.isPureVirtual) { + (DispatchTypes.DYNAMIC_DISPATCH, Some(instanceAst)) + } else { + (DispatchTypes.STATIC_DISPATCH, None) + } + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + dispatchType, + Some(signature), + Some(registerType(cleanType(safeGetType(call.getExpressionType)))) + ) + createCallAst(callCpgNode, args, base = Some(instanceAst), receiver) + case other => + astForCppCallExpressionUntyped(call) + } + case classType: ICPPClassType => + val evaluation = call.getEvaluation.asInstanceOf[EvalFunctionCall] + + val functionType = Try(evaluation.getOverload.getType).toOption + val signature = functionType.map(functionTypeToSignature).getOrElse(X2CpgDefines.UnresolvedSignature) + val name = Defines.OperatorCall + + classType match { + case closureType: CPPClosureType => + val fullName = s"$name:$signature" + val dispatchType = DispatchTypes.DYNAMIC_DISPATCH + + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + dispatchType, + Some(signature), + Some(registerType(cleanType(safeGetType(call.getExpressionType)))) + ) + + val receiverAst = astForExpression(functionNameExpr) + val args = call.getArguments.toList.map(a => astForNode(a)) + + createCallAst(callCpgNode, args, receiver = Some(receiverAst)) + case _ => + val classFullName = cleanType(safeGetType(classType)) + val fullName = s"$classFullName.$name:$signature" + + val dispatchType = evaluation.getOverload match { + case method: ICPPMethod => + if (method.isVirtual || method.isPureVirtual) { + DispatchTypes.DYNAMIC_DISPATCH + } else { + DispatchTypes.STATIC_DISPATCH + } + case _ => + DispatchTypes.STATIC_DISPATCH + } + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + dispatchType, + Some(signature), + Some(registerType(cleanType(safeGetType(call.getExpressionType)))) + ) + + val instanceAst = astForExpression(functionNameExpr) + val args = call.getArguments.toList.map(a => astForNode(a)) + createCallAst(callCpgNode, args, base = Some(instanceAst), receiver = Some(instanceAst)) + } + case _: IProblemType => + astForCppCallExpressionUntyped(call) + case _: IProblemBinding => + astForCppCallExpressionUntyped(call) + case other => + astForCppCallExpressionUntyped(call) } + } + + private def astForCppCallExpressionUntyped(call: ICPPASTFunctionCallExpression): Ast = { + val functionNameExpr = call.getFunctionNameExpression + + functionNameExpr match { + case fieldRefExpr: ICPPASTFieldReference => + val instanceAst = astForExpression(fieldRefExpr.getFieldOwner) + val args = call.getArguments.toList.map(a => astForNode(a)) + + val name = StringUtils.normalizeSpace(fieldRefExpr.getFieldName.toString) + val signature = X2CpgDefines.UnresolvedSignature + val fullName = s"${X2CpgDefines.UnresolvedNamespace}.$name:$signature(${args.size})" - val (dd, name) = call.getFunctionNameExpression match { - case _: ICPPASTLambdaExpression => - (DispatchTypes.STATIC_DISPATCH, rec.root.get.asInstanceOf[NewMethodRef].methodFullName) - case _ if rec.root.exists(_.isInstanceOf[NewIdentifier]) => - (DispatchTypes.STATIC_DISPATCH, rec.root.get.asInstanceOf[NewIdentifier].name) - case _ - if rec.root.exists(_.isInstanceOf[NewCall]) && call.getFunctionNameExpression - .isInstanceOf[IASTFieldReference] => - ( + val callCpgNode = callNode( + call, + code(call), + name, + fullName, DispatchTypes.STATIC_DISPATCH, - code(call.getFunctionNameExpression.asInstanceOf[IASTFieldReference].getFieldName) + Some(signature), + Some(X2CpgDefines.Any) ) - case _ if rec.root.exists(_.isInstanceOf[NewCall]) => - (DispatchTypes.STATIC_DISPATCH, rec.root.get.asInstanceOf[NewCall].code) - case reference: IASTIdExpression => - (DispatchTypes.STATIC_DISPATCH, code(reference)) + createCallAst(callCpgNode, args, base = Some(instanceAst), receiver = Some(instanceAst)) + case idExpr: CPPASTIdExpression => + val args = call.getArguments.toList.map(a => astForNode(a)) + + val name = StringUtils.normalizeSpace(idExpr.getName.getLastName.toString) + val signature = X2CpgDefines.UnresolvedSignature + val fullName = s"${X2CpgDefines.UnresolvedNamespace}.$name:$signature(${args.size})" + + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + DispatchTypes.STATIC_DISPATCH, + Some(signature), + Some(X2CpgDefines.Any) + ) + createCallAst(callCpgNode, args) + case other => + // This could either be a pointer or an operator() call we do not know at this point + // but since it is CPP we opt for the later. + val args = call.getArguments.toList.map(a => astForNode(a)) + + val name = Defines.OperatorCall + val signature = X2CpgDefines.UnresolvedSignature + val fullName = s"${X2CpgDefines.UnresolvedNamespace}.$name:$signature(${args.size})" + + val callCpgNode = callNode( + call, + code(call), + name, + fullName, + DispatchTypes.STATIC_DISPATCH, + Some(signature), + Some(X2CpgDefines.Any) + ) + val instanceAst = astForExpression(functionNameExpr) + createCallAst(callCpgNode, args, base = Some(instanceAst), receiver = Some(instanceAst)) + } + } + + private def astForCCallExpression(call: CASTFunctionCallExpression): Ast = { + val functionNameExpr = call.getFunctionNameExpression + val typ = functionNameExpr.getExpressionType + typ match { + case pointerType: CPointerType => + createPointerCallAst(call, cleanType(safeGetType(call.getExpressionType))) + case functionType: CFunctionType => + functionNameExpr match { + case idExpr: CASTIdExpression => + createCFunctionCallAst(call, idExpr, cleanType(safeGetType(call.getExpressionType))) + case _ => + createPointerCallAst(call, cleanType(safeGetType(call.getExpressionType))) + } case _ => - (DispatchTypes.STATIC_DISPATCH, "") + astForCCallExpressionUntyped(call) } + } + + private def createCFunctionCallAst( + call: CASTFunctionCallExpression, + idExpr: CASTIdExpression, + callTypeFullName: String + ): Ast = { + val name = idExpr.getName.getLastName.toString + val signature = "" + val dispatchType = DispatchTypes.STATIC_DISPATCH + val callCpgNode = + callNode(call, code(call), name, name, dispatchType, Some(signature), Some(registerType(callTypeFullName))) + val args = call.getArguments.toList.map(a => astForNode(a)) + createCallAst(callCpgNode, args) + } + + private def createPointerCallAst(call: IASTFunctionCallExpression, callTypeFullName: String): Ast = { + val functionNameExpr = call.getFunctionNameExpression + val name = Defines.OperatorPointerCall + val signature = "" + val dispatchType = DispatchTypes.DYNAMIC_DISPATCH + val callCpgNode = + callNode(call, code(call), name, name, dispatchType, Some(signature), Some(registerType(callTypeFullName))) + val args = call.getArguments.toList.map(a => astForNode(a)) + val receiverAst = astForExpression(functionNameExpr) + createCallAst(callCpgNode, args, receiver = Some(receiverAst)) + } - val shortName = fixQualifiedName(name) - val fullName = typeFor(call.getFunctionNameExpression) match { - case t if t == shortName || t.endsWith(s".$shortName") => dereferenceTypeFullName(t) - case t if t != Defines.anyTypeName => s"${dereferenceTypeFullName(t)}.$shortName" - case _ => shortName + private def astForCCallExpressionUntyped(call: CASTFunctionCallExpression): Ast = { + val functionNameExpr = call.getFunctionNameExpression + functionNameExpr match { + case idExpr: CASTIdExpression => createCFunctionCallAst(call, idExpr, X2CpgDefines.Any) + case _ => createPointerCallAst(call, X2CpgDefines.Any) } - val cpgCall = callNode(call, code(call), shortName, fullName, dd) - val args = call.getArguments.toList.map(a => astForNode(a)) - rec.root match { - // Optimization: do not include the receiver if the receiver is just the function name, - // e.g., for `f(x)`, don't include an `f` identifier node as a first child. Since we - // have so many call sites in CPGs, this drastically reduces the number of nodes. - // Moreover, the data flow tracker does not need to track `f`, which would not make - // much sense anyway. - case Some(r: NewIdentifier) if r.name == shortName => - callAst(cpgCall, args) - case Some(r: NewMethodRef) if r.code == shortName => - callAst(cpgCall, args) - case Some(_) => - callAst(cpgCall, args, Option(rec)) - case None => - callAst(cpgCall, args) + } + + private def astForCallExpression(call: IASTFunctionCallExpression): Ast = { + call match { + case cppCall: ICPPASTFunctionCallExpression => astForCppCallExpression(cppCall) + case cCall: CASTFunctionCallExpression => astForCCallExpression(cCall) } } + private def astForThrowExpression(expression: IASTUnaryExpression): Ast = { + val operand = nullSafeAst(expression.getOperand) + Ast(controlStructureNode(expression, ControlStructureTypes.THROW, code(expression))) + .withChild(operand) + } + private def astForUnaryExpression(unary: IASTUnaryExpression): Ast = { val operatorMethod = unary.getOperator match { case IASTUnaryExpression.op_prefixIncr => Operators.preIncrement @@ -139,10 +350,9 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { case IASTUnaryExpression.op_sizeof => Operators.sizeOf case IASTUnaryExpression.op_postFixIncr => Operators.postIncrement case IASTUnaryExpression.op_postFixDecr => Operators.postDecrement - case IASTUnaryExpression.op_throw => ".throw" - case IASTUnaryExpression.op_typeid => ".typeOf" - case IASTUnaryExpression.op_bracketedPrimary => ".bracketedPrimary" - case _ => ".unknown" + case IASTUnaryExpression.op_typeid => Defines.OperatorTypeOf + case IASTUnaryExpression.op_bracketedPrimary => Defines.OperatorBracketedPrimary + case _ => Defines.OperatorUnknown } if ( @@ -151,8 +361,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { ) { nullSafeAst(unary.getOperand) } else { - val cpgUnary = - callNode(unary, code(unary), operatorMethod, operatorMethod, DispatchTypes.STATIC_DISPATCH) + val cpgUnary = callNode( + unary, + code(unary), + operatorMethod, + operatorMethod, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val operand = nullSafeAst(unary.getOperand) callAst(cpgUnary, List(operand)) } @@ -167,7 +384,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { op == IASTTypeIdExpression.op_alignof || op == IASTTypeIdExpression.op_typeof => val call = - callNode(typeId, code(typeId), Operators.sizeOf, Operators.sizeOf, DispatchTypes.STATIC_DISPATCH) + callNode( + typeId, + code(typeId), + Operators.sizeOf, + Operators.sizeOf, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val arg = astForNode(typeId.getTypeId.getDeclSpecifier) callAst(call, List(arg)) case _ => notHandledYet(typeId) @@ -176,7 +401,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForConditionalExpression(expr: IASTConditionalExpression): Ast = { val name = Operators.conditional - val call = callNode(expr, code(expr), name, name, DispatchTypes.STATIC_DISPATCH) + val call = callNode(expr, code(expr), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val condAst = nullSafeAst(expr.getLogicalConditionExpression) val posAst = nullSafeAst(expr.getPositiveResultExpression) @@ -189,7 +414,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForArrayIndexExpression(arrayIndexExpression: IASTArraySubscriptExpression): Ast = { val name = Operators.indirectIndexAccess val cpgArrayIndexing = - callNode(arrayIndexExpression, code(arrayIndexExpression), name, name, DispatchTypes.STATIC_DISPATCH) + callNode( + arrayIndexExpression, + code(arrayIndexExpression), + name, + name, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val expr = astForExpression(arrayIndexExpression.getArrayExpression) val arg = astForNode(arrayIndexExpression.getArgument) @@ -198,7 +431,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForCastExpression(castExpression: IASTCastExpression): Ast = { val cpgCastExpression = - callNode(castExpression, code(castExpression), Operators.cast, Operators.cast, DispatchTypes.STATIC_DISPATCH) + callNode( + castExpression, + code(castExpression), + Operators.cast, + Operators.cast, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val expr = astForExpression(castExpression.getOperand) val argNode = castExpression.getTypeId @@ -220,9 +461,16 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } private def astForNewExpression(newExpression: ICPPASTNewExpression): Ast = { - val name = ".new" - val cpgNewExpression = - callNode(newExpression, code(newExpression), name, name, DispatchTypes.STATIC_DISPATCH) + val name = Defines.OperatorNew + val cpgNewExpression = callNode( + newExpression, + code(newExpression), + name, + name, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val typeId = newExpression.getTypeId if (newExpression.isArrayAllocation) { @@ -239,7 +487,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForDeleteExpression(delExpression: ICPPASTDeleteExpression): Ast = { val name = Operators.delete val cpgDeleteNode = - callNode(delExpression, code(delExpression), name, name, DispatchTypes.STATIC_DISPATCH) + callNode( + delExpression, + code(delExpression), + name, + name, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val arg = astForExpression(delExpression.getOperand) callAst(cpgDeleteNode, List(arg)) } @@ -247,7 +503,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForTypeIdInitExpression(typeIdInit: IASTTypeIdInitializerExpression): Ast = { val name = Operators.cast val cpgCastExpression = - callNode(typeIdInit, code(typeIdInit), name, name, DispatchTypes.STATIC_DISPATCH) + callNode(typeIdInit, code(typeIdInit), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val typeAst = unknownNode(typeIdInit.getTypeId, code(typeIdInit.getTypeId)) val expr = astForNode(typeIdInit.getInitializer) @@ -256,7 +512,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { private def astForConstructorExpression(c: ICPPASTSimpleTypeConstructorExpression): Ast = { val name = c.getDeclSpecifier.toString - val callNode_ = callNode(c, code(c), name, name, DispatchTypes.STATIC_DISPATCH) + val callNode_ = callNode(c, code(c), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val arg = astForNode(c.getInitializer) callAst(callNode_, List(arg)) } @@ -269,14 +525,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { protected def astForExpression(expression: IASTExpression): Ast = { val r = expression match { - case lit: IASTLiteralExpression => astForLiteral(lit) - case un: IASTUnaryExpression => astForUnaryExpression(un) - case bin: IASTBinaryExpression => astForBinaryExpression(bin) - case exprList: IASTExpressionList => astForExpressionList(exprList) - case idExpr: IASTIdExpression => astForIdExpression(idExpr) - case call: IASTFunctionCallExpression => astForCallExpression(call) - case typeId: IASTTypeIdExpression => astForTypeIdExpression(typeId) - case fieldRef: IASTFieldReference => astForFieldReference(fieldRef) + case lit: IASTLiteralExpression => astForLiteral(lit) + case un: IASTUnaryExpression if un.getOperator == IASTUnaryExpression.op_throw => astForThrowExpression(un) + case un: IASTUnaryExpression => astForUnaryExpression(un) + case bin: IASTBinaryExpression => astForBinaryExpression(bin) + case exprList: IASTExpressionList => astForExpressionList(exprList) + case idExpr: IASTIdExpression => astForIdExpression(idExpr) + case call: IASTFunctionCallExpression => astForCallExpression(call) + case typeId: IASTTypeIdExpression => astForTypeIdExpression(typeId) + case fieldRef: IASTFieldReference => astForFieldReference(fieldRef) case expr: IASTConditionalExpression => astForConditionalExpression(expr) case arr: IASTArraySubscriptExpression => astForArrayIndexExpression(arr) case castExpression: IASTCastExpression => astForCastExpression(castExpression) @@ -298,11 +555,11 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } protected def astForStaticAssert(a: ICPPASTStaticAssertDeclaration): Ast = { - val name = "static_assert" - val call = callNode(a, code(a), name, name, DispatchTypes.STATIC_DISPATCH) - val cond = nullSafeAst(a.getCondition) - val messg = nullSafeAst(a.getMessage) - callAst(call, List(cond, messg)) + val name = "static_assert" + val call = callNode(a, code(a), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) + val cond = nullSafeAst(a.getCondition) + val message = nullSafeAst(a.getMessage) + callAst(call, List(cond, message)) } } diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForFunctionsCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForFunctionsCreator.scala index 7b2853357239..1b1ecc7b7ebc 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForFunctionsCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForFunctionsCreator.scala @@ -1,24 +1,39 @@ package io.joern.c2cpg.astcreation -import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.Ast +import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Stack.* import io.joern.x2cpg.utils.NodeBuilders.newModifierNode +import io.shiftleft.codepropertygraph.generated.EvaluationStrategies +import io.shiftleft.codepropertygraph.generated.ModifierTypes import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EvaluationStrategies, ModifierTypes} import org.apache.commons.lang3.StringUtils import org.eclipse.cdt.core.dom.ast.* +import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLambdaExpression +import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator -import org.eclipse.cdt.internal.core.dom.parser.c.{CASTFunctionDeclarator, CASTParameterDeclaration} -import org.eclipse.cdt.internal.core.dom.parser.cpp.{CPPASTFunctionDeclarator, CPPASTParameterDeclaration} +import org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionDeclarator +import org.eclipse.cdt.internal.core.dom.parser.c.CASTParameterDeclaration +import org.eclipse.cdt.internal.core.dom.parser.c.CVariable +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPEnumeration +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPStructuredBindingComposite import org.eclipse.cdt.internal.core.model.ASTStringUtil import scala.annotation.tailrec -import scala.collection.mutable +import scala.util.Try trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => - private val seenFunctionSignatures = mutable.HashSet.empty[String] + private def methodDeclarationParentInfo(): (String, String) = { + methodAstParentStack.collectFirst { case t: NewTypeDecl => (t.label, t.fullName) }.getOrElse { + (methodAstParentStack.head.label, methodAstParentStack.head.properties("FULL_NAME").toString) + } + } private def createFunctionTypeAndTypeDecl( node: IASTNode, @@ -52,7 +67,7 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th Ast(functionBinding).withBindsEdge(parentNode, functionBinding).withRefEdge(functionBinding, method) } - private def parameters(functionNode: IASTNode): Seq[IASTNode] = functionNode match { + final protected def parameters(functionNode: IASTNode): Seq[IASTNode] = functionNode match { case arr: IASTArrayDeclarator => parameters(arr.getNestedDeclarator) case decl: CPPASTFunctionDeclarator => decl.getParameters.toIndexedSeq ++ parameters(decl.getNestedDeclarator) case decl: CASTFunctionDeclarator => decl.getParameters.toIndexedSeq ++ parameters(decl.getNestedDeclarator) @@ -65,7 +80,7 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th } @tailrec - private def isVariadic(functionNode: IASTNode): Boolean = functionNode match { + final protected def isVariadic(functionNode: IASTNode): Boolean = functionNode match { case decl: CPPASTFunctionDeclarator => decl.takesVarArgs() case decl: CASTFunctionDeclarator => decl.takesVarArgs() case defn: IASTFunctionDefinition => isVariadic(defn.getDeclarator) @@ -73,15 +88,6 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th case _ => false } - private def parameterListSignature(func: IASTNode): String = { - val variadic = if (isVariadic(func)) "..." else "" - val elements = parameters(func).map { - case p: IASTParameterDeclaration => typeForDeclSpecifier(p.getDeclSpecifier) - case other => typeForDeclSpecifier(other) - } - s"(${elements.mkString(",")}$variadic)" - } - private def setVariadic(parameterNodes: Seq[NewMethodParameterIn], func: IASTNode): Unit = { parameterNodes.lastOption.foreach { case p: NewMethodParameterIn if isVariadic(func) => @@ -91,22 +97,20 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th } } - protected def astForMethodRefForLambda(lambdaExpression: ICPPASTLambdaExpression): Ast = { - val filename = fileName(lambdaExpression) - - val returnType = lambdaExpression.getDeclarator match { - case declarator: IASTDeclarator => - declarator.getTrailingReturnType match { - case id: IASTTypeId => typeForDeclSpecifier(id.getDeclSpecifier) - case null => Defines.anyTypeName - } - case null => Defines.anyTypeName + private def setVariadicParameterInfo(parameterNodeInfos: Seq[CGlobal.ParameterInfo], func: IASTNode): Unit = { + parameterNodeInfos.lastOption.foreach { + case p: CGlobal.ParameterInfo if isVariadic(func) => + p.isVariadic = true + p.code = s"${p.code}..." + case _ => } - val name = nextClosureName() - val fullname = s"${fullName(lambdaExpression)}$name" - val signature = s"$returnType $fullname ${parameterListSignature(lambdaExpression)}" - val codeString = code(lambdaExpression) - val methodNode_ = methodNode(lambdaExpression, name, codeString, fullname, Some(signature), filename) + } + + protected def astForMethodRefForLambda(lambdaExpression: ICPPASTLambdaExpression): Ast = { + val filename = fileName(lambdaExpression) + val MethodFullNameInfo(name, fullName, signature, returnType) = this.methodFullNameInfo(lambdaExpression) + val codeString = code(lambdaExpression) + val methodNode_ = methodNode(lambdaExpression, name, codeString, fullName, Some(signature), filename) scope.pushNewScope(methodNode_) val parameterNodes = withIndex(parameters(lambdaExpression.getDeclarator)) { (p, i) => @@ -120,64 +124,150 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th methodNode_, parameterNodes.map(Ast(_)), astForMethodBody(Option(lambdaExpression.getBody)), - newMethodReturnNode(lambdaExpression, registerType(returnType)), + methodReturnNode(lambdaExpression, registerType(returnType)), newModifierNode(ModifierTypes.LAMBDA) :: Nil ) - val typeDeclAst = createFunctionTypeAndTypeDecl(lambdaExpression, methodNode_, name, fullname, signature) + val typeDeclAst = createFunctionTypeAndTypeDecl(lambdaExpression, methodNode_, name, fullName, signature) Ast.storeInDiffGraph(astForLambda.merge(typeDeclAst), diffGraph) - Ast(methodRefNode(lambdaExpression, codeString, fullname, methodNode_.astParentFullName)) + Ast(methodRefNode(lambdaExpression, codeString, fullName, registerType(fullName))) } protected def astForFunctionDeclarator(funcDecl: IASTFunctionDeclarator): Ast = { - val returnType = typeForDeclSpecifier(funcDecl.getParent.asInstanceOf[IASTSimpleDeclaration].getDeclSpecifier) - val fullname = fullName(funcDecl) - val templateParams = templateParameters(funcDecl).getOrElse("") - val signature = - s"$returnType $fullname$templateParams ${parameterListSignature(funcDecl)}" - - if (seenFunctionSignatures.add(signature)) { - val name = shortName(funcDecl) - val codeString = code(funcDecl.getParent) - val filename = fileName(funcDecl) - val methodNode_ = methodNode(funcDecl, name, codeString, fullname, Some(signature), filename) - - scope.pushNewScope(methodNode_) - - val parameterNodes = withIndex(parameters(funcDecl)) { (p, i) => - parameterNode(p, i) - } - setVariadic(parameterNodes, funcDecl) - - scope.popScope() - - val stubAst = - methodStubAst(methodNode_, parameterNodes.map(Ast(_)), newMethodReturnNode(funcDecl, registerType(returnType))) - val typeDeclAst = createFunctionTypeAndTypeDecl(funcDecl, methodNode_, name, fullname, signature) - stubAst.merge(typeDeclAst) - } else { - Ast() + funcDecl.getName.resolveBinding() match { + case _: IFunction => + val MethodFullNameInfo(name, fullName, signature, returnType) = this.methodFullNameInfo(funcDecl) + val codeString = code(funcDecl.getParent) + val filename = fileName(funcDecl) + + val parameterNodeInfos = thisForCPPFunctions(funcDecl) ++ withIndex(parameters(funcDecl)) { (p, i) => + parameterNodeInfo(p, i) + } + setVariadicParameterInfo(parameterNodeInfos, funcDecl) + + val (astParentType, astParentFullName) = methodDeclarationParentInfo() + + val methodInfo = CGlobal.MethodInfo( + name, + code = codeString, + fileName = filename, + returnType = registerType(returnType), + astParentType = astParentType, + astParentFullName = astParentFullName, + lineNumber = line(funcDecl), + columnNumber = column(funcDecl), + lineNumberEnd = lineEnd(funcDecl), + columnNumberEnd = columnEnd(funcDecl), + signature = signature, + offset(funcDecl), + parameter = parameterNodeInfos, + modifier = modifierFor(funcDecl).map(_.modifierType) + ) + registerMethodDeclaration(fullName, methodInfo) + Ast() + case cVariable: CVariable => + val name = shortName(funcDecl) + val tpe = cleanType(ASTTypeUtil.getType(cVariable.getType)) + val codeString = code(funcDecl.getParent) + val node = localNode(funcDecl, name, codeString, registerType(tpe)) + scope.addToScope(name, (node, tpe)) + Ast(node) + case field: IField => + // TODO create a member for the field + // We get here a least for function pointer member declarations in classes like: + // class A { + // public: + // void (*foo)(int); + // }; + Ast() + case typeDef: ITypedef => + // TODO handle typeDecl for now we just ignore this. + Ast() + case other => + notHandledYet(funcDecl) } + } - protected def astForFunctionDefinition(funcDef: IASTFunctionDefinition): Ast = { - val filename = fileName(funcDef) - val returnType = typeForDeclSpecifier(funcDef.getDeclSpecifier) - val name = shortName(funcDef) - val fullname = fullName(funcDef) - val templateParams = templateParameters(funcDef).getOrElse("") + private def modifierFromString(image: String): List[NewModifier] = { + image match { + case "static" => List(newModifierNode(ModifierTypes.STATIC)) + case _ => Nil + } + } + + private def modifierFor(funcDef: IASTFunctionDefinition): List[NewModifier] = { + val constructorModifier = if (isCppConstructor(funcDef)) { + List(newModifierNode(ModifierTypes.CONSTRUCTOR), newModifierNode(ModifierTypes.PUBLIC)) + } else Nil + val visibilityModifier = Try(modifierFromString(funcDef.getSyntax.getImage)).getOrElse(Nil) + constructorModifier ++ visibilityModifier + } + + private def modifierFor(funcDecl: IASTFunctionDeclarator): List[NewModifier] = { + Try(modifierFromString(funcDecl.getParent.getSyntax.getImage)).getOrElse(Nil) + } + + protected def isCppConstructor(funcDef: IASTFunctionDefinition): Boolean = { + funcDef match { + case cppFunc: CPPASTFunctionDefinition => cppFunc.getMemberInitializers.nonEmpty + case _ => false + } + } + + private def thisForCPPFunctions(func: IASTNode): Seq[CGlobal.ParameterInfo] = { + func match { + case cppFunc: ICPPASTFunctionDefinition => + val maybeOwner = Try(cppFunc.getDeclarator.getName.getBinding).toOption match { + case Some(o: ICPPBinding) if o.getOwner.isInstanceOf[CPPClassType] => + Some(o.getOwner.asInstanceOf[CPPClassType].getQualifiedName.mkString(".")) + case Some(o: ICPPBinding) if o.getOwner.isInstanceOf[CPPEnumeration] => + Some(o.getOwner.asInstanceOf[CPPEnumeration].getQualifiedName.mkString(".")) + case Some(o: ICPPBinding) if o.getOwner.isInstanceOf[CPPStructuredBindingComposite] => + Some(o.getOwner.asInstanceOf[CPPStructuredBindingComposite].getQualifiedName.mkString(".")) + case _ => None + } + maybeOwner.toSeq.map { owner => + new CGlobal.ParameterInfo( + "this", + "this", + 0, + false, + EvaluationStrategies.BY_VALUE, + line(cppFunc), + column(cppFunc), + registerType(owner) + ) + } + case _ => Seq.empty + } + } - val signature = - s"$returnType $fullname$templateParams ${parameterListSignature(funcDef)}" - seenFunctionSignatures.add(signature) + protected def astForFunctionDefinition(funcDef: IASTFunctionDefinition): Ast = { + val filename = fileName(funcDef) + val MethodFullNameInfo(name, fullName, signature, returnType) = this.methodFullNameInfo(funcDef) + registerMethodDefinition(fullName) val codeString = code(funcDef) - val methodNode_ = methodNode(funcDef, name, codeString, fullname, Some(signature), filename) + val methodNode_ = methodNode(funcDef, name, codeString, fullName, Some(signature), filename) methodAstParentStack.push(methodNode_) scope.pushNewScope(methodNode_) - val parameterNodes = withIndex(parameters(funcDef)) { (p, i) => + val implicitThisParam = thisForCPPFunctions(funcDef).map { thisParam => + val parameterNode = parameterInNode( + funcDef, + thisParam.name, + thisParam.code, + thisParam.index, + thisParam.isVariadic, + thisParam.evaluationStrategy, + thisParam.typeFullName + ) + scope.addToScope(thisParam.name, (parameterNode, thisParam.typeFullName)) + parameterNode + } + val parameterNodes = implicitThisParam ++ withIndex(parameters(funcDef)) { (p, i) => parameterNode(p, i) } setVariadic(parameterNodes, funcDef) @@ -186,17 +276,18 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th methodNode_, parameterNodes.map(Ast(_)), astForMethodBody(Option(funcDef.getBody)), - newMethodReturnNode(funcDef, registerType(returnType)) + methodReturnNode(funcDef, registerType(returnType)), + modifiers = modifierFor(funcDef) ) scope.popScope() methodAstParentStack.pop() - val typeDeclAst = createFunctionTypeAndTypeDecl(funcDef, methodNode_, name, fullname, signature) + val typeDeclAst = createFunctionTypeAndTypeDecl(funcDef, methodNode_, name, fullName, signature) astForMethod.merge(typeDeclAst) } - private def parameterNode(parameter: IASTNode, paramIndex: Int): NewMethodParameterIn = { + private def parameterNodeInfo(parameter: IASTNode, paramIndex: Int): CGlobal.ParameterInfo = { val (name, codeString, tpe, variadic) = parameter match { case p: CASTParameterDeclaration => ( @@ -224,25 +315,38 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th case other => (code(other), code(other), cleanType(typeForDeclSpecifier(other)), false) } + new CGlobal.ParameterInfo( + name, + codeString, + paramIndex, + variadic, + EvaluationStrategies.BY_VALUE, + lineNumber = line(parameter), + columnNumber = column(parameter), + typeFullName = registerType(tpe) + ) + } + private def parameterNode(parameter: IASTNode, paramIndex: Int): NewMethodParameterIn = { + val parameterInfo = parameterNodeInfo(parameter, paramIndex) val parameterNode = parameterInNode( parameter, - name, - codeString, - paramIndex, - variadic, - EvaluationStrategies.BY_VALUE, - registerType(tpe) + parameterInfo.name, + parameterInfo.code, + parameterInfo.index, + parameterInfo.isVariadic, + parameterInfo.evaluationStrategy, + parameterInfo.typeFullName ) - scope.addToScope(name, (parameterNode, tpe)) + scope.addToScope(parameterInfo.name, (parameterNode, parameterInfo.typeFullName)) parameterNode } private def astForMethodBody(body: Option[IASTStatement]): Ast = body match { case Some(b: IASTCompoundStatement) => astForBlockStatement(b) case Some(b) => astForNode(b) - case None => blockAst(NewBlock()) + case None => blockAst(NewBlock().typeFullName(Defines.Any)) } } diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForPrimitivesCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForPrimitivesCreator.scala index b1c268e2cb7e..2ff0a3ae9803 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForPrimitivesCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForPrimitivesCreator.scala @@ -1,35 +1,61 @@ package io.joern.c2cpg.astcreation -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.Ast +import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.Defines as X2CpgDefines +import io.shiftleft.codepropertygraph.generated.DispatchTypes +import io.shiftleft.codepropertygraph.generated.Operators +import io.shiftleft.codepropertygraph.generated.nodes.NewMethod import io.shiftleft.codepropertygraph.generated.nodes.NewMethodRef +import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl import org.eclipse.cdt.core.dom.ast.* import org.eclipse.cdt.internal.core.dom.parser.c.ICInternalBinding import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTQualifiedName import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPField +import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess import org.eclipse.cdt.internal.core.model.ASTStringUtil +import scala.util.Try + trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => protected def astForComment(comment: IASTComment): Ast = Ast(newCommentNode(comment, code(comment), fileName(comment))) protected def astForLiteral(lit: IASTLiteralExpression): Ast = { - val tpe = cleanType(ASTTypeUtil.getType(lit.getExpressionType)) - Ast(literalNode(lit, code(lit), registerType(tpe))) + val codeString = code(lit) + val tpe = registerType(cleanType(safeGetType(lit.getExpressionType))) + if (codeString == "this") { + val thisIdentifier = identifierNode(lit, "this", "this", tpe) + scope.lookupVariable("this") match { + case Some((variable, _)) => Ast(thisIdentifier).withRefEdge(thisIdentifier, variable) + case None => Ast(identifierNode(lit, codeString, codeString, tpe)) + } + } else { + Ast(literalNode(lit, codeString, tpe)) + } } private def namesForBinding(binding: ICInternalBinding | ICPPInternalBinding): (Option[String], Option[String]) = { val definition = binding match { - // sadly, there is no common interface defining .getDefinition - case b: ICInternalBinding => b.getDefinition.asInstanceOf[IASTFunctionDeclarator] - case b: ICPPInternalBinding => b.getDefinition.asInstanceOf[IASTFunctionDeclarator] + // sadly, there is no common interface + case b: ICInternalBinding if b.getDefinition.isInstanceOf[IASTFunctionDeclarator] => + Some(b.getDefinition.asInstanceOf[IASTFunctionDeclarator]) + case b: ICPPInternalBinding if b.getDefinition.isInstanceOf[IASTFunctionDeclarator] => + Some(b.getDefinition.asInstanceOf[IASTFunctionDeclarator]) + case b: ICInternalBinding => b.getDeclarations.find(_.isInstanceOf[IASTFunctionDeclarator]) + case b: ICPPInternalBinding => b.getDeclarations.find(_.isInstanceOf[IASTFunctionDeclarator]) + case null => None } - val typeFullName = definition.getParent match { - case d: IASTFunctionDefinition => Some(typeForDeclSpecifier(d.getDeclSpecifier)) - case _ => None + val typeFullName = definition.map(_.getParent) match { + case Some(d: IASTFunctionDefinition) => Some(typeForDeclSpecifier(d.getDeclSpecifier)) + case Some(d: IASTSimpleDeclaration) => Some(typeForDeclSpecifier(d.getDeclSpecifier)) + case _ => None } - (Some(this.fullName(definition)), typeFullName) + (definition.map(fullName), typeFullName) } private def maybeMethodRefForIdentifier(ident: IASTNode): Option[NewMethodRef] = { @@ -39,58 +65,110 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t val (mayBeFullName, mayBeTypeFullName) = id.getName.getBinding match { case binding: ICInternalBinding if binding.getDefinition.isInstanceOf[IASTFunctionDeclarator] => namesForBinding(binding) + case binding: ICInternalBinding + if binding.getDeclarations != null && + binding.getDeclarations.exists(_.isInstanceOf[IASTFunctionDeclarator]) => + namesForBinding(binding) case binding: ICPPInternalBinding if binding.getDefinition.isInstanceOf[IASTFunctionDeclarator] => namesForBinding(binding) + case binding: ICPPInternalBinding + if binding.getDeclarations != null && + binding.getDeclarations.exists(_.isInstanceOf[CPPASTFunctionDeclarator]) => + namesForBinding(binding) case _ => (None, None) } for { fullName <- mayBeFullName typeFullName <- mayBeTypeFullName - } yield methodRefNode(ident, code(ident), fullName, typeFullName) + } yield methodRefNode(ident, code(ident), fullName, registerType(cleanType(typeFullName))) case _ => None } } + private def isInCurrentScope(owner: String): Boolean = { + methodAstParentStack.collectFirst { + case typeDecl: NewTypeDecl if typeDecl.fullName == owner => typeDecl + case method: NewMethod if method.fullName.startsWith(owner) => method + }.nonEmpty + } + + private def nameForIdentifier(ident: IASTNode): String = { + ident match { + case id: IASTIdExpression => ASTStringUtil.getSimpleName(id.getName) + case id: IASTName if ASTStringUtil.getSimpleName(id).isEmpty && id.getBinding != null => id.getBinding.getName + case id: IASTName if ASTStringUtil.getSimpleName(id).isEmpty => uniqueName("name", "", "")._1 + case _ => code(ident) + } + } + + private def syntheticThisAccess(ident: CPPASTIdExpression, identifierName: String): String | Ast = { + val tpe = ident.getName.getBinding match { + case f: CPPField => cleanType(f.getType.toString) + case _ => typeFor(ident) + } + Try(ident.getEvaluation).toOption match { + case Some(e: EvalMemberAccess) => + val tpe = registerType(typeFor(ident)) + val ownerType = registerType(cleanType(e.getOwnerType.toString)) + if (isInCurrentScope(ownerType)) { + scope.lookupVariable("this") match { + case Some((variable, _)) => + val op = Operators.indirectFieldAccess + val code = s"this->$identifierName" + val thisIdentifier = identifierNode(ident, "this", "this", tpe) + val member = fieldIdentifierNode(ident, identifierName, identifierName) + val ma = callNode(ident, code, op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) + callAst(ma, Seq(Ast(thisIdentifier).withRefEdge(thisIdentifier, variable), Ast(member))) + case None => tpe + } + } else tpe + case _ => tpe + } + } + + private def typeNameForIdentifier(ident: IASTNode, identifierName: String): String | Ast = { + val variableOption = scope.lookupVariable(identifierName) + variableOption match { + case Some((_, variableTypeName)) => variableTypeName + case None if ident.isInstanceOf[IASTName] && ident.asInstanceOf[IASTName].getBinding != null => + val id = ident.asInstanceOf[IASTName] + id.getBinding match { + case v: IVariable => + v.getType match { + case f: IFunctionType => f.getReturnType.toString + case other => other.toString + } + case other => other.getName + } + case None if ident.isInstanceOf[IASTName] => + typeFor(ident.getParent) + case None if ident.isInstanceOf[CPPASTIdExpression] => + syntheticThisAccess(ident.asInstanceOf[CPPASTIdExpression], identifierName) + case None => typeFor(ident) + } + } + protected def astForIdentifier(ident: IASTNode): Ast = { maybeMethodRefForIdentifier(ident) match { case Some(ref) => Ast(ref) case None => - val identifierName = ident match { - case id: IASTIdExpression => ASTStringUtil.getSimpleName(id.getName) - case id: IASTName if ASTStringUtil.getSimpleName(id).isEmpty && id.getBinding != null => id.getBinding.getName - case id: IASTName if ASTStringUtil.getSimpleName(id).isEmpty => uniqueName("name", "", "")._1 - case _ => code(ident) - } - val variableOption = scope.lookupVariable(identifierName) - val identifierTypeName = variableOption match { - case Some((_, variableTypeName)) => variableTypeName - case None if ident.isInstanceOf[IASTName] && ident.asInstanceOf[IASTName].getBinding != null => - val id = ident.asInstanceOf[IASTName] - id.getBinding match { - case v: IVariable => - v.getType match { - case f: IFunctionType => f.getReturnType.toString - case other => other.toString - } - case other => other.getName + val identifierName = nameForIdentifier(ident) + typeNameForIdentifier(ident, identifierName) match { + case identifierTypeName: String => + val node = identifierNode(ident, identifierName, code(ident), registerType(cleanType(identifierTypeName))) + scope.lookupVariable(identifierName) match { + case Some((variable, _)) => + Ast(node).withRefEdge(node, variable) + case None => Ast(node) } - case None if ident.isInstanceOf[IASTName] => - typeFor(ident.getParent) - case None => typeFor(ident) - } - - val node = identifierNode(ident, identifierName, code(ident), registerType(cleanType(identifierTypeName))) - variableOption match { - case Some((variable, _)) => - Ast(node).withRefEdge(node, variable) - case None => Ast(node) + case ast: Ast => ast } } } protected def astForFieldReference(fieldRef: IASTFieldReference): Ast = { val op = if (fieldRef.isPointerDereference) Operators.indirectFieldAccess else Operators.fieldAccess - val ma = callNode(fieldRef, code(fieldRef), op, op, DispatchTypes.STATIC_DISPATCH) + val ma = callNode(fieldRef, code(fieldRef), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val owner = astForExpression(fieldRef.getFieldOwner) val member = fieldIdentifierNode(fieldRef, fieldRef.getFieldName.toString, fieldRef.getFieldName.toString) callAst(ma, List(owner, Ast(member))) @@ -101,7 +179,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t protected def astForInitializerList(l: IASTInitializerList): Ast = { val op = Operators.arrayInitializer - val initCallNode = callNode(l, code(l), op, op, DispatchTypes.STATIC_DISPATCH) + val initCallNode = callNode(l, code(l), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val MAX_INITIALIZERS = 1000 val clauses = l.getClauses.slice(0, MAX_INITIALIZERS) @@ -111,7 +189,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t val ast = callAst(initCallNode, args) if (l.getClauses.length > MAX_INITIALIZERS) { val placeholder = - literalNode(l, "", Defines.anyTypeName).argumentIndex(MAX_INITIALIZERS) + literalNode(l, "", Defines.Any).argumentIndex(MAX_INITIALIZERS) ast.withChild(Ast(placeholder)).withArgEdge(initCallNode, placeholder) } else { ast @@ -120,7 +198,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t protected def astForQualifiedName(qualId: CPPASTQualifiedName): Ast = { val op = Operators.fieldAccess - val ma = callNode(qualId, code(qualId), op, op, DispatchTypes.STATIC_DISPATCH) + val ma = callNode(qualId, code(qualId), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) def fieldAccesses(names: List[IASTNode], argIndex: Int = -1): Ast = names match { case Nil => Ast() @@ -129,7 +207,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t case head :: tail => val codeString = s"${code(head)}::${tail.map(code).mkString("::")}" val callNode_ = - callNode(head, code(head), op, op, DispatchTypes.STATIC_DISPATCH) + callNode(head, code(head), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) .argumentIndex(argIndex) callNode_.code = codeString val arg1 = astForNode(head) @@ -142,7 +220,7 @@ trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { t val owner = if (qualifier != Ast()) { qualifier } else { - Ast(literalNode(qualId.getLastName, "", Defines.anyTypeName)) + Ast(literalNode(qualId.getLastName, "", Defines.Any)) } val member = fieldIdentifierNode( diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForStatementsCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForStatementsCreator.scala index 040e4a9ffa12..7f717ee9b8a0 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForStatementsCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForStatementsCreator.scala @@ -5,6 +5,8 @@ import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.AstNodeNew import io.shiftleft.codepropertygraph.generated.nodes.ExpressionNew +import io.shiftleft.codepropertygraph.generated.DispatchTypes +import io.shiftleft.codepropertygraph.generated.Operators import org.eclipse.cdt.core.dom.ast.* import org.eclipse.cdt.core.dom.ast.cpp.* import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTGotoStatement @@ -21,8 +23,8 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t protected def astForBlockStatement(blockStmt: IASTCompoundStatement, order: Int = -1): Ast = { val codeString = code(blockStmt) - val blockCode = if (codeString == "{}" || codeString.isEmpty) Defines.empty else codeString - val node = blockNode(blockStmt, blockCode, registerType(Defines.voidTypeName)) + val blockCode = if (codeString == "{}" || codeString.isEmpty) Defines.Empty else codeString + val node = blockNode(blockStmt, blockCode, registerType(Defines.Void)) .order(order) .argumentIndex(order) scope.pushNewScope(node) @@ -36,19 +38,34 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t blockAst(node, childAsts.toList) } + private def hasValidArrayModifier(arrayDecl: IASTArrayDeclarator): Boolean = + arrayDecl.getArrayModifiers.nonEmpty && arrayDecl.getArrayModifiers.forall(_.getConstantExpression != null) + private def astsForDeclarationStatement(decl: IASTDeclarationStatement): Seq[Ast] = decl.getDeclaration match { - case simplDecl: IASTSimpleDeclaration - if simplDecl.getDeclarators.headOption.exists(_.isInstanceOf[IASTFunctionDeclarator]) => - Seq(astForFunctionDeclarator(simplDecl.getDeclarators.head.asInstanceOf[IASTFunctionDeclarator])) - case simplDecl: IASTSimpleDeclaration => - val locals = - simplDecl.getDeclarators.zipWithIndex.toList.map { case (d, i) => astForDeclarator(simplDecl, d, i) } - val calls = - simplDecl.getDeclarators.filter(_.getInitializer != null).toList.map { d => - astForInitializer(d, d.getInitializer) + case simpleDecl: IASTSimpleDeclaration + if simpleDecl.getDeclarators.headOption.exists(_.isInstanceOf[IASTFunctionDeclarator]) => + Seq(astForFunctionDeclarator(simpleDecl.getDeclarators.head.asInstanceOf[IASTFunctionDeclarator])) + case simpleDecl: IASTSimpleDeclaration => + val locals = simpleDecl.getDeclarators.zipWithIndex.map { case (d, i) => astForDeclarator(simpleDecl, d, i) } + val arrayModCalls = simpleDecl.getDeclarators + .collect { case d: IASTArrayDeclarator if hasValidArrayModifier(d) => d } + .map { d => + val name = Operators.alloc + val tpe = registerType(typeFor(d)) + val codeString = code(d) + val allocCallNode = callNode(d, code(d), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(tpe)) + val allocCallAst = callAst(allocCallNode, d.getArrayModifiers.toIndexedSeq.map(astForNode)) + val operatorName = Operators.assignment + val assignmentCallNode = + callNode(d, code(d), operatorName, operatorName, DispatchTypes.STATIC_DISPATCH, None, Some(tpe)) + val left = astForNode(d.getName) + callAst(assignmentCallNode, List(left, allocCallAst)) } - locals ++ calls + val initCalls = simpleDecl.getDeclarators.filter(_.getInitializer != null).map { d => + astForInitializer(d, d.getInitializer) + } + Seq.from(locals ++ arrayModCalls ++ initCalls) case s: ICPPASTStaticAssertDeclaration => Seq(astForStaticAssert(s)) case usingDeclaration: ICPPASTUsingDeclaration => handleUsingDeclaration(usingDeclaration) case alias: ICPPASTAliasDeclaration => Seq(astForAliasDeclaration(alias)) @@ -123,18 +140,21 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t private def astForTryStatement(tryStmt: ICPPASTTryBlockStatement): Ast = { val tryNode = controlStructureNode(tryStmt, ControlStructureTypes.TRY, "try") - val body = nullSafeAst(tryStmt.getTryBody, 1) - val catches = tryStmt.getCatchHandlers.zipWithIndex.map { case (h, index) => - astForCatchHandler(h, index + 2) - }.toIndexedSeq - Ast(tryNode).withChildren(body).withChildren(catches) + val bodyAst = nullSafeAst(tryStmt.getTryBody) match { + case Nil => Ast() + case elem :: Nil => elem + case elements => + setArgumentIndices(elements) + blockAst(blockNode(tryStmt.getTryBody)).withChildren(elements) + } + val catchAsts = tryStmt.getCatchHandlers.toSeq.map(astForCatchHandler) + tryCatchAst(tryNode, bodyAst, catchAsts, None) } - private def astForCatchHandler(catchHandler: ICPPASTCatchHandler, argIndex: Int): Ast = { - val catchNode = - controlStructureNode(catchHandler, ControlStructureTypes.CATCH, "catch").order(argIndex).argumentIndex(argIndex) - val declAst = nullSafeAst(catchHandler.getDeclaration) - val bodyAst = nullSafeAst(catchHandler.getCatchBody) + private def astForCatchHandler(catchHandler: ICPPASTCatchHandler): Ast = { + val catchNode = controlStructureNode(catchHandler, ControlStructureTypes.CATCH, "catch") + val declAst = nullSafeAst(catchHandler.getDeclaration) + val bodyAst = nullSafeAst(catchHandler.getCatchBody) Ast(catchNode).withChildren(declAst).withChildren(bodyAst) } @@ -190,7 +210,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t private def astForConditionExpression(expression: IASTExpression, explicitArgumentIndex: Option[Int] = None): Ast = { val ast = expression match { case exprList: IASTExpressionList => - val compareAstBlock = blockNode(expression, Defines.empty, registerType(Defines.voidTypeName)) + val compareAstBlock = blockNode(expression, Defines.Empty, registerType(Defines.Void)) scope.pushNewScope(compareAstBlock) val compareBlockAstChildren = exprList.getExpressions.toList.map(nullSafeAst) setArgumentIndices(compareBlockAstChildren) @@ -214,7 +234,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t val code = s"for ($codeInit$codeCond;$codeIter)" val forNode = controlStructureNode(forStmt, ControlStructureTypes.FOR, code) - val initAstBlock = blockNode(forStmt, Defines.empty, registerType(Defines.voidTypeName)) + val initAstBlock = blockNode(forStmt, Defines.Empty, registerType(Defines.Void)) scope.pushNewScope(initAstBlock) val initAst = blockAst(initAstBlock, nullSafeAst(forStmt.getInitializerStatement, 1).toList) scope.popScope() @@ -259,7 +279,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t (c, compareAst) case s: CPPASTIfStatement if s.getConditionExpression == null => val c = s"if (${nullSafeCode(s.getConditionDeclaration)})" - val exprBlock = blockNode(s.getConditionDeclaration, Defines.empty, Defines.voidTypeName) + val exprBlock = blockNode(s.getConditionDeclaration, Defines.Empty, Defines.Void) scope.pushNewScope(exprBlock) val a = astsForDeclaration(s.getConditionDeclaration) setArgumentIndices(a) @@ -272,7 +292,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t val thenAst = ifStmt.getThenClause match { case block: IASTCompoundStatement => astForBlockStatement(block) case other if other != null => - val thenBlock = blockNode(other, Defines.empty, Defines.voidTypeName) + val thenBlock = blockNode(other, Defines.Empty, Defines.Void) scope.pushNewScope(thenBlock) val a = astsForStatement(other) setArgumentIndices(a) @@ -288,7 +308,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t Ast(elseNode).withChild(elseAst) case other if other != null => val elseNode = controlStructureNode(ifStmt.getElseClause, ControlStructureTypes.ELSE, "else") - val elseBlock = blockNode(other, Defines.empty, Defines.voidTypeName) + val elseBlock = blockNode(other, Defines.Empty, Defines.Void) scope.pushNewScope(elseBlock) val a = astsForStatement(other) setArgumentIndices(a) diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForTypesCreator.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForTypesCreator.scala index 8bfbf0a2e05a..d4154f13d58d 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForTypesCreator.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstForTypesCreator.scala @@ -3,12 +3,15 @@ package io.joern.c2cpg.astcreation import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.Defines as X2CpgDefines import org.eclipse.cdt.core.dom.ast.* import org.eclipse.cdt.core.dom.ast.cpp.* import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTAliasDeclaration import org.eclipse.cdt.internal.core.model.ASTStringUtil import io.joern.x2cpg.datastructures.Stack.* +import scala.util.Try + trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => private def parentIsClassDef(node: IASTNode): Boolean = Option(node.getParent) match { @@ -19,7 +22,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: private def isTypeDef(decl: IASTSimpleDeclaration): Boolean = code(decl).startsWith("typedef") - protected def templateParameters(e: IASTNode): Option[String] = { + private def templateParameters(e: IASTNode): Option[String] = { val templateDeclaration = e match { case _: IASTElaboratedTypeSpecifier | _: IASTFunctionDeclarator | _: IASTCompositeTypeSpecifier if e.getParent != null => @@ -34,11 +37,10 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: } private def astForNamespaceDefinition(namespaceDefinition: ICPPASTNamespaceDefinition): Ast = { - val (name, fullname) = - uniqueName("namespace", namespaceDefinition.getName.getLastName.toString, fullName(namespaceDefinition)) - val codeString = code(namespaceDefinition) + val TypeFullNameInfo(name, fullName) = typeFullNameInfo(namespaceDefinition) + val codeString = code(namespaceDefinition) val cpgNamespace = - newNamespaceBlockNode(namespaceDefinition, name, fullname, codeString, fileName(namespaceDefinition)) + newNamespaceBlockNode(namespaceDefinition, name, fullName, codeString, fileName(namespaceDefinition)) scope.pushNewScope(cpgNamespace) val childrenAsts = namespaceDefinition.getDeclarations.flatMap { decl => @@ -52,15 +54,12 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: } protected def astForNamespaceAlias(namespaceAlias: ICPPASTNamespaceAlias): Ast = { - val name = ASTStringUtil.getSimpleName(namespaceAlias.getAlias) - val fullname = fullName(namespaceAlias) - + val TypeFullNameInfo(name, fullName) = typeFullNameInfo(namespaceAlias) if (!isQualifiedName(name)) { - usingDeclarationMappings.put(name, fullname) + usingDeclarationMappings.put(name, fullName) } - val codeString = code(namespaceAlias) - val cpgNamespace = newNamespaceBlockNode(namespaceAlias, name, fullname, codeString, fileName(namespaceAlias)) + val cpgNamespace = newNamespaceBlockNode(namespaceAlias, name, fullName, codeString, fileName(namespaceAlias)) Ast(cpgNamespace) } @@ -69,8 +68,22 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: declaration match { case d if isTypeDef(d) && shortName(d.getDeclSpecifier).nonEmpty => val filename = fileName(declaration) - val tpe = registerType(typeFor(declarator)) - Ast(typeDeclNode(declarator, name, registerType(name), filename, code(d), alias = Option(tpe))) + val typeDefName = if (name.isEmpty) { + Try(declarator.getName.resolveBinding()).toOption.map(b => registerType(b.getName)) + } else { + Option(registerType(name)) + } + val tpe = registerType(typeFor(declarator)) + Ast( + typeDeclNode( + declarator, + typeDefName.getOrElse(name), + typeDefName.getOrElse(name), + filename, + code(d), + alias = Option(tpe) + ) + ) case d if parentIsClassDef(d) => val tpe = declarator match { case _: IASTArrayDeclarator => registerType(typeFor(declarator)) @@ -99,19 +112,36 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: case i: IASTEqualsInitializer => val operatorName = Operators.assignment val callNode_ = - callNode(declarator, code(declarator), operatorName, operatorName, DispatchTypes.STATIC_DISPATCH) + callNode( + declarator, + code(declarator), + operatorName, + operatorName, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val left = astForNode(declarator.getName) val right = astForNode(i.getInitializerClause) callAst(callNode_, List(left, right)) case i: ICPPASTConstructorInitializer => - val name = ASTStringUtil.getSimpleName(declarator.getName) - val callNode_ = callNode(declarator, code(declarator), name, name, DispatchTypes.STATIC_DISPATCH) - val args = i.getArguments.toList.map(x => astForNode(x)) + val name = ASTStringUtil.getSimpleName(declarator.getName) + val callNode_ = + callNode(declarator, code(declarator), name, name, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) + val args = i.getArguments.toList.map(x => astForNode(x)) callAst(callNode_, args) case i: IASTInitializerList => val operatorName = Operators.assignment val callNode_ = - callNode(declarator, code(declarator), operatorName, operatorName, DispatchTypes.STATIC_DISPATCH) + callNode( + declarator, + code(declarator), + operatorName, + operatorName, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val left = astForNode(declarator.getName) val right = astForNode(i) callAst(callNode_, List(left, right)) @@ -151,7 +181,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: protected def astForASMDeclaration(asm: IASTASMDeclaration): Ast = Ast(unknownNode(asm, code(asm))) private def astForStructuredBindingDeclaration(decl: ICPPASTStructuredBindingDeclaration): Ast = { - val node = blockNode(decl, Defines.empty, Defines.voidTypeName) + val node = blockNode(decl, Defines.Empty, Defines.Void) scope.pushNewScope(node) val childAsts = decl.getNames.toList.map { name => astForNode(name) @@ -212,8 +242,9 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: case d: IASTDeclarator if d.getInitializer != null => astForInitializer(d, d.getInitializer) case arrayDecl: IASTArrayDeclarator => - val op = Operators.arrayInitializer - val initCallNode = callNode(arrayDecl, code(arrayDecl), op, op, DispatchTypes.STATIC_DISPATCH) + val op = Operators.arrayInitializer + val initCallNode = + callNode(arrayDecl, code(arrayDecl), op, op, DispatchTypes.STATIC_DISPATCH, None, Some(X2CpgDefines.Any)) val initArgs = arrayDecl.getArrayModifiers.toList.filter(m => m.getConstantExpression != null).map(astForNode) callAst(initCallNode, initArgs) @@ -235,25 +266,21 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: astForDeclarator(typeSpecifier.getParent.asInstanceOf[IASTSimpleDeclaration], d, i) } - val lineNumber = line(typeSpecifier) - val columnNumber = column(typeSpecifier) - val fullname = registerType(cleanType(fullName(typeSpecifier))) - val name = ASTStringUtil.getSimpleName(typeSpecifier.getName) match { - case n if n.isEmpty => lastNameOfQualifiedName(fullname) - case other => other - } - val codeString = code(typeSpecifier) - val nameAlias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) - val nameWithTemplateParams = templateParameters(typeSpecifier).map(t => registerType(s"$fullname$t")) - val alias = (nameAlias.toList ++ nameWithTemplateParams.toList).headOption + val lineNumber = line(typeSpecifier) + val columnNumber = column(typeSpecifier) + val TypeFullNameInfo(name, fullName) = typeFullNameInfo(typeSpecifier) + val codeString = code(typeSpecifier) + val nameAlias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) + val nameWithTemplateParams = templateParameters(typeSpecifier).map(t => registerType(s"$fullName$t")) + val alias = (nameAlias.toList ++ nameWithTemplateParams.toList).headOption val typeDecl = typeSpecifier match { case cppClass: ICPPASTCompositeTypeSpecifier => val baseClassList = cppClass.getBaseSpecifiers.toSeq.map(s => registerType(s.getNameSpecifier.toString)) - typeDeclNode(typeSpecifier, name, fullname, filename, codeString, inherits = baseClassList, alias = alias) + typeDeclNode(typeSpecifier, name, fullName, filename, codeString, inherits = baseClassList, alias = alias) case _ => - typeDeclNode(typeSpecifier, name, fullname, filename, codeString, alias = alias) + typeDeclNode(typeSpecifier, name, fullName, filename, codeString, alias = alias) } methodAstParentStack.push(typeDecl) @@ -270,9 +297,9 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: } else { val init = staticInitMethodAst( calls, - s"$fullname:${io.joern.x2cpg.Defines.StaticInitMethodName}", + s"$fullName.${io.joern.x2cpg.Defines.StaticInitMethodName}", None, - Defines.anyTypeName, + Defines.Any, Some(filename), lineNumber, columnNumber @@ -289,16 +316,11 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: val declAsts = decls.zipWithIndex.map { case (d, i) => astForDeclarator(typeSpecifier.getParent.asInstanceOf[IASTSimpleDeclaration], d, i) } - - val name = ASTStringUtil.getSimpleName(typeSpecifier.getName) - val fullname = registerType(cleanType(fullName(typeSpecifier))) - val nameAlias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) - val nameWithTemplateParams = templateParameters(typeSpecifier).map(t => registerType(s"$fullname$t")) - val alias = (nameAlias.toList ++ nameWithTemplateParams.toList).headOption - - val typeDecl = - typeDeclNode(typeSpecifier, name, fullname, filename, code(typeSpecifier), alias = alias) - + val TypeFullNameInfo(name, fullName) = typeFullNameInfo(typeSpecifier) + val nameAlias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) + val nameWithTemplateParams = templateParameters(typeSpecifier).map(t => registerType(s"$fullName$t")) + val alias = (nameAlias.toList ++ nameWithTemplateParams.toList).headOption + val typeDecl = typeDeclNode(typeSpecifier, name, fullName, filename, code(typeSpecifier), alias = alias) Ast(typeDecl) +: declAsts } @@ -318,7 +340,15 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: if (enumerator.getValue != null) { val operatorName = Operators.assignment val callNode_ = - callNode(enumerator, code(enumerator), operatorName, operatorName, DispatchTypes.STATIC_DISPATCH) + callNode( + enumerator, + code(enumerator), + operatorName, + operatorName, + DispatchTypes.STATIC_DISPATCH, + None, + Some(X2CpgDefines.Any) + ) val left = astForNode(enumerator.getName) val right = astForNode(enumerator.getValue) val ast = callAst(callNode_, List(left, right)) @@ -334,15 +364,14 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: astForDeclarator(typeSpecifier.getParent.asInstanceOf[IASTSimpleDeclaration], d, i) } - val lineNumber = line(typeSpecifier) - val columnNumber = column(typeSpecifier) - val (name, fullname) = - uniqueName("enum", ASTStringUtil.getSimpleName(typeSpecifier.getName), fullName(typeSpecifier)) - val alias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) + val lineNumber = line(typeSpecifier) + val columnNumber = column(typeSpecifier) + val TypeFullNameInfo(name, fullName) = typeFullNameInfo(typeSpecifier) + val alias = decls.headOption.map(d => registerType(shortName(d))).filter(_.nonEmpty) val (deAliasedName, deAliasedFullName, newAlias) = if (name.contains("anonymous_enum") && alias.isDefined) { - (alias.get, fullname.substring(0, fullname.indexOf("anonymous_enum")) + alias.get, None) - } else { (name, fullname, alias) } + (alias.get, fullName.substring(0, fullName.indexOf("anonymous_enum")) + alias.get, None) + } else { (name, fullName, alias) } val typeDecl = typeDeclNode( @@ -370,7 +399,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: calls, s"$deAliasedFullName:${io.joern.x2cpg.Defines.StaticInitMethodName}", None, - Defines.anyTypeName, + Defines.Any, Some(filename), lineNumber, columnNumber diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstNodeBuilder.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstNodeBuilder.scala index f3d7316835f2..5499f2d655a4 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstNodeBuilder.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/AstNodeBuilder.scala @@ -1,12 +1,12 @@ package io.joern.c2cpg.astcreation -import io.joern.x2cpg.utils.NodeBuilders.{newMethodReturnNode => newMethodReturnNode_} -import io.shiftleft.codepropertygraph.generated.nodes._ -import org.eclipse.cdt.core.dom.ast.{IASTLabelStatement, IASTNode} -import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement +import io.shiftleft.codepropertygraph.generated.nodes.* +import org.eclipse.cdt.core.dom.ast.IASTLabelStatement +import org.eclipse.cdt.core.dom.ast.IASTNode import org.eclipse.cdt.internal.core.model.ASTStringUtil trait AstNodeBuilder { this: AstCreator => + protected def newCommentNode(node: IASTNode, code: String, filename: String): NewComment = { NewComment().code(code).filename(filename).lineNumber(line(node)).columnNumber(column(node)) } @@ -14,7 +14,7 @@ trait AstNodeBuilder { this: AstCreator => protected def newNamespaceBlockNode( node: IASTNode, name: String, - fullname: String, + fullName: String, code: String, filename: String ): NewNamespaceBlock = { @@ -24,12 +24,7 @@ trait AstNodeBuilder { this: AstCreator => .columnNumber(column(node)) .filename(filename) .name(name) - .fullName(fullname) - } - - // TODO: We should get rid of this method as its being used at multiple places and use it from x2cpg/AstNodeBuilder "methodReturnNode" - protected def newMethodReturnNode(node: IASTNode, typeFullName: String): NewMethodReturn = { - newMethodReturnNode_(typeFullName, None, line(node), column(node)) + .fullName(fullName) } protected def newJumpTargetNode(node: IASTNode): NewJumpTarget = { diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/CGlobal.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/CGlobal.scala new file mode 100644 index 000000000000..bb417bd27a9a --- /dev/null +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/CGlobal.scala @@ -0,0 +1,43 @@ +package io.joern.c2cpg.astcreation + +import io.joern.x2cpg.datastructures.Global +import java.util.concurrent.ConcurrentHashMap + +object CGlobal { + + final case class MethodInfo( + name: String, + code: String, + fileName: String, + returnType: String, + astParentType: String, + astParentFullName: String, + lineNumber: Option[Int], + columnNumber: Option[Int], + lineNumberEnd: Option[Int], + columnNumberEnd: Option[Int], + signature: String, + offset: Option[(Int, Int)], + parameter: Seq[ParameterInfo], + modifier: Seq[String] + ) + final class ParameterInfo( + val name: String, + var code: String, + val index: Int, + var isVariadic: Boolean, + val evaluationStrategy: String, + val lineNumber: Option[Int], + val columnNumber: Option[Int], + val typeFullName: String + ) + +} + +class CGlobal extends Global { + import io.joern.c2cpg.astcreation.CGlobal.MethodInfo + + val methodDeclarations: ConcurrentHashMap[String, MethodInfo] = new ConcurrentHashMap() + val methodDefinitions: ConcurrentHashMap[String, Boolean] = new ConcurrentHashMap() + +} diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/Defines.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/Defines.scala index 924d9645cab5..612200d00f18 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/Defines.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/Defines.scala @@ -1,8 +1,23 @@ package io.joern.c2cpg.astcreation object Defines { - val anyTypeName: String = "ANY" - val voidTypeName: String = "void" - val qualifiedNameSeparator: String = "::" - val empty = "" + val Any: String = "ANY" + val Void: String = "void" + val Function: String = "std.function" + val Array: String = "std.array" + val QualifiedNameSeparator: String = "::" + val Empty = "" + + val OperatorPointerCall = ".pointerCall" + val OperatorConstructorInitializer = ".constructorInitializer" + val OperatorTypeOf = ".typeOf" + val OperatorMax = ".max" + val OperatorMin = ".min" + val OperatorEllipses = ".op_ellipses" + val OperatorUnknown = ".unknown" + val OperatorCall = "()" + val OperatorExpressionList = ".expressionList" + val OperatorNew = ".new" + val OperatorThrow = ".throw" + val OperatorBracketedPrimary = ".bracketedPrimary" } diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/FullNameProvider.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/FullNameProvider.scala new file mode 100644 index 000000000000..2ac5bc00ba6b --- /dev/null +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/FullNameProvider.scala @@ -0,0 +1,354 @@ +package io.joern.c2cpg.astcreation + +import org.apache.commons.lang3.StringUtils +import org.eclipse.cdt.core.dom.ast.* +import org.eclipse.cdt.core.dom.ast.cpp.* +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression +import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinding +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPFunction +import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVariable +import org.eclipse.cdt.internal.core.model.ASTStringUtil +import io.joern.x2cpg.Defines as X2CpgDefines +import org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionDeclarator +import org.eclipse.cdt.internal.core.dom.parser.c.CVariable + +trait FullNameProvider { this: AstCreator => + + protected type MethodLike = IASTFunctionDeclarator | IASTFunctionDefinition | ICPPASTLambdaExpression + + protected type TypeLike = IASTEnumerationSpecifier | ICPPASTNamespaceDefinition | ICPPASTNamespaceAlias | + IASTCompositeTypeSpecifier | IASTElaboratedTypeSpecifier + + protected def fixQualifiedName(name: String): String = { + if (name.isEmpty) { name } + else { + val normalizedName = StringUtils.normalizeSpace(name) + normalizedName.stripPrefix(Defines.QualifiedNameSeparator).replace(Defines.QualifiedNameSeparator, ".") + } + } + + protected def isQualifiedName(name: String): Boolean = + name.startsWith(Defines.QualifiedNameSeparator) + + protected def lastNameOfQualifiedName(name: String): String = { + val normalizedName = StringUtils.normalizeSpace(name) + val cleanedName = if (normalizedName.contains("<") && normalizedName.contains(">")) { + name.substring(0, normalizedName.indexOf("<")) + } else { + normalizedName + } + cleanedName.split(Defines.QualifiedNameSeparator).lastOption.getOrElse(cleanedName) + } + + protected def methodFullNameInfo(methodLike: MethodLike): MethodFullNameInfo = { + val returnType_ = returnType(methodLike) + val signature_ = signature(returnType_, methodLike) + val name_ = shortName(methodLike) + val fullName_ = fullName(methodLike) + val sanitizedFullName = sanitizeMethodLikeFullName(name_, fullName_, signature_, methodLike) + MethodFullNameInfo(name_, sanitizedFullName, signature_, returnType_) + } + + protected def typeFullNameInfo(typeLike: TypeLike): TypeFullNameInfo = { + typeLike match { + case e: IASTElaboratedTypeSpecifier => + val name_ = shortName(typeLike) + val fullName_ = registerType(cleanType(fullName(typeLike))) + TypeFullNameInfo(name_, fullName_) + case e: IASTEnumerationSpecifier => + val name_ = shortName(e) + val fullName_ = fullName(e) + val (uniqueName_, uniqueNameFullName_) = uniqueName("enum", name_, fullName_) + TypeFullNameInfo(uniqueName_, uniqueNameFullName_) + case n: ICPPASTNamespaceDefinition => + val name_ = shortName(n) + val fullName_ = fullName(n) + val (uniqueName_, uniqueNameFullName_) = uniqueName("namespace", name_, fullName_) + TypeFullNameInfo(uniqueName_, uniqueNameFullName_) + case a: ICPPASTNamespaceAlias => + val name_ = shortName(a) + val fullName_ = fullName(a) + TypeFullNameInfo(name_, fullName_) + case s: IASTCompositeTypeSpecifier => + val fullName_ = registerType(cleanType(fullName(s))) + val name_ = shortName(s) match { + case n if n.isEmpty => lastNameOfQualifiedName(fullName_) + case other => other + } + TypeFullNameInfo(name_, fullName_) + } + } + + protected def shortName(node: IASTNode): String = { + val name = node match { + case s: IASTSimpleDeclSpecifier => s.getRawSignature + case d: IASTDeclarator => shortNameForIASTDeclarator(d) + case f: ICPPASTFunctionDefinition => shortNameForICPPASTFunctionDefinition(f) + case f: IASTFunctionDefinition => shortNameForIASTFunctionDefinition(f) + case u: IASTUnaryExpression => shortName(u.getOperand) + case c: IASTFunctionCallExpression => shortName(c.getFunctionNameExpression) + case d: CPPASTIdExpression => shortNameForCPPASTIdExpression(d) + case d: IASTIdExpression => shortNameForIASTIdExpression(d) + case a: ICPPASTNamespaceAlias => ASTStringUtil.getSimpleName(a.getAlias) + case n: ICPPASTNamespaceDefinition => ASTStringUtil.getSimpleName(n.getName) + case e: IASTEnumerationSpecifier => ASTStringUtil.getSimpleName(e.getName) + case c: IASTCompositeTypeSpecifier => ASTStringUtil.getSimpleName(c.getName) + case e: IASTElaboratedTypeSpecifier => ASTStringUtil.getSimpleName(e.getName) + case s: IASTNamedTypeSpecifier => ASTStringUtil.getSimpleName(s.getName) + case l: ICPPASTLambdaExpression => nextClosureName() + case other => + notHandledYet(other) + nextClosureName() + } + StringUtils.normalizeSpace(name) + } + + protected def fullName(node: IASTNode): String = { + fullNameFromBinding(node) match { + case Some(fullName) => + StringUtils.normalizeSpace(fullName) + case None => + val qualifiedName = node match { + case _: IASTTranslationUnit => "" + case alias: ICPPASTNamespaceAlias => ASTStringUtil.getQualifiedName(alias.getMappingName) + case namespace: ICPPASTNamespaceDefinition => fullNameForICPPASTNamespaceDefinition(namespace) + case compType: IASTCompositeTypeSpecifier => fullNameForIASTCompositeTypeSpecifier(compType) + case enumSpecifier: IASTEnumerationSpecifier => fullNameForIASTEnumerationSpecifier(enumSpecifier) + case f: ICPPASTLambdaExpression => fullName(f.getParent) + case f: IASTFunctionDeclarator => fullNameForIASTFunctionDeclarator(f) + case f: IASTFunctionDefinition => fullNameForIASTFunctionDefinition(f) + case e: IASTElaboratedTypeSpecifier => fullNameForIASTElaboratedTypeSpecifier(e) + case d: IASTIdExpression => ASTStringUtil.getSimpleName(d.getName) + case u: IASTUnaryExpression => code(u.getOperand) + case x: ICPPASTQualifiedName => ASTStringUtil.getQualifiedName(x) + case other if other != null && other.getParent != null => fullName(other.getParent) + case other if other != null => notHandledYet(other); "" + case null => "" + } + fixQualifiedName(qualifiedName).stripPrefix(".") + } + } + + private def isCPPFunction(methodLike: MethodLike): Boolean = { + methodLike.isInstanceOf[CPPASTFunctionDeclarator] || methodLike.isInstanceOf[CPPASTFunctionDefinition] + } + + private def sanitizeMethodLikeFullName( + name: String, + fullName: String, + signature: String, + methodLike: MethodLike + ): String = { + fullName match { + case f if methodLike.isInstanceOf[ICPPASTLambdaExpression] && (f.contains("[") || f.contains("{")) => + s"${X2CpgDefines.UnresolvedNamespace}.$name" + case f if methodLike.isInstanceOf[ICPPASTLambdaExpression] && f.isEmpty => + name + case f if methodLike.isInstanceOf[ICPPASTLambdaExpression] => + s"$f.$name" + case f if isCPPFunction(methodLike) && (f.isEmpty || f == s"${X2CpgDefines.UnresolvedNamespace}.") => + s"${X2CpgDefines.UnresolvedNamespace}.$name:$signature" + case f if isCPPFunction(methodLike) && f.contains("?") => + s"${StringUtils.normalizeSpace(f).takeWhile(_ != ':')}:$signature" + case f if f.isEmpty || f == s"${X2CpgDefines.UnresolvedNamespace}." => + s"${X2CpgDefines.UnresolvedNamespace}.$name" + case other if other.nonEmpty => other + case other => s"${X2CpgDefines.UnresolvedNamespace}.$name" + } + } + + private def returnTypeForIASTFunctionDeclarator(declarator: IASTFunctionDeclarator): String = { + cleanType(typeForDeclSpecifier(declarator.getParent.asInstanceOf[IASTSimpleDeclaration].getDeclSpecifier)) + } + + private def returnTypeForIASTFunctionDefinition(definition: IASTFunctionDefinition): String = { + if (isCppConstructor(definition)) { + typeFor(definition.asInstanceOf[CPPASTFunctionDefinition].getMemberInitializers.head.getInitializer) + } else { + typeForDeclSpecifier(definition.getDeclSpecifier) + } + } + + private def returnTypeForICPPASTLambdaExpression(lambda: ICPPASTLambdaExpression): String = { + lambda.getDeclarator match { + case declarator: IASTDeclarator => + Option(declarator.getTrailingReturnType) + .map(id => typeForDeclSpecifier(id.getDeclSpecifier)) + .getOrElse(Defines.Any) + case null => Defines.Any + } + } + + private def returnType(methodLike: MethodLike): String = { + methodLike match { + case declarator: IASTFunctionDeclarator => returnTypeForIASTFunctionDeclarator(declarator) + case definition: IASTFunctionDefinition => returnTypeForIASTFunctionDefinition(definition) + case lambda: ICPPASTLambdaExpression => returnTypeForICPPASTLambdaExpression(lambda) + } + } + + private def parameterListSignature(func: IASTNode): String = { + val variadic = if (isVariadic(func)) "..." else "" + val elements = parameters(func).map { + case p: IASTParameterDeclaration => typeForDeclSpecifier(p.getDeclSpecifier) + case other => typeForDeclSpecifier(other) + } + s"(${elements.mkString(",")}$variadic)" + } + + private def signature(returnType: String, methodLike: MethodLike): String = { + StringUtils.normalizeSpace(s"$returnType${parameterListSignature(methodLike)}") + } + + private def shortNameForIASTDeclarator(declarator: IASTDeclarator): String = { + if (ASTStringUtil.getSimpleName(declarator.getName).isEmpty && declarator.getNestedDeclarator != null) { + shortName(declarator.getNestedDeclarator) + } else { + ASTStringUtil.getSimpleName(declarator.getName) + } + } + + private def shortNameForICPPASTFunctionDefinition(definition: ICPPASTFunctionDefinition): String = { + if ( + ASTStringUtil.getSimpleName(definition.getDeclarator.getName).isEmpty + && definition.getDeclarator.getNestedDeclarator != null + ) { + shortName(definition.getDeclarator.getNestedDeclarator) + } else { + lastNameOfQualifiedName(ASTStringUtil.getSimpleName(definition.getDeclarator.getName)) + } + } + + private def shortNameForIASTFunctionDefinition(definition: IASTFunctionDefinition): String = { + if ( + ASTStringUtil.getSimpleName(definition.getDeclarator.getName).isEmpty + && definition.getDeclarator.getNestedDeclarator != null + ) { + shortName(definition.getDeclarator.getNestedDeclarator) + } else { + ASTStringUtil.getSimpleName(definition.getDeclarator.getName) + } + } + + private def shortNameForCPPASTIdExpression(d: CPPASTIdExpression): String = { + val name = safeGetEvaluation(d) match { + case Some(evalBinding: EvalBinding) => + evalBinding.getBinding match { + case f: CPPFunction if f.getDeclarations != null => + f.getDeclarations.headOption.map(n => ASTStringUtil.getSimpleName(n.getName)).getOrElse(f.getName) + case f: CPPFunction if f.getDefinition != null => ASTStringUtil.getSimpleName(f.getDefinition.getName) + case other => other.getName + } + case _ => ASTStringUtil.getSimpleName(d.getName) + } + lastNameOfQualifiedName(name) + } + + private def shortNameForIASTIdExpression(d: IASTIdExpression): String = { + lastNameOfQualifiedName(ASTStringUtil.getSimpleName(d.getName)) + } + + private def fullNameFromBinding(node: IASTNode): Option[String] = { + node match { + case id: CPPASTIdExpression => + safeGetEvaluation(id) match { + case Some(evalBinding: EvalBinding) => + evalBinding.getBinding match { + case f: CPPFunction if f.getDeclarations != null => + Option(f.getDeclarations.headOption.map(n => s"${fullName(n)}").getOrElse(f.getName)) + case f: CPPFunction if f.getDefinition != null => + Option(s"${fullName(f.getDefinition)}") + case other => + Option(other.getName) + } + case _ => None + } + case declarator: CPPASTFunctionDeclarator => + declarator.getName.resolveBinding() match { + case function: ICPPFunction => + val fullNameNoSig = function.getQualifiedName.mkString(".") + val fn = if (function.isExternC) { + function.getName + } else { + s"$fullNameNoSig:${functionTypeToSignature(function.getType)}" + } + Option(fn) + case x @ (_: ICPPField | _: CPPVariable) => + val fullNameNoSig = x.getQualifiedName.mkString(".") + val fn = if (x.isExternC) { + x.getName + } else { + s"$fullNameNoSig:${cleanType(safeGetType(x.getType))}" + } + Option(fn) + case _: IProblemBinding => + val fullNameNoSig = ASTStringUtil.getQualifiedName(declarator.getName) + val fixedFullName = fixQualifiedName(fullNameNoSig).stripPrefix(".") + if (fixedFullName.isEmpty) { + Option(s"${X2CpgDefines.UnresolvedNamespace}:${X2CpgDefines.UnresolvedSignature}") + } else { + Option(s"$fixedFullName:${X2CpgDefines.UnresolvedSignature}") + } + case _ => None + } + case declarator: CASTFunctionDeclarator => + declarator.getName.resolveBinding() match { + case cVariable: CVariable => Option(cVariable.getName) + case _ => Option(declarator.getName.toString) + } + case definition: ICPPASTFunctionDefinition => + Option(fullName(definition.getDeclarator)) + case _ => None + } + } + + private def fullNameForICPPASTNamespaceDefinition(namespace: ICPPASTNamespaceDefinition): String = { + s"${fullName(namespace.getParent)}.${ASTStringUtil.getSimpleName(namespace.getName)}" + } + + private def fullNameForIASTCompositeTypeSpecifier(compType: IASTCompositeTypeSpecifier): String = { + if (ASTStringUtil.getSimpleName(compType.getName).nonEmpty) { + s"${fullName(compType.getParent)}.${ASTStringUtil.getSimpleName(compType.getName)}" + } else { + val name = compType.getParent match { + case decl: IASTSimpleDeclaration => + decl.getDeclarators.headOption + .map(n => ASTStringUtil.getSimpleName(n.getName)) + .getOrElse(uniqueName("composite_type", "", "")._1) + case _ => uniqueName("composite_type", "", "")._1 + } + s"${fullName(compType.getParent)}.$name" + } + } + + private def fullNameForIASTEnumerationSpecifier(enumSpecifier: IASTEnumerationSpecifier): String = { + s"${fullName(enumSpecifier.getParent)}.${ASTStringUtil.getSimpleName(enumSpecifier.getName)}" + } + + private def fullNameForIASTFunctionDeclarator(f: IASTFunctionDeclarator): String = { + if (f.getParent.isInstanceOf[IASTFunctionDefinition]) { + s"${fullName(f.getParent)}" + } else { + s"${fullName(f.getParent)}.${shortName(f)}" + } + } + + private def fullNameForIASTFunctionDefinition(f: IASTFunctionDefinition): String = { + if (f.getDeclarator != null) { + ASTStringUtil.getQualifiedName(f.getDeclarator.getName) + } else { + s"${fullName(f.getParent)}.${shortName(f)}" + } + } + + private def fullNameForIASTElaboratedTypeSpecifier(e: IASTElaboratedTypeSpecifier): String = { + s"${fullName(e.getParent)}.${ASTStringUtil.getSimpleName(e.getName)}" + } + + protected final case class MethodFullNameInfo(name: String, fullName: String, signature: String, returnType: String) + + protected final case class TypeFullNameInfo(name: String, fullName: String) + +} diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/MacroHandler.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/MacroHandler.scala index 9001ddcd0855..61394858a887 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/MacroHandler.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/astcreation/MacroHandler.scala @@ -1,18 +1,20 @@ package io.joern.c2cpg.astcreation +import io.joern.x2cpg.Ast +import io.joern.x2cpg.AstEdge +import io.joern.x2cpg.ValidationMode import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.codepropertygraph.generated.nodes.{ - AstNodeNew, - ExpressionNew, - NewBlock, - NewCall, - NewFieldIdentifier, - NewNode -} -import io.joern.x2cpg.{Ast, AstEdge, ValidationMode} +import io.shiftleft.codepropertygraph.generated.nodes.AstNodeNew +import io.shiftleft.codepropertygraph.generated.nodes.ExpressionNew +import io.shiftleft.codepropertygraph.generated.nodes.NewBlock +import io.shiftleft.codepropertygraph.generated.nodes.NewCall +import io.shiftleft.codepropertygraph.generated.nodes.NewFieldIdentifier +import io.shiftleft.codepropertygraph.generated.nodes.NewNode import io.shiftleft.codepropertygraph.generated.nodes.NewLocal import org.apache.commons.lang3.StringUtils -import org.eclipse.cdt.core.dom.ast.{IASTMacroExpansionLocation, IASTNode, IASTPreprocessorMacroDefinition} +import org.eclipse.cdt.core.dom.ast.IASTMacroExpansionLocation +import org.eclipse.cdt.core.dom.ast.IASTNode +import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression import org.eclipse.cdt.internal.core.model.ASTStringUtil @@ -45,18 +47,19 @@ trait MacroHandler(implicit withSchemaValidation: ValidationMode) { this: AstCre val macroCallAst = matchingMacro.map { case (mac, args) => createMacroCallAst(ast, node, mac, args) } macroCallAst match { case Some(callAst) => - val lostLocals = ast.refEdges.collect { case AstEdge(_, dst: NewLocal) => Ast(dst) }.toList - val newAst = ast.subTreeCopy(ast.root.get.asInstanceOf[AstNodeNew], argIndex = 1) + val newAst = ast.subTreeCopy(ast.root.get.asInstanceOf[AstNodeNew], argIndex = 1) // We need to wrap the copied AST as it may contain CPG nodes not being allowed // to be connected via AST edges under a CALL. E.g., LOCALs but only if its not already a BLOCK. val childAst = newAst.root match { - case Some(_: NewBlock) => - newAst - case _ => - val b = NewBlock().argumentIndex(1).typeFullName(registerType(Defines.voidTypeName)) - blockAst(b, List(newAst)) + case Some(_: NewBlock) => newAst + case _ => blockAst(blockNode(node), List(newAst)) } - callAst.withChildren(lostLocals).withChild(childAst) + val lostLocals = ast.edges.collect { + case AstEdge(_, dst: NewLocal) if !newAst.edges.exists(_.dst == dst) => Ast(dst) + }.distinct + val childrenAsts = lostLocals :+ childAst + setArgumentIndices(childrenAsts.toList) + callAst.withChildren(childrenAsts) case None => ast } } @@ -124,13 +127,14 @@ trait MacroHandler(implicit withSchemaValidation: ValidationMode) { this: AstCre val callName = StringUtils.normalizeSpace(name) val callFullName = StringUtils.normalizeSpace(fullName(macroDef, argAsts)) + val typeFullName = registerType(cleanType(typeFor(node))) val callNode = NewCall() .name(callName) .dispatchType(DispatchTypes.INLINED) .methodFullName(callFullName) .code(code) - .typeFullName(typeFor(node)) + .typeFullName(typeFullName) .lineNumber(line(node)) .columnNumber(column(node)) callAst(callNode, argAsts) diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/parser/HeaderFileFinder.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/parser/HeaderFileFinder.scala index dbc6f36a1be9..af72687a9315 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/parser/HeaderFileFinder.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/parser/HeaderFileFinder.scala @@ -1,6 +1,6 @@ package io.joern.c2cpg.parser -import better.files._ +import better.files.* import io.joern.x2cpg.SourceFiles import org.jline.utils.Levenshtein diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/AstCreationPass.scala index 93e8bb426b36..182be0a18071 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/AstCreationPass.scala @@ -3,29 +3,37 @@ package io.joern.c2cpg.passes import io.joern.c2cpg.C2Cpg.DefaultIgnoredFolders import io.joern.c2cpg.Config import io.joern.c2cpg.astcreation.AstCreator -import io.joern.c2cpg.astcreation.Defines +import io.joern.c2cpg.astcreation.CGlobal import io.joern.c2cpg.parser.{CdtParser, FileDefaults} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.joern.x2cpg.SourceFiles -import io.joern.x2cpg.datastructures.Global import io.joern.x2cpg.utils.Report import io.joern.x2cpg.utils.TimeUtils import java.nio.file.Paths import java.util.concurrent.ConcurrentHashMap +import org.slf4j.{Logger, LoggerFactory} + import scala.util.matching.Regex +import scala.util.{Failure, Success, Try} import scala.jdk.CollectionConverters.* class AstCreationPass(cpg: Cpg, config: Config, report: Report = new Report()) - extends ConcurrentWriterCpgPass[String](cpg) { + extends ForkJoinParallelCpgPass[String](cpg) { + + private val logger: Logger = LoggerFactory.getLogger(classOf[AstCreationPass]) private val file2OffsetTable: ConcurrentHashMap[String, Array[Int]] = new ConcurrentHashMap() private val parser: CdtParser = new CdtParser(config) - private val global = new Global() + private val global = new CGlobal() - def typesSeen(): List[String] = global.usedTypes.keys().asScala.filterNot(_ == Defines.anyTypeName).toList + def typesSeen(): List[String] = global.usedTypes.keys().asScala.toList + + def unhandledMethodDeclarations(): Map[String, CGlobal.MethodInfo] = { + global.methodDeclarations.asScala.toMap -- global.methodDefinitions.asScala.keys + } override def generateParts(): Array[String] = { val sourceFileExtensions = FileDefaults.SOURCE_FILE_EXTENSIONS @@ -61,11 +69,17 @@ class AstCreationPass(cpg: Cpg, config: Config, report: Report = new Report()) parseResult match { case Some(translationUnit) => report.addReportInfo(relPath, fileLOC, parsed = true) - val localDiff = new AstCreator(relPath, global, config, translationUnit, file2OffsetTable)( - config.schemaValidation - ).createAst() - diffGraph.absorb(localDiff) - true + Try { + val localDiff = new AstCreator(relPath, global, config, translationUnit, file2OffsetTable)( + config.schemaValidation + ).createAst() + diffGraph.absorb(localDiff) + } match { + case Failure(exception) => + logger.warn(s"Failed to generate a CPG for: '$filename'", exception) + false + case Success(_) => true + } case None => report.addReportInfo(relPath, fileLOC) false diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/FunctionDeclNodePass.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/FunctionDeclNodePass.scala new file mode 100644 index 000000000000..ceba5ba84df0 --- /dev/null +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/FunctionDeclNodePass.scala @@ -0,0 +1,174 @@ +package io.joern.c2cpg.passes + +import io.joern.c2cpg.astcreation.CGlobal +import io.joern.x2cpg.Ast +import io.joern.x2cpg.Defines +import io.joern.x2cpg.ValidationMode +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.NewBlock +import io.shiftleft.codepropertygraph.generated.nodes.NewMethod +import io.shiftleft.codepropertygraph.generated.nodes.NewMethodParameterIn +import io.shiftleft.codepropertygraph.generated.nodes.NewMethodReturn +import io.shiftleft.codepropertygraph.generated.EvaluationStrategies +import io.shiftleft.codepropertygraph.generated.nodes.NewBinding +import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl +import io.shiftleft.codepropertygraph.generated.EdgeTypes +import io.shiftleft.codepropertygraph.generated.NodeTypes +import io.shiftleft.codepropertygraph.generated.nodes.NewModifier +import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* +import org.apache.commons.lang3.StringUtils + +import scala.collection.immutable.Map + +class FunctionDeclNodePass(cpg: Cpg, methodDeclarations: Map[String, CGlobal.MethodInfo])(implicit + withSchemaValidation: ValidationMode +) extends CpgPass(cpg) { + + private def methodNode(fullName: String, methodNodeInfo: CGlobal.MethodInfo): NewMethod = { + val node_ = + NewMethod() + .name(StringUtils.normalizeSpace(methodNodeInfo.name)) + .code(methodNodeInfo.code) + .fullName(StringUtils.normalizeSpace(fullName)) + .filename(methodNodeInfo.fileName) + .astParentType(methodNodeInfo.astParentType) + .astParentFullName(methodNodeInfo.astParentFullName) + .isExternal(false) + .lineNumber(methodNodeInfo.lineNumber) + .columnNumber(methodNodeInfo.columnNumber) + .lineNumberEnd(methodNodeInfo.lineNumberEnd) + .columnNumberEnd(methodNodeInfo.columnNumberEnd) + .signature(StringUtils.normalizeSpace(methodNodeInfo.signature)) + methodNodeInfo.offset.foreach { case (offset, offsetEnd) => + node_.offset(offset).offsetEnd(offsetEnd) + } + node_ + } + + private def parameterInNode(parameterNodeInfo: CGlobal.ParameterInfo): NewMethodParameterIn = { + NewMethodParameterIn() + .name(parameterNodeInfo.name) + .code(parameterNodeInfo.code) + .index(parameterNodeInfo.index) + .order(parameterNodeInfo.index) + .isVariadic(parameterNodeInfo.isVariadic) + .evaluationStrategy(parameterNodeInfo.evaluationStrategy) + .lineNumber(parameterNodeInfo.lineNumber) + .columnNumber(parameterNodeInfo.columnNumber) + .typeFullName(parameterNodeInfo.typeFullName) + } + + private def methodReturnNode(typeFullName: String, line: Option[Int], column: Option[Int]): NewMethodReturn = + NewMethodReturn() + .typeFullName(typeFullName) + .code("RET") + .evaluationStrategy(EvaluationStrategies.BY_VALUE) + .lineNumber(line) + .columnNumber(column) + + private def typeDeclNode( + name: String, + fullName: String, + filename: String, + code: String, + astParentType: String, + astParentFullName: String, + line: Option[Int], + column: Option[Int], + offset: Option[(Int, Int)] + ): NewTypeDecl = { + val node_ = NewTypeDecl() + .name(name) + .fullName(fullName) + .code(code) + .isExternal(false) + .filename(filename) + .astParentType(astParentType) + .astParentFullName(astParentFullName) + .lineNumber(line) + .columnNumber(column) + offset.foreach { case (offset, offsetEnd) => + node_.offset(offset).offsetEnd(offsetEnd) + } + node_ + } + + private def methodStubAst( + method: NewMethod, + parameters: Seq[Ast], + methodReturn: NewMethodReturn, + modifier: Seq[Ast] + ): Ast = + Ast(method) + .withChildren(parameters) + .withChild(Ast(NewBlock().typeFullName(Defines.Any))) + .withChildren(modifier) + .withChild(Ast(methodReturn)) + + private def createFunctionTypeAndTypeDecl( + methodInfo: CGlobal.MethodInfo, + method: NewMethod, + methodName: String, + methodFullName: String, + signature: String, + dstGraph: DiffGraphBuilder + ): Ast = { + val normalizedName = StringUtils.normalizeSpace(methodName) + val normalizedFullName = StringUtils.normalizeSpace(methodFullName) + + if (methodInfo.astParentType == NodeTypes.TYPE_DECL) { + val parentTypeDecl = cpg.typeDecl.nameExact(methodInfo.astParentFullName).headOption + parentTypeDecl + .map { typeDecl => + val functionBinding = + NewBinding().name(normalizedName).methodFullName(normalizedFullName).signature(signature) + dstGraph.addEdge(typeDecl, functionBinding, EdgeTypes.BINDS) + Ast(functionBinding).withRefEdge(functionBinding, method) + } + .getOrElse(Ast()) + } else { + val typeDecl = typeDeclNode( + normalizedName, + normalizedFullName, + method.filename, + normalizedName, + methodInfo.astParentType, + methodInfo.astParentFullName, + methodInfo.lineNumber, + methodInfo.columnNumber, + methodInfo.offset + ) + Ast.storeInDiffGraph(Ast(typeDecl), dstGraph) + method.astParentFullName = typeDecl.fullName + method.astParentType = typeDecl.label + val functionBinding = NewBinding().name(normalizedName).methodFullName(normalizedFullName).signature(signature) + Ast(functionBinding).withBindsEdge(typeDecl, functionBinding).withRefEdge(functionBinding, method) + } + } + + override def run(dstGraph: DiffGraphBuilder): Unit = { + methodDeclarations.foreach { case (fullName, methodNodeInfo) => + val methodNode_ = methodNode(fullName, methodNodeInfo) + val parameterNodes = methodNodeInfo.parameter.map(p => Ast(parameterInNode(p))) + val stubAst = + methodStubAst( + methodNode_, + parameterNodes, + methodReturnNode(methodNodeInfo.returnType, methodNodeInfo.lineNumber, methodNodeInfo.columnNumber), + methodNodeInfo.modifier.map(m => Ast(NewModifier().modifierType(m))) + ) + val typeDeclAst = createFunctionTypeAndTypeDecl( + methodNodeInfo, + methodNode_, + methodNodeInfo.name, + fullName, + methodNodeInfo.signature, + dstGraph + ) + val ast = stubAst.merge(typeDeclAst) + Ast.storeInDiffGraph(ast, dstGraph) + } + } + +} diff --git a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/TypeDeclNodePass.scala b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/TypeDeclNodePass.scala index e431c01194fb..f4dc1ead9293 100644 --- a/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/TypeDeclNodePass.scala +++ b/joern-cli/frontends/c2cpg/src/main/scala/io/joern/c2cpg/passes/TypeDeclNodePass.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes import io.joern.c2cpg.astcreation.Defines -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.passes.CpgPass @@ -34,8 +34,8 @@ class TypeDeclNodePass(cpg: Cpg)(implicit withSchemaValidation: ValidationMode) .lineNumber(1) .astParentType(NodeTypes.NAMESPACE_BLOCK) .astParentFullName(fullName) - val blockNode = NewBlock().typeFullName(Defines.anyTypeName) - val methodReturn = newMethodReturnNode(Defines.anyTypeName, line = None, column = None) + val blockNode = NewBlock().typeFullName(Defines.Any) + val methodReturn = newMethodReturnNode(Defines.Any, line = None, column = None) Ast(includesFile).withChild( Ast(namespaceBlock) .withChild(Ast(fakeGlobalIncludesMethod).withChild(Ast(blockNode)).withChild(Ast(methodReturn))) diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/DataFlowTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/DataFlowTests.scala index 5d9e0e4cd7be..c288f2d57e75 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/DataFlowTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/DataFlowTests.scala @@ -6,8 +6,7 @@ import io.joern.dataflowengineoss.queryengine.{EngineConfig, EngineContext} import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{CfgNode, Identifier, Literal} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Table.AvailableWidthProvider -import overflowdb.traversal.toNodeTraversal +import flatgraph.help.Table.AvailableWidthProvider class DataFlowTests extends DataFlowCodeToCpgSuite { @@ -1082,7 +1081,7 @@ class DataFlowTests extends DataFlowCodeToCpgSuite { cpg .call("bar") .outE(EdgeTypes.REACHING_DEF) - .count(_.inNode() == cpg.ret.head) shouldBe 1 + .count(_.dst == cpg.ret.head) shouldBe 1 } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/ReachingDefTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/ReachingDefTests.scala index c1c41699ed98..c8c0771dc094 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/ReachingDefTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/dataflow/ReachingDefTests.scala @@ -3,7 +3,7 @@ package io.joern.c2cpg.dataflow import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite import io.joern.dataflowengineoss.passes.reachingdef.ReachingDefFlowGraph import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ReachingDefTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/CodeDumperFromFileTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/CodeDumperFromFileTests.scala index e05a794841d5..fcd7e87c1502 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/CodeDumperFromFileTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/CodeDumperFromFileTests.scala @@ -3,7 +3,7 @@ package io.joern.c2cpg.io import better.files.File import io.joern.c2cpg.testfixtures.C2CpgSuite import io.shiftleft.semanticcpg.codedumper.CodeDumper -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.util.regex.Pattern diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/ExcludeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/ExcludeTests.scala index 4d750ebda36e..09c8dad7fe05 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/ExcludeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/ExcludeTests.scala @@ -4,7 +4,7 @@ import better.files.File import io.joern.c2cpg.Config import io.joern.c2cpg.C2Cpg import io.joern.x2cpg.X2Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import org.scalatest.matchers.should.Matchers import org.scalatest.prop.TableDrivenPropertyChecks @@ -62,6 +62,28 @@ class ExcludeTests extends AnyWordSpec with Matchers with TableDrivenPropertyChe ) } + "Using case sensitive excludes" should { + "exclude the given files correctly" in { + if (scala.util.Properties.isWin) { + // both are written uppercase and are ignored nevertheless + testWithArguments(Seq("Folder", "Index.c"), "", Set("a.c", "foo.bar/d.c")) + } + if (scala.util.Properties.isMac) { + // Folder written uppercase and it is not ignored while Index.c is. + // This might be an issue within Files.isSameFile but we take it for now. + testWithArguments(Seq("Folder", "Index.c"), "", Set("a.c", "folder/b.c", "folder/c.c", "foo.bar/d.c")) + } + if (scala.util.Properties.isLinux) { + // both are written uppercase and are not ignored + testWithArguments( + Seq("Folder", "Index.c"), + "", + Set("a.c", "folder/b.c", "folder/c.c", "foo.bar/d.c", "index.c") + ) + } + } + } + "Using different excludes via program arguments" should { val testInput = Table( diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/FileHandlingTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/FileHandlingTests.scala new file mode 100644 index 000000000000..f4bf24a6ec48 --- /dev/null +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/FileHandlingTests.scala @@ -0,0 +1,73 @@ +package io.joern.c2cpg.io + +import better.files.File +import io.joern.c2cpg.parser.FileDefaults +import io.joern.c2cpg.testfixtures.CDefaultTestCpg +import io.joern.x2cpg.testfixtures.Code2CpgFixture +import io.shiftleft.semanticcpg.language.* + +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths + +object FileHandlingTests { + private val brokenLinkedFile: String = "broken.c" + private val cyclicLinkedFile: String = "loop.c" +} + +class FileHandlingTests + extends Code2CpgFixture(() => + new CDefaultTestCpg(FileDefaults.C_EXT) { + override def codeFilePreProcessing(codeFile: Path): Unit = { + if (codeFile.toString.endsWith(FileHandlingTests.brokenLinkedFile)) { + File(codeFile).delete().symbolicLinkTo(File("does/not/exist.c")) + } + if (codeFile.toString.endsWith(FileHandlingTests.cyclicLinkedFile)) { + val dir = File(codeFile).delete().parent + val folderA = Paths.get(dir.toString(), "FolderA") + val folderB = Paths.get(dir.toString(), "FolderB") + val symlinkAtoB = folderA.resolve("LinkToB") + val symlinkBtoA = folderB.resolve("LinkToA") + Files.createDirectory(folderA) + Files.createDirectory(folderB) + Files.createSymbolicLink(symlinkAtoB, folderB) + Files.createSymbolicLink(symlinkBtoA, folderA) + } + } + } + .withOssDataflow(false) + .withExtraFlows(List.empty) + .withPostProcessingPasses(false) + ) { + + "File handling 1" should { + val cpg = code( + """ + |int a() {} + |""".stripMargin, + "a.c" + ).moreCode("", FileHandlingTests.brokenLinkedFile) + + "not crash on broken symlinks" in { + val fileNames = cpg.file.name.l + fileNames should contain("a.c").and(not contain FileHandlingTests.brokenLinkedFile) + } + + } + + "File handling 2" should { + val cpg = code( + """ + |int a() {} + |""".stripMargin, + "a.c" + ).moreCode("", FileHandlingTests.cyclicLinkedFile) + + "not crash on cyclic symlinks" in { + val fileNames = cpg.file.name.l + fileNames should contain("a.c") + } + + } + +} diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotAstGeneratorTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotAstGeneratorTests.scala index 76a1bc882684..32e598393484 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotAstGeneratorTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotAstGeneratorTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.io.dotgenerator import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DotAstGeneratorTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCdgGeneratorTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCdgGeneratorTests.scala index 08778bd8ec6e..550e5a2349dd 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCdgGeneratorTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCdgGeneratorTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.io.dotgenerator import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DotCdgGeneratorTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCfgGeneratorTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCfgGeneratorTests.scala index 4cd62011ce76..a281be9e1b01 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCfgGeneratorTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotCfgGeneratorTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.io.dotgenerator import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DotCfgGeneratorTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotDdgGeneratorTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotDdgGeneratorTests.scala index 846ca622d3d7..f043b7fbe7f5 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotDdgGeneratorTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/io/dotgenerator/DotDdgGeneratorTests.scala @@ -1,8 +1,8 @@ package io.joern.c2cpg.io.dotgenerator import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* class DotDdgGeneratorTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/macros/MacroHandlingTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/macros/MacroHandlingTests.scala index 56192a053e2f..94a80e22521e 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/macros/MacroHandlingTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/macros/MacroHandlingTests.scala @@ -2,13 +2,13 @@ package io.joern.c2cpg.macros import io.joern.c2cpg.testfixtures.C2CpgSuite import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Block import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MacroHandlingTests extends C2CpgSuite { @@ -231,7 +231,7 @@ class MacroHandlingTests extends C2CpgSuite { """.stripMargin) "should not result in malformed CFGs when expanding a nested macro with block" in { - cpg.all.collectAll[Block].l.count(b => b.cfgOut.size > 1) shouldBe 0 + cpg.all.collectAll[Block].l.count(b => b._cfgOut.size > 1) shouldBe 0 } } @@ -298,6 +298,52 @@ class MacroHandlingTests extends C2CpgSuite { typeNumCall.columnNumber shouldBe Some(11) } } + + "MacroHandlingTests10" should { + + "have ast parents" in { + val cpg = code(""" + |#define FFSWAP(type,a,b) do{type SWAP_tmp=b; b=a; a=SWAP_tmp;}while(0) + |struct elem_to_channel { + | uint64_t av_position; + | uint8_t syn_ele; + | uint8_t elem_id; + | uint8_t aac_position; + |}; + |int main () { + | struct elem_to_channel e2c_vec[4 * 1] = { { 0 } }; + | int i = 1; + | FFSWAP(struct elem_to_channel, e2c_vec[i - 1], e2c_vec[i]); + |} + |""".stripMargin) + cpg.local.count(l => l._astIn.isEmpty) shouldBe 0 + cpg.local.count(l => l._astIn.size == 1) shouldBe 4 + cpg.local.count(l => l._astIn.size > 1) shouldBe 0 + } + + "only have locals with exactly one ast parent" in { + val cpg = code( + """ + |#define deleteReset(ptr) do { delete ptr; ptr = nullptr; } while(0) + |void func(void) { + | int *foo = new int; + | int *bar = new int; + | int *baz = new int; + | deleteReset(foo); + | deleteReset(bar); + | deleteReset(baz); + |} + |""".stripMargin, + "foo.cc" + ) + val List(foo) = cpg.local.nameExact("foo").l + foo._astIn.size shouldBe 1 + val List(bar) = cpg.local.nameExact("bar").l + bar._astIn.size shouldBe 1 + val List(baz) = cpg.local.nameExact("baz").l + baz._astIn.size shouldBe 1 + } + } } class CfgMacroTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/MetaDataPassTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/MetaDataPassTests.scala index 030b34d660fd..9996ac6b6995 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/MetaDataPassTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/MetaDataPassTests.scala @@ -1,27 +1,25 @@ package io.joern.c2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import io.joern.x2cpg.passes.frontend.MetaDataPass import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import scala.jdk.CollectionConverters._ - class MetaDataPassTests extends AnyWordSpec with Matchers { "MetaDataPass" should { - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new MetaDataPass(cpg, Languages.C, "").createAndApply() "create exactly two nodes" in { - cpg.graph.V.asScala.size shouldBe 2 + cpg.graph.allNodes.size shouldBe 2 } "create no edges" in { - cpg.graph.E.asScala.size shouldBe 0 + cpg.graph.allNodes.outE.size shouldBe 0 } "create a metadata node with correct language" in { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/AstCreationPassTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/AstCreationPassTests.scala index fec046826e12..0edb99cde86f 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/AstCreationPassTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/AstCreationPassTests.scala @@ -1,17 +1,17 @@ package io.joern.c2cpg.passes.ast +import io.joern.c2cpg.astcreation.Defines import io.joern.c2cpg.testfixtures.AstC2CpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal -import overflowdb.traversal.toNodeTraversal class AstCreationPassTests extends AstC2CpgSuite { @@ -23,11 +23,10 @@ class AstCreationPassTests extends AstC2CpgSuite { |char *hello(); |""".stripMargin) inside(cpg.method("foo").l) { case List(foo) => - foo.signature shouldBe "char* foo ()" + foo.signature shouldBe "char*()" } inside(cpg.method("hello").l) { case List(hello) => - hello.signature shouldBe "char* hello ()" - + hello.signature shouldBe "char*()" } } @@ -39,7 +38,7 @@ class AstCreationPassTests extends AstC2CpgSuite { "test.cpp" ) inside(cpg.method("foo").l) { case List(m) => - m.signature shouldBe "void foo (int,int*)" + m.signature shouldBe "void(int,int*)" inside(m.parameter.l) { case List(x, args) => x.name shouldBe "x" x.code shouldBe "int x" @@ -112,8 +111,8 @@ class AstCreationPassTests extends AstC2CpgSuite { val lambda1FullName = "0" val lambda2FullName = "1" - cpg.local.name("x").order.l shouldBe List(1) - cpg.local.name("y").order.l shouldBe List(3) + cpg.local.nameExact("x").order.l shouldBe List(1) + cpg.local.nameExact("y").order.l shouldBe List(3) inside(cpg.assignment.l) { case List(assignment1, assignment2) => assignment1.order shouldBe 2 @@ -129,32 +128,32 @@ class AstCreationPassTests extends AstC2CpgSuite { inside(cpg.method.fullNameExact(lambda1FullName).isLambda.l) { case List(l1) => l1.name shouldBe lambda1FullName l1.code should startWith("[] (int a, int b) -> int") - l1.signature shouldBe s"int $lambda1FullName (int,int)" + l1.signature shouldBe s"int(int,int)" l1.body.code shouldBe "{ return a + b; }" } inside(cpg.method.fullNameExact(lambda2FullName).isLambda.l) { case List(l2) => l2.name shouldBe lambda2FullName l2.code should startWith("[] (string a, string b) -> string") - l2.signature shouldBe s"string $lambda2FullName (string,string)" + l2.signature shouldBe s"string(string,string)" l2.body.code shouldBe "{ return a + b; }" } inside(cpg.typeDecl(NamespaceTraversal.globalNamespaceName).head.bindsOut.l) { case List(bX: Binding, bY: Binding) => bX.name shouldBe lambda1FullName - bX.signature shouldBe s"int $lambda1FullName (int,int)" + bX.signature shouldBe s"int(int,int)" inside(bX.refOut.l) { case List(method: Method) => method.name shouldBe lambda1FullName method.fullName shouldBe lambda1FullName - method.signature shouldBe s"int $lambda1FullName (int,int)" + method.signature shouldBe s"int(int,int)" } bY.name shouldBe lambda2FullName - bY.signature shouldBe s"string $lambda2FullName (string,string)" + bY.signature shouldBe s"string(string,string)" inside(bY.refOut.l) { case List(method: Method) => method.name shouldBe lambda2FullName method.fullName shouldBe lambda2FullName - method.signature shouldBe s"string $lambda2FullName (string,string)" + method.signature shouldBe s"string(string,string)" } } } @@ -174,9 +173,9 @@ class AstCreationPassTests extends AstC2CpgSuite { ) val lambdaName = "0" val lambdaFullName = s"Foo.$lambdaName" - val signature = s"int $lambdaFullName (int,int)" + val signature = s"int(int,int)" - cpg.member.name("x").order.l shouldBe List(1) + cpg.member.nameExact("x").order.l shouldBe List(1) inside(cpg.assignment.l) { case List(assignment1) => inside(assignment1.astMinusRoot.isMethodRef.l) { case List(ref) => @@ -217,9 +216,9 @@ class AstCreationPassTests extends AstC2CpgSuite { ) val lambdaName = "0" val lambdaFullName = s"A.B.Foo.$lambdaName" - val signature = s"int $lambdaFullName (int,int)" + val signature = s"int(int,int)" - cpg.member.name("x").order.l shouldBe List(1) + cpg.member.nameExact("x").order.l shouldBe List(1) inside(cpg.assignment.l) { case List(assignment1) => inside(assignment1.astMinusRoot.isMethodRef.l) { case List(ref) => @@ -261,13 +260,13 @@ class AstCreationPassTests extends AstC2CpgSuite { "test.cpp" ) val lambda1Name = "0" - val signature1 = s"int $lambda1Name (int)" + val signature1 = s"int(int)" val lambda2Name = "1" - val signature2 = s"int $lambda2Name (int)" + val signature2 = s"int(int)" - cpg.local.name("x").order.l shouldBe List(1) - cpg.local.name("foo1").order.l shouldBe List(3) - cpg.local.name("foo2").order.l shouldBe List(5) + cpg.local.nameExact("x").order.l shouldBe List(1) + cpg.local.nameExact("foo1").order.l shouldBe List(3) + cpg.local.nameExact("foo2").order.l shouldBe List(5) inside(cpg.assignment.l) { case List(assignment1, assignment2, assignment3) => assignment1.order shouldBe 2 @@ -302,40 +301,43 @@ class AstCreationPassTests extends AstC2CpgSuite { } } - inside(cpg.call("x").l) { case List(lambda1call) => - lambda1call.name shouldBe "x" - lambda1call.methodFullName shouldBe "x" - lambda1call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH - inside(lambda1call.astChildren.l) { case List(lit: Literal) => + inside(cpg.call.nameExact("()").l) { case List(lambda1call, lambda2call) => + lambda1call.name shouldBe "()" + lambda1call.methodFullName shouldBe "():int(int)" + lambda1call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + inside(lambda1call.astChildren.l) { case List(id: Identifier, lit: Literal) => + id.code shouldBe "x" lit.code shouldBe "10" } inside(lambda1call.argument.l) { case List(lit: Literal) => lit.code shouldBe "10" } - lambda1call.receiver.l shouldBe empty - } + inside(lambda1call.receiver.l) { case List(receiver: Identifier) => + receiver.code shouldBe "x" + } - inside(cpg.call(lambda2Name).l) { case List(lambda2call) => - lambda2call.name shouldBe lambda2Name - lambda2call.methodFullName shouldBe lambda2Name - // TODO: lambda2call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + lambda2call.name shouldBe "()" + lambda2call.methodFullName shouldBe "():int(int)" + lambda2call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH inside(lambda2call.astChildren.l) { case List(ref: MethodRef, lit: Literal) => ref.methodFullName shouldBe lambda2Name ref.code should startWith("[](int n) -> int") lit.code shouldBe "10" } - inside(lambda2call.argument.l) { case List(ref: MethodRef, lit: Literal) => + inside(lambda2call.argument.l) { case List(lit: Literal) => + lit.code shouldBe "10" + } + inside(lambda2call.receiver.l) { case List(ref: MethodRef) => ref.methodFullName shouldBe lambda2Name ref.code should startWith("[](int n) -> int") - lit.code shouldBe "10" } } } "be correct for empty method" in { val cpg = code("void method(int x) { }") - inside(cpg.method.name("method").astChildren.l) { + inside(cpg.method.nameExact("method").astChildren.l) { case List(param: MethodParameterIn, _: Block, ret: MethodReturn) => ret.typeFullName shouldBe "void" param.typeFullName shouldBe "int" @@ -351,7 +353,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.typeFullName shouldBe "a_struct_type*" param.name shouldBe "a_struct" param.code shouldBe "a_struct_type *a_struct" @@ -366,7 +368,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.code shouldBe "struct date *date" param.typeFullName shouldBe "date*" param.name shouldBe "date" @@ -381,7 +383,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.typeFullName shouldBe "int[]" param.name shouldBe "x" } @@ -395,7 +397,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.typeFullName shouldBe "int[]" param.name shouldBe "" } @@ -409,7 +411,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.typeFullName shouldBe "a_struct_type[]" param.name shouldBe "a_struct" } @@ -423,7 +425,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | free(x); |} |""".stripMargin) - inside(cpg.method.name("method").parameter.l) { case List(param: MethodParameterIn) => + inside(cpg.method.nameExact("method").parameter.l) { case List(param: MethodParameterIn) => param.typeFullName shouldBe "a_struct_type[]*" param.name shouldBe "a_struct" } @@ -435,7 +437,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | int local = 1; |} |""".stripMargin) - inside(cpg.method.name("method").block.astChildren.l) { case List(local: Local, call: Call) => + inside(cpg.method.nameExact("method").block.astChildren.l) { case List(local: Local, call: Call) => local.name shouldBe "local" local.typeFullName shouldBe "int" local.order shouldBe 1 @@ -464,7 +466,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "test.cpp" ) - inside(cpg.method.name("method").block.astChildren.l) { case List(_, call1: Call, _, call2: Call) => + inside(cpg.method.nameExact("method").block.astChildren.l) { case List(_, call1: Call, _, call2: Call) => call1.name shouldBe Operators.assignment inside(call2.astChildren.l) { case List(identifier: Identifier, call: Call) => identifier.name shouldBe "is_std_array_v" @@ -489,7 +491,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |void method(int x) { | int local = x; |}""".stripMargin) - cpg.local.name("local").order.l shouldBe List(1) + cpg.local.nameExact("local").order.l shouldBe List(1) inside(cpg.method("method").block.astChildren.assignment.source.l) { case List(identifier: Identifier) => identifier.code shouldBe "x" identifier.typeFullName shouldBe "int" @@ -541,7 +543,7 @@ class AstCreationPassTests extends AstC2CpgSuite { val localZ = cpg.local.order(3) localZ.name.l shouldBe List("z") - inside(cpg.method.name("method").ast.isCall.name(Operators.assignment).cast[OpNodes.Assignment].l) { + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.assignment).cast[OpNodes.Assignment].l) { case List(assignment) => assignment.target.code shouldBe "x" assignment.source.start.isCall.name.l shouldBe List(Operators.addition) @@ -563,7 +565,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | } |} """.stripMargin) - inside(cpg.method.name("method").block.astChildren.l) { case List(local: Local, innerBlock: Block) => + inside(cpg.method.nameExact("method").block.astChildren.l) { case List(local: Local, innerBlock: Block) => local.name shouldBe "x" local.order shouldBe 1 inside(innerBlock.astChildren.l) { case List(localInBlock: Local) => @@ -581,7 +583,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | } |} """.stripMargin) - inside(cpg.method.name("method").block.astChildren.isControlStructure.l) { + inside(cpg.method.nameExact("method").block.astChildren.isControlStructure.l) { case List(controlStruct: ControlStructure) => controlStruct.code shouldBe "while (x < 1)" controlStruct.controlStructureType shouldBe ControlStructureTypes.WHILE @@ -603,7 +605,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | } |} """.stripMargin) - inside(cpg.method.name("method").controlStructure.l) { case List(controlStruct: ControlStructure) => + inside(cpg.method.nameExact("method").controlStructure.l) { case List(controlStruct: ControlStructure) => controlStruct.code shouldBe "if (x > 0)" controlStruct.controlStructureType shouldBe ControlStructureTypes.IF inside(controlStruct.condition.l) { case List(cndNode) => @@ -625,7 +627,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | } |} """.stripMargin) - inside(cpg.method.name("method").controlStructure.l) { case List(ifStmt, elseStmt) => + inside(cpg.method.nameExact("method").controlStructure.l) { case List(ifStmt, elseStmt) => ifStmt.controlStructureType shouldBe ControlStructureTypes.IF ifStmt.code shouldBe "if (x > 0)" elseStmt.controlStructureType shouldBe ControlStructureTypes.ELSE @@ -650,7 +652,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | int x = (true ? vlc_dccp_CreateFD : vlc_datagram_CreateFD)(fd); | } """.stripMargin) - inside(cpg.method.name("method").ast.isCall.name(Operators.conditional).l) { case List(call) => + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.conditional).l) { case List(call) => call.code shouldBe "true ? vlc_dccp_CreateFD : vlc_datagram_CreateFD" } } @@ -665,7 +667,7 @@ class AstCreationPassTests extends AstC2CpgSuite { // `cpg.method.call` will not work at this stage // either because there are no CONTAINS edges - inside(cpg.method.name("method").ast.isCall.name(Operators.conditional).l) { case List(call) => + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.conditional).l) { case List(call) => call.code shouldBe "(foo == 1) ? bar : 0" inside(call.argument.l) { case List(condition, trueBranch, falseBranch) => condition.argumentIndex shouldBe 1 @@ -688,7 +690,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |}""".stripMargin, "file.cpp" ) - inside(cpg.method.name("method").controlStructure.l) { case List(forStmt) => + inside(cpg.method.nameExact("method").controlStructure.l) { case List(forStmt) => forStmt.controlStructureType shouldBe ControlStructureTypes.FOR inside(forStmt.astChildren.order(1).l) { case List(ident: Identifier) => ident.code shouldBe "list" @@ -714,7 +716,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "test.cpp" ) - inside(cpg.method.name("method").controlStructure.l) { case List(forStmt) => + inside(cpg.method.nameExact("method").controlStructure.l) { case List(forStmt) => forStmt.controlStructureType shouldBe ControlStructureTypes.FOR inside(forStmt.astChildren.order(1).l) { case List(ident) => ident.code shouldBe "foo" @@ -738,7 +740,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | } |} """.stripMargin) - inside(cpg.method.name("method").controlStructure.l) { case List(forStmt) => + inside(cpg.method.nameExact("method").controlStructure.l) { case List(forStmt) => forStmt.controlStructureType shouldBe ControlStructureTypes.FOR childContainsAssignments(forStmt, 1, List("x = 0", "y = 0")) @@ -765,10 +767,10 @@ class AstCreationPassTests extends AstC2CpgSuite { |} """.stripMargin) cpg.method - .name("method") + .nameExact("method") .ast .isCall - .name(Operators.preIncrement) + .nameExact(Operators.preIncrement) .argument(1) .code .l shouldBe List("x") @@ -816,10 +818,10 @@ class AstCreationPassTests extends AstC2CpgSuite { |} """.stripMargin) cpg.method - .name("method") + .nameExact("method") .ast .isCall - .name("foo") + .nameExact("foo") .argument(1) .code .l shouldBe List("x") @@ -832,7 +834,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | foo(x); |} """.stripMargin) - inside(cpg.method.name("method").ast.isCall.l) { case List(call: Call) => + inside(cpg.method.nameExact("method").ast.isCall.l) { case List(call: Call) => call.code shouldBe "foo(x)" call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH val rec = call.receiver.l @@ -847,7 +849,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | x.a; |} """.stripMargin) - inside(cpg.method.name("method").ast.isCall.name(Operators.fieldAccess).l) { case List(call) => + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.fieldAccess).l) { case List(call) => val arg1 = call.argument(1) val arg2 = call.argument(2) arg1.isIdentifier shouldBe true @@ -866,7 +868,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | x->a; |} """.stripMargin) - inside(cpg.method.name("method").ast.isCall.name(Operators.indirectFieldAccess).l) { case List(call) => + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.indirectFieldAccess).l) { case List(call) => val arg1 = call.argument(1) val arg2 = call.argument(2) arg1.isIdentifier shouldBe true @@ -885,7 +887,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return (x->a)(1, 2); |} """.stripMargin) - inside(cpg.method.name("method").ast.isCall.name(Operators.indirectFieldAccess).l) { case List(call) => + inside(cpg.method.nameExact("method").ast.isCall.nameExact(Operators.indirectFieldAccess).l) { case List(call) => val arg1 = call.argument(1) val arg2 = call.argument(2) arg1.isIdentifier shouldBe true @@ -906,9 +908,9 @@ class AstCreationPassTests extends AstC2CpgSuite { | return (*strLenFunc)("123"); |} """.stripMargin) - inside(cpg.method.name("main").ast.isCall.codeExact("(*strLenFunc)(\"123\")").l) { case List(call) => - call.name shouldBe "*strLenFunc" - call.methodFullName shouldBe "*strLenFunc" + inside(cpg.method.nameExact("main").ast.isCall.codeExact("(*strLenFunc)(\"123\")").l) { case List(call) => + call.name shouldBe Defines.OperatorPointerCall + call.methodFullName shouldBe Defines.OperatorPointerCall } } @@ -920,13 +922,13 @@ class AstCreationPassTests extends AstC2CpgSuite { |} """.stripMargin) cpg.method - .name("method") + .nameExact("method") .ast .isCall - .name(Operators.sizeOf) + .nameExact(Operators.sizeOf) .argument(1) .isIdentifier - .name("a") + .nameExact("a") .argumentIndex(1) .size shouldBe 1 } @@ -939,13 +941,13 @@ class AstCreationPassTests extends AstC2CpgSuite { |} """.stripMargin) cpg.method - .name("method") + .nameExact("method") .ast .isCall - .name(Operators.sizeOf) + .nameExact(Operators.sizeOf) .argument(1) .isIdentifier - .name("a") + .nameExact("a") .argumentIndex(1) .size shouldBe 1 } @@ -959,13 +961,13 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) cpg.method - .name("method") + .nameExact("method") .ast .isCall - .name(Operators.sizeOf) + .nameExact(Operators.sizeOf) .argument(1) .isIdentifier - .name("int") + .nameExact("int") .argumentIndex(1) .size shouldBe 1 } @@ -978,7 +980,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | void method() { | }; """.stripMargin) - cpg.method.name("method").size shouldBe 1 + cpg.method.nameExact("method").size shouldBe 1 } "be correct for empty named struct" in { @@ -986,14 +988,14 @@ class AstCreationPassTests extends AstC2CpgSuite { | struct foo { | }; """.stripMargin) - cpg.typeDecl.name("foo").size shouldBe 1 + cpg.typeDecl.nameExact("foo").size shouldBe 1 } "be correct for struct decl" in { val cpg = code(""" | struct foo; """.stripMargin) - cpg.typeDecl.name("foo").size shouldBe 1 + cpg.typeDecl.nameExact("foo").size shouldBe 1 } "be correct for named struct with single field" in { @@ -1003,10 +1005,10 @@ class AstCreationPassTests extends AstC2CpgSuite { | }; """.stripMargin) cpg.typeDecl - .name("foo") + .nameExact("foo") .member .code("x") - .name("x") + .nameExact("x") .typeFullName("int") .size shouldBe 1 } @@ -1019,7 +1021,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | int z; | }; """.stripMargin) - cpg.typeDecl.name("foo").member.code.toSetMutable shouldBe Set("x", "y", "z") + cpg.typeDecl.nameExact("foo").member.code.toSetMutable shouldBe Set("x", "y", "z") } "be correct for named struct with nested struct" in { @@ -1034,12 +1036,12 @@ class AstCreationPassTests extends AstC2CpgSuite { | }; | }; """.stripMargin) - inside(cpg.typeDecl.name("foo").l) { case List(fooStruct: TypeDecl) => - fooStruct.member.name("x").size shouldBe 1 + inside(cpg.typeDecl.nameExact("foo").l) { case List(fooStruct: TypeDecl) => + fooStruct.member.nameExact("x").size shouldBe 1 inside(fooStruct.astChildren.isTypeDecl.l) { case List(barStruct: TypeDecl) => - barStruct.member.name("y").size shouldBe 1 + barStruct.member.nameExact("y").size shouldBe 1 inside(barStruct.astChildren.isTypeDecl.l) { case List(foo2Struct: TypeDecl) => - foo2Struct.member.name("z").size shouldBe 1 + foo2Struct.member.nameExact("z").size shouldBe 1 } } } @@ -1050,7 +1052,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |typedef struct foo { |} abc; """.stripMargin) - cpg.typeDecl.name("foo").aliasTypeFullName("abc").size shouldBe 1 + cpg.typeDecl.nameExact("foo").aliasTypeFullName("abc").size shouldBe 1 } "be correct for struct with local" in { @@ -1064,7 +1066,7 @@ class AstCreationPassTests extends AstC2CpgSuite { x.name shouldBe "x" x.typeFullName shouldBe "int" } - cpg.typeDecl.name("B").size shouldBe 1 + cpg.typeDecl.nameExact("B").size shouldBe 1 inside(cpg.local.l) { case List(localA, localB) => localA.name shouldBe "a" localA.typeFullName shouldBe "A" @@ -1101,10 +1103,10 @@ class AstCreationPassTests extends AstC2CpgSuite { | i = 0; |} """.stripMargin) - val List(localMyOtherFs) = cpg.method("main").local.name("my_other_fs").l + val List(localMyOtherFs) = cpg.method("main").local.nameExact("my_other_fs").l localMyOtherFs.order shouldBe 2 localMyOtherFs.referencingIdentifiers.name.l shouldBe List("my_other_fs") - val List(localMyFs) = cpg.local.name("my_fs").l + val List(localMyFs) = cpg.local.nameExact("my_fs").l localMyFs.order shouldBe 4 localMyFs.referencingIdentifiers.name.l shouldBe List("my_fs") cpg.typeDecl.nameNot(NamespaceTraversal.globalNamespaceName).fullName.l.distinct shouldBe List("filesystem") @@ -1115,7 +1117,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |typedef enum foo { |} abc; """.stripMargin) - cpg.typeDecl.name("foo").aliasTypeFullName("abc").size shouldBe 1 + cpg.typeDecl.nameExact("foo").aliasTypeFullName("abc").size shouldBe 1 } "be correct for classes with friends" in { @@ -1147,36 +1149,10 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) cpg.typeDecl - .name("Derived") + .nameExact("Derived") .count(_.inheritsFromTypeFullName == List("Base")) shouldBe 1 } - "be correct for field access" in { - val cpg = code( - """ - |class Foo { - |public: - | char x; - | int method(){return i;}; - |}; - | - |Foo f; - |int x = f.method(); - """.stripMargin, - "file.cpp" - ) - cpg.typeDecl - .name("Foo") - .l - .size shouldBe 1 - - inside(cpg.call.code("f.method()").l) { case List(call: Call) => - call.methodFullName shouldBe Operators.fieldAccess - call.argument(1).code shouldBe "f" - call.argument(2).code shouldBe "method" - } - } - "be correct for type initializer expression" in { val cpg = code( """ @@ -1184,7 +1160,7 @@ class AstCreationPassTests extends AstC2CpgSuite { """.stripMargin, "file.cpp" ) - inside(cpg.call.name(Operators.cast).l) { case List(call: Call) => + inside(cpg.call.nameExact(Operators.cast).l) { case List(call: Call) => call.argument(2).code shouldBe "{ 1 }" call.argument(1).code shouldBe "int" } @@ -1323,7 +1299,7 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) cpg.typeDecl - .name("Y") + .nameExact("Y") .l .size shouldBe 1 } @@ -1342,7 +1318,7 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) cpg.method - .name("f") + .nameExact("f") .l .size shouldBe 1 } @@ -1375,10 +1351,10 @@ class AstCreationPassTests extends AstC2CpgSuite { |} |""".stripMargin) cpg.method - .name("foo") + .nameExact("foo") .ast .isCall - .name("bar") + .nameExact("bar") .argument .code("x") .size shouldBe 1 @@ -1391,16 +1367,14 @@ class AstCreationPassTests extends AstC2CpgSuite { |} |""".stripMargin) // TODO no step class defined for `Return` nodes - cpg.method.name("d").ast.isReturn.astChildren.order(1).isCall.code.l shouldBe List("x * 2") + cpg.method.nameExact("d").ast.isReturn.astChildren.order(1).isCall.code.l shouldBe List("x * 2") cpg.method - .name("d") + .nameExact("d") .ast .isReturn - .outE(EdgeTypes.ARGUMENT) + .out(EdgeTypes.ARGUMENT) .head - .inNode() - .get - .asInstanceOf[CallDb] + .asInstanceOf[Call] .code shouldBe "x * 2" } @@ -1410,7 +1384,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return x * 2; |} |""".stripMargin) - cpg.call.name(Operators.multiplication).code.l shouldBe List("x * 2") + cpg.call.nameExact(Operators.multiplication).code.l shouldBe List("x * 2") } "be correct for unary method calls" in { @@ -1419,7 +1393,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return !b; |} |""".stripMargin) - cpg.call.name(Operators.logicalNot).argument(1).code.l shouldBe List("b") + cpg.call.nameExact(Operators.logicalNot).argument(1).code.l shouldBe List("b") } "be correct for unary expr" in { @@ -1430,7 +1404,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return end ? (int)(end - str) : max; | } |""".stripMargin) - inside(cpg.call.name(Operators.cast).astChildren.l) { case List(tpe: Unknown, call: Call) => + inside(cpg.call.nameExact(Operators.cast).astChildren.l) { case List(tpe: Unknown, call: Call) => call.code shouldBe "end - str" call.argumentIndex shouldBe 2 tpe.code shouldBe "int" @@ -1446,8 +1420,8 @@ class AstCreationPassTests extends AstC2CpgSuite { | return pos; |} |""".stripMargin) - cpg.call.name(Operators.postIncrement).argument(1).code("x").size shouldBe 1 - cpg.call.name(Operators.postDecrement).argument(1).code("x").size shouldBe 1 + cpg.call.nameExact(Operators.postIncrement).argument(1).code("x").size shouldBe 1 + cpg.call.nameExact(Operators.postDecrement).argument(1).code("x").size shouldBe 1 } "be correct for conditional expressions containing calls" in { @@ -1456,7 +1430,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return x > 0 ? x : -x; |} |""".stripMargin) - cpg.call.name(Operators.conditional).argument.code.l shouldBe List("x > 0", "x", "-x") + cpg.call.nameExact(Operators.conditional).argument.code.l shouldBe List("x > 0", "x", "-x") } "be correct for sizeof expressions" in { @@ -1465,7 +1439,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return sizeof(int); |} |""".stripMargin) - inside(cpg.call.name(Operators.sizeOf).argument(1).l) { case List(i: Identifier) => + inside(cpg.call.nameExact(Operators.sizeOf).argument(1).l) { case List(i: Identifier) => i.code shouldBe "int" i.name shouldBe "int" } @@ -1482,7 +1456,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return x[0]; |} |""".stripMargin) - cpg.call.name(Operators.indirectIndexAccess).argument.code.l shouldBe List("x", "0") + cpg.call.nameExact(Operators.indirectIndexAccess).argument.code.l shouldBe List("x", "0") } "be correct for type casts" in { @@ -1491,7 +1465,7 @@ class AstCreationPassTests extends AstC2CpgSuite { | return (int) x; |} |""".stripMargin) - cpg.call.name(Operators.cast).argument.code.l shouldBe List("int", "x") + cpg.call.nameExact(Operators.cast).argument.code.l shouldBe List("int", "x") } "be correct for 'new' array" in { @@ -1505,7 +1479,7 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) // TODO: ".new" is not part of Operators - cpg.call.name(".new").code("new int\\[n\\]").argument.code("int").size shouldBe 1 + cpg.call.nameExact(".new").code("new int\\[n\\]").argument.code("int").size shouldBe 1 } "be correct for 'new' with explicit identifier" in { @@ -1519,7 +1493,7 @@ class AstCreationPassTests extends AstC2CpgSuite { "file.cpp" ) // TODO: ".new" is not part of Operators - val List(newCall) = cpg.call.name(".new").l + val List(newCall) = cpg.call.nameExact(".new").l val List(string, hi, buf) = newCall.argument.l string.argumentIndex shouldBe 1 string.code shouldBe "string" @@ -1533,15 +1507,59 @@ class AstCreationPassTests extends AstC2CpgSuite { "be correct for array size" in { val cpg = code(""" |int main() { - | char buf[256]; - | printf("%s", buf); + | char bufA[256]; + | char bufB[1+2]; |} |""".stripMargin) - inside(cpg.local.l) { case List(buf: Local) => - buf.typeFullName shouldBe "char[256]" - buf.name shouldBe "buf" - buf.code shouldBe "char[256] buf" + inside(cpg.call.nameExact(Operators.assignment).l) { case List(bufCallAAssign: Call, bufCallBAssign: Call) => + val List(bufAId, bufCallA) = bufCallAAssign.argument.l + bufAId.code shouldBe "bufA" + val List(bufBId, bufCallB) = bufCallBAssign.argument.l + bufBId.code shouldBe "bufB" + + inside(cpg.call.nameExact(Operators.alloc).l) { case List(bufCallAAlloc: Call, bufCallBAlloc: Call) => + bufCallAAlloc shouldBe bufCallA + bufCallBAlloc shouldBe bufCallB + + bufCallAAlloc.code shouldBe "bufA[256]" + bufCallAAlloc.typeFullName shouldBe "char[256]" + val List(argA) = bufCallAAlloc.argument.isLiteral.l + argA.code shouldBe "256" + + bufCallBAlloc.code shouldBe "bufB[1+2]" + bufCallBAlloc.typeFullName shouldBe "char[1+2]" + val List(argB) = bufCallBAlloc.argument.isCall.l + argB.name shouldBe Operators.addition + argB.code shouldBe "1+2" + val List(one, two) = argB.argument.isLiteral.l + one.code shouldBe "1" + two.code shouldBe "2" + } } + + inside(cpg.local.l) { case List(bufA: Local, bufB: Local) => + bufA.typeFullName shouldBe "char[256]" + bufA.name shouldBe "bufA" + bufA.code shouldBe "char[256] bufA" + + bufB.typeFullName shouldBe "char[1+2]" + bufB.name shouldBe "bufB" + bufB.code shouldBe "char[1+2] bufB" + } + } + + "be correct for empty array init" in { + val cpg = code(""" + |void other(void) { + | int i = 0; + | char str[] = "abc"; + | printf("%d %s", i, str); + |} + |""".stripMargin) + val List(str1, str2) = cpg.identifier.nameExact("str").l + str1.typeFullName shouldBe "char[]" + str2.typeFullName shouldBe "char[]" + cpg.call.nameExact(Operators.alloc) shouldBe empty } "be correct for array init" in { @@ -1681,6 +1699,27 @@ class AstCreationPassTests extends AstC2CpgSuite { } } + "be correct for method refs from function pointers" in { + val cpg = code(""" + |uid_t getuid(void); + |void someFunction() {} + |void checkFunctionPointerComparison() { + | if (getuid == 0 || someFunction == 0) {} + |} + |""".stripMargin) + val List(methodA) = cpg.method.fullNameExact("getuid").l + val List(methodB) = cpg.method.fullNameExact("someFunction").l + val List(methodC) = cpg.method.fullNameExact("checkFunctionPointerComparison").l + inside(cpg.call.nameExact(Operators.equals).l) { case List(callA: Call, callB: Call) => + val getuidRef = callA.argument(1).asInstanceOf[MethodRef] + getuidRef.methodFullName shouldBe methodA.fullName + getuidRef.typeFullName shouldBe methodA.methodReturn.typeFullName + val someFunctionRef = callB.argument(1).asInstanceOf[MethodRef] + someFunctionRef.methodFullName shouldBe methodB.fullName + someFunctionRef.typeFullName shouldBe methodB.methodReturn.typeFullName + } + } + "be correct for locals for array init" in { val cpg = code(""" |bool x[2] = { TRUE, FALSE }; @@ -1761,7 +1800,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(".new").codeExact("new Foo(n, 42)").argument.code("Foo").size shouldBe 1 + cpg.call.nameExact(".new").codeExact("new Foo(n, 42)").argument.code("Foo").size shouldBe 1 } "be correct for simple 'delete'" in { @@ -1773,7 +1812,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.delete).code("delete n").argument.code("n").size shouldBe 1 + cpg.call.nameExact(Operators.delete).code("delete n").argument.code("n").size shouldBe 1 } "be correct for array 'delete'" in { @@ -1785,7 +1824,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.delete).codeExact("delete[] n").argument.code("n").size shouldBe 1 + cpg.call.nameExact(Operators.delete).codeExact("delete[] n").argument.code("n").size shouldBe 1 } "be correct for const_cast" in { @@ -1798,7 +1837,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.cast).codeExact("const_cast(n)").argument.code.l shouldBe List("int", "n") + cpg.call.nameExact(Operators.cast).codeExact("const_cast(n)").argument.code.l shouldBe List("int", "n") } "be correct for static_cast" in { @@ -1811,7 +1850,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.cast).codeExact("static_cast(n)").argument.code.l shouldBe List("int", "n") + cpg.call.nameExact(Operators.cast).codeExact("static_cast(n)").argument.code.l shouldBe List("int", "n") } "be correct for dynamic_cast" in { @@ -1824,7 +1863,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.cast).codeExact("dynamic_cast(n)").argument.code.l shouldBe List("int", "n") + cpg.call.nameExact(Operators.cast).codeExact("dynamic_cast(n)").argument.code.l shouldBe List("int", "n") } "be correct for reinterpret_cast" in { @@ -1837,7 +1876,7 @@ class AstCreationPassTests extends AstC2CpgSuite { |""".stripMargin, "file.cpp" ) - cpg.call.name(Operators.cast).codeExact("reinterpret_cast(n)").argument.code.l shouldBe List("int", "n") + cpg.call.nameExact(Operators.cast).codeExact("reinterpret_cast(n)").argument.code.l shouldBe List("int", "n") } "be correct for designated initializers in plain C" in { @@ -1846,14 +1885,14 @@ class AstCreationPassTests extends AstC2CpgSuite { | int a[3] = { [1] = 5, [2] = 10, [3 ... 9] = 15 }; |}; """.stripMargin) - inside(cpg.assignment.head.astChildren.l) { case List(ident: Identifier, call: Call) => + inside(cpg.assignment.l(1).astChildren.l) { case List(ident: Identifier, call: Call) => ident.typeFullName shouldBe "int[3]" ident.order shouldBe 1 call.code shouldBe "{ [1] = 5, [2] = 10, [3 ... 9] = 15 }" call.order shouldBe 2 call.name shouldBe Operators.arrayInitializer call.methodFullName shouldBe Operators.arrayInitializer - val children = call.astMinusRoot.isCall.name(Operators.assignment).l + val children = call.astMinusRoot.isCall.nameExact(Operators.assignment).l val args = call.argument.astChildren.l inside(children) { case List(call1, call2, call3) => call1.code shouldBe "[1] = 5" @@ -1886,14 +1925,14 @@ class AstCreationPassTests extends AstC2CpgSuite { """.stripMargin, "test.cpp" ) - inside(cpg.assignment.head.astChildren.l) { case List(ident: Identifier, call: Call) => + inside(cpg.assignment.l(1).astChildren.l) { case List(ident: Identifier, call: Call) => ident.typeFullName shouldBe "int[3]" ident.order shouldBe 1 call.code shouldBe "{ [1] = 5, [2] = 10, [3 ... 9] = 15 }" call.order shouldBe 2 call.name shouldBe Operators.arrayInitializer call.methodFullName shouldBe Operators.arrayInitializer - val children = call.astMinusRoot.isCall.name(Operators.assignment).l + val children = call.astMinusRoot.isCall.nameExact(Operators.assignment).l val args = call.argument.astChildren.l inside(children) { case List(call1, call2, call3) => call1.code shouldBe "[1] = 5" @@ -2070,8 +2109,8 @@ class AstCreationPassTests extends AstC2CpgSuite { | x = 1; | } """.stripMargin) - cpg.method.name("method").lineNumber.l shouldBe List(6) - cpg.method.name("method").block.assignment.lineNumber.l shouldBe List(8) + cpg.method.nameExact("method").lineNumber.l shouldBe List(6) + cpg.method.nameExact("method").block.assignment.lineNumber.l shouldBe List(8) } // for https://github.com/ShiftLeftSecurity/codepropertygraph/issues/1321 @@ -2146,9 +2185,9 @@ class AstCreationPassTests extends AstC2CpgSuite { val cpg = code("class Foo { char (*(*x())[5])() }", "test.cpp") val List(method) = cpg.method.nameNot("").l method.name shouldBe "x" - method.fullName shouldBe "Foo.x" + method.fullName shouldBe "Foo.x:char(*(*)[5])()()" method.code shouldBe "char (*(*x())[5])()" - method.signature shouldBe "char Foo.x ()" + method.signature shouldBe "char()" } "be consistent with pointer types" in { @@ -2158,10 +2197,10 @@ class AstCreationPassTests extends AstC2CpgSuite { | char *x; |} |""".stripMargin) - cpg.member.name("z").typeFullName.head shouldBe "char*" - cpg.parameter.name("y").typeFullName.head shouldBe "char*" - cpg.local.name("x").typeFullName.head shouldBe "char*" - cpg.method.name("a").methodReturn.typeFullName.head shouldBe "char*" + cpg.member.nameExact("z").typeFullName.head shouldBe "char*" + cpg.parameter.nameExact("y").typeFullName.head shouldBe "char*" + cpg.local.nameExact("x").typeFullName.head shouldBe "char*" + cpg.method.nameExact("a").methodReturn.typeFullName.head shouldBe "char*" } "be consistent with array types" in { @@ -2171,9 +2210,9 @@ class AstCreationPassTests extends AstC2CpgSuite { | char x[1]; |} |""".stripMargin) - cpg.member.name("z").typeFullName.head shouldBe "char[1]" - cpg.parameter.name("y").typeFullName.head shouldBe "char[1]" - cpg.local.name("x").typeFullName.head shouldBe "char[1]" + cpg.member.nameExact("z").typeFullName.head shouldBe "char[1]" + cpg.parameter.nameExact("y").typeFullName.head shouldBe "char[1]" + cpg.local.nameExact("x").typeFullName.head shouldBe "char[1]" } "be consistent with long number types" in { @@ -2187,7 +2226,9 @@ class AstCreationPassTests extends AstC2CpgSuite { val List(bufLocal) = cpg.local.nameExact("buf").l bufLocal.typeFullName shouldBe "char[0x111111111111111]" bufLocal.code shouldBe "char[0x111111111111111] buf" - cpg.literal.code.l shouldBe List("0x111111111111111") + val List(bufAllocCall) = cpg.call.nameExact(Operators.alloc).l + bufAllocCall.code shouldBe "buf[BUFSIZE]" + bufAllocCall.argument.ast.isLiteral.code.l shouldBe List("0x111111111111111") } } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallConventionsTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallConventionsTests.scala index 1adaddce886d..41f1ee51627c 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallConventionsTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallConventionsTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.AstC2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class CallConventionsTests extends AstC2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallTests.scala index f3b20f6aa77a..b928b1b3d38d 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/CallTests.scala @@ -1,11 +1,13 @@ package io.joern.c2cpg.passes.ast +import io.joern.c2cpg.astcreation.Defines import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.codepropertygraph.generated.Operators +import io.joern.x2cpg.Defines as X2CpgDefines +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.codepropertygraph.generated.nodes.Literal import io.shiftleft.semanticcpg.language.NoResolve -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallTests extends C2CpgSuite { @@ -108,7 +110,7 @@ class CallTests extends C2CpgSuite { "have the correct callIn" in { val List(m) = cpg.method.nameNot("").where(_.ast.isReturn.code(".*nullptr.*")).l val List(c) = cpg.call.codeExact("b->GetObj()").l - c.callee.head shouldBe m + c.callee.l should contain(m) val List(callIn) = m.callIn.l callIn.code shouldBe "b->GetObj()" } @@ -127,8 +129,8 @@ class CallTests extends C2CpgSuite { "test.cpp" ) "have correct names for static methods / calls" in { - cpg.method.name("square").fullName.head shouldBe "square" - cpg.method.name("call_square").call.methodFullName.head shouldBe "square" + cpg.method.name("square").fullName.head shouldBe "square:int(int)" + cpg.method.name("call_square").call.methodFullName.head shouldBe "square:int(int)" } } @@ -149,8 +151,8 @@ class CallTests extends C2CpgSuite { "test.cpp" ) "have correct names for static methods / calls from classes" in { - cpg.method.name("square").fullName.head shouldBe "A.square" - cpg.method.name("call_square").call.methodFullName.head shouldBe "A.square" + cpg.method.name("square").fullName.head shouldBe "A.square:int(int)" + cpg.method.name("call_square").call.methodFullName.head shouldBe "A.square:int(int)" } } @@ -168,9 +170,9 @@ class CallTests extends C2CpgSuite { ) "have correct type full names for calls" in { val List(bCall) = cpg.call.l - bCall.methodFullName shouldBe "A.b" + bCall.methodFullName shouldBe "A.b:void()" val List(bMethod) = cpg.method.name("b").internal.l - bMethod.fullName shouldBe "A.b" + bMethod.fullName shouldBe "A.b:void()" bMethod.callIn.head shouldBe bCall bCall.callee.head shouldBe bMethod } @@ -196,10 +198,429 @@ class CallTests extends C2CpgSuite { ) "have correct type full names for calls" in { val List(foo2Call) = cpg.call("foo2").l - foo2Call.methodFullName shouldBe "A.foo2" + foo2Call.methodFullName shouldBe "A.foo2:void()" val List(foo2Method) = cpg.method("foo2").l - foo2Method.fullName shouldBe "A.foo2" + foo2Method.fullName shouldBe "A.foo2:void()" } } + "Successfully typed calls" should { + "have correct call for call on non virtual class method" in { + val cpg = code( + """ + |namespace NNN { + | class A { + | public: + | void foo(int a){} + | }; + |} + | + |void outer() { + | NNN::A a; + | a.foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "void(int)" + call.methodFullName shouldBe "NNN.A.foo:void(int)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(instArg, arg1) = call.argument.l + instArg.code shouldBe "a" + instArg.argumentIndex shouldBe 0 + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + call.receiver.isEmpty shouldBe true + } + + "have correct call for call on virtual class method" in { + val cpg = code( + """ + |namespace NNN { + | class A { + | public: + | virtual void foo(int a){} + | }; + |} + | + |void outer() { + | NNN::A a; + | a.foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "void(int)" + call.methodFullName shouldBe "NNN.A.foo:void(int)" + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(instArg, arg1) = call.argument.l + instArg.code shouldBe "a" + instArg.argumentIndex shouldBe 0 + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver shouldBe instArg + } + + "have correct call for call on stand alone method (CPP)" in { + val cpg = code( + """ + |namespace NNN { + | void foo(int a){} + |} + | + |void outer() { + | NNN::foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "void(int)" + call.methodFullName shouldBe "NNN.foo:void(int)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + + call.receiver.isEmpty shouldBe true + } + + "have correct call for call on lambda function" in { + val cpg = code( + """ + |void outer() { + | [](int a) {}(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("()").l + call.signature shouldBe "void(int)" + call.methodFullName shouldBe "():void(int)" + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver.isMethodRef shouldBe true + receiver.argumentIndex shouldBe -1 + } + + "have correct call for call on function pointer (CPP)" in { + val cpg = code( + """ + |class A { + | public: + | void (*foo)(int); + |}; + | + |void outer() { + | A a; + | a.foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact(Defines.OperatorPointerCall).l + call.signature shouldBe "" + call.methodFullName shouldBe Defines.OperatorPointerCall + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver.code shouldBe "a.foo" + receiver.argumentIndex shouldBe -1 + } + + "have correct call for call on callable object" in { + val cpg = code( + """ + |namespace NNN { + | class Callable { + | public: + | void operator()(int a){} + | }; + |} + |class A { + | public: + | NNN::Callable foo; + |}; + | + |void outer() { + | A a; + | a.foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("()").l + call.signature shouldBe "void(int)" + call.methodFullName shouldBe "NNN.Callable.():void(int)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(instArg, arg1) = call.argument.l + instArg.code shouldBe "a.foo" + instArg.argumentIndex shouldBe 0 + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver shouldBe instArg + } + + "have correct call for call on function pointer (C)" in { + val cpg = code( + """ + |struct A { + | void (*foo)(int); + |} + |void outer() { + | struct A a; + | a.foo(1); + |} + |""".stripMargin, + "test.c" + ) + + val List(call) = cpg.call.nameExact(Defines.OperatorPointerCall).l + call.signature shouldBe "" + call.methodFullName shouldBe Defines.OperatorPointerCall + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver.code shouldBe "a.foo" + receiver.argumentIndex shouldBe -1 + } + + "have correct call for call on stand alone method (C)" in { + val cpg = code( + """ + |void foo(int) {} + |void outer() { + | foo(1); + |} + |""".stripMargin, + "test.c" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "" + call.methodFullName shouldBe "foo" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + + call.receiver.isEmpty shouldBe true + } + + "have correct call for call on extern C function" in { + val cpg = code( + """ + |extern "C" { + | void foo(int); + |} + | + |void outer() { + | foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "" + call.methodFullName shouldBe "foo" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe "void" + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + call.receiver.isEmpty shouldBe true + } + } + + "Not successfully typed calls" should { + "have correct call for field reference style call (CPP)" in { + val cpg = code( + """ + |void outer() { + | Unknown a; + | a.foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe X2CpgDefines.UnresolvedSignature + call.methodFullName shouldBe s"${X2CpgDefines.UnresolvedNamespace}.foo:${X2CpgDefines.UnresolvedSignature}(1)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(instArg, arg1) = call.argument.l + instArg.code shouldBe "a" + instArg.argumentIndex shouldBe 0 + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver shouldBe instArg + } + + "have correct call for plain call (CPP)" in { + val cpg = code( + """ + |void outer() { + | foo(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe X2CpgDefines.UnresolvedSignature + call.methodFullName shouldBe s"${X2CpgDefines.UnresolvedNamespace}.foo:${X2CpgDefines.UnresolvedSignature}(1)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + call.receiver.isEmpty shouldBe true + } + + "have correct call for call on arbitrary expression (CPP)" in { + val cpg = code( + """ + |void outer() { + | getX()(1); + |} + |""".stripMargin, + "test.cpp" + ) + + val List(call) = cpg.call.nameExact("()").l + call.signature shouldBe X2CpgDefines.UnresolvedSignature + call.methodFullName shouldBe s"${X2CpgDefines.UnresolvedNamespace}.():${X2CpgDefines.UnresolvedSignature}(1)" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(instArg, arg1) = call.argument.l + instArg.code shouldBe "getX()" + instArg.argumentIndex shouldBe 0 + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver shouldBe instArg + } + + "have correct call for field reference style call (C)" in { + val cpg = code( + """ + |void outer() { + | struct A a; + | a.foo(1); + |} + |""".stripMargin, + "test.c" + ) + + val List(call) = cpg.call.nameExact(Defines.OperatorPointerCall).l + call.signature shouldBe "" + call.methodFullName shouldBe Defines.OperatorPointerCall + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver.code shouldBe "a.foo" + receiver.argumentIndex shouldBe -1 + } + + "have correct call for plain call (C)" in { + val cpg = code( + """ + |void outer() { + | foo(1); + |} + |""".stripMargin, + "test.c" + ) + + val List(call) = cpg.call.nameExact("foo").l + call.signature shouldBe "" + call.methodFullName shouldBe s"foo" + call.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + call.receiver.isEmpty shouldBe true + } + + "have correct call for call on arbitrary expression (C)" in { + val cpg = code( + """ + |void outer() { + | getX()(1); + |} + |""".stripMargin, + "test.c" + ) + + val List(call) = cpg.call.nameExact(Defines.OperatorPointerCall).l + call.signature shouldBe "" + call.methodFullName shouldBe Defines.OperatorPointerCall + call.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + call.typeFullName shouldBe X2CpgDefines.Any + + val List(arg1) = call.argument.l + arg1.code shouldBe "1" + arg1.argumentIndex shouldBe 1 + + val List(receiver) = call.receiver.l + receiver.code shouldBe "getX()" + receiver.argumentIndex shouldBe -1 + } + } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ControlStructureTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ControlStructureTests.scala index b918bb66bca4..5313ff41f2d4 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ControlStructureTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ControlStructureTests.scala @@ -3,7 +3,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.parser.FileDefaults import io.joern.c2cpg.testfixtures.C2CpgSuite import io.shiftleft.codepropertygraph.generated.ControlStructureTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ControlStructureTests extends C2CpgSuite(FileDefaults.CPP_EXT) { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/DependencyTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/DependencyTests.scala index 5961a22bd2f1..ff9882703a7d 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/DependencyTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/DependencyTests.scala @@ -2,7 +2,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.AstC2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DependencyTests extends AstC2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/HeaderAstCreationPassTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/HeaderAstCreationPassTests.scala index 53a624e68242..e09854f53372 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/HeaderAstCreationPassTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/HeaderAstCreationPassTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class HeaderAstCreationPassTests extends C2CpgSuite { @@ -37,20 +37,17 @@ class HeaderAstCreationPassTests extends C2CpgSuite { "de-duplicate content correctly" in { inside(cpg.method.nameNot(NamespaceTraversal.globalNamespaceName).sortBy(_.fullName)) { - case Seq(bar, foo, m1, m2, printf) => + case Seq(bar, foo, m, printf) => // note that we don't see bar twice even so it is contained // in main.h and included in main.c and we do scan both bar.fullName shouldBe "bar" bar.filename shouldBe "main.h" foo.fullName shouldBe "foo" foo.filename shouldBe "other.h" - // main is include twice. First time for the header file, - // second time for the actual implementation in the source file - // We do not de-duplicate this as line/column numbers differ - m1.fullName shouldBe "main" - m1.filename shouldBe "main.c" - m2.fullName shouldBe "main" - m2.filename shouldBe "main.h" + // main is also deduplicated. It is defined within the header file, + // and has an actual implementation in the source file + m.fullName shouldBe "main" + m.filename shouldBe "main.c" printf.fullName shouldBe "printf" } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MemberTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MemberTests.scala index 82b91be23f27..6117f4ae71e0 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MemberTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MemberTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MemberTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MetaDataTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MetaDataTests.scala index 0724f67523f9..c3c91d81c19b 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MetaDataTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MetaDataTests.scala @@ -6,7 +6,7 @@ import io.joern.x2cpg.layers.CallGraph import io.joern.x2cpg.layers.ControlFlow import io.joern.x2cpg.layers.TypeRelations import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodParameterTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodParameterTests.scala index 4c4535132524..d3c12d8c82c2 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodParameterTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodParameterTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodParameterTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodReturnTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodReturnTests.scala index 64ab131c7323..ca33f31a7595 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodReturnTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodReturnTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class MethodReturnTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodTests.scala index b37e6825d64b..aea6f46b10d3 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/MethodTests.scala @@ -3,7 +3,9 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite import io.shiftleft.codepropertygraph.generated.EvaluationStrategies import io.shiftleft.codepropertygraph.generated.NodeTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Operators +import io.shiftleft.codepropertygraph.generated.nodes.Identifier +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class MethodTests extends C2CpgSuite { @@ -18,7 +20,7 @@ class MethodTests extends C2CpgSuite { x.name shouldBe "main" x.fullName shouldBe "main" x.code should startWith("int main(int argc, char **argv) {") - x.signature shouldBe "int main (int,char**)" + x.signature shouldBe "int(int,char**)" x.isExternal shouldBe false x.order shouldBe 1 x.filename shouldBe "Test0.c" @@ -111,8 +113,8 @@ class MethodTests extends C2CpgSuite { "should be correct for methods with line breaks / whitespace" in { inside(cpg.method("foo").l) { case List(foo) => foo.name shouldBe "foo" - foo.fullName shouldBe "foo" - foo.signature shouldBe "void foo ()" + foo.fullName shouldBe "foo:void()" + foo.signature shouldBe "void()" } } } @@ -128,7 +130,7 @@ class MethodTests extends C2CpgSuite { val List(method) = cpg.method.nameExact("foo").l method.isExternal shouldBe false method.fullName shouldBe "foo" - method.signature shouldBe "int foo (int,int)" + method.signature shouldBe "int(int,int)" method.lineNumber shouldBe Option(2) method.columnNumber shouldBe Option(1) method.lineNumberEnd shouldBe Option(4) @@ -264,10 +266,152 @@ class MethodTests extends C2CpgSuite { ) "deduplicate method forward declarations correctly" in { - cpg.method.fullName("abs").size shouldBe 1 + cpg.method.fullNameExact("abs:int(int)").size shouldBe 1 cpg.call.name("abs").callee(NoResolve).size shouldBe 1 } } + "Static modifier for methods" should { + "be correct" in { + val cpg = code( + """ + |static void staticCMethodDecl(); + |static void staticCMethodDef() {} + |""".stripMargin, + "test.c" + ).moreCode( + """ + |class A { + | static void staticCPPMethodDecl(); + | static void staticCPPMethodDef() {} + |}; + |""".stripMargin, + "test.cpp" + ) + val List(staticCMethodDecl) = cpg.method.nameExact("staticCMethodDecl").isStatic.l + val List(staticCMethodDef) = cpg.method.nameExact("staticCMethodDef").isStatic.l + val List(staticCPPMethodDecl) = cpg.method.nameExact("staticCPPMethodDecl").isStatic.l + val List(staticCPPMethodDef) = cpg.method.nameExact("staticCPPMethodDef").isStatic.l + staticCMethodDecl.fullName shouldBe "staticCMethodDecl" + staticCMethodDef.fullName shouldBe "staticCMethodDef" + staticCPPMethodDecl.fullName shouldBe "A.staticCPPMethodDecl:void()" + staticCPPMethodDef.fullName shouldBe "A.staticCPPMethodDef:void()" + } + } + + "Method name, signature and full name tests" should { + "be correct for plain C method" in { + val cpg = code( + """ + |int method(int); + |""".stripMargin, + "test.c" + ) + val List(method) = cpg.method.nameExact("method").l + method.signature shouldBe "int(int)" + method.fullName shouldBe "method" + } + + "be correct for C function pointer" in { + val cpg = code( + """ + |int (*foo)(int, int) = { 0 }; + |int (*bar[])(int, int) = { 0 }; + |""".stripMargin, + "test.c" + ) + val List(foo, bar) = cpg.local.l + foo.name shouldBe "foo" + foo.typeFullName shouldBe "int(*)(int,int)" + bar.name shouldBe "bar" + bar.typeFullName shouldBe "int(*[])(int,int)" + } + + "be correct for plain method CPP" in { + val cpg = code( + """ + |namespace NNN { + | int method(int); + |} + |""".stripMargin, + "test.cpp" + ) + val List(method) = cpg.method.nameExact("method").l + method.signature shouldBe "int(int)" + method.fullName shouldBe "NNN.method:int(int)" + } + + "be correct for plain extern C method" in { + val cpg = code( + """ + |namespace NNN { + | extern "C" { + | int method(int); + | } + |} + |""".stripMargin, + "test.cpp" + ) + val List(method) = cpg.method.nameExact("method").l + method.signature shouldBe "int(int)" + method.fullName shouldBe "method" + } + + "be correct for class method" in { + val cpg = code( + """ + |namespace NNN { + | class CCC { + | int method(int); + | } + |} + |""".stripMargin, + "test.cpp" + ) + val List(method) = cpg.method.nameExact("method").l + method.signature shouldBe "int(int)" + method.fullName shouldBe "NNN.CCC.method:int(int)" + } + + "be correct for class method with implicit member access" in { + val cpg = code( + """ + |class A { + | int var; + | void meth(); + |}; + |namespace Foo { + | void A::meth() { + | assert(this->var == var); + | } + |}""".stripMargin, + "test.cpp" + ) + val List(implicitThisParam) = cpg.method.name("meth").parameter.l + implicitThisParam.name shouldBe "this" + implicitThisParam.typeFullName shouldBe "A" + val List(trueVarAccess) = cpg.call.name(Operators.equals).argument.argumentIndex(1).isCall.l + trueVarAccess.code shouldBe "this->var" + trueVarAccess.name shouldBe Operators.indirectFieldAccess + val List(trueThisId, trueVarFieldIdent) = trueVarAccess.argument.l + trueThisId.code shouldBe "this" + trueThisId.isIdentifier shouldBe true + trueThisId.asInstanceOf[Identifier].typeFullName shouldBe "A*" + trueThisId._refOut.l shouldBe List(implicitThisParam) + trueVarFieldIdent.code shouldBe "var" + trueVarFieldIdent.isFieldIdentifier shouldBe true + + val List(varAccess) = cpg.call.name(Operators.equals).argument.argumentIndex(2).isCall.l + varAccess.code shouldBe "this->var" + varAccess.name shouldBe Operators.indirectFieldAccess + val List(thisId, varFieldIdent) = varAccess.argument.l + thisId.code shouldBe "this" + thisId.isIdentifier shouldBe true + thisId.asInstanceOf[Identifier].typeFullName shouldBe "A*" + thisId._refOut.l shouldBe List(implicitThisParam) + varFieldIdent.code shouldBe "var" + varFieldIdent.isFieldIdentifier shouldBe true + } + } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/NamespaceBlockTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/NamespaceBlockTests.scala index 200c7bed77ce..335c187314d6 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/NamespaceBlockTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/NamespaceBlockTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ProgramStructureTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ProgramStructureTests.scala index cda8183dcc8a..bef636625dac 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ProgramStructureTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/ast/ProgramStructureTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.passes.ast import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class ProgramStructureTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/CfgCreationPassTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/CfgCreationPassTests.scala index e250f37ea820..4a26d09b77a6 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/CfgCreationPassTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/CfgCreationPassTests.scala @@ -4,7 +4,7 @@ import io.joern.c2cpg.parser.FileDefaults import io.joern.c2cpg.testfixtures.CCfgTestCpg import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.* import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class CfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg) { override def code(code: String): CCfgTestCpg = { @@ -14,319 +14,341 @@ class CfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg) { "Cfg" should { "contain an entry and exit node at least" in { implicit val cpg: Cpg = code("") - succOf("func") shouldBe expected(("RET", AlwaysEdge)) - succOf("RET") shouldBe expected() + succOf("func") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("RET") should contain theSameElementsAs expected() } "be correct for decl statement with assignment" in { implicit val cpg: Cpg = code("int x = 1;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x = 1", AlwaysEdge)) - succOf("x = 1") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x = 1", AlwaysEdge)) + succOf("x = 1") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested expression" in { implicit val cpg: Cpg = code("x = y + 1;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y + 1", AlwaysEdge)) - succOf("y + 1") shouldBe expected(("x = y + 1", AlwaysEdge)) - succOf("x = y + 1") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y + 1", AlwaysEdge)) + succOf("y + 1") should contain theSameElementsAs expected(("x = y + 1", AlwaysEdge)) + succOf("x = y + 1") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for return statement" in { implicit val cpg: Cpg = code("return x;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("return x;", AlwaysEdge)) - succOf("return x;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("return x;", AlwaysEdge)) + succOf("return x;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for consecutive return statements" in { implicit val cpg: Cpg = code("return x; return y;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("return x;", AlwaysEdge)) - succOf("y") shouldBe expected(("return y;", AlwaysEdge)) - succOf("return x;") shouldBe expected(("RET", AlwaysEdge)) - succOf("return y;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("return x;", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("return y;", AlwaysEdge)) + succOf("return x;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("return y;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for void return statement" in { implicit val cpg: Cpg = code("return;") - succOf("func") shouldBe expected(("return;", AlwaysEdge)) - succOf("return;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("return;", AlwaysEdge)) + succOf("return;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for call expression" in { implicit val cpg: Cpg = code("foo(a + 1, b);") - succOf("func") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("a + 1", AlwaysEdge)) - succOf("a + 1") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("foo(a + 1, b)", AlwaysEdge)) - succOf("foo(a + 1, b)") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("a + 1", AlwaysEdge)) + succOf("a + 1") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("foo(a + 1, b)", AlwaysEdge)) + succOf("foo(a + 1, b)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for unary expression '+'" in { implicit val cpg: Cpg = code("+x;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("+x", AlwaysEdge)) - succOf("+x") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("+x", AlwaysEdge)) + succOf("+x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for unary expression '++'" in { implicit val cpg: Cpg = code("++x;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("++x", AlwaysEdge)) - succOf("++x") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("++x", AlwaysEdge)) + succOf("++x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for conditional expression" in { implicit val cpg: Cpg = code("x ? y : z;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("z", FalseEdge)) - succOf("y") shouldBe expected(("x ? y : z", AlwaysEdge)) - succOf("z") shouldBe expected(("x ? y : z", AlwaysEdge)) - succOf("x ? y : z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("z", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("x ? y : z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("x ? y : z", AlwaysEdge)) + succOf("x ? y : z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for conditional expression with empty then" in { implicit val cpg: Cpg = code("x ? : z;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("x ? : z", TrueEdge), ("z", FalseEdge)) - succOf("z") shouldBe expected(("x ? : z", AlwaysEdge)) - succOf("x ? : z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("x ? : z", TrueEdge), ("z", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("x ? : z", AlwaysEdge)) + succOf("x ? : z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for short-circuit AND expression" in { implicit val cpg: Cpg = code("int z = x && y;") - succOf("func") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("x && y", FalseEdge)) - succOf("y") shouldBe expected(("x && y", AlwaysEdge)) - succOf("x && y") shouldBe expected(("z = x && y", AlwaysEdge)) - succOf("z = x && y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("x && y", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("x && y", AlwaysEdge)) + succOf("x && y") should contain theSameElementsAs expected(("z = x && y", AlwaysEdge)) + succOf("z = x && y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for short-circuit OR expression" in { implicit val cpg: Cpg = code("x || y;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", FalseEdge), ("x || y", TrueEdge)) - succOf("y") shouldBe expected(("x || y", AlwaysEdge)) - succOf("x || y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", FalseEdge), ("x || y", TrueEdge)) + succOf("y") should contain theSameElementsAs expected(("x || y", AlwaysEdge)) + succOf("x || y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } "Cfg for while-loop" should { "be correct" in { implicit val cpg: Cpg = code("while (x < 1) { y = 2; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y = 2", AlwaysEdge)) - succOf("y = 2") shouldBe expected(("x", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y = 2", AlwaysEdge)) + succOf("y = 2") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct with break" in { implicit val cpg: Cpg = code("while (x < 1) { break; y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct with continue" in { implicit val cpg: Cpg = code("while (x < 1) { continue; y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) - succOf("continue;") shouldBe expected(("x", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("continue;") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct with nested while-loop" in { implicit val cpg: Cpg = code("while (x) { while (y) { z; }}") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("z", TrueEdge), ("x", FalseEdge)) - succOf("z") shouldBe expected(("y", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("z", TrueEdge), ("x", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("y", AlwaysEdge)) } } "Cfg for do-while-loop" should { "be correct" in { implicit val cpg: Cpg = code("do { y = 2; } while (x < 1);") - succOf("func") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y = 2", AlwaysEdge)) - succOf("y = 2") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y = 2", AlwaysEdge)) + succOf("y = 2") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) } "be correct with break" in { implicit val cpg: Cpg = code("do { break; y; } while (x < 1);") - succOf("func") shouldBe expected(("break;", AlwaysEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("break;", AlwaysEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) } "be correct with continue" in { implicit val cpg: Cpg = code("do { continue; y; } while (x < 1);") - succOf("func") shouldBe expected(("continue;", AlwaysEdge)) - succOf("continue;") shouldBe expected(("x", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("continue;", AlwaysEdge)) + succOf("continue;") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) } "be correct with nested do-while-loop" in { implicit val cpg: Cpg = code("do { do { x; } while (y); } while (z);") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("x", TrueEdge), ("z", FalseEdge)) - succOf("z") shouldBe expected(("x", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", TrueEdge), ("z", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("x", TrueEdge), ("RET", FalseEdge)) } "be correct for do-while-loop with empty body" in { implicit val cpg: Cpg = code("do { } while(x > 1);") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("1") shouldBe expected(("x > 1", AlwaysEdge)) - succOf("x > 1") shouldBe expected(("x", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x > 1", AlwaysEdge)) + succOf("x > 1") should contain theSameElementsAs expected(("x", TrueEdge), ("RET", FalseEdge)) + } + + "be correct with multiple macro calls" in { + implicit val cpg: Cpg = code( + """ + |#define deleteReset(ptr) do { delete ptr; ptr = nullptr; } while(0) + |void func(void) { + | int *foo = new int; + | int *bar = new int; + | int *baz = new int; + | deleteReset(foo); + | deleteReset(bar); + | deleteReset(baz); + |} + |""".stripMargin, + "foo.cc" + ) + succOf("deleteReset(foo)") should contain theSameElementsAs expected(("foo", 2, AlwaysEdge), ("bar", AlwaysEdge)) + succOf("foo", 2) should contain theSameElementsAs expected(("delete foo", AlwaysEdge)) + succOf("deleteReset(bar)") should contain theSameElementsAs expected(("bar", 2, AlwaysEdge), ("baz", AlwaysEdge)) + succOf("bar", 2) should contain theSameElementsAs expected(("delete bar", AlwaysEdge)) + succOf("deleteReset(baz)") should contain theSameElementsAs expected(("baz", 2, AlwaysEdge), ("RET", AlwaysEdge)) + succOf("baz", 2) should contain theSameElementsAs expected(("delete baz", AlwaysEdge)) } - } "Cfg for for-loop" should { "be correct" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { a = 3; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("x = 0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("a", TrueEdge), ("RET", FalseEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("x = 0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("a", TrueEdge), ("RET", FalseEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct with break" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { break; a = 3; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct with continue" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { continue; a = 3; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("x = 0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) - succOf("continue;") shouldBe expected(("z", AlwaysEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("x = 0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("continue;") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct with nested for-loop" in { implicit val cpg: Cpg = code("for (x; y; z) { for (a; b; c) { u; } }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("a", TrueEdge), ("RET", FalseEdge)) - succOf("z") shouldBe expected(("y", AlwaysEdge)) - succOf("a") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("u", TrueEdge), ("z", FalseEdge)) - succOf("c") shouldBe expected(("b", AlwaysEdge)) - succOf("u") shouldBe expected(("c", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("a", TrueEdge), ("RET", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("u", TrueEdge), ("z", FalseEdge)) + succOf("c") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("u") should contain theSameElementsAs expected(("c", AlwaysEdge)) } "be correct with empty condition" in { implicit val cpg: Cpg = code("for (;;) { a = 1; }") - succOf("func") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("a = 1", AlwaysEdge)) - succOf("a = 1") shouldBe expected(("a", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("a = 1", AlwaysEdge)) + succOf("a = 1") should contain theSameElementsAs expected(("a", AlwaysEdge)) } "be correct with empty condition with break" in { implicit val cpg: Cpg = code("for (;;) { break; }") - succOf("func") shouldBe expected(("break;", AlwaysEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("break;", AlwaysEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with empty condition with continue" in { implicit val cpg: Cpg = code("for (;;) { continue ; }") - succOf("func") shouldBe expected(("continue ;", AlwaysEdge)) - succOf("continue ;") shouldBe expected(("continue ;", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("continue ;", AlwaysEdge)) + succOf("continue ;") should contain theSameElementsAs expected(("continue ;", AlwaysEdge)) } "be correct with empty condition with nested empty for-loop" in { implicit val cpg: Cpg = code("for (;;) { for (;;) { x; } }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("x", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct with empty condition with empty block" in { implicit val cpg: Cpg = code("for (;;) ;") - succOf("func") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct when empty for-loop is skipped" in { implicit val cpg: Cpg = code("for (;;) {}; return;") - succOf("func") shouldBe expected(("return;", AlwaysEdge)) - succOf("return;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("return;", AlwaysEdge)) + succOf("return;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with function call condition with empty block" in { implicit val cpg: Cpg = code("for (; x(1);) ;") - succOf("func") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x(1)", AlwaysEdge)) - succOf("x(1)") shouldBe expected(("1", TrueEdge), ("RET", FalseEdge)) + succOf("func") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x(1)", AlwaysEdge)) + succOf("x(1)") should contain theSameElementsAs expected(("1", TrueEdge), ("RET", FalseEdge)) } } "Cfg for goto" should { "be correct for single label" in { implicit val cpg: Cpg = code("x; goto l1; y; l1: ;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("goto l1;", AlwaysEdge)) - succOf("goto l1;") shouldBe expected(("l1: ;", AlwaysEdge)) - succOf("l1: ;") shouldBe expected(("RET", AlwaysEdge)) - succOf("y") shouldBe expected(("l1: ;", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("goto l1;", AlwaysEdge)) + succOf("goto l1;") should contain theSameElementsAs expected(("l1: ;", AlwaysEdge)) + succOf("l1: ;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("l1: ;", AlwaysEdge)) } "be correct for GNU goto labels as values" in { @@ -336,40 +358,40 @@ class CfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg) { |otherCall(); |foo: someCall(); |""".stripMargin) - succOf("func") shouldBe expected(("ptr", AlwaysEdge)) - succOf("ptr") shouldBe expected(("foo", AlwaysEdge)) - succOf("ptr", 1) shouldBe expected(("*ptr", AlwaysEdge)) - succOf("foo") shouldBe expected(("&&foo", AlwaysEdge)) - succOf("*ptr = &&foo") shouldBe expected(("goto *;", AlwaysEdge)) - succOf("goto *;") shouldBe expected(("foo: someCall();", AlwaysEdge)) - succOf("foo: someCall();") shouldBe expected(("someCall()", AlwaysEdge)) - succOf("otherCall()") shouldBe expected(("foo: someCall();", AlwaysEdge)) - succOf("someCall()") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("ptr", AlwaysEdge)) + succOf("ptr") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("ptr", 1) should contain theSameElementsAs expected(("*ptr", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("&&foo", AlwaysEdge)) + succOf("*ptr = &&foo") should contain theSameElementsAs expected(("goto *;", AlwaysEdge)) + succOf("goto *;") should contain theSameElementsAs expected(("foo: someCall();", AlwaysEdge)) + succOf("foo: someCall();") should contain theSameElementsAs expected(("someCall()", AlwaysEdge)) + succOf("otherCall()") should contain theSameElementsAs expected(("foo: someCall();", AlwaysEdge)) + succOf("someCall()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for multiple labels" in { implicit val cpg: Cpg = code("x; goto l1; l2: y; l1: ;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("goto l1;", AlwaysEdge)) - succOf("goto l1;") shouldBe expected(("l1: ;", AlwaysEdge)) - succOf("y") shouldBe expected(("l1: ;", AlwaysEdge)) - succOf("l1: ;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("goto l1;", AlwaysEdge)) + succOf("goto l1;") should contain theSameElementsAs expected(("l1: ;", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("l1: ;", AlwaysEdge)) + succOf("l1: ;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for multiple labels on same spot" in { implicit val cpg: Cpg = code("x; goto l2; y; l1: ;l2: ;") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("goto l2;", AlwaysEdge)) - succOf("goto l2;") shouldBe expected(("l2: ;", AlwaysEdge)) - succOf("y") shouldBe expected(("l1: ;", AlwaysEdge)) - succOf("l1: ;") shouldBe expected(("l2: ;", AlwaysEdge)) - succOf("l2: ;") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("goto l2;", AlwaysEdge)) + succOf("goto l2;") should contain theSameElementsAs expected(("l2: ;", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("l1: ;", AlwaysEdge)) + succOf("l1: ;") should contain theSameElementsAs expected(("l2: ;", AlwaysEdge)) + succOf("l2: ;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "work correctly with if block" in { implicit val cpg: Cpg = code("if(foo) goto end; if(bar) { f(x); } end: ;") - succOf("func") shouldBe expected(("foo", AlwaysEdge)) - succOf("goto end;") shouldBe expected(("end: ;", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("goto end;") should contain theSameElementsAs expected(("end: ;", AlwaysEdge)) } } @@ -377,85 +399,93 @@ class CfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg) { "Cfg for switch" should { "be correct with one case" in { implicit val cpg: Cpg = code("switch (x) { case 1: y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("case 1:", CaseEdge), ("RET", CaseEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with multiple cases" in { implicit val cpg: Cpg = code("switch (x) { case 1: y; case 2: z;}") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("case 2:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("case 2:", AlwaysEdge)) - succOf("case 2:") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected( + ("case 1:", CaseEdge), + ("case 2:", CaseEdge), + ("RET", CaseEdge) + ) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("case 2:", AlwaysEdge)) + succOf("case 2:") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with multiple cases on same spot" in { implicit val cpg: Cpg = code("switch (x) { case 1: case 2: y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("case 2:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("case 2:", AlwaysEdge)) - succOf("case 2:") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected( + ("case 1:", CaseEdge), + ("case 2:", CaseEdge), + ("RET", CaseEdge) + ) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("case 2:", AlwaysEdge)) + succOf("case 2:") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with multiple cases and multiple cases on same spot" in { implicit val cpg: Cpg = code("switch (x) { case 1: case 2: y; case 3: z;}") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected( + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected( ("case 1:", CaseEdge), ("case 2:", CaseEdge), ("case 3:", CaseEdge), ("RET", CaseEdge) ) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("case 2:", AlwaysEdge)) - succOf("case 2:") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("case 3:", AlwaysEdge)) - succOf("case 3:") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("case 2:", AlwaysEdge)) + succOf("case 2:") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("case 3:", AlwaysEdge)) + succOf("case 3:") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with default case" in { implicit val cpg: Cpg = code("switch (x) { default: y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("default:", CaseEdge)) - succOf("default:") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("default:", CaseEdge)) + succOf("default:") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for case and default combined" in { implicit val cpg: Cpg = code("switch (x) { case 1: y; break; default: z;}") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("default:", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("break;", AlwaysEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("default:") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("case 1:", CaseEdge), ("default:", CaseEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", AlwaysEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("default:") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested switch" in { implicit val cpg: Cpg = code("switch (x) { case 1: switch(y) { default: z; } }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("RET", AlwaysEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("default:", CaseEdge)) - succOf("default:") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("case 1:", CaseEdge), ("RET", AlwaysEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("default:", CaseEdge)) + succOf("default:") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch containing continue statement" in { @@ -467,42 +497,62 @@ class CfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg) { | } |} |""".stripMargin) - succOf("continue;") shouldBe expected(("i", AlwaysEdge)) + succOf("continue;") should contain theSameElementsAs expected(("i", AlwaysEdge)) } } "Cfg for if" should { "be correct" in { implicit val cpg: Cpg = code("if (x) { y; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with else block" in { implicit val cpg: Cpg = code("if (x) { y; } else { z; }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("z", FalseEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("z", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with nested if" in { implicit val cpg: Cpg = code("if (x) { if (y) { z; } }") - succOf("func") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("z", TrueEdge), ("RET", FalseEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("z", TrueEdge), ("RET", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct with else if chain" in { implicit val cpg: Cpg = code("if (a) { b; } else if (c) { d;} else { e; }") - succOf("func") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("b", TrueEdge), ("c", FalseEdge)) - succOf("b") shouldBe expected(("RET", AlwaysEdge)) - succOf("c") shouldBe expected(("d", TrueEdge), ("e", FalseEdge)) - succOf("d") shouldBe expected(("RET", AlwaysEdge)) - succOf("e") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", TrueEdge), ("c", FalseEdge)) + succOf("b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("d", TrueEdge), ("e", FalseEdge)) + succOf("d") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("e") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + } + + "be correct for empty 'then' block" in { + implicit val cpg: Cpg = code("if (cond()) {} else { foo(); }") + succOf("func") should contain theSameElementsAs expected(("cond()", AlwaysEdge)) + succOf("cond()") should contain theSameElementsAs expected(("RET", TrueEdge), ("foo()", FalseEdge)) + succOf("foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + } + + "be correct for empty 'else' block" in { + implicit val cpg: Cpg = code("if (cond()) {foo();} else {}") + succOf("func") should contain theSameElementsAs expected(("cond()", AlwaysEdge)) + succOf("cond()") should contain theSameElementsAs expected(("RET", FalseEdge), ("foo()", TrueEdge)) + succOf("foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + } + + "be correct for empty 'then' and 'else' block" in { + implicit val cpg: Cpg = code("if (cond()) {} else {}") + succOf("func") should contain theSameElementsAs expected(("cond()", AlwaysEdge)) + succOf("cond()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } } @@ -516,9 +566,9 @@ class CppCfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg(FileD "be correct for try with a single catch" in { implicit val cpg: Cpg = code("try { a; } catch (int x) { b; }") - succOf("func") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("b", AlwaysEdge), ("RET", AlwaysEdge)) - succOf("b") shouldBe expected(("RET", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", AlwaysEdge), ("RET", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for try with multiple catches" in { @@ -533,13 +583,41 @@ class CppCfgCreationPassTests extends CfgTestFixture(() => new CCfgTestCpg(FileD | d; |} |""".stripMargin) - succOf("func") shouldBe expected(("a", AlwaysEdge)) + succOf("func") should contain theSameElementsAs expected(("a", AlwaysEdge)) // Try should have an edge to all catches and return - succOf("a") shouldBe expected(("b", AlwaysEdge), ("c", AlwaysEdge), ("d", AlwaysEdge), ("RET", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected( + ("b", AlwaysEdge), + ("c", AlwaysEdge), + ("d", AlwaysEdge), + ("RET", AlwaysEdge) + ) // But catches should only have edges to return - succOf("b") shouldBe expected(("RET", AlwaysEdge)) - succOf("c") shouldBe expected(("RET", AlwaysEdge)) - succOf("d") shouldBe expected(("RET", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("d") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + } + + "be correct for throw statement" in { + implicit val cpg: Cpg = code(""" + |throw foo(); + |bar(); + |""".stripMargin) + succOf("func") should contain theSameElementsAs expected(("foo()", AlwaysEdge)) + succOf("foo()") should contain theSameElementsAs expected(("throw foo()", AlwaysEdge)) + succOf("throw foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("bar()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + } + + "be correct for throw statement in if-else" in { + implicit val cpg: Cpg = code(""" + |if (true) throw foo(); + |else bar(); + |""".stripMargin) + succOf("func") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("foo()", TrueEdge), ("bar()", FalseEdge)) + succOf("foo()") should contain theSameElementsAs expected(("throw foo()", AlwaysEdge)) + succOf("throw foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("bar()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/MethodCfgLayoutTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/MethodCfgLayoutTests.scala index d2c5042faa88..27b285307716 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/MethodCfgLayoutTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/MethodCfgLayoutTests.scala @@ -1,9 +1,9 @@ package io.joern.c2cpg.passes.cfg import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodCfgLayoutTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/ClassTypeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/ClassTypeTests.scala index 786c38b32968..332c7e5e6c0c 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/ClassTypeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/ClassTypeTests.scala @@ -2,7 +2,7 @@ package io.joern.c2cpg.passes.types import io.joern.c2cpg.parser.FileDefaults import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class ClassTypeTests extends C2CpgSuite(FileDefaults.CPP_EXT) { @@ -129,6 +129,7 @@ class ClassTypeTests extends C2CpgSuite(FileDefaults.CPP_EXT) { cpg.typeDecl.file.filter(_.name.endsWith(FileDefaults.CPP_EXT)).l should not be empty } } + "handling C++ classes (code example 3)" should { "generate correct call fullnames" in { val cpg = code(""" @@ -144,6 +145,7 @@ class ClassTypeTests extends C2CpgSuite(FileDefaults.CPP_EXT) { |public: | void foo1() { | b.foo2(); + | B x = b; | } |}; | @@ -154,7 +156,31 @@ class ClassTypeTests extends C2CpgSuite(FileDefaults.CPP_EXT) { |}""".stripMargin) val List(call) = cpg.call("foo2").l - call.methodFullName shouldBe "B.foo2" + call.methodFullName shouldBe "B.foo2:void()" + cpg.fieldIdentifier.canonicalNameExact("b").inCall.code.l shouldBe List("this->b", "this->b") + } + } + + "handling C++ class constructors" should { + "generate correct types" in { + val cpg = code(""" + |class FooT : public Foo { + | public: + | FooT( + | const std::string& a, + | const Bar::SomeClass& b + | ): Bar::Foo(a, b) {} + |}""".stripMargin) + val List(constructor) = cpg.typeDecl.nameExact("FooT").method.isConstructor.l + constructor.signature shouldBe "Bar.Foo(std.string,Bar.SomeClass)" + val List(thisP, p1, p2) = constructor.parameter.l + thisP.name shouldBe "this" + thisP.typeFullName shouldBe "FooT" + thisP.index shouldBe 0 + p1.typ.fullName shouldBe "std.string" + p1.index shouldBe 1 + p2.typ.fullName shouldBe "Bar.SomeClass" + p2.index shouldBe 2 } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/EnumTypeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/EnumTypeTests.scala index 27dd1b780dd2..48d4cafc9034 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/EnumTypeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/EnumTypeTests.scala @@ -6,7 +6,7 @@ import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.codepropertygraph.generated.nodes.FieldIdentifier import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class EnumTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/NamespaceTypeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/NamespaceTypeTests.scala index b91ad6f66604..e219fb585fca 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/NamespaceTypeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/NamespaceTypeTests.scala @@ -6,7 +6,7 @@ import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.codepropertygraph.generated.nodes.FieldIdentifier import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { @@ -35,8 +35,8 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { |} |""".stripMargin) inside(cpg.method.isNotStub.fullName.l) { case List(f, m) => - f shouldBe "Q.V.f" - m shouldBe "Q.V.C.m" + f shouldBe "Q.V.f:int()" + m shouldBe "Q.V.C.m:int()" } inside(cpg.namespaceBlock.nameNot("").l) { case List(q, v) => @@ -50,9 +50,9 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { inside(q.method.l) { case List(f, m) => f.name shouldBe "f" - f.fullName shouldBe "Q.V.f" + f.fullName shouldBe "Q.V.f:int()" m.name shouldBe "m" - m.fullName shouldBe "Q.V.C.m" + m.fullName shouldBe "Q.V.C.m:int()" } } @@ -66,25 +66,21 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { | int f(); // f is a member of V, but is only declared here |} | - |int V::f() // definition of V's member f outside of V + |int Q::V::f() // definition of V's member f outside of V | // f's enclosing namespaces are still the global namespace, Q, and Q::V |{ - | extern void h(); // This declares ::Q::V::h + | extern void h(); | return 0; |} | - |int V::C::m() // definition of V::C::m outside of the namespace (and the class body) + |int Q::V::C::m() // definition of V::C::m outside of the namespace (and the class body) | // enclosing namespaces are the global namespace, Q, and Q::V |{ return 0; } |""".stripMargin) - inside(cpg.method.nameNot("").fullName.l) { case List(m1, f1, f2, h, m2) => - // TODO: this looks strange too it first glance. But as Eclipse CDT does not provide any - // mapping from definitions outside of namespace into them we cant reconstruct proper full-names. - m1 shouldBe "Q.V.C.m" - f1 shouldBe "Q.V.f" - h shouldBe "V.f.h" - f2 shouldBe "V.f" - m2 shouldBe "V.C.m" + inside(cpg.method.nameNot("").fullName.l) { case List(f, m, h) => + f shouldBe "Q.V.f:int()" + m shouldBe "Q.V.C.m:int()" + h shouldBe "h:void()" } inside(cpg.namespaceBlock.nameNot("").l) { case List(q, v) => @@ -129,9 +125,9 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { } inside(cpg.method.internal.nameNot("").fullName.l) { case List(f, g, h) => - f shouldBe "f" - g shouldBe "A.g" - h shouldBe "h" + f shouldBe "f:void()" + g shouldBe "A.g:void()" + h shouldBe "h:void()" } inside(cpg.method.nameExact("h").ast.isCall.code.l) { case List(c1, c2, c3, c4) => @@ -164,17 +160,17 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { namespaceX.fullName shouldBe "X" } - inside(cpg.method.internal.nameNot("").fullName.l) { case List(f, g, h) => - f shouldBe "f" - g shouldBe "A.g" - h shouldBe "h" + inside(cpg.method.internal.nameNot("").fullName.l) { case List(h, f, g) => + h shouldBe "h:void()" + f shouldBe "f:void()" + g shouldBe "A.g:void()" } inside(cpg.call.filterNot(_.name == Operators.fieldAccess).l) { case List(f, g) => - f.name shouldBe "X.f" - f.methodFullName shouldBe "X.f" - g.name shouldBe "X.g" - g.methodFullName shouldBe "X.g" + f.name shouldBe "f" + f.methodFullName shouldBe "f:void()" + g.name shouldBe "g" + g.methodFullName shouldBe "A.g:void()" } } @@ -203,20 +199,20 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { a2.fullName shouldBe "A" } - inside(cpg.method.internal.nameNot("").l) { case List(f1, f2, foo, bar) => - f1.fullName shouldBe "A.f" - f1.signature shouldBe "void A.f (int)" - f2.fullName shouldBe "A.f" - f2.signature shouldBe "void A.f (char)" - foo.fullName shouldBe "foo" - bar.fullName shouldBe "bar" + inside(cpg.method.internal.nameNot("").l) { case List(foo, bar, f1, f2) => + f1.fullName shouldBe "A.f:void(int)" + f1.signature shouldBe "void(int)" + f2.fullName shouldBe "A.f:void(char)" + f2.signature shouldBe "void(char)" + foo.fullName shouldBe "foo:void()" + bar.fullName shouldBe "bar:void()" } inside(cpg.call.l) { case List(c1, c2) => c1.name shouldBe "f" - c1.methodFullName shouldBe "f" + c1.methodFullName shouldBe "A.f:void(int)" c2.name shouldBe "f" - c2.methodFullName shouldBe "f" + c2.methodFullName shouldBe "A.f:void(char)" } } @@ -371,35 +367,16 @@ class NamespaceTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { finalClasses.name shouldBe "FinalClasses" finalClasses.fullName shouldBe "FinalClasses" } - inside(cpg.typ.name("A").derivedTypeTransitive.l) { case List(b1, c11, c12, b2, c21, c22, c23) => - b1.name shouldBe "B1" - b1.fullName shouldBe "IntermediateClasses.B1" - b1.typeDeclFullName shouldBe "IntermediateClasses.B1" - - c11.name shouldBe "C11" - c11.fullName shouldBe "FinalClasses.C11" - c11.typeDeclFullName shouldBe "FinalClasses.C11" - - c12.name shouldBe "C12" - c12.fullName shouldBe "FinalClasses.C12" - c12.typeDeclFullName shouldBe "FinalClasses.C12" - b2.name shouldBe "B2" - b2.fullName shouldBe "IntermediateClasses.B2" - b2.typeDeclFullName shouldBe "IntermediateClasses.B2" - - c21.name shouldBe "C21" - c21.fullName shouldBe "FinalClasses.C21" - c21.typeDeclFullName shouldBe "FinalClasses.C21" - - c22.name shouldBe "C22" - c22.fullName shouldBe "FinalClasses.C22" - c22.typeDeclFullName shouldBe "FinalClasses.C22" - - c23.name shouldBe "C23" - c23.fullName shouldBe "FinalClasses.C23" - c23.typeDeclFullName shouldBe "FinalClasses.C23" - } + cpg.typ.name("A").derivedTypeTransitive.typeDeclFullName.sorted.l shouldBe List( + "FinalClasses.C11", + "FinalClasses.C12", + "FinalClasses.C21", + "FinalClasses.C22", + "FinalClasses.C23", + "IntermediateClasses.B1", + "IntermediateClasses.B2" + ) } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/StructTypeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/StructTypeTests.scala index c6cfba93a1d4..8b4b9b76c92f 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/StructTypeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/StructTypeTests.scala @@ -2,7 +2,7 @@ package io.joern.c2cpg.passes.types import io.joern.c2cpg.testfixtures.C2CpgSuite import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class StructTypeTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TemplateTypeTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TemplateTypeTests.scala index 8185d8023015..050c9603ea52 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TemplateTypeTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TemplateTypeTests.scala @@ -2,7 +2,7 @@ package io.joern.c2cpg.passes.types import io.joern.c2cpg.parser.FileDefaults import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class TemplateTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { @@ -72,11 +72,11 @@ class TemplateTypeTests extends C2CpgSuite(fileSuffix = FileDefaults.CPP_EXT) { |""".stripMargin) inside(cpg.method.nameNot("").internal.l) { case List(x, y) => x.name shouldBe "x" - x.fullName shouldBe "x" - x.signature shouldBe "void x (T,U)" + x.fullName shouldBe "x:void(ANY,ANY)" + x.signature shouldBe "void(T,U)" y.name shouldBe "y" - y.fullName shouldBe "y" - y.signature shouldBe "void y (T,U)" + y.fullName shouldBe "y:void(ANY,ANY)" + y.signature shouldBe "void(T,U)" } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TypeNodePassTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TypeNodePassTests.scala index 01a1ffa70919..9e48c9ffdc65 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TypeNodePassTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/types/TypeNodePassTests.scala @@ -1,9 +1,9 @@ package io.joern.c2cpg.passes.types import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TypeNodePassTests extends C2CpgSuite { @@ -16,8 +16,20 @@ class TypeNodePassTests extends C2CpgSuite { |""".stripMargin) val List(foo) = cpg.typeDecl.nameExact("foo").l val List(bar) = cpg.typeDecl.nameExact("bar").l - foo.aliasTypeFullName shouldBe Option("char") - bar.aliasTypeFullName shouldBe Option("char") + foo.aliasTypeFullName shouldBe Option("char*") + bar.aliasTypeFullName shouldBe Option("char**") + } + + "be correct for reference to type" in { + val cpg = code( + """ + |typedef const char (&TwoChars)[2]; + |""".stripMargin, + "twochars.cpp" + ) + val List(bar) = cpg.typeDecl.nameExact("TwoChars").l + bar.fullName shouldBe "TwoChars" + bar.aliasTypeFullName shouldBe Option("char(&)[2]") } "be correct for static decl assignment" in { @@ -126,12 +138,11 @@ class TypeNodePassTests extends C2CpgSuite { |} |""".stripMargin) inside(cpg.call("free").argument(1).l) { case List(arg) => - arg.evalType.l shouldBe List("test") + arg.evalType.l shouldBe List("test*") arg.code shouldBe "ptr" inside(arg.typ.referencedTypeDecl.l) { case List(tpe) => - tpe.fullName shouldBe "test" - tpe.name shouldBe "test" - tpe.code should startWith("struct test") + tpe.fullName shouldBe "test*" + tpe.name shouldBe "test*" } inside(cpg.local.l) { case List(ptr) => ptr.name shouldBe "ptr" @@ -139,9 +150,8 @@ class TypeNodePassTests extends C2CpgSuite { ptr.code shouldBe "struct test* ptr" } inside(cpg.local.typ.referencedTypeDecl.l) { case List(tpe) => - tpe.name shouldBe "test" - tpe.fullName shouldBe "test" - tpe.code should startWith("struct test") + tpe.name shouldBe "test*" + tpe.fullName shouldBe "test*" } } } @@ -169,7 +179,7 @@ class TypeNodePassTests extends C2CpgSuite { |} |""".stripMargin) inside(cpg.local.typ.referencedTypeDecl.l) { case List(tpe) => - tpe.fullName shouldBe "Foo" + tpe.fullName shouldBe "Foo*" } } @@ -194,6 +204,42 @@ class TypeNodePassTests extends C2CpgSuite { } } } + + "be correct for volatile types" in { + val cpg = code(""" + |void func(void) { + | static volatile int **ipp; + | static int *ip; + | static volatile int i = 0; + | + | ipp = &ip; + | ipp = (int**) &ip; + | *ipp = &i; + | if (*ip != 0) {} + |}""".stripMargin) + cpg.identifier.nameExact("ipp").typeFullName.distinct.l shouldBe List("volatile int**") + cpg.identifier.nameExact("ip").typeFullName.distinct.l shouldBe List("int*") + cpg.identifier.nameExact("i").typeFullName.distinct.l shouldBe List("volatile int") + cpg.local.nameExact("ipp").typeFullName.l shouldBe List("volatile int**") + cpg.local.nameExact("ip").typeFullName.l shouldBe List("int*") + cpg.local.nameExact("i").typeFullName.l shouldBe List("volatile int") + } + + "be correct for referenced types from locals" in { + val cpg = code(""" + |struct flex { + | int a; + | char b[]; + |}; + |void foo() { + | struct flex *ptr = malloc(sizeof(struct flex)); + | struct flex value = {0}; + |}""".stripMargin) + val List(value) = cpg.typeDecl.fullNameExact("flex").referencingType.fullNameExact("flex").localOfType.l + value.name shouldBe "value" + value.typeFullName shouldBe "flex" + value.code shouldBe "struct flex value" + } } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/AstQueryTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/AstQueryTests.scala index b77feba015d4..f3b9675ec390 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/AstQueryTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/AstQueryTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.querying import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AstQueryTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/CfgQueryTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/CfgQueryTests.scala index f66694c2ceb2..8c31b9ce4a69 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/CfgQueryTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/CfgQueryTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.querying import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CfgQueryTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/DdgCfgQueryTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/DdgCfgQueryTests.scala index befa06bf7d00..f2e558ed8dd9 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/DdgCfgQueryTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/DdgCfgQueryTests.scala @@ -2,8 +2,8 @@ package io.joern.c2cpg.querying import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* class DdgCfgQueryTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocalQueryTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocalQueryTests.scala index d858744b122e..ae0acd31eb25 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocalQueryTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocalQueryTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.querying import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* /** Language primitives for navigating local variables */ diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocationQueryTests.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocationQueryTests.scala index a4bc22e264c4..7ac71e73f9fe 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocationQueryTests.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/querying/LocationQueryTests.scala @@ -1,7 +1,7 @@ package io.joern.c2cpg.querying import io.joern.c2cpg.testfixtures.C2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocationQueryTests extends C2CpgSuite { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/AstC2CpgFrontend.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/AstC2CpgFrontend.scala index 4c0e6eac0c2f..71d522a20ae0 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/AstC2CpgFrontend.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/AstC2CpgFrontend.scala @@ -3,9 +3,11 @@ package io.joern.c2cpg.testfixtures import better.files.File import io.joern.c2cpg.Config import io.joern.c2cpg.passes.AstCreationPass +import io.joern.c2cpg.passes.FunctionDeclNodePass import io.joern.x2cpg.testfixtures.LanguageFrontend +import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.X2Cpg.newEmptyCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait AstC2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { @@ -19,6 +21,8 @@ trait AstC2CpgFrontend extends LanguageFrontend { .withOutputPath(pathAsString) val astCreationPass = new AstCreationPass(cpg, config) astCreationPass.createAndApply() + new FunctionDeclNodePass(cpg, astCreationPass.unhandledMethodDeclarations())(ValidationMode.Enabled) + .createAndApply() cpg } } diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/C2CpgFrontend.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/C2CpgFrontend.scala index 5d800eb7646b..83bead41572c 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/C2CpgFrontend.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/C2CpgFrontend.scala @@ -4,7 +4,7 @@ import better.files.File import io.joern.c2cpg.C2Cpg import io.joern.c2cpg.Config import io.joern.x2cpg.testfixtures.LanguageFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait C2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { diff --git a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/DataFlowCodeToCpgSuite.scala b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/DataFlowCodeToCpgSuite.scala index 16211eb85508..7e3498ff8d24 100644 --- a/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/DataFlowCodeToCpgSuite.scala +++ b/joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/testfixtures/DataFlowCodeToCpgSuite.scala @@ -27,7 +27,7 @@ class DataFlowCodeToCpgSuite extends Code2CpgFixture(() => new DataFlowTestCpg() protected implicit val context: EngineContext = EngineContext() protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + path.resultPairs().collect { case (firstElement: String, secondElement) => (firstElement, secondElement.getOrElse(-1)) } } diff --git a/joern-cli/frontends/csharpsrc2cpg/build.sbt b/joern-cli/frontends/csharpsrc2cpg/build.sbt index 7423eed2d697..dccd5f859080 100644 --- a/joern-cli/frontends/csharpsrc2cpg/build.sbt +++ b/joern-cli/frontends/csharpsrc2cpg/build.sbt @@ -60,8 +60,8 @@ astGenBinaryNames := { case Environment.OperatingSystemType.Windows => Seq(AstgenWin) case Environment.OperatingSystemType.Linux => Environment.architecture match { - case Environment.ArchitectureType.X86 => Seq(AstgenLinux) - case Environment.ArchitectureType.ARM => Seq(AstgenLinuxArm) + case Environment.ArchitectureType.X86 => Seq(AstgenLinux) + case Environment.ArchitectureType.ARMv8 => Seq(AstgenLinuxArm) } case Environment.OperatingSystemType.Mac => Seq(AstgenMac) case Environment.OperatingSystemType.Unknown => diff --git a/joern-cli/frontends/csharpsrc2cpg/csharpsrc2cpg.sh b/joern-cli/frontends/csharpsrc2cpg/csharpsrc2cpg.sh index 3739ac799b66..0c98d8935cab 100755 --- a/joern-cli/frontends/csharpsrc2cpg/csharpsrc2cpg.sh +++ b/joern-cli/frontends/csharpsrc2cpg/csharpsrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/csharpsrc2cpg $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/csharpsrc2cpg.sh" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/CSharpSrc2Cpg.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/CSharpSrc2Cpg.scala index 7939fe89f4d2..096ccca8c4d4 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/CSharpSrc2Cpg.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/CSharpSrc2Cpg.scala @@ -13,7 +13,7 @@ import io.joern.x2cpg.passes.callgraph.NaiveCallLinker import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass} import io.joern.x2cpg.utils.{ConcurrentTaskUtil, Environment, HashUtil, Report} import io.joern.x2cpg.{SourceFiles, X2CpgFrontend} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.passes.CpgPassBase import org.slf4j.LoggerFactory @@ -42,13 +42,15 @@ class CSharpSrc2Cpg extends X2CpgFrontend[Config] { case Failure(exception) => logger.warn(s"Unable to pre-parse C# file, skipping - ", exception); None case Success(summary) => Option(summary) } - .foldLeft(CSharpProgramSummary(imports = CSharpProgramSummary.initialImports))(_ ++ _) + .foldLeft(CSharpProgramSummary(imports = CSharpProgramSummary.initialImports))(_ ++= _) val builtinSummary = CSharpProgramSummary( - CSharpProgramSummary.BuiltinTypes.view.filterKeys(internalProgramSummary.imports(_)).toMap + mutable.Map + .fromSpecific(CSharpProgramSummary.BuiltinTypes.view.filterKeys(internalProgramSummary.imports(_))) + .result() ) - val internalAndBuiltinSummary = internalProgramSummary ++ builtinSummary + val internalAndBuiltinSummary = internalProgramSummary ++= builtinSummary val hash = HashUtil.sha256(astCreators.map(_.parserResult).map(x => Paths.get(x.fullPath))) new MetaDataPass(cpg, Languages.CSHARPSRC, config.inputPath, Option(hash)).createAndApply() diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/Main.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/Main.scala index ad7d954d2553..2333179302cb 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/Main.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/Main.scala @@ -2,7 +2,7 @@ package io.joern.csharpsrc2cpg import io.joern.csharpsrc2cpg.Frontend.{cmdLineParser, defaultConfig} import io.joern.x2cpg.astgen.AstGenConfig -import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery} +import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery, XTypeRecoveryConfig} import io.joern.x2cpg.utils.Environment import io.joern.x2cpg.{DependencyDownloadConfig, X2CpgConfig, X2CpgMain} import org.slf4j.LoggerFactory @@ -31,7 +31,11 @@ object Frontend { val cmdLineParser: OParser[Unit, Config] = { val builder = OParser.builder[Config] import builder.* - OParser.sequence(programName("csharpsrc2cpg"), DependencyDownloadConfig.parserOptions, XTypeRecovery.parserOptions) + OParser.sequence( + programName("csharpsrc2cpg"), + DependencyDownloadConfig.parserOptions, + XTypeRecoveryConfig.parserOptionsForParserConfig + ) } } diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreator.scala index 90291c57fcb6..bd420286d8bb 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreator.scala @@ -8,9 +8,8 @@ import io.joern.x2cpg.astgen.{AstGenNodeBuilder, ParserResult} import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode} import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.{NewFile, NewTypeDecl} -import io.shiftleft.passes.IntervalKeyPool import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import ujson.Value import java.math.BigInteger diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreatorHelper.scala index 0048e2297a9c..7e284e250531 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstCreatorHelper.scala @@ -3,14 +3,15 @@ package io.joern.csharpsrc2cpg.astcreation import io.joern.csharpsrc2cpg.parser.DotNetJsonAst.* import io.joern.csharpsrc2cpg.parser.{DotNetJsonAst, DotNetNodeInfo, ParserKeys} import io.joern.csharpsrc2cpg.{CSharpDefines, Constants, astcreation} +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.{Ast, Defines, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, PropertyNames} -import io.shiftleft.passes.IntervalKeyPool import ujson.Value import scala.annotation.tailrec import scala.util.{Failure, Success, Try} + trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: AstCreator => private val anonymousTypeKeyPool = new IntervalKeyPool(first = 0, last = Long.MaxValue) @@ -83,7 +84,7 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As case x: NewMethodParameterIn => identifierNode(dotNetNode.orNull, x.name, x.code, x.typeFullName, x.dynamicTypeHintFullName) case x => - logger.warn(s"Unhandled declaration type '${x.label()}' for ${x.name}") + logger.warn(s"Unhandled declaration type '${x.label}' for ${x.name}") identifierNode(dotNetNode.orNull, x.name, x.name, Defines.Any) } @@ -170,10 +171,10 @@ object AstCreatorHelper { */ def createDotNetNodeInfo(json: Value, relativeFileName: Option[String] = None): DotNetNodeInfo = { val metaData = json(ParserKeys.MetaData) - val ln = metaData(ParserKeys.LineStart).numOpt.map(_.toInt.asInstanceOf[Integer]) - val cn = metaData(ParserKeys.ColumnStart).numOpt.map(_.toInt.asInstanceOf[Integer]) - val lnEnd = metaData(ParserKeys.LineEnd).numOpt.map(_.toInt.asInstanceOf[Integer]) - val cnEnd = metaData(ParserKeys.ColumnEnd).numOpt.map(_.toInt.asInstanceOf[Integer]) + val ln = metaData(ParserKeys.LineStart).numOpt.map(_.toInt) + val cn = metaData(ParserKeys.ColumnStart).numOpt.map(_.toInt) + val lnEnd = metaData(ParserKeys.LineEnd).numOpt.map(_.toInt) + val cnEnd = metaData(ParserKeys.ColumnEnd).numOpt.map(_.toInt) val node = nodeType(metaData, relativeFileName) val c = node.toString match case "Attribute" => diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstForStatementsCreator.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstForStatementsCreator.scala index ab43bff6aa2d..9e0fd7cc592e 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstForStatementsCreator.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstForStatementsCreator.scala @@ -295,16 +295,11 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t * Thus, this is lowered as a try-finally, with finally making a call to `Dispose` on the declared variable. */ private def astForUsingStatement(usingStmt: DotNetNodeInfo): Seq[Ast] = { - val tryNode = NewControlStructure() - .controlStructureType(ControlStructureTypes.TRY) - .code(code(usingStmt)) - .lineNumber(line(usingStmt)) - .columnNumber(column(usingStmt)) + val tryNode = controlStructureNode(usingStmt, ControlStructureTypes.TRY, code(usingStmt)) val declAst = Try(createDotNetNodeInfo(usingStmt.json(ParserKeys.Declaration))) match { case Success(declNodevalue) => astForNode(declNodevalue) case _ => Seq.empty[Ast] } - val tryNodeInfo = createDotNetNodeInfo(usingStmt.json(ParserKeys.Statement)) val tryAst = astForBlock(tryNodeInfo, Option("try")) @@ -322,11 +317,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t ) val disposeAst = callAst(disposeCall, receiver = Option(Ast(id))) val childrenAst = Ast(blockNode(usingStmt)).withChild(disposeAst) - val finallyNode = NewControlStructure() - .controlStructureType(ControlStructureTypes.FINALLY) - .code("finally") - .lineNumber(line(usingStmt)) - .columnNumber(column(usingStmt)) + val finallyNode = controlStructureNode(usingStmt, ControlStructureTypes.FINALLY, "finally") Ast(finallyNode).withChild(childrenAst) } diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstSummaryVisitor.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstSummaryVisitor.scala index 5e8efbe5cdb9..9915b71c51d9 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstSummaryVisitor.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/astcreation/AstSummaryVisitor.scala @@ -1,14 +1,22 @@ package io.joern.csharpsrc2cpg.astcreation +import flatgraph.DiffGraphApplier.applyDiff import io.joern.csharpsrc2cpg.Constants -import io.joern.csharpsrc2cpg.datastructures.{CSharpField, CSharpMethod, CSharpProgramSummary, CSharpType} +import io.joern.csharpsrc2cpg.datastructures.{ + CSharpField, + CSharpMethod, + CSharpProgramSummary, + CSharpType, + NamespaceToTypeMap +} + import io.joern.csharpsrc2cpg.parser.ParserKeys import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{Cpg, DiffGraphBuilder, EdgeTypes} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes} import io.shiftleft.semanticcpg.language.* -import overflowdb.{BatchedUpdate, Config} +import scala.collection.mutable import scala.util.Using /** Allows the AST creator to run at a signature-only level and query the resulting CPG to build up a look-ahead cache. @@ -21,19 +29,19 @@ trait AstSummaryVisitor(implicit withSchemaValidation: ValidationMode) { this: A this.parseLevel = AstParseLevel.SIGNATURES val fileNode = NewFile().name(relativeFileName) val compilationUnit = createDotNetNodeInfo(parserResult.json(ParserKeys.AstRoot)) - Using.resource(Cpg.withConfig(Config.withoutOverflow())) { cpg => + Using.resource(Cpg.empty) { cpg => // Build and store compilation unit AST val ast = Ast(fileNode).withChildren(astForCompilationUnit(compilationUnit)) Ast.storeInDiffGraph(ast, diffGraph) - BatchedUpdate.applyDiff(cpg.graph, diffGraph) + applyDiff(cpg.graph, diffGraph) // Simulate AST Linker for global namespace val globalNode = NewNamespaceBlock().fullName(Constants.Global).name(Constants.Global) - val globalDiffGraph = new DiffGraphBuilder + val globalDiffGraph = Cpg.newDiffGraphBuilder cpg.typeDecl .where(_.astParentFullNameExact(Constants.Global)) .foreach(globalDiffGraph.addEdge(globalNode, _, EdgeTypes.AST)) - BatchedUpdate.applyDiff(cpg.graph, globalDiffGraph) + applyDiff(cpg.graph, globalDiffGraph) // Summarize findings summarize(cpg) @@ -63,11 +71,13 @@ trait AstSummaryVisitor(implicit withSchemaValidation: ValidationMode) { this: A CSharpField(f.name, f.typeFullName) } - val mapping = cpg.namespaceBlock.map { namespace => - namespace.fullName -> namespace.typeDecl.map { typ => - CSharpType(typ.fullName, typ.method.map(toMethod).l, typ.member.map(toField).l) - }.toSet - }.toMap + val mapping = mutable.Map + .from(cpg.namespaceBlock.map { namespace => + namespace.fullName -> mutable.Set.from(namespace.typeDecl.map { typ => + CSharpType(typ.fullName, typ.method.map(toMethod).l, typ.member.map(toField).l) + }) + }) + .asInstanceOf[NamespaceToTypeMap] CSharpProgramSummary(mapping, imports) } diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/datastructures/CSharpProgramSummary.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/datastructures/CSharpProgramSummary.scala index 63dd25eb54b4..ca6598bea083 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/datastructures/CSharpProgramSummary.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/datastructures/CSharpProgramSummary.scala @@ -12,10 +12,11 @@ import scala.collection.mutable.ListBuffer import scala.io.Source import scala.util.{Failure, Success, Try} import java.net.JarURLConnection +import scala.collection.mutable import scala.util.Using import scala.jdk.CollectionConverters.* -type NamespaceToTypeMap = Map[String, Set[CSharpType]] +type NamespaceToTypeMap = mutable.Map[String, mutable.Set[CSharpType]] /** A mapping of type stubs of known types within the scope of the analysis. * @@ -24,14 +25,14 @@ type NamespaceToTypeMap = Map[String, Set[CSharpType]] * @see * [[CSharpProgramSummary.jsonToInitialMapping]] for generating initial mappings. */ -case class CSharpProgramSummary(val namespaceToType: NamespaceToTypeMap, val imports: Set[String]) - extends ProgramSummary[CSharpType] { +case class CSharpProgramSummary(namespaceToType: NamespaceToTypeMap, imports: Set[String]) + extends ProgramSummary[CSharpType, CSharpMethod, CSharpField] { - def findGlobalTypes: Set[CSharpType] = namespaceToType.getOrElse(Constants.Global, Set.empty) + def findGlobalTypes: Set[CSharpType] = namespaceToType.getOrElse(Constants.Global, Set.empty).toSet - @targetName("add") - def ++(other: CSharpProgramSummary): CSharpProgramSummary = { - new CSharpProgramSummary(ProgramSummary.combine(namespaceToType, other.namespaceToType), imports ++ other.imports) + @targetName("appendAll") + def ++=(other: CSharpProgramSummary): CSharpProgramSummary = { + new CSharpProgramSummary(ProgramSummary.merge(namespaceToType, other.namespaceToType), imports ++ other.imports) } } @@ -42,11 +43,14 @@ object CSharpProgramSummary { // the types and their methods are exposed through autoboxing of primitives def initialImports: Set[String] = Set("", "System") - def apply(namespaceToType: NamespaceToTypeMap = Map.empty, imports: Set[String] = Set.empty): CSharpProgramSummary = + def apply( + namespaceToType: NamespaceToTypeMap = mutable.Map.empty, + imports: Set[String] = Set.empty + ): CSharpProgramSummary = new CSharpProgramSummary(namespaceToType, imports) def apply(summaries: Iterable[CSharpProgramSummary]): CSharpProgramSummary = - summaries.foldLeft(CSharpProgramSummary())(_ ++ _) + summaries.foldLeft(CSharpProgramSummary())(_ ++= _) private val logger = LoggerFactory.getLogger(getClass) @@ -54,9 +58,11 @@ object CSharpProgramSummary { * a mapping of the `System` package types. */ def BuiltinTypes: NamespaceToTypeMap = { - jsonToInitialMapping(mergeBuiltInTypesJson) match - case Failure(exception) => logger.warn("Unable to parse JSON type entry from builtin types", exception); Map.empty - case Success(mapping) => mapping + jsonToInitialMapping(mergeBuiltInTypesJson) match { + case Failure(exception) => + logger.warn("Unable to parse JSON type entry from builtin types", exception); mutable.Map.empty + case Success(mapping) => mapping + } } /** Converts a JSON type mapping to a NamespaceToTypeMap entry. @@ -68,7 +74,7 @@ object CSharpProgramSummary { def jsonToInitialMapping(jsonInputStream: InputStream): Try[NamespaceToTypeMap] = Try(read[NamespaceToTypeMap](ujson.Readable.fromByteArray(jsonInputStream.readAllBytes()))) - def mergeBuiltInTypesJson: InputStream = { + private def mergeBuiltInTypesJson: InputStream = { val classLoader = getClass.getClassLoader val builtinDirectory = "builtin_types" diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/parser/package.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/parser/package.scala index 18823496b0fc..b26d17a8f07d 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/parser/package.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/parser/package.scala @@ -11,10 +11,10 @@ package object parser { node: DotNetParserNode, json: Value, code: String, - lineNumber: Option[Integer], - columnNumber: Option[Integer], - lineNumberEnd: Option[Integer], - columnNumberEnd: Option[Integer] + lineNumber: Option[Int], + columnNumber: Option[Int], + lineNumberEnd: Option[Int], + columnNumberEnd: Option[Int] ) extends BaseNodeInfo[DotNetParserNode] } diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/AstCreationPass.scala index b20c39f4b60d..eb1c7e11d288 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/AstCreationPass.scala @@ -4,7 +4,7 @@ import io.joern.csharpsrc2cpg.Config import io.joern.csharpsrc2cpg.astcreation.AstCreator import io.joern.x2cpg.utils.{Report, TimeUtils} import io.shiftleft.codepropertygraph.generated.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.utils.IOUtils import org.slf4j.{Logger, LoggerFactory} @@ -12,7 +12,7 @@ import scala.util.{Try, Success, Failure} import java.nio.file.Paths class AstCreationPass(cpg: Cpg, astCreators: Seq[AstCreator], report: Report) - extends ConcurrentWriterCpgPass[AstCreator](cpg) { + extends ForkJoinParallelCpgPass[AstCreator](cpg) { private val logger: Logger = LoggerFactory.getLogger(classOf[AstCreationPass]) diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/DependencyPass.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/DependencyPass.scala index db4d3a576947..209a712c656c 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/DependencyPass.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/passes/DependencyPass.scala @@ -2,7 +2,7 @@ package io.joern.csharpsrc2cpg.passes import better.files.File import io.joern.semanticcpg.utils.SecureXmlParsing -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewDependency import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DependencyDownloader.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DependencyDownloader.scala index 580da7a5beab..a58a8bf005a2 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DependencyDownloader.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DependencyDownloader.scala @@ -42,7 +42,7 @@ class DependencyDownloader( File.temporaryDirectory("joern-csharpsrc2cpg").apply { dir => cpg.dependency.filterNot(isAlreadySummarized).foreach(downloadDependency(dir, _)) unzipDependencies(dir) - summarizeDependencies(dir) ++ internalProgramSummary + summarizeDependencies(dir) ++= internalProgramSummary } } diff --git a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DotNetAstGenRunner.scala b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DotNetAstGenRunner.scala index 7e0cdffd137c..ae8b7b72a442 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DotNetAstGenRunner.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/main/scala/io/joern/csharpsrc2cpg/utils/DotNetAstGenRunner.scala @@ -3,13 +3,13 @@ package io.joern.csharpsrc2cpg.utils import better.files.File import io.joern.csharpsrc2cpg.Config import io.joern.x2cpg.SourceFiles -import io.joern.x2cpg.astgen.AstGenRunner.{AstGenProgramMetaData, DefaultAstGenRunnerResult, getClass} +import io.joern.x2cpg.astgen.AstGenRunner.{AstGenProgramMetaData, getClass} import io.joern.x2cpg.astgen.AstGenRunnerBase import io.joern.x2cpg.utils.ExternalCommand import org.slf4j.LoggerFactory import scala.collection.mutable -import scala.util.{Failure, Success, Try} +import scala.util.Try class DotNetAstGenRunner(config: Config) extends AstGenRunnerBase(config) { diff --git a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/io/ProjectParseTests.scala b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/io/ProjectParseTests.scala index e195fcaef641..1dc9312deaad 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/io/ProjectParseTests.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/io/ProjectParseTests.scala @@ -8,7 +8,7 @@ import io.joern.csharpsrc2cpg.utils.DotNetAstGenRunner import io.joern.csharpsrc2cpg.{CSharpSrc2Cpg, Config} import io.joern.x2cpg.X2Cpg.newEmptyCpg import io.joern.x2cpg.utils.Report -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import org.scalatest.BeforeAndAfterAll diff --git a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/querying/ast/CallTests.scala b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/querying/ast/CallTests.scala index ccb60bad242b..03ec7cb47171 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/querying/ast/CallTests.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/querying/ast/CallTests.scala @@ -142,6 +142,8 @@ class CallTests extends CSharpCode2CpgFixture { |} |""".stripMargin) + cpg.typeDecl.nameExact("Baz").inheritsFromTypeFullName.l shouldBe List("Foo.Bar.Bar.SomeClass") + inside(cpg.call.nameExact("SomeOtherMethod").l) { case callNode :: Nil => callNode.code shouldBe "SomeOtherMethod()" diff --git a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/testfixtures/CSharpCode2CpgFixture.scala b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/testfixtures/CSharpCode2CpgFixture.scala index 9a11bcf53932..9b31f150451f 100644 --- a/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/testfixtures/CSharpCode2CpgFixture.scala +++ b/joern-cli/frontends/csharpsrc2cpg/src/test/scala/io/joern/csharpsrc2cpg/testfixtures/CSharpCode2CpgFixture.scala @@ -29,7 +29,7 @@ class CSharpCode2CpgFixture( implicit val resolver: ICallResolver = NoResolve protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + path.resultPairs().collect { case (firstElement, secondElement) => (firstElement, secondElement.get) } diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Ghidra2Cpg.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Ghidra2Cpg.scala index 8d287a959854..1b3003fa1945 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Ghidra2Cpg.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Ghidra2Cpg.scala @@ -13,20 +13,20 @@ import ghidra.program.model.listing.Program import ghidra.program.util.{DefinedDataIterator, GhidraProgramUtilities} import ghidra.util.exception.InvalidInputException import ghidra.util.task.TaskMonitor -import io.joern.ghidra2cpg.passes._ +import io.joern.ghidra2cpg.passes.* import io.joern.ghidra2cpg.passes.arm.ArmFunctionPass import io.joern.ghidra2cpg.passes.mips.{LoHiPass, MipsFunctionPass} import io.joern.ghidra2cpg.passes.x86.{ReturnEdgesPass, X86FunctionPass} import io.joern.ghidra2cpg.utils.Decompiler import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass} import io.joern.x2cpg.{X2Cpg, X2CpgFrontend} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import utilities.util.FileUtilities import java.io.File import scala.collection.mutable -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.Try class Ghidra2Cpg extends X2CpgFrontend[Config] { diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Main.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Main.scala index 3c6ee6139f2f..189f3f8fd034 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Main.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/Main.scala @@ -1,6 +1,6 @@ package io.joern.ghidra2cpg -import io.joern.ghidra2cpg.Frontend._ +import io.joern.ghidra2cpg.Frontend.* import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} import scopt.OParser diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/FunctionPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/FunctionPass.scala index 0ae31c0fcf1d..c32880c96990 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/FunctionPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/FunctionPass.scala @@ -6,17 +6,17 @@ import ghidra.program.model.lang.Register import ghidra.program.model.listing.{CodeUnitFormat, CodeUnitFormatOptions, Function, Instruction, Program} import ghidra.program.model.pcode.{HighFunction, HighSymbol} import ghidra.program.model.scalar.Scalar -import io.joern.ghidra2cpg._ -import io.joern.ghidra2cpg.processors._ +import io.joern.ghidra2cpg.* +import io.joern.ghidra2cpg.processors.* import io.joern.ghidra2cpg.utils.Decompiler -import io.joern.ghidra2cpg.utils.Utils._ -import io.shiftleft.codepropertygraph.Cpg +import io.joern.ghidra2cpg.utils.Utils.* +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{CfgNodeNew, NewBlock, NewMethod} import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import scala.collection.mutable -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions abstract class FunctionPass( @@ -25,7 +25,7 @@ abstract class FunctionPass( functions: List[Function], cpg: Cpg, decompiler: Decompiler -) extends ConcurrentWriterCpgPass[Function](cpg) { +) extends ForkJoinParallelCpgPass[Function](cpg) { protected val functionByName: mutable.Map[String, Function] = mutable.HashMap[String, Function]() for (fn <- functions) { @@ -60,7 +60,7 @@ abstract class FunctionPass( override def generateParts(): Array[Function] = functions.toArray - implicit def intToIntegerOption(intOption: Option[Int]): Option[Integer] = intOption.map(intValue => { + implicit def intToIntegerOption(intOption: Option[Int]): Option[Int] = intOption.map(intValue => { val integerValue = intValue integerValue }) diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/JumpPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/JumpPass.scala index 777fcd67925c..7a58ae23608e 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/JumpPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/JumpPass.scala @@ -1,14 +1,14 @@ package io.joern.ghidra2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method} -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import scala.util.Try -class JumpPass(cpg: Cpg) extends ConcurrentWriterCpgPass[Method](cpg) { +class JumpPass(cpg: Cpg) extends ForkJoinParallelCpgPass[Method](cpg) { override def generateParts(): Array[Method] = cpg.method.toArray diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/LiteralPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/LiteralPass.scala index 47dc52aa7a21..97f37248b57a 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/LiteralPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/LiteralPass.scala @@ -2,14 +2,14 @@ package io.joern.ghidra2cpg.passes import ghidra.program.flatapi.FlatProgramAPI import ghidra.program.util.DefinedDataIterator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions -class LiteralPass(cpg: Cpg, flatProgramAPI: FlatProgramAPI) extends ConcurrentWriterCpgPass[String](cpg) { +class LiteralPass(cpg: Cpg, flatProgramAPI: FlatProgramAPI) extends ForkJoinParallelCpgPass[String](cpg) { override def generateParts(): Array[String] = { val address2Literals: Map[Long, String] = DefinedDataIterator diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/MetaDataPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/MetaDataPass.scala index f26a3b02bba8..46f11db1efd2 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/MetaDataPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/MetaDataPass.scala @@ -1,6 +1,6 @@ package io.joern.ghidra2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{Languages, nodes} import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/NamespacePass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/NamespacePass.scala index ce4652cb1e86..05574e15d480 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/NamespacePass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/NamespacePass.scala @@ -1,12 +1,12 @@ package io.joern.ghidra2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import java.io.File -class NamespacePass(cpg: Cpg, programFile: File) extends ConcurrentWriterCpgPass[String](cpg) { +class NamespacePass(cpg: Cpg, programFile: File) extends ForkJoinParallelCpgPass[String](cpg) { override def generateParts(): Array[String] = Array(programFile.getCanonicalFile.toString) diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/PCodePass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/PCodePass.scala index 8507fe8dba34..de8fca302cdf 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/PCodePass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/PCodePass.scala @@ -2,19 +2,18 @@ package io.joern.ghidra2cpg.passes import ghidra.program.model.listing.{Function, Program} import ghidra.program.util.DefinedDataIterator -import io.joern.ghidra2cpg._ -import io.joern.ghidra2cpg.utils.Utils._ +import io.joern.ghidra2cpg.* +import io.joern.ghidra2cpg.utils.Utils.* import io.joern.ghidra2cpg.utils.{Decompiler, PCodeMapper} -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{NewBlock, NewMethod} -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, nodes} +import io.shiftleft.passes.ForkJoinParallelCpgPass -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions class PCodePass(currentProgram: Program, fileName: String, functions: List[Function], cpg: Cpg, decompiler: Decompiler) - extends ConcurrentWriterCpgPass[Function](cpg) { + extends ForkJoinParallelCpgPass[Function](cpg) { val address2Literals: Map[Long, String] = DefinedDataIterator .definedStrings(currentProgram) @@ -116,7 +115,7 @@ class PCodePass(currentProgram: Program, fileName: String, functions: List[Funct } override def runOnPart(diffGraphBuilder: DiffGraphBuilder, function: Function): Unit = { - val localDiffGraph = new DiffGraphBuilder + val localDiffGraph = Cpg.newDiffGraphBuilder // we need it just once with default settings val blockNode = nodes.NewBlock().code("").order(0) val methodNode = createMethodNode(decompiler, function, fileName, checkIfExternal(currentProgram, function.getName)) diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/arm/ArmFunctionPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/arm/ArmFunctionPass.scala index 4e269fd97bfe..60963b18126e 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/arm/ArmFunctionPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/arm/ArmFunctionPass.scala @@ -5,9 +5,8 @@ import io.joern.ghidra2cpg.utils.Decompiler import io.joern.ghidra2cpg.passes.FunctionPass import io.joern.ghidra2cpg.processors.ArmProcessor import io.joern.ghidra2cpg.utils.Utils.{checkIfExternal, createMethodNode, createReturnNode} -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewBlock -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, nodes} class ArmFunctionPass( currentProgram: Program, @@ -18,7 +17,7 @@ class ArmFunctionPass( ) extends FunctionPass(ArmProcessor, currentProgram, functions, cpg, decompiler) { override def runOnPart(diffGraphBuilder: DiffGraphBuilder, function: Function): Unit = { - val localDiffGraph = new DiffGraphBuilder() + val localDiffGraph = Cpg.newDiffGraphBuilder // we need it just once with default settings val blockNode: NewBlock = nodes.NewBlock().code("").order(0) try { diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/LoHiPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/LoHiPass.scala index f9f7284ae724..70f7bbe485dc 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/LoHiPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/LoHiPass.scala @@ -1,12 +1,12 @@ package io.joern.ghidra2cpg.passes.mips -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames} -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* -class LoHiPass(cpg: Cpg) extends ConcurrentWriterCpgPass[(Call, Call)](cpg) { +class LoHiPass(cpg: Cpg) extends ForkJoinParallelCpgPass[(Call, Call)](cpg) { override def generateParts(): Array[(Call, Call)] = { val readFromLoHiRegsRegex = "_?(mflo|mfhi).*" @@ -23,6 +23,9 @@ class LoHiPass(cpg: Cpg) extends ConcurrentWriterCpgPass[(Call, Call)](cpg) { }.toArray override def runOnPart(diffGraph: DiffGraphBuilder, pair: (Call, Call)): Unit = { - diffGraph.addEdge(pair._1, pair._2, EdgeTypes.REACHING_DEF, PropertyNames.VARIABLE, pair._1.code) + // in flatgraph an edge may have zero or one properties and they're not named... + // in this case we know that we're dealing with ReachingDef edges which has the `variable` property + val variableProperty = pair._1.code + diffGraph.addEdge(pair._1, pair._2, EdgeTypes.REACHING_DEF, variableProperty) } } diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsFunctionPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsFunctionPass.scala index faa2aaa22039..71222e896100 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsFunctionPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsFunctionPass.scala @@ -2,20 +2,20 @@ package io.joern.ghidra2cpg.passes.mips import ghidra.program.model.address.GenericAddress import ghidra.program.model.lang.Register import ghidra.program.model.listing.{Function, Instruction, Program} -import ghidra.program.model.pcode.PcodeOp._ +import ghidra.program.model.pcode.PcodeOp.* import ghidra.program.model.pcode.{HighFunction, PcodeOp, PcodeOpAST, Varnode} import ghidra.program.model.scalar.Scalar import io.joern.ghidra2cpg.passes.FunctionPass import io.joern.ghidra2cpg.processors.MipsProcessor -import io.joern.ghidra2cpg.utils.Utils._ +import io.joern.ghidra2cpg.utils.Utils.* import io.joern.ghidra2cpg.Types import io.joern.ghidra2cpg.utils.Decompiler -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{CfgNodeNew, NewBlock} import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} import org.slf4j.LoggerFactory -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions class MipsFunctionPass( @@ -258,7 +258,7 @@ class MipsFunctionPass( } override def runOnPart(diffGraphBuilder: DiffGraphBuilder, function: Function): Unit = { - val localDiffGraph = new DiffGraphBuilder + val localDiffGraph = Cpg.newDiffGraphBuilder // we need it just once with default settings val blockNode: NewBlock = nodes.NewBlock().code("").order(0) val methodNode = createMethodNode(decompiler, function, filename, checkIfExternal(currentProgram, function.getName)) diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsReturnEdgesPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsReturnEdgesPass.scala index 11d8cf7b064f..468d6a3e82f5 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsReturnEdgesPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/mips/MipsReturnEdgesPass.scala @@ -1,9 +1,9 @@ package io.joern.ghidra2cpg.passes.mips -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames} import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} class MipsReturnEdgesPass(cpg: Cpg) extends CpgPass(cpg) { @@ -17,7 +17,10 @@ class MipsReturnEdgesPass(cpg: Cpg) extends CpgPass(cpg) { // the first .cfgNext is skipping a _nop instruction after the call val to = from.cfgNext.cfgNext.isCall.argument.code("v(0|1)").headOption if (to.nonEmpty) { - diffGraph.addEdge(from, to.get, EdgeTypes.REACHING_DEF, PropertyNames.VARIABLE, from.code) + // in flatgraph an edge may have zero or one properties and they're not named... + // in this case we know that we're dealing with ReachingDef edges which has the `variable` property + val variableProperty = from.code + diffGraph.addEdge(from, to.get, EdgeTypes.REACHING_DEF, variableProperty) } } } diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/ReturnEdgesPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/ReturnEdgesPass.scala index ec87ca0bcacf..0669e45b7a16 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/ReturnEdgesPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/ReturnEdgesPass.scala @@ -1,9 +1,9 @@ package io.joern.ghidra2cpg.passes.x86 -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames} import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory class ReturnEdgesPass(cpg: Cpg) extends CpgPass(cpg) { @@ -15,7 +15,11 @@ class ReturnEdgesPass(cpg: Cpg) extends CpgPass(cpg) { cpg.call.nameNot(".*").foreach { from => // We expect RAX/EAX as return val to = from.cfgNext.isCall.argument.code("(R|E)AX").headOption - if (to.nonEmpty) diffGraph.addEdge(from, to.get, EdgeTypes.REACHING_DEF, PropertyNames.VARIABLE, from.code) + + // in flatgraph an edge may have zero or one properties and they're not named... + // in this case we know that we're dealing with ReachingDef edges which has the `variable` property + val variableProperty = from.code + if (to.nonEmpty) diffGraph.addEdge(from, to.get, EdgeTypes.REACHING_DEF, variableProperty) } } diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/X86FunctionPass.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/X86FunctionPass.scala index 9d5a619413a4..aff0452836d8 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/X86FunctionPass.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/passes/x86/X86FunctionPass.scala @@ -4,8 +4,8 @@ import ghidra.program.model.listing.{Function, Program} import io.joern.ghidra2cpg.utils.Decompiler import io.joern.ghidra2cpg.passes.FunctionPass import io.joern.ghidra2cpg.processors.X86Processor -import io.joern.ghidra2cpg.utils.Utils._ -import io.shiftleft.codepropertygraph.Cpg +import io.joern.ghidra2cpg.utils.Utils.* +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} import io.shiftleft.codepropertygraph.generated.nodes.{NewBlock, NewMethod} @@ -51,7 +51,7 @@ class X86FunctionPass( val blockNode: NewBlock = nodes.NewBlock().code("").order(0) val methodNode = createMethodNode(decompiler, function, filename, checkIfExternal(currentProgram, function.getName)) - val localGraphBuilder = new DiffGraphBuilder() + val localGraphBuilder = Cpg.newDiffGraphBuilder val methodReturn = createReturnNode() localGraphBuilder.addNode(methodNode) localGraphBuilder.addNode(blockNode) diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/PCodeMapper.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/PCodeMapper.scala index ccd8fa695d6a..d24f15f3b5db 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/PCodeMapper.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/PCodeMapper.scala @@ -2,17 +2,17 @@ package io.joern.ghidra2cpg.utils import ghidra.app.util.template.TemplateSimplifier import ghidra.program.model.listing.{CodeUnitFormat, CodeUnitFormatOptions, Function, Instruction} -import ghidra.program.model.pcode.PcodeOp._ +import ghidra.program.model.pcode.PcodeOp.* import ghidra.program.model.pcode.{HighFunction, PcodeOp, PcodeOpAST, Varnode} import io.joern.ghidra2cpg.Types //import io.joern.ghidra2cpg.utils.Utils.{createCallNode, createIdentifier, createLiteral} -import io.joern.ghidra2cpg.utils.Utils._ +import io.joern.ghidra2cpg.utils.Utils.* import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.CfgNodeNew import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions class State(argumentIndex: Int) { var argument: Int = argumentIndex diff --git a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/Utils.scala b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/Utils.scala index 5185c815db89..1d9128ba886c 100644 --- a/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/Utils.scala +++ b/joern-cli/frontends/ghidra2cpg/src/main/scala/io/joern/ghidra2cpg/utils/Utils.scala @@ -2,11 +2,11 @@ package io.joern.ghidra2cpg.utils import ghidra.program.model.listing.{Function, Instruction, Program} import io.joern.ghidra2cpg.Types -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.proto.cpg.Cpg.DispatchTypes -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.language.implicitConversions object Utils { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/BinToCpgFixture.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/BinToCpgFixture.scala index 3d8de65d8533..2dbeb50100ab 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/BinToCpgFixture.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/BinToCpgFixture.scala @@ -2,7 +2,7 @@ package io.joern.ghidra2cpg.fixtures import io.joern.x2cpg.X2Cpg.applyDefaultOverlays import io.joern.x2cpg.testfixtures.LanguageFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.utils.ProjectRoot import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers @@ -12,7 +12,7 @@ import java.io.File class BinToCpgFixture(val frontend: LanguageFrontend) extends AnyWordSpec with Matchers with BeforeAndAfterAll { - var cpg: Cpg = Cpg.emptyCpg + var cpg: Cpg = Cpg.empty val binDirectory = ProjectRoot.relativise("src/test/resources/testbinaries/") def passes(cpg: Cpg): Unit = applyDefaultOverlays(cpg) diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/DataFlowBinToCpgSuite.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/DataFlowBinToCpgSuite.scala index 93da418c0020..a586f3206acd 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/DataFlowBinToCpgSuite.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/DataFlowBinToCpgSuite.scala @@ -3,18 +3,19 @@ package io.joern.ghidra2cpg.fixtures import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.x2cpg.X2Cpg.applyDefaultOverlays -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.dotextension.ImageViewer import io.shiftleft.semanticcpg.layers.* +import scala.compiletime.uninitialized import scala.sys.process.Process import scala.util.Try class DataFlowBinToCpgSuite extends GhidraBinToCpgSuite { - implicit var context: EngineContext = scala.compiletime.uninitialized + implicit var context: EngineContext = uninitialized override def beforeAll(): Unit = { super.beforeAll() @@ -33,7 +34,7 @@ class DataFlowBinToCpgSuite extends GhidraBinToCpgSuite { new OssDataFlow(options).run(context) } - protected implicit def int2IntegerOption(x: Int): Option[Integer] = + protected implicit def int2IntegerOption(x: Int): Option[Int] = Some(x) protected def getMemberOfType(cpg: Cpg, typeName: String, memberName: String): Iterator[Member] = diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/GhidraBinToCpgSuite.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/GhidraBinToCpgSuite.scala index 917da1ffa137..21d619dcb701 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/GhidraBinToCpgSuite.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/fixtures/GhidraBinToCpgSuite.scala @@ -1,13 +1,13 @@ package io.joern.ghidra2cpg.fixtures import io.joern.ghidra2cpg.{Config, Ghidra2Cpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.joern.x2cpg.testfixtures.LanguageFrontend import io.shiftleft.utils.ProjectRoot import org.apache.commons.io.FileUtils import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* import java.nio.file.Files diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/CallArgumentsTest.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/CallArgumentsTest.scala index f885b944657c..9fc3cf0d22ec 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/CallArgumentsTest.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/CallArgumentsTest.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.mips import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallArgumentsTest extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowTests.scala index 7e01679e48e6..dc6babe19dae 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowTests.scala @@ -1,13 +1,13 @@ package io.joern.ghidra2cpg.querying.mips -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite import io.joern.x2cpg.X2Cpg.applyDefaultOverlays -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.{ICallResolver, _} -import io.shiftleft.semanticcpg.layers._ +import io.shiftleft.semanticcpg.layers.* class DataFlowTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowThroughLoHiRegistersTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowThroughLoHiRegistersTests.scala index b1164c9b5d21..1fb218d0ad93 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowThroughLoHiRegistersTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/mips/DataFlowThroughLoHiRegistersTests.scala @@ -1,14 +1,14 @@ package io.joern.ghidra2cpg.querying.mips -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.{Parser, Semantics} import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite import io.joern.x2cpg.X2Cpg.applyDefaultOverlays -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ -import io.shiftleft.semanticcpg.layers._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.layers.* class DataFlowThroughLoHiRegistersTests extends GhidraBinToCpgSuite { override def passes(cpg: Cpg): Unit = { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/CFGTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/CFGTests.scala index 5b9e420a5059..15f43cc1807b 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/CFGTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/CFGTests.scala @@ -2,7 +2,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CFGTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/DataFlowTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/DataFlowTests.scala index ec369e163436..de5a4ea2f40b 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/DataFlowTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/DataFlowTests.scala @@ -1,15 +1,15 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.codepropertygraph.Cpg -import io.joern.dataflowengineoss.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics import io.joern.dataflowengineoss.DefaultSemantics import io.joern.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} -import io.shiftleft.semanticcpg.language._ -import io.shiftleft.semanticcpg.layers._ +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.layers.* class DataFlowTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/FileTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/FileTests.scala index 2d77c4520a6c..645b906d5873 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/FileTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/FileTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.File diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LiteralNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LiteralNodeTests.scala index 2b10f2019861..f7bab3771104 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LiteralNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LiteralNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LiteralNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LocalNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LocalNodeTests.scala index 009cf922c0fa..1a54bd8a3bc4 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LocalNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/LocalNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocalNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MetaDataNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MetaDataNodeTests.scala index f8b5143c4252..9f141e9ff412 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MetaDataNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MetaDataNodeTests.scala @@ -2,7 +2,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MethodNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MethodNodeTests.scala index c4c04ce1c827..85f99d1afa53 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MethodNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/MethodNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/NamespaceBlockTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/NamespaceBlockTests.scala index f9341692c73a..abe9dcd5f9db 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/NamespaceBlockTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/NamespaceBlockTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.{FileTraversal, NamespaceTraversal} class NamespaceBlockTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ParameterNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ParameterNodeTests.scala index 9f2c03f4b1fb..c37d5ac9c4d5 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ParameterNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ParameterNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ParameterNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/RefNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/RefNodeTests.scala index b3b317abc4f1..2db2de746f84 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/RefNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/RefNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class RefNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ReturnNodeTests.scala b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ReturnNodeTests.scala index 795b879e4f38..dd564ce01662 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ReturnNodeTests.scala +++ b/joern-cli/frontends/ghidra2cpg/src/test/scala/io/joern/ghidra2cpg/querying/x86/ReturnNodeTests.scala @@ -1,7 +1,7 @@ package io.joern.ghidra2cpg.querying.x86 import io.joern.ghidra2cpg.fixtures.GhidraBinToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ReturnNodeTests extends GhidraBinToCpgSuite { diff --git a/joern-cli/frontends/ghidra2cpg/src/test/testbinaries/coverage/testscript.sc b/joern-cli/frontends/ghidra2cpg/src/test/testbinaries/coverage/testscript.sc index a5176227b675..2cd441ae3888 100644 --- a/joern-cli/frontends/ghidra2cpg/src/test/testbinaries/coverage/testscript.sc +++ b/joern-cli/frontends/ghidra2cpg/src/test/testbinaries/coverage/testscript.sc @@ -1,8 +1,8 @@ -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.joern.dataflowengineoss.language._ import io.shiftleft.semanticcpg.language._ import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment -import overflowdb.traversal._ +import flatgraph.traversal._ @main def main(testBinary: String) = { importCode.ghidra(testBinary) diff --git a/joern-cli/frontends/gosrc2cpg/build.sbt b/joern-cli/frontends/gosrc2cpg/build.sbt index 1e476bba642b..b1b30a84d9fa 100644 --- a/joern-cli/frontends/gosrc2cpg/build.sbt +++ b/joern-cli/frontends/gosrc2cpg/build.sbt @@ -59,13 +59,13 @@ goAstGenBinaryNames := { Seq(GoAstgenWin) case Environment.OperatingSystemType.Linux => Environment.architecture match { - case Environment.ArchitectureType.X86 => Seq(GoAstgenLinux) - case Environment.ArchitectureType.ARM => Seq(GoAstgenLinuxArm) + case Environment.ArchitectureType.X86 => Seq(GoAstgenLinux) + case Environment.ArchitectureType.ARMv8 => Seq(GoAstgenLinuxArm) } case Environment.OperatingSystemType.Mac => Environment.architecture match { - case Environment.ArchitectureType.X86 => Seq(GoAstgenMac) - case Environment.ArchitectureType.ARM => Seq(GoAstgenMacArm) + case Environment.ArchitectureType.X86 => Seq(GoAstgenMac) + case Environment.ArchitectureType.ARMv8 => Seq(GoAstgenMacArm) } case Environment.OperatingSystemType.Unknown => Seq(GoAstgenWin, GoAstgenLinux, GoAstgenLinuxArm, GoAstgenMac, GoAstgenMacArm) diff --git a/joern-cli/frontends/gosrc2cpg/gosrc2cpg.sh b/joern-cli/frontends/gosrc2cpg/gosrc2cpg.sh index b5c97948ab82..750b36d7eded 100755 --- a/joern-cli/frontends/gosrc2cpg/gosrc2cpg.sh +++ b/joern-cli/frontends/gosrc2cpg/gosrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/gosrc2cpg $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/gosrc2cpg" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreator.scala index 56e5584645d5..3e3f085b415a 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreator.scala @@ -12,7 +12,7 @@ import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.NewNode import io.shiftleft.codepropertygraph.generated.{ModifierTypes, NodeTypes} import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import ujson.Value import java.nio.file.Paths diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreatorHelper.scala index 92d5aa3b7ce1..93f690fd64f9 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstCreatorHelper.scala @@ -131,13 +131,13 @@ trait AstCreatorHelper { this: AstCreator => } } - protected def line(node: Value): Option[Integer] = Try(node(ParserKeys.NodeLineNo).num).toOption.map(_.toInt) + protected def line(node: Value): Option[Int] = Try(node(ParserKeys.NodeLineNo).num).toOption.map(_.toInt) - protected def column(node: Value): Option[Integer] = Try(node(ParserKeys.NodeColNo).num).toOption.map(_.toInt) + protected def column(node: Value): Option[Int] = Try(node(ParserKeys.NodeColNo).num).toOption.map(_.toInt) - protected def lineEndNo(node: Value): Option[Integer] = Try(node(ParserKeys.NodeLineEndNo).num).toOption.map(_.toInt) + protected def lineEndNo(node: Value): Option[Int] = Try(node(ParserKeys.NodeLineEndNo).num).toOption.map(_.toInt) - protected def columnEndNo(node: Value): Option[Integer] = Try(node(ParserKeys.NodeColEndNo).num).toOption.map(_.toInt) + protected def columnEndNo(node: Value): Option[Int] = Try(node(ParserKeys.NodeColEndNo).num).toOption.map(_.toInt) protected def positionLookupTables: Map[Int, String] = { val result = if (!goGlobal.processingDependencies) { diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstForPackageConstructorCreator.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstForPackageConstructorCreator.scala index d7c2f7b6a4e5..31b8d03a1732 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstForPackageConstructorCreator.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/AstForPackageConstructorCreator.scala @@ -7,7 +7,7 @@ import io.joern.x2cpg.astgen.AstGenNodeBuilder import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode, Defines as XDefines} import io.shiftleft.codepropertygraph.generated.NodeTypes import org.apache.commons.lang3.StringUtils -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import ujson.Value import scala.collection.immutable.Set diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/InitialMainSrcProcessor.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/InitialMainSrcProcessor.scala index 5893116d563a..d56020f92998 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/InitialMainSrcProcessor.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/astcreation/InitialMainSrcProcessor.scala @@ -5,7 +5,7 @@ import io.joern.gosrc2cpg.parser.{ParserKeys, ParserNodeInfo} import io.joern.gosrc2cpg.utils.UtilityConstants.fileSeparateorPattern import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.NewNamespaceBlock -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import ujson.{Arr, Obj, Value} import java.io.File diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/parser/ParserNodeInfo.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/parser/ParserNodeInfo.scala index 2f3751ebeeb6..823779871036 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/parser/ParserNodeInfo.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/parser/ParserNodeInfo.scala @@ -8,8 +8,8 @@ case class ParserNodeInfo( node: ParserNode, json: Value, code: String, - lineNumber: Option[Integer], - columnNumber: Option[Integer], - lineNumberEnd: Option[Integer], - columnNumberEnd: Option[Integer] + lineNumber: Option[Int], + columnNumber: Option[Int], + lineNumberEnd: Option[Int], + columnNumberEnd: Option[Int] ) extends BaseNodeInfo[ParserNode] diff --git a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/utils/AstGenRunner.scala b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/utils/AstGenRunner.scala index 4a0540a9d634..c7d107ce76cc 100644 --- a/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/utils/AstGenRunner.scala +++ b/joern-cli/frontends/gosrc2cpg/src/main/scala/io/joern/gosrc2cpg/utils/AstGenRunner.scala @@ -36,9 +36,9 @@ class AstGenRunner(config: Config, includeFileRegex: String = "") extends AstGen override val SupportedBinaries: Set[(OperatingSystemType, ArchitectureType)] = Set( Environment.OperatingSystemType.Windows -> Environment.ArchitectureType.X86, Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.X86, - Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.ARM, + Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.ARMv8, Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.X86, - Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.ARM + Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.ARMv8 ) override def skippedFiles(in: File, astGenOut: List[String]): List[String] = { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/ConditionalsDataflowTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/ConditionalsDataflowTests.scala index a0f4fbac6484..6dd2003ef65a 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/ConditionalsDataflowTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/ConditionalsDataflowTests.scala @@ -1,8 +1,8 @@ package io.joern.go2cpg.dataflow import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite class ConditionalsDataflowTests extends GoCodeToCpgSuite(withOssDataflow = true) { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/LoopsDataflowTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/LoopsDataflowTests.scala index ce889f319522..f69b72680ea0 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/LoopsDataflowTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/LoopsDataflowTests.scala @@ -1,8 +1,8 @@ package io.joern.go2cpg.dataflow import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite class LoopsDataflowTests extends GoCodeToCpgSuite(withOssDataflow = true) { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/SwitchDataflowTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/SwitchDataflowTests.scala index ad4d2a22445a..9eb77b9272ba 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/SwitchDataflowTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/SwitchDataflowTests.scala @@ -1,8 +1,8 @@ package io.joern.go2cpg.dataflow import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite class SwitchDataflowTests extends GoCodeToCpgSuite(withOssDataflow = true) { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/TypeDeclConstructorDataflowTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/TypeDeclConstructorDataflowTests.scala index f2829f37f35e..5f79899ff2fe 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/TypeDeclConstructorDataflowTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/dataflow/TypeDeclConstructorDataflowTests.scala @@ -1,8 +1,8 @@ package io.joern.go2cpg.dataflow import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* class TypeDeclConstructorDataflowTests extends GoCodeToCpgSuite(withOssDataflow = true) { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ConditionalsTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ConditionalsTests.scala index 776c8c5a5142..36183ae1d152 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ConditionalsTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ConditionalsTests.scala @@ -4,8 +4,8 @@ import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.nodes.Call import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import scala.collection.immutable.List diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DeclarationsTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DeclarationsTests.scala index 0d4deb9b345f..827b7812364e 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DeclarationsTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DeclarationsTests.scala @@ -1,8 +1,8 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DownloadDependencyTest.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DownloadDependencyTest.scala index c47106fe286f..e659adcea216 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DownloadDependencyTest.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/DownloadDependencyTest.scala @@ -225,9 +225,9 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { "not create any entry in method full name to return type map" in { // This should only contain the `main` method return type mapping as main source code is not invoking any of the dependency method. goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.methodMetaMap.size() shouldBe 1 - val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().toList + val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().asScala.toList mainfullname shouldBe "main" val Array(returnType) = metadata.methodMetaMap.values().toArray returnType shouldBe MethodCacheMetaData(Defines.voidTypeName, "main.main()") @@ -236,7 +236,7 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { "not create any entry in struct member to type map" in { // This should be empty as neither main code has defined any struct type nor we are accessing the third party struct type. goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.structTypeMembers.size() shouldBe 0 } } @@ -298,9 +298,9 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { "not create any entry in method full name to return type map" ignore { // This should only contain the `main` method return type mapping as main source code is not invoking any of the dependency method. goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.methodMetaMap.size() shouldBe 1 - val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().toList + val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().asScala.toList mainfullname shouldBe "main" val Array(returnType) = metadata.methodMetaMap.values().toArray returnType shouldBe MethodCacheMetaData(Defines.voidTypeName, "main.main()") @@ -310,7 +310,7 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { "not create any entry in struct member to type map" ignore { // This should be empty as neither main code has defined any struct type nor we are accessing the third party struct type. goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.structTypeMembers.size() shouldBe 0 } } @@ -397,9 +397,9 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { // TODO: While doing the implementation we need update this test // Lambda expression return types are also getting recorded under this map goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.methodMetaMap.size() shouldBe 1 - val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().toList + val List(mainfullname) = metadata.methodMetaMap.keys().asIterator().asScala.toList mainfullname shouldBe "main" val Array(returnType) = metadata.methodMetaMap.values().toArray returnType shouldBe MethodCacheMetaData(Defines.voidTypeName, "main.main()") @@ -412,7 +412,7 @@ class DownloadDependencyTest extends GoCodeToCpgSuite { // 2. Struct Type is being passed as parameter or returned as value of method that is being used. // 3. A method of Struct Type being used. goGlobal.nameSpaceMetaDataMap.size() shouldBe 1 - val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().toArray + val Array(metadata) = goGlobal.nameSpaceMetaDataMap.values().iterator().asScala.toArray metadata.structTypeMembers.size() shouldBe 0 } } diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ExpressionsTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ExpressionsTests.scala index aff9c3dda63f..50f14e27db6b 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ExpressionsTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ExpressionsTests.scala @@ -3,8 +3,8 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes class ExpressionsTests extends GoCodeToCpgSuite { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/FileTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/FileTests.scala index f338ba6084aa..357fa250f93f 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/FileTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/FileTests.scala @@ -1,7 +1,7 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import java.io.File diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ImportTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ImportTests.scala index dbacf6940a4a..571d6632a569 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ImportTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/ImportTests.scala @@ -1,7 +1,7 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ImportTests extends GoCodeToCpgSuite { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MetaDataTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MetaDataTests.scala index 83662d57b493..98370d93b790 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MetaDataTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MetaDataTests.scala @@ -3,7 +3,7 @@ package io.joern.go2cpg.passes.ast import io.joern.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} import io.shiftleft.codepropertygraph.generated.Languages import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends GoCodeToCpgSuite { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MethodCallTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MethodCallTests.scala index ceb574e867ed..56972e8865a6 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MethodCallTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/MethodCallTests.scala @@ -7,9 +7,8 @@ import io.shiftleft.codepropertygraph.generated.edges.Ref import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, nodes} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.{jIteratortoTraversal, toNodeTraversal} - import java.io.File + class MethodCallTests extends GoCodeToCpgSuite(withOssDataflow = true) { "Simple method call use case" should { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/NamespaceBlockTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/NamespaceBlockTests.scala index b9013d929b36..e860d36a142f 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/NamespaceBlockTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/NamespaceBlockTests.scala @@ -1,7 +1,7 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/OperatorsTests.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/OperatorsTests.scala index 21238c36cb69..5b56a56d070c 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/OperatorsTests.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/OperatorsTests.scala @@ -3,7 +3,7 @@ package io.joern.go2cpg.passes.ast import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class OperatorsTests extends GoCodeToCpgSuite { diff --git a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/TypeDeclMembersAndMemberMethodsTest.scala b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/TypeDeclMembersAndMemberMethodsTest.scala index 878af00ed211..34d2bc145379 100644 --- a/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/TypeDeclMembersAndMemberMethodsTest.scala +++ b/joern-cli/frontends/gosrc2cpg/src/test/scala/io/joern/go2cpg/passes/ast/TypeDeclMembersAndMemberMethodsTest.scala @@ -4,8 +4,8 @@ import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.nodes.Call import io.joern.go2cpg.testfixtures.GoCodeToCpgSuite import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import scala.collection.immutable.List import io.joern.gosrc2cpg.astcreation.Defines diff --git a/joern-cli/frontends/javasrc2cpg/javasrc2cpg.sh b/joern-cli/frontends/javasrc2cpg/javasrc2cpg.sh index f2e69e9d54f7..ac17d3879fb2 100755 --- a/joern-cli/frontends/javasrc2cpg/javasrc2cpg.sh +++ b/joern-cli/frontends/javasrc2cpg/javasrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/javasrc2cpg.sh $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/javasrc2cpg.sh" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/JavaSrc2Cpg.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/JavaSrc2Cpg.scala index 08e21be3b2e5..2b78bf8f68f9 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/JavaSrc2Cpg.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/JavaSrc2Cpg.scala @@ -1,18 +1,11 @@ package io.joern.javasrc2cpg -import better.files.File -import io.joern.javasrc2cpg.passes.{ - AstCreationPass, - JavaTypeHintCallLinker, - JavaTypeRecoveryPassGenerator, - TypeInferencePass -} +import io.joern.javasrc2cpg.passes.{AstCreationPass, TypeInferencePass} import io.joern.x2cpg.X2Cpg.withNewEmptyCpg -import io.joern.x2cpg.passes.frontend.{JavaConfigFileCreationPass, MetaDataPass, TypeNodePass, XTypeRecoveryConfig} +import io.joern.x2cpg.passes.frontend.{JavaConfigFileCreationPass, MetaDataPass, TypeNodePass} import io.joern.x2cpg.X2CpgFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.passes.CpgPassBase import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* @@ -56,12 +49,6 @@ object JavaSrc2Cpg { def apply(): JavaSrc2Cpg = new JavaSrc2Cpg() - def typeRecoveryPasses(cpg: Cpg, config: Option[Config] = None): List[CpgPassBase] = { - new JavaTypeRecoveryPassGenerator(cpg, XTypeRecoveryConfig(enabledDummyTypes = !config.exists(_.disableDummyTypes))) - .generate() ++ - List(new JavaTypeHintCallLinker(cpg)) - } - def showEnv(): Unit = { val value = JavaSrcEnvVar.values.foreach { envVar => diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/Main.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/Main.scala index 2b876f04b1e0..c06fd5acef7e 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/Main.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/Main.scala @@ -1,12 +1,11 @@ package io.joern.javasrc2cpg import io.joern.javasrc2cpg.Frontend.* -import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery} +import io.joern.javasrc2cpg.jpastprinter.JavaParserAstPrinter +import io.joern.x2cpg.frontendspecific.javasrc2cpg import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} +import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery, XTypeRecoveryConfig} import scopt.OParser -import scala.util.matching.Regex -import io.joern.javasrc2cpg.typesolvers.SimpleCombinedTypeSolver -import io.joern.javasrc2cpg.jpastprinter.JavaParserAstPrinter /** Command line configuration parameters */ @@ -80,7 +79,7 @@ private object Frontend { val cmdLineParser: OParser[Unit, Config] = { val builder = OParser.builder[Config] - import builder._ + import builder.* OParser.sequence( programName("javasrc2cpg"), opt[Seq[String]]("inference-jar-paths") @@ -101,11 +100,11 @@ private object Frontend { | run-delombok => run delombok and use delomboked source for both analysis and type information.""".stripMargin ) .action((mode, c) => c.withDelombokMode(mode)), - opt[Unit]("enable-type-recovery") + opt[Unit](javasrc2cpg.ParameterNames.EnableTypeRecovery) .hidden() .action((_, c) => c.withEnableTypeRecovery(true)) .text("enable generic type recovery"), - XTypeRecovery.parserOptions, + XTypeRecoveryConfig.parserOptionsForParserConfig, opt[String]("jdk-path") .action((path, c) => c.withJdkPath(path)) .text("JDK used for resolving builtin Java types. If not set, current classpath will be used"), diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/AstCreator.scala index ac832ee08043..c7b5e5a46c59 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/AstCreator.scala @@ -15,6 +15,8 @@ import com.github.javaparser.ast.expr.{ } import com.github.javaparser.ast.nodeTypes.{NodeWithName, NodeWithSimpleName} import com.github.javaparser.ast.{CompilationUnit, ImportDeclaration, Node, PackageDeclaration} +import com.github.javaparser.printer.configuration.DefaultPrinterConfiguration.ConfigOption +import com.github.javaparser.printer.configuration.{DefaultConfigurationOption, DefaultPrinterConfiguration} import com.github.javaparser.resolution.UnsolvedSymbolException import com.github.javaparser.resolution.declarations.{ ResolvedMethodDeclaration, @@ -49,8 +51,9 @@ import io.joern.x2cpg.{Ast, AstCreatorBase, AstNodeBuilder, ValidationMode} import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.{NewClosureBinding, NewFile, NewImport, NewNamespaceBlock} import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder +import java.util.concurrent.ConcurrentHashMap import scala.collection.mutable import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional @@ -85,7 +88,8 @@ class AstCreator( fileContent: Option[String], global: Global, val symbolSolver: JavaSymbolSolver, - protected val keepTypeArguments: Boolean + protected val keepTypeArguments: Boolean, + val loggedExceptionCounts: scala.collection.concurrent.Map[Class[?], Int] )(implicit val withSchemaValidation: ValidationMode) extends AstCreatorBase(filename) with AstNodeBuilder[Node, AstCreator] @@ -125,11 +129,17 @@ class AstCreator( case _ => None } } - protected def line(node: Node): Option[Integer] = node.getBegin.map(x => Integer.valueOf(x.line)).toScala - protected def column(node: Node): Option[Integer] = node.getBegin.map(x => Integer.valueOf(x.column)).toScala - protected def lineEnd(node: Node): Option[Integer] = node.getEnd.map(x => Integer.valueOf(x.line)).toScala - protected def columnEnd(node: Node): Option[Integer] = node.getEnd.map(x => Integer.valueOf(x.column)).toScala - protected def code(node: Node): String = "" // TODO: javasrc2cpg uses custom code strings everywhere + + /** Custom printer that omits comments. To be used by [[code]] */ + private val codePrinterOptions = new DefaultPrinterConfiguration() + .removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_COMMENTS)) + .removeOption(new DefaultConfigurationOption(ConfigOption.PRINT_JAVADOC)) + + protected def line(node: Node): Option[Int] = node.getBegin.map(_.line).toScala + protected def column(node: Node): Option[Int] = node.getBegin.map(_.column).toScala + protected def lineEnd(node: Node): Option[Int] = node.getEnd.map(_.line).toScala + protected def columnEnd(node: Node): Option[Int] = node.getEnd.map(_.column).toScala + protected def code(node: Node): String = node.toString(codePrinterOptions) private val lineOffsetTable = OffsetUtils.getLineOffsetTable(fileContent) @@ -209,11 +219,11 @@ class AstCreator( scope.popNamespaceScope() Ast(namespaceBlock).withChildren(typeDeclAsts).withChildren(importNodes) } catch { - case t: UnsolvedSymbolException => - logger.error(s"Unsolved symbol exception caught in $filename") + case exception: UnsolvedSymbolException => + logger.warn(s"Unsolved symbol exception caught in $filename", exception) Ast() case t: Throwable => - logger.error(s"Parsing file $filename failed", t) + logger.warn(s"Parsing file $filename failed", t) Ast() } } @@ -236,7 +246,28 @@ class AstCreator( private[astcreation] def tryWithSafeStackOverflow[T](expr: => T): Try[T] = { try { - Try(expr) + + /** JavaParser throws UnsolvedSymbolExceptions if a type cannot be solved, which is usually an expected occurrence + * that does not warrant specific failure logging. Since it's impossible to tell whether these are legitimately + * unresolved types or a bug, don't log them. + */ + Try(expr) match { + case success: Success[_] => success + case Failure(exception: UnsolvedSymbolException) => Failure(exception) + case failure: Failure[_] => + val exceptionType = failure.exception.getClass + + val loggedCount = loggedExceptionCounts.updateWith(exceptionType) { + case Some(value) => Some(value + 1) + case None => Some(1) + } + + if (loggedCount.exists(_ <= 3)) { + logger.debug("tryWithFailureLogging encountered exception", failure.exception) + } + + failure + } } catch { // This is really, really ugly, but there's a bug in the JavaParser symbol solver that can lead to // unterminated recursion in some cases where types cannot be resolved. diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForMethodsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForMethodsCreator.scala index 7e4052557500..292ad1db6dec 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForMethodsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForMethodsCreator.scala @@ -33,31 +33,36 @@ import io.joern.javasrc2cpg.scope.JavaScopeElement.fullName import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional -import scala.util.Try +import scala.util.{Failure, Success, Try} import io.shiftleft.codepropertygraph.generated.nodes.AstNodeNew import io.shiftleft.codepropertygraph.generated.nodes.NewCall import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.EdgeTypes import com.github.javaparser.ast.Node +import com.github.javaparser.ast.`type`.ClassOrInterfaceType import com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserParameterDeclaration import io.joern.javasrc2cpg.astcreation.declarations.AstForMethodsCreator.PartialConstructorDeclaration +import io.joern.javasrc2cpg.util.{NameConstants, Util} private[declarations] trait AstForMethodsCreator { this: AstCreator => def astForMethod(methodDeclaration: MethodDeclaration): Ast = { val methodNode = createPartialMethod(methodDeclaration) val typeParameters = getIdentifiersForTypeParameters(methodDeclaration) - val maybeResolved = tryWithSafeStackOverflow(methodDeclaration.resolve()) - val expectedReturnType = Try(symbolSolver.toResolvedType(methodDeclaration.getType, classOf[ResolvedType])).toOption - val simpleMethodReturnType = methodDeclaration.getTypeAsString() + val maybeResolved = tryWithSafeStackOverflow(methodDeclaration.resolve()) + val expectedReturnType = tryWithSafeStackOverflow( + symbolSolver.toResolvedType(methodDeclaration.getType, classOf[ResolvedType]) + ).toOption + val simpleMethodReturnType = + tryWithSafeStackOverflow(methodDeclaration.getTypeAsString).map(Util.stripGenericTypes).toOption val returnTypeFullName = expectedReturnType .flatMap(typeInfoCalc.fullName) - .orElse(scope.lookupType(simpleMethodReturnType)) - .orElse( - Try(methodDeclaration.getType.asClassOrInterfaceType).toOption.flatMap(t => scope.lookupType(t.getNameAsString)) - ) - .orElse(typeParameters.find(_.name == simpleMethodReturnType).map(_.typeFullName)) + .orElse(simpleMethodReturnType.flatMap(scope.lookupType(_))) + .orElse(tryWithSafeStackOverflow(methodDeclaration.getType).toOption.collect { case t: ClassOrInterfaceType => + scope.lookupType(t.getNameAsString) + }.flatten) + .orElse(typeParameters.find(typeParam => simpleMethodReturnType.contains(typeParam.name)).map(_.typeFullName)) scope.pushMethodScope( methodNode, @@ -87,12 +92,11 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => } val bodyAst = methodDeclaration.getBody.toScala.map(astForBlockStatement(_)).getOrElse(Ast(NewBlock())) - val methodReturn = newMethodReturnNode( - returnTypeFullName.getOrElse(TypeConstants.Any), - None, - line(methodDeclaration.getType), - column(methodDeclaration.getType) - ) + val (lineNr, columnNr) = tryWithSafeStackOverflow(methodDeclaration.getType) match { + case Success(typ) => (line(typ), column(typ)) + case Failure(_) => (line(methodDeclaration), column(methodDeclaration)) + } + val methodReturn = newMethodReturnNode(returnTypeFullName.getOrElse(TypeConstants.Any), None, lineNr, columnNr) val annotationAsts = methodDeclaration.getAnnotations.asScala.map(astForAnnotationExpr).toSeq @@ -145,7 +149,7 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => private def getIdentifiersForTypeParameters(methodDeclaration: MethodDeclaration): List[NewIdentifier] = { methodDeclaration.getTypeParameters.asScala.map { typeParameter => val name = typeParameter.getNameAsString - val typeFullName = typeParameter.getTypeBound.asScala.headOption + val typeFullName = tryWithSafeStackOverflow(typeParameter.getTypeBound.asScala.headOption).toOption.flatten .flatMap(typeInfoCalc.fullName) .getOrElse(TypeConstants.Object) typeInfoCalc.registerType(typeFullName) @@ -218,25 +222,22 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => private def astForParameter(parameter: Parameter, childNum: Int): Ast = { val maybeArraySuffix = if (parameter.isVarArgs) "[]" else "" + val rawParameterTypeName = + tryWithSafeStackOverflow(parameter.getTypeAsString).map(Util.stripGenericTypes).getOrElse(NameConstants.Unknown) + val parameterType = tryWithSafeStackOverflow(parameter.getType).toOption val typeFullName = - typeInfoCalc - .fullName(parameter.getType) - .orElse(scope.lookupType(parameter.getTypeAsString)) - // In a scenario where we have an import of an external type e.g. `import foo.bar.Baz` and - // this parameter's type is e.g. `Baz`, the lookup will fail. However, if we lookup - // for `Baz` instead (i.e. without type arguments), then the lookup will succeed. - .orElse( - Try(parameter.getType.asClassOrInterfaceType).toOption.flatMap(t => scope.lookupType(t.getNameAsString)) - ) + parameterType + .flatMap(typeInfoCalc.fullName) + .orElse(scope.lookupType(rawParameterTypeName)) .map(_ ++ maybeArraySuffix) - .getOrElse(s"${Defines.UnresolvedNamespace}.${parameter.getTypeAsString}") + .getOrElse(s"${Defines.UnresolvedNamespace}.$rawParameterTypeName") val evalStrat = - if (parameter.getType.isPrimitiveType) EvaluationStrategies.BY_VALUE else EvaluationStrategies.BY_SHARING + if (parameterType.exists(_.isPrimitiveType)) EvaluationStrategies.BY_VALUE else EvaluationStrategies.BY_SHARING typeInfoCalc.registerType(typeFullName) val parameterNode = NewMethodParameterIn() .name(parameter.getName.toString) - .code(parameter.toString) + .code(code(parameter)) .lineNumber(line(parameter)) .columnNumber(column(parameter)) .evaluationStrategy(evalStrat) @@ -261,7 +262,7 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => Try(methodLike.getParam(index)).toOption } .map { param => - Try(param.getType).toOption + tryWithSafeStackOverflow(param.getType).toOption .flatMap(paramType => typeInfoCalc.fullName(paramType, typeParamValues)) // In a scenario where we have an import of an external type e.g. `import foo.bar.Baz` and // this parameter's type is e.g. `Baz`, the lookup will fail. However, if we lookup @@ -295,7 +296,7 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => val maybeReturnType = Try(method.getReturnType).toOption - .flatMap(returnType => typeInfoCalc.fullName(returnType, typeParamValues)) + .flatMap(typeInfoCalc.fullName(_, typeParamValues)) composeSignature(maybeReturnType, maybeParameterTypes, method.getNumberOfParams) } @@ -461,8 +462,8 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => } private def constructorReturnNode(constructorDeclaration: ConstructorDeclaration): NewMethodReturn = { - val line = constructorDeclaration.getEnd.map(x => Integer.valueOf(x.line)).toScala - val column = constructorDeclaration.getEnd.map(x => Integer.valueOf(x.column)).toScala + val line = constructorDeclaration.getEnd.map(_.line).toScala + val column = constructorDeclaration.getEnd.map(_.column).toScala newMethodReturnNode(TypeConstants.Void, None, line, column) } @@ -497,7 +498,7 @@ private[declarations] trait AstForMethodsCreator { this: AstCreator => methodNode(declaration, declaration.getNameAsString(), code, placeholderFullName, None, filename) } - def thisNodeForMethod(maybeTypeFullName: Option[String], lineNumber: Option[Integer]): NewMethodParameterIn = { + def thisNodeForMethod(maybeTypeFullName: Option[String], lineNumber: Option[Int]): NewMethodParameterIn = { val typeFullName = typeInfoCalc.registerType(maybeTypeFullName.getOrElse(TypeConstants.Any)) NodeBuilders.newThisParameterNode( typeFullName = typeFullName, diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForTypeDeclsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForTypeDeclsCreator.scala index 25733602ccbc..c036d6e016f4 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForTypeDeclsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/declarations/AstForTypeDeclsCreator.scala @@ -568,36 +568,21 @@ private[declarations] trait AstForTypeDeclsCreator { this: AstCreator => // TODO: Should be able to find expected type here val annotations = fieldDeclaration.getAnnotations - // variable can be declared with generic type, so we need to get rid of the <> part of it to get the package information - // and append the <> when forming the typeFullName again - // Ex - private Consumer consumer; - // From Consumer we need to get to Consumer so splitting it by '<' and then combining with '<' to - // form typeFullName as Consumer - - val typeFullNameWithoutGenericSplit = typeInfoCalc - .fullName(v.getType) - .orElse(scope.lookupType(v.getTypeAsString)) - .getOrElse(s"${Defines.UnresolvedNamespace}.${v.getTypeAsString}") - val typeFullName = { - // Check if the typeFullName is unresolved and if it has generic information to resolve the typeFullName - if ( - typeFullNameWithoutGenericSplit - .contains(Defines.UnresolvedNamespace) && v.getTypeAsString.contains(Defines.LeftAngularBracket) - ) { - val splitByLeftAngular = v.getTypeAsString.split(Defines.LeftAngularBracket) - scope.lookupType(splitByLeftAngular.head) match { - case Some(foundType) => - foundType + splitByLeftAngular - .slice(1, splitByLeftAngular.size) - .mkString(Defines.LeftAngularBracket, Defines.LeftAngularBracket, "") - case None => typeFullNameWithoutGenericSplit - } - } else typeFullNameWithoutGenericSplit - } - val name = v.getName.toString - val node = memberNode(v, name, s"$typeFullName $name", typeFullName) - val memberAst = Ast(node) - val annotationAsts = annotations.asScala.map(astForAnnotationExpr) + val rawTypeName = + tryWithSafeStackOverflow(v.getTypeAsString).map(Util.stripGenericTypes).getOrElse(NameConstants.Unknown) + + val typeFullName = + tryWithSafeStackOverflow(v.getType).toOption + .flatMap(typeInfoCalc.fullName) + .orElse(scope.lookupType(rawTypeName)) + .getOrElse(s"${Defines.UnresolvedNamespace}.$rawTypeName") + + val name = v.getName.toString + // Use type name without generics stripped in code + val variableTypeString = tryWithSafeStackOverflow(v.getTypeAsString).getOrElse("") + val node = memberNode(v, name, s"$variableTypeString $name", typeFullName) + val memberAst = Ast(node) + val annotationAsts = annotations.asScala.map(astForAnnotationExpr) val fieldDeclModifiers = modifiersForFieldDeclaration(fieldDeclaration) diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForCallExpressionsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForCallExpressionsCreator.scala index 7fcd0db7d07e..88687b18fa29 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForCallExpressionsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForCallExpressionsCreator.scala @@ -20,7 +20,7 @@ import io.joern.javasrc2cpg.astcreation.expressions.AstForCallExpressionsCreator import io.joern.javasrc2cpg.astcreation.{AstCreator, ExpectedType} import io.joern.javasrc2cpg.scope.Scope.typeFullName import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants -import io.joern.javasrc2cpg.util.NameConstants +import io.joern.javasrc2cpg.util.{NameConstants, Util} import io.joern.javasrc2cpg.util.Util.{composeMethodFullName, composeMethodLikeSignature, composeUnresolvedSignature} import io.joern.x2cpg.utils.AstPropertiesUtil.* import io.joern.x2cpg.utils.NodeBuilders.{newIdentifierNode, newOperatorCallNode} @@ -192,9 +192,14 @@ trait AstForCallExpressionsCreator { this: AstCreator => val anonymousClassBody = expr.getAnonymousClassBody.toScala.map(_.asScala.toList) val nameSuffix = if (anonymousClassBody.isEmpty) "" else s"$$${scope.getNextAnonymousClassIndex()}" - val typeName = s"${expr.getTypeAsString}$nameSuffix" - - val baseTypeFromScope = scope.lookupScopeType(expr.getTypeAsString) + val rawType = + tryWithSafeStackOverflow(expr.getTypeAsString) + .map(Util.stripGenericTypes) + .toOption + .getOrElse(NameConstants.Unknown) + val typeName = s"$rawType$nameSuffix" + + val baseTypeFromScope = scope.lookupScopeType(rawType) // These will be the same for non-anonymous type decls, but in that case only the typeFullName will be used. val baseTypeFullName = baseTypeFromScope @@ -313,9 +318,9 @@ trait AstForCallExpressionsCreator { this: AstCreator => val paramCount = methodDecl.getNumberOfParams val resolvedType = if (idx < paramCount) { - Some(methodDecl.getParam(idx).getType) + tryWithSafeStackOverflow(methodDecl.getParam(idx).getType).toOption } else if (paramCount > 0 && methodDecl.getParam(paramCount - 1).isVariadic) { - Some(methodDecl.getParam(paramCount - 1).getType) + tryWithSafeStackOverflow(methodDecl.getParam(paramCount - 1).getType).toOption } else { None } @@ -331,8 +336,8 @@ trait AstForCallExpressionsCreator { this: AstCreator => argumentTypes: Option[List[String]], argsSize: Int, code: String, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): NewCall = { val initSignature = argumentTypes match { case Some(tpe) => composeMethodLikeSignature(TypeConstants.Void, tpe) @@ -356,7 +361,7 @@ trait AstForCallExpressionsCreator { this: AstCreator => args.asScala .map { case _: LambdaExpr => "" - case other => other.toString + case other => code(other) } .mkString(", ") } @@ -455,7 +460,8 @@ trait AstForCallExpressionsCreator { this: AstCreator => } case objectCreationExpr: ObjectCreationExpr => - val typeName = objectCreationExpr.getTypeAsString + // Use type name with generics for code + val typeName = tryWithSafeStackOverflow(objectCreationExpr.getTypeAsString).getOrElse(NameConstants.Unknown) val argumentsString = getArgumentCodeString(objectCreationExpr.getArguments) someWithDotSuffix(s"new $typeName($argumentsString)") diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForLambdasCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForLambdasCreator.scala index 9c93f12b47ea..98e756c4a52d 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForLambdasCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForLambdasCreator.scala @@ -17,13 +17,12 @@ import io.joern.javasrc2cpg.util.BindingTable.createBindingTable import io.joern.javasrc2cpg.util.Util.{composeMethodFullName, composeMethodLikeSignature, composeUnresolvedSignature} import io.joern.javasrc2cpg.util.{BindingTable, BindingTableAdapterForLambdas, LambdaBindingInfo, NameConstants} import io.joern.x2cpg.utils.AstPropertiesUtil.* -import io.joern.x2cpg.utils.NodeBuilders +import io.joern.x2cpg.utils.{IntervalKeyPool, NodeBuilders} import io.joern.x2cpg.utils.NodeBuilders.* import io.joern.x2cpg.{Ast, Defines} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.nodes.MethodParameterIn.PropertyDefaults as ParameterDefaults import io.shiftleft.codepropertygraph.generated.{EdgeTypes, EvaluationStrategies, ModifierTypes} -import io.shiftleft.passes.IntervalKeyPool import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* @@ -352,8 +351,7 @@ private[expressions] trait AstForLambdasCreator { this: AstCreator => // this will yield the erased types which is why the actual lambda // expression parameters are only used as a fallback. lambdaParameters - .map(_.getType) - .map(typeInfoCalc.fullName) + .flatMap(param => tryWithSafeStackOverflow(typeInfoCalc.fullName(param.getType)).toOption) } if (paramTypesList.sizeIs != lambdaParameters.size) { @@ -368,7 +366,8 @@ private[expressions] trait AstForLambdasCreator { this: AstCreator => val typeFullName = maybeType.getOrElse(TypeConstants.Any) val code = s"$typeFullName $name" val evalStrat = - if (param.getType.isPrimitiveType) EvaluationStrategies.BY_VALUE else EvaluationStrategies.BY_SHARING + if (tryWithSafeStackOverflow(param.getType).toOption.exists(_.isPrimitiveType)) EvaluationStrategies.BY_VALUE + else EvaluationStrategies.BY_SHARING val paramNode = NewMethodParameterIn() .name(name) .index(idx + 1) diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForNameExpressionsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForNameExpressionsCreator.scala index d3f17a2ad8fc..8b8ad10c6a34 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForNameExpressionsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForNameExpressionsCreator.scala @@ -97,22 +97,17 @@ trait AstForNameExpressionsCreator { this: AstCreator => val variable = capturedVariable.variable val typeDeclChain = capturedVariable.typeDeclChain - scope.enclosingMethod.map(_.lookupVariable("this")) match { - case None | Some(NotInScope) | Some(CapturedVariable(_, _)) => + scope.lookupVariable("this") match { + case NotInScope | CapturedVariable(_, _) => logger.warn( s"Attempted to create AST for captured variable ${variable.name}, but could not find `this` param in direct scope." ) - Ast(NewUnknown().code(variable.name).lineNumber(line(nameExpr)).columnNumber(column(nameExpr))) - - case Some(SimpleVariable(ScopeParameter(thisNode: NewMethodParameterIn))) => - val thisIdentifier = identifierNode( - nameExpr, - thisNode.name, - thisNode.code, - thisNode.typeFullName, - thisNode.dynamicTypeHintFullName - ) - val thisAst = Ast(thisIdentifier).withRefEdge(thisIdentifier, thisNode) + Ast(identifierNode(nameExpr, variable.name, variable.name, variable.typeFullName)) + + case SimpleVariable(scopeVariable) => + val thisIdentifier = + identifierNode(nameExpr, scopeVariable.name, scopeVariable.name, scopeVariable.typeFullName) + val thisAst = Ast(thisIdentifier).withRefEdge(thisIdentifier, scopeVariable.node) val lineNumber = line(nameExpr) val columnNumber = column(nameExpr) @@ -139,12 +134,6 @@ trait AstForNameExpressionsCreator { this: AstCreator => val captureFieldIdentifier = fieldIdentifierNode(nameExpr, variable.name, variable.name) callAst(finalFieldAccess, List(outerClassChain, Ast(captureFieldIdentifier))) - - case Some(SimpleVariable(thisNode)) => - logger.warn( - s"Attempted to create AST for captured variable ${variable.name}, but found non-parameter `this`: ${thisNode}." - ) - Ast(NewUnknown().code(variable.name).lineNumber(line(nameExpr)).columnNumber(column(nameExpr))) } } } diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForSimpleExpressionsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForSimpleExpressionsCreator.scala index d2d4c3677b45..867636fa1e43 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForSimpleExpressionsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForSimpleExpressionsCreator.scala @@ -33,7 +33,7 @@ import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Operators} import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional -import scala.util.{Failure, Success} +import scala.util.{Failure, Success, Try} trait AstForSimpleExpressionsCreator { this: AstCreator => @@ -59,7 +59,11 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => } private[expressions] def astForArrayCreationExpr(expr: ArrayCreationExpr, expectedType: ExpectedType): Ast = { - val maybeInitializerAst = expr.getInitializer.toScala.map(astForArrayInitializerExpr(_, expectedType)) + val elementType = tryWithSafeStackOverflow(expr.getElementType.resolve()).map(elementType => + ExpectedType(typeInfoCalc.fullName(elementType).map(_ ++ "[]"), Option(elementType)) + ) + val maybeInitializerAst = + expr.getInitializer.toScala.map(astForArrayInitializerExpr(_, elementType.getOrElse(expectedType))) maybeInitializerAst.flatMap(_.root) match { case Some(initializerRoot: NewCall) => initializerRoot.code(expr.toString) @@ -84,11 +88,12 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => } private[expressions] def astForArrayInitializerExpr(expr: ArrayInitializerExpr, expectedType: ExpectedType): Ast = { - val typeFullName = - expressionReturnTypeFullName(expr) - .orElse(expectedType.fullName) - .map(typeInfoCalc.registerType) - .getOrElse(TypeConstants.Any) + // In the expression `new int[] { 1, 2 }`, the ArrayInitializerExpr is only the `{ 1, 2 }` part and does not have + // a type itself. We need to use the expected type from the parent expr here. + val typeFullName = expectedType.fullName + .map(typeInfoCalc.registerType) + .getOrElse(TypeConstants.Any) + val callNode = newOperatorCallNode( Operators.arrayInitializer, code = expr.toString, @@ -174,8 +179,8 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => private[expressions] def astForCastExpr(expr: CastExpr, expectedType: ExpectedType): Ast = { val typeFullName = - typeInfoCalc - .fullName(expr.getType) + tryWithSafeStackOverflow(expr.getType).toOption + .flatMap(typeInfoCalc.fullName) .orElse(expectedType.fullName) .getOrElse(TypeConstants.Any) @@ -188,7 +193,7 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => ) val typeNode = NewTypeRef() - .code(expr.getType.toString) + .code(tryWithSafeStackOverflow(expr.getType.toString).getOrElse(code(expr))) .lineNumber(line(expr)) .columnNumber(column(expr)) .typeFullName(typeFullName) @@ -203,9 +208,14 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => val someTypeFullName = Some(TypeConstants.Class) val callNode = newOperatorCallNode(Operators.fieldAccess, expr.toString, someTypeFullName, line(expr), column(expr)) - val identifierType = typeInfoCalc.fullName(expr.getType) - val identifier = identifierNode(expr, expr.getTypeAsString, expr.getTypeAsString, identifierType.getOrElse("ANY")) - val idAst = Ast(identifier) + val identifierType = tryWithSafeStackOverflow(expr.getType).toOption.flatMap(typeInfoCalc.fullName) + val exprTypeString = + tryWithSafeStackOverflow(expr.getTypeAsString).toOption + .orElse(identifierType) + .getOrElse(code(expr).stripSuffix(".class")) + val identifier = + identifierNode(expr, Util.stripGenericTypes(exprTypeString), exprTypeString, identifierType.getOrElse("ANY")) + val idAst = Ast(identifier) val fieldIdentifier = NewFieldIdentifier() .canonicalName("class") @@ -268,12 +278,13 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => newOperatorCallNode(Operators.instanceOf, expr.toString, booleanTypeFullName, line(expr), column(expr)) val exprAst = astsForExpression(expr.getExpression, ExpectedType.empty) - val typeFullName = typeInfoCalc.fullName(expr.getType).getOrElse(TypeConstants.Any) + val exprType = tryWithSafeStackOverflow(expr.getType).toOption + val typeFullName = exprType.flatMap(typeInfoCalc.fullName).getOrElse(TypeConstants.Any) val typeNode = NewTypeRef() - .code(expr.getType.toString) + .code(exprType.map(_.toString).getOrElse(code(expr).split("instanceof").lastOption.getOrElse(""))) .lineNumber(line(expr)) - .columnNumber(column(expr.getType)) + .columnNumber(exprType.map(column(_)).getOrElse(column(expr))) .typeFullName(typeFullName) val typeAst = Ast(typeNode) @@ -285,8 +296,8 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => identifierType: Option[String], fieldIdentifierName: String, returnType: Option[String], - lineNo: Option[Integer], - columnNo: Option[Integer] + lineNo: Option[Int], + columnNo: Option[Int] ): Ast = { val typeFullName = identifierType.orElse(Some(TypeConstants.Any)).map(typeInfoCalc.registerType) val identifier = newIdentifierNode(identifierName, typeFullName.getOrElse("ANY")) @@ -319,7 +330,7 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => val typeFullName = expressionReturnTypeFullName(expr).map(typeInfoCalc.registerType).getOrElse(TypeConstants.Any) val literalNode = NewLiteral() - .code(expr.toString) + .code(code(expr)) .lineNumber(line(expr)) .columnNumber(column(expr)) .typeFullName(typeFullName) @@ -388,8 +399,9 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => private[expressions] def astForMethodReferenceExpr(expr: MethodReferenceExpr, expectedType: ExpectedType): Ast = { val typeFullName = expr.getScope match { case typeExpr: TypeExpr => + val rawType = tryWithSafeStackOverflow(typeExpr.getTypeAsString).map(Util.stripGenericTypes).toOption // JavaParser wraps the "type" scope of a MethodReferenceExpr in a TypeExpr, but this also catches variable names. - scope.lookupVariableOrType(typeExpr.getTypeAsString).orElse(expressionReturnTypeFullName(typeExpr)) + rawType.flatMap(scope.lookupVariableOrType).orElse(expressionReturnTypeFullName(typeExpr)) case scopeExpr => expressionReturnTypeFullName(scopeExpr) } @@ -400,7 +412,7 @@ trait AstForSimpleExpressionsCreator { this: AstCreator => case Failure(_) => Defines.UnresolvedSignature case Success(resolvedMethod) => - val returnType = typeInfoCalc.fullName(resolvedMethod.getReturnType) + val returnType = tryWithSafeStackOverflow(resolvedMethod.getReturnType).toOption.flatMap(typeInfoCalc.fullName) val parameterTypes = argumentTypesForMethodLike(Success(resolvedMethod)) composeSignature(returnType, parameterTypes, resolvedMethod.getNumberOfParams) } diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForVarDeclAndAssignsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForVarDeclAndAssignsCreator.scala index 5445ed980a09..174eabe7617a 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForVarDeclAndAssignsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/expressions/AstForVarDeclAndAssignsCreator.scala @@ -9,7 +9,7 @@ import com.github.javaparser.resolution.types.ResolvedType import io.joern.javasrc2cpg.astcreation.{AstCreator, ExpectedType} import io.joern.javasrc2cpg.scope.Scope.{NewVariableNode, typeFullName} import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants -import io.joern.javasrc2cpg.util.NameConstants +import io.joern.javasrc2cpg.util.{NameConstants, Util} import io.joern.x2cpg.utils.AstPropertiesUtil.* import io.joern.x2cpg.Ast import io.shiftleft.codepropertygraph.generated.nodes.{ @@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional -import scala.util.Try +import scala.util.{Failure, Success, Try} import io.joern.javasrc2cpg.scope.JavaScopeElement.PartialInit trait AstForVarDeclAndAssignsCreator { this: AstCreator => @@ -107,19 +107,20 @@ trait AstForVarDeclAndAssignsCreator { this: AstCreator => def astsForVariableDeclarator(variableDeclarator: VariableDeclarator, originNode: Node): Seq[Ast] = { - val variableDeclaratorType = variableDeclarator.getType + val declaratorType = tryWithSafeStackOverflow(variableDeclarator.getType).toOption // If generics are in the type name, we may be unable to resolve the type - val (variableTypeString, maybeTypeArgs) = variableDeclaratorType match { - case typ: ClassOrInterfaceType => + val (variableTypeString, maybeTypeArgs) = declaratorType match { + case Some(typ: ClassOrInterfaceType) => val typeParams = typ.getTypeArguments.toScala.map(_.asScala.flatMap(typeInfoCalc.fullName)) - (typ.getName.asString(), typeParams) - case _ => (variableDeclarator.getTypeAsString, None) + (Some(typ.getName.asString()), typeParams) + case Some(typ) => (Some(Util.stripGenericTypes(typ.toString)), None) + case None => (None, None) } val typeFullName = tryWithSafeStackOverflow( - scope - .lookupType(variableTypeString, includeWildcards = false) - .orElse(typeInfoCalc.fullName(variableDeclarator.getType)) + variableTypeString + .flatMap(scope.lookupType(_, includeWildcards = false)) + .orElse(declaratorType.flatMap(typeInfoCalc.fullName)) ).toOption.flatten.map { typ => maybeTypeArgs match { case Some(typeArgs) if keepTypeArguments => s"$typ<${typeArgs.mkString(",")}>" @@ -131,7 +132,8 @@ trait AstForVarDeclAndAssignsCreator { this: AstCreator => val declarationNode: Option[NewVariableNode] = if (originNode.isInstanceOf[FieldDeclaration]) { scope.lookupVariable(variableName).variableNode } else { - val localCode = s"${variableDeclarator.getTypeAsString} ${variableDeclarator.getNameAsString}" + // Use type name with generics for code + val localCode = s"${declaratorType.map(_.toString).getOrElse("")} ${variableDeclarator.getNameAsString}" val local = localNode(originNode, variableDeclarator.getNameAsString, localCode, typeFullName.getOrElse(TypeConstants.Any)) @@ -174,6 +176,8 @@ trait AstForVarDeclAndAssignsCreator { this: AstCreator => symbolSolver.toResolvedType(variableDeclarator.getType, classOf[ResolvedType]) ).toOption + val strippedType = + tryWithSafeStackOverflow(variableDeclarator.getTypeAsString).map(Util.stripGenericTypes).toOption astsForAssignment( variableDeclarator, assignmentTarget, @@ -181,7 +185,7 @@ trait AstForVarDeclAndAssignsCreator { this: AstCreator => Operators.assignment, "=", ExpectedType(typeFullName, expectedType), - Some(variableDeclarator.getTypeAsString) + strippedType ) } diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForForLoopsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForForLoopsCreator.scala index 086f33f1d3ca..5938bff74273 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForForLoopsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForForLoopsCreator.scala @@ -6,6 +6,7 @@ import io.joern.javasrc2cpg.astcreation.{AstCreator, ExpectedType} import io.joern.javasrc2cpg.scope.NodeTypeInfo import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants import io.joern.x2cpg.Ast +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.utils.NodeBuilders.{newCallNode, newFieldIdentifierNode, newIdentifierNode, newOperatorCallNode} import io.shiftleft.codepropertygraph.generated.nodes.Call.PropertyDefaults import io.shiftleft.codepropertygraph.generated.nodes.{ @@ -18,11 +19,11 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ NewNode } import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, DispatchTypes, Operators} -import io.shiftleft.passes.IntervalKeyPool import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional +import scala.util.Try trait AstForForLoopsCreator { this: AstCreator => @@ -229,7 +230,7 @@ trait AstForForLoopsCreator { this: AstCreator => ) } - private def nativeForEachIdxLocalNode(lineNo: Option[Integer]): NewLocal = { + private def nativeForEachIdxLocalNode(lineNo: Option[Int]): NewLocal = { val idxName = nextIndexName() val typeFullName = TypeConstants.Int val idxLocal = @@ -242,7 +243,7 @@ trait AstForForLoopsCreator { this: AstCreator => idxLocal } - private def nativeForEachIdxInitializerAst(lineNo: Option[Integer], idxLocal: NewLocal): Ast = { + private def nativeForEachIdxInitializerAst(lineNo: Option[Int], idxLocal: NewLocal): Ast = { val idxName = idxLocal.name val idxInitializerCallNode = newOperatorCallNode( Operators.assignment, @@ -261,11 +262,7 @@ trait AstForForLoopsCreator { this: AstCreator => .withRefEdge(idxIdentifierArg, idxLocal) } - private def nativeForEachCompareAst( - lineNo: Option[Integer], - iterableSource: NodeTypeInfo, - idxLocal: NewLocal - ): Ast = { + private def nativeForEachCompareAst(lineNo: Option[Int], iterableSource: NodeTypeInfo, idxLocal: NewLocal): Ast = { val idxName = idxLocal.name val compareNode = newOperatorCallNode( @@ -295,7 +292,7 @@ trait AstForForLoopsCreator { this: AstCreator => .withRefEdges(fieldAccessIdentifier, iterableSourceNode.toList) } - private def nativeForEachIncrementAst(lineNo: Option[Integer], idxLocal: NewLocal): Ast = { + private def nativeForEachIncrementAst(lineNo: Option[Int], idxLocal: NewLocal): Ast = { val incrementNode = newOperatorCallNode( Operators.postIncrement, code = s"${idxLocal.name}++", @@ -325,8 +322,9 @@ trait AstForForLoopsCreator { this: AstCreator => maybeVariable match { case Some(variable) => - val name = variable.getNameAsString - val typeFullName = typeInfoCalc.fullName(variable.getType).getOrElse("ANY") + val name = variable.getNameAsString + val typeFullName = + tryWithSafeStackOverflow(variable.getType).toOption.flatMap(typeInfoCalc.fullName).getOrElse("ANY") val localNode = partialLocalNode .name(name) .code(variable.getNameAsString) @@ -341,7 +339,7 @@ trait AstForForLoopsCreator { this: AstCreator => } } - private def iteratorLocalForForEach(lineNumber: Option[Integer]): NewLocal = { + private def iteratorLocalForForEach(lineNumber: Option[Int]): NewLocal = { val iteratorLocalName = nextIterableName() NewLocal() .name(iteratorLocalName) @@ -354,7 +352,7 @@ trait AstForForLoopsCreator { this: AstCreator => iterExpr: Expression, iteratorLocalNode: NewLocal, iterableType: Option[String], - lineNo: Option[Integer] + lineNo: Option[Int] ): Ast = { val iteratorAssignNode = newOperatorCallNode(Operators.assignment, code = "", typeFullName = Some(TypeConstants.Iterator), line = lineNo) @@ -383,7 +381,7 @@ trait AstForForLoopsCreator { this: AstCreator => .withRefEdge(iteratorAssignIdentifier, iteratorLocalNode) } - private def hasNextCallAstForForEach(iteratorLocalNode: NewLocal, lineNo: Option[Integer]): Ast = { + private def hasNextCallAstForForEach(iteratorLocalNode: NewLocal, lineNo: Option[Int]): Ast = { val iteratorHasNextCallNode = newCallNode( "hasNext", diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForSimpleStatementsCreator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForSimpleStatementsCreator.scala index b01d7c854770..829dea82a3a3 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForSimpleStatementsCreator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/astcreation/statements/AstForSimpleStatementsCreator.scala @@ -89,7 +89,7 @@ trait AstForSimpleStatementsCreator { this: AstCreator => .name("assert") .methodFullName("assert") .dispatchType(DispatchTypes.STATIC_DISPATCH) - .code(stmt.toString) + .code(code(stmt)) .lineNumber(line(stmt)) .columnNumber(column(stmt)) @@ -102,7 +102,7 @@ trait AstForSimpleStatementsCreator { this: AstCreator => .controlStructureType(ControlStructureTypes.BREAK) .lineNumber(line(stmt)) .columnNumber(column(stmt)) - .code(stmt.toString) + .code(code(stmt)) Ast(node) } @@ -111,7 +111,7 @@ trait AstForSimpleStatementsCreator { this: AstCreator => .controlStructureType(ControlStructureTypes.CONTINUE) .lineNumber(line(stmt)) .columnNumber(column(stmt)) - .code(stmt.toString) + .code(code(stmt)) Ast(node) } @@ -245,7 +245,7 @@ trait AstForSimpleStatementsCreator { this: AstCreator => val returnNode = NewReturn() .lineNumber(line(ret)) .columnNumber(column(ret)) - .code(ret.toString) + .code(code(ret)) if (ret.getExpression.isPresent) { val expectedType = scope.enclosingMethodReturnType.getOrElse(ExpectedType.empty) val exprAsts = astsForExpression(ret.getExpression.get(), expectedType) @@ -268,7 +268,7 @@ trait AstForSimpleStatementsCreator { this: AstCreator => .methodFullName(".throw") .lineNumber(line(stmt)) .columnNumber(column(stmt)) - .code(stmt.toString()) + .code(code(stmt)) .dispatchType(DispatchTypes.STATIC_DISPATCH) val args = astsForExpression(stmt.getExpression, ExpectedType.empty) @@ -281,35 +281,19 @@ trait AstForSimpleStatementsCreator { this: AstCreator => } private[statements] def astsForTry(stmt: TryStmt): Seq[Ast] = { - val tryNode = NewControlStructure() - .controlStructureType(ControlStructureTypes.TRY) - .code("try") - .lineNumber(line(stmt)) - .columnNumber(column(stmt)) - + val tryNode = controlStructureNode(stmt, ControlStructureTypes.TRY, "try") val resources = stmt.getResources.asScala.flatMap(astsForExpression(_, expectedType = ExpectedType.empty)).toList val tryAst = astForBlockStatement(stmt.getTryBlock, codeStr = "try") val catchAsts = stmt.getCatchClauses.asScala.toList.map { catchClause => - val catchNode = NewControlStructure() - .controlStructureType(ControlStructureTypes.CATCH) - .code("catch") - .lineNumber(line(catchClause)) - .columnNumber(column(catchClause)) + val catchNode = controlStructureNode(catchClause, ControlStructureTypes.CATCH, "catch") Ast(catchNode).withChild(astForCatchClause(catchClause)) } val finallyAst = stmt.getFinallyBlock.toScala.map { finallyBlock => - val finallyNode = NewControlStructure() - .controlStructureType(ControlStructureTypes.FINALLY) - .code("finally") - .lineNumber(line(finallyBlock)) - .columnNumber(column(finallyBlock)) + val finallyNode = controlStructureNode(finallyBlock, ControlStructureTypes.FINALLY, "finally") Ast(finallyNode).withChild(astForBlockStatement(finallyBlock, "finally")) - }.toList - - val childrenAsts = tryAst +: (catchAsts ++ finallyAst) - setArgumentIndices(childrenAsts) - val controlStructureAst = Ast(tryNode).withChildren(childrenAsts) + } + val controlStructureAst = tryCatchAst(tryNode, tryAst, catchAsts, finallyAst) resources.appended(controlStructureAst) } } diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TokenParser.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TokenParser.scala index 2984520ca54c..e053b780a2f0 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TokenParser.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TokenParser.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.jartypereader.descriptorparser import io.joern.javasrc2cpg.jartypereader.model.PrimitiveType -import io.joern.javasrc2cpg.jartypereader.model.Model.TypeConstants._ +import io.joern.javasrc2cpg.jartypereader.model.Model.TypeConstants.* import org.slf4j.LoggerFactory import scala.util.parsing.combinator.RegexParsers diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TypeParser.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TypeParser.scala index d1f735573013..6694c27abf3a 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TypeParser.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/jartypereader/descriptorparser/TypeParser.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.jartypereader.descriptorparser import io.joern.javasrc2cpg.jartypereader.model.Bound.{BoundAbove, BoundBelow} -import io.joern.javasrc2cpg.jartypereader.model._ +import io.joern.javasrc2cpg.jartypereader.model.* import org.slf4j.LoggerFactory trait TypeParser extends TokenParser { diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/AstCreationPass.scala index 7f9bf5866f88..4694b137d250 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/AstCreationPass.scala @@ -24,22 +24,25 @@ import io.joern.x2cpg.SourceFiles import io.joern.x2cpg.datastructures.Global import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.utils.dependency.DependencyResolver -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import java.net.URLClassLoader import java.nio.file.{Path, Paths} +import java.util.concurrent.ConcurrentHashMap import scala.collection.parallel.CollectionConverters.* +import scala.collection.concurrent import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional import scala.util.{Success, Try} class AstCreationPass(config: Config, cpg: Cpg, sourcesOverride: Option[List[String]] = None) - extends ConcurrentWriterCpgPass[String](cpg) { + extends ForkJoinParallelCpgPass[String](cpg) { - val global: Global = new Global() - private val logger = LoggerFactory.getLogger(classOf[AstCreationPass]) + val global: Global = new Global() + private val logger = LoggerFactory.getLogger(classOf[AstCreationPass]) + private val loggedExceptionCounts = new ConcurrentHashMap[Class[?], Int]().asScala val (sourceParser, symbolSolver) = initParserAndUtils(config) @@ -50,10 +53,17 @@ class AstCreationPass(config: Config, cpg: Cpg, sourcesOverride: Option[List[Str case Some(compilationUnit, fileContent) => symbolSolver.inject(compilationUnit) val contentToUse = if (!config.disableFileContent) fileContent else None + diffGraph.absorb( - new AstCreator(filename, compilationUnit, contentToUse, global, symbolSolver, config.keepTypeArguments)( - config.schemaValidation - ) + new AstCreator( + filename, + compilationUnit, + contentToUse, + global, + symbolSolver, + config.keepTypeArguments, + loggedExceptionCounts + )(config.schemaValidation) .createAst() ) diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/TypeInferencePass.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/TypeInferencePass.scala index 595d30374e1a..a92e51fe2c42 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/TypeInferencePass.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/TypeInferencePass.scala @@ -3,11 +3,10 @@ package io.joern.javasrc2cpg.passes import com.github.javaparser.symbolsolver.cache.GuavaCache import com.google.common.cache.CacheBuilder import io.joern.x2cpg.Defines -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.ModifierTypes +import io.shiftleft.codepropertygraph.generated.{Cpg, ModifierTypes, Properties} import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method} -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory import scala.jdk.OptionConverters.RichOptional @@ -15,7 +14,7 @@ import io.joern.x2cpg.Defines.UnresolvedNamespace import io.shiftleft.codepropertygraph.generated.nodes.Call.PropertyNames import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants -class TypeInferencePass(cpg: Cpg) extends ConcurrentWriterCpgPass[Call](cpg) { +class TypeInferencePass(cpg: Cpg) extends ForkJoinParallelCpgPass[Call](cpg) { private val cache = new GuavaCache(CacheBuilder.newBuilder().build[String, Option[Method]]()) private val resolvedMethodIndex = cpg.method @@ -55,11 +54,8 @@ class TypeInferencePass(cpg: Cpg) extends ConcurrentWriterCpgPass[Call](cpg) { val callArgs = if (skipCallThis) call.argument.toList.tail else call.argument.toList val hasDifferingArg = method.parameter.zip(callArgs).exists { case (parameter, argument) => - val maybeArgumentType = Option(argument.property(PropertyNames.TypeFullName)) - .map(_.toString()) - .getOrElse(TypeConstants.Any) - - val argMatches = maybeArgumentType == TypeConstants.Any || maybeArgumentType == parameter.typeFullName + val maybeArgumentType = argument.propertyOption(Properties.TypeFullName).getOrElse(TypeConstants.Any) + val argMatches = maybeArgumentType == TypeConstants.Any || maybeArgumentType == parameter.typeFullName !argMatches } @@ -80,10 +76,8 @@ class TypeInferencePass(cpg: Cpg) extends ConcurrentWriterCpgPass[Call](cpg) { } private def getReplacementMethod(call: Call): Option[Method] = { - val argTypes = - call.argument.flatMap(arg => Option(arg.property(PropertyNames.TypeFullName)).map(_.toString)).mkString(":") - val callKey = - s"${call.methodFullName}:$argTypes" + val argTypes = call.argument.property(Properties.TypeFullName).mkString(":") + val callKey = s"${call.methodFullName}:$argTypes" cache.get(callKey).toScala.getOrElse { val callNameParts = getNameParts(call.name, call.methodFullName) resolvedMethodIndex.get(call.name).flatMap { candidateMethods => diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/scope/JavaScopeElement.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/scope/JavaScopeElement.scala index 04f5df7ea105..005cf188c7f3 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/scope/JavaScopeElement.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/scope/JavaScopeElement.scala @@ -11,7 +11,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.NewMethodParameterIn import io.shiftleft.codepropertygraph.generated.nodes.NewLocal import io.shiftleft.codepropertygraph.generated.nodes.NewMember import io.joern.javasrc2cpg.util.{BindingTable, BindingTableEntry, NameConstants} -import io.shiftleft.passes.IntervalKeyPool +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.Ast trait JavaScopeElement { diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/JmodClassPath.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/JmodClassPath.scala index e234475e2508..a9891ff5aabf 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/JmodClassPath.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/JmodClassPath.scala @@ -1,10 +1,10 @@ package io.joern.javasrc2cpg.typesolvers import better.files.File -import io.joern.javasrc2cpg.typesolvers.JmodClassPath._ +import io.joern.javasrc2cpg.typesolvers.JmodClassPath.* import javassist.ClassPath -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.Try import java.io.InputStream import java.net.URL diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeInfoCalculator.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeInfoCalculator.scala index fb14ca648104..5c47594f83a3 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeInfoCalculator.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeInfoCalculator.scala @@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory import scala.collection.mutable import scala.jdk.CollectionConverters.* import scala.jdk.OptionConverters.RichOptional -import scala.util.Try +import scala.util.{Failure, Try} class TypeInfoCalculator(global: Global, symbolResolver: SymbolResolver, keepTypeArguments: Boolean) { private val logger = LoggerFactory.getLogger(this.getClass) @@ -108,7 +108,15 @@ class TypeInfoCalculator(global: Global, symbolResolver: SymbolResolver, keepTyp } else { val extendsBoundOption = Try(typeParamDecl.getBounds.asScala.find(_.isExtends)).toOption.flatten extendsBoundOption - .flatMap(bound => nameOrFullName(bound.getType, typeParamValues, fullyQualified)) + .flatMap(bound => + Try(bound.getType) + .recoverWith(throwable => { + logger.debug("Error getting bound type", throwable) + Failure(throwable) + }) + .toOption + ) + .flatMap(boundType => nameOrFullName(boundType, typeParamValues, fullyQualified)) .orElse(objectType(fullyQualified)) } case lambdaConstraintType: ResolvedLambdaConstraintType => diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeSizeReducer.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeSizeReducer.scala index 11fa1fdd082f..5e1e0e250267 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeSizeReducer.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/typesolvers/TypeSizeReducer.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.typesolvers import com.github.javaparser.ast.body.TypeDeclaration import com.github.javaparser.ast.stmt.BlockStmt -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object TypeSizeReducer { def simplifyType(typeDeclaration: TypeDeclaration[?]): Unit = { diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/BindingTable.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/BindingTable.scala index 27d8c2634036..1e4c3f190960 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/BindingTable.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/BindingTable.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.util import scala.collection.mutable import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl import io.joern.x2cpg.utils.NodeBuilders.newBindingNode -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import io.shiftleft.codepropertygraph.generated.EdgeTypes case class BindingTableEntry(name: String, signature: String, implementingMethodFullName: String) diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/Util.scala b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/Util.scala index ac849eb464e8..9d844758da35 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/Util.scala +++ b/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/util/Util.scala @@ -2,15 +2,12 @@ package io.joern.javasrc2cpg.util import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration import com.github.javaparser.resolution.types.ResolvedReferenceType -import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants -import io.joern.x2cpg.{Ast, Defines} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, PropertyNames} -import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewFieldIdentifier, NewMember} +import io.joern.x2cpg.Defines import org.slf4j.LoggerFactory import scala.collection.mutable import scala.util.{Failure, Success, Try} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object Util { @@ -50,6 +47,19 @@ object Util { s"${Defines.UnresolvedSignature}($paramCount)" } + def stripGenericTypes(typeName: String): String = { + if (typeName.startsWith(Defines.UnresolvedNamespace)) { + logger.warn(s"stripGenericTypes should not be used for javasrc2cpg type $typeName") + typeName.head +: takeUntilGenericStart(typeName.tail) + } else { + takeUntilGenericStart(typeName) + } + } + + private def takeUntilGenericStart(typeName: String): String = { + typeName.takeWhile(char => char != '<') + } + private def getAllParents(typ: ResolvedReferenceType, result: mutable.ArrayBuffer[ResolvedReferenceType]): Unit = { if (typ.isJavaLangObject) { Iterable.empty diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/JavaSrc2CpgTestContext.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/JavaSrc2CpgTestContext.scala index 8ed98b844d1f..afc3a72a0da0 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/JavaSrc2CpgTestContext.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/JavaSrc2CpgTestContext.scala @@ -1,6 +1,6 @@ package io.joern.javasrc2cpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.x2cpg.X2Cpg.writeCodeToFile diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/passes/ConfigFileCreationPassTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/passes/ConfigFileCreationPassTests.scala index 5e9ec0f92568..d48a1a873f6e 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/passes/ConfigFileCreationPassTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/passes/ConfigFileCreationPassTests.scala @@ -1,14 +1,13 @@ package io.joern.javasrc2cpg.passes import better.files.File +import flatgraph.misc.TestUtils.* import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.joern.x2cpg.passes.frontend.JavaConfigFileCreationPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewMetaData import io.shiftleft.semanticcpg.language.* import io.shiftleft.utils.ProjectRoot -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder import java.nio.file.Paths @@ -18,8 +17,8 @@ class ConfigFileCreationPassTests extends JavaSrcCode2CpgFixture { ProjectRoot.relativise("joern-cli/frontends/javasrc2cpg/src/test/resources/config_tests") "it should find the correct config files" in { - val cpg = new Cpg() - BatchedUpdate.applyDiff(cpg.graph, new DiffGraphBuilder().addNode(NewMetaData().root(testConfigDir)).build()) + val cpg = Cpg.from(_.addNode(NewMetaData().root(testConfigDir))) + val foundFiles = new JavaConfigFileCreationPass(cpg).generateParts().map(_.canonicalPath) val absoluteConfigDir = File(testConfigDir).canonicalPath foundFiles should contain theSameElementsAs Array( diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArithmeticOperationsTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArithmeticOperationsTests.scala index e8850380d254..6e33a3755eef 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArithmeticOperationsTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArithmeticOperationsTests.scala @@ -1,11 +1,11 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Identifier import io.shiftleft.semanticcpg.language.toNodeTypeStarters -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ArithmeticOperationsTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArrayTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArrayTests.scala index e1f247b52fd8..1c44df3ef426 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArrayTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ArrayTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ArrayTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BindingTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BindingTests.scala index e7904883cec5..153b99d7e4a1 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BindingTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BindingTests.scala @@ -1,6 +1,6 @@ package io.joern.javasrc2cpg.querying -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture class BindingTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BooleanOperationsTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BooleanOperationsTests.scala index 7ec4357a2891..76e69e381f6c 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BooleanOperationsTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/BooleanOperationsTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class BooleanOperationsTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallGraphTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallGraphTests.scala index c54121618cf8..1c680d2d689b 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallGraphTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallGraphTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallGraphTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallTests.scala index dc2f5fac7ad4..9e62224b211f 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CallTests.scala @@ -6,9 +6,7 @@ import io.shiftleft.codepropertygraph.generated.edges.Ref import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, nodes} import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, Literal, MethodParameterIn} import io.shiftleft.semanticcpg.language.NoResolve -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.jIteratortoTraversal -import overflowdb.traversal.toNodeTraversal +import io.shiftleft.semanticcpg.language.* class NewCallTests extends JavaSrcCode2CpgFixture { "calls to imported methods" when { @@ -284,7 +282,7 @@ class NewCallTests extends JavaSrcCode2CpgFixture { cpg.method.name("test").call.name("foo").argument(0).outE.collectAll[Ref].l match { case List(ref) => - ref.inNode match { + ref.dst match { case param: MethodParameterIn => param.name shouldBe "this" param.index shouldBe 0 @@ -309,7 +307,7 @@ class NewCallTests extends JavaSrcCode2CpgFixture { cpg.method.name("test").call.name("foo").argument(0).outE.collectAll[Ref].l match { case List(ref) => - ref.inNode match { + ref.dst match { case param: MethodParameterIn => param.name shouldBe "this" param.index shouldBe 0 @@ -400,6 +398,31 @@ class NewCallTests extends JavaSrcCode2CpgFixture { } } + "be correct for chained call interspersed with a line comment" in { + val cpg = code(""" + |class Foo { + | private String value; + | + | public String getValue() { + | return value; + | } + | + | public static void test() { + | String s = new Foo() + | // some comment + | .getValue(); + | } + |} + |""".stripMargin) + + cpg.call.name("getValue").l match { + case List(getValueCall) => + getValueCall.code shouldBe "new Foo().getValue()" + + case result => fail(s"Expected single getValue call but got $result") + } + } + "be correct for constructor invocations" in { lazy val cpg = code(""" |class Foo { @@ -416,6 +439,47 @@ class NewCallTests extends JavaSrcCode2CpgFixture { case result => fail(s"Expected single init call but got $result") } } + + "be correct when there are line comments between arguments of a call" in { + val cpg = code(""" + |import foo.*; + |public class Main { + | public static void main(String[] args) { + | Foo foo = Foo.create( + | "username", // hehe silly comment + | "password"); + | } + |} + |""".stripMargin) + + cpg.call.name("create").argument.argumentIndexGt(0).l match { + case List(username: Literal, password: Literal) => + username.code shouldBe "\"username\"" + password.code shouldBe "\"password\"" + case result => fail(s"Expected two arguments but got $result") + } + } + + "be correct when there are multi-line comments between arguments of a call" in { + val cpg = code(""" + |import foo.*; + |public class Main { + | public static void main(String[] args) { + | Foo foo = Foo.create( + | // another comment + | "username", /* hehe silly comment */ + | "password"); + | } + |} + |""".stripMargin) + + cpg.call.name("create").argument.argumentIndexGt(0).l match { + case List(username: Literal, password: Literal) => + username.code shouldBe "\"username\"" + password.code shouldBe "\"password\"" + case result => fail(s"Expected two arguments but got $result") + } + } } "call to method with generic return type" should { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CfgTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CfgTests.scala index 5bcf4d6c7fec..9b7e75ec1bd0 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CfgTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/CfgTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CfgTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ClassLoaderTypeTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ClassLoaderTypeTests.scala index 1178f9113a77..303a4a668994 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ClassLoaderTypeTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ClassLoaderTypeTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.Config import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.joern.x2cpg.utils.ExternalCommand class ClassLoaderTypeTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConditionalTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConditionalTests.scala index a253b40778a6..b621d8dcd0d9 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConditionalTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConditionalTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConditionalTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConstructorInvocationTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConstructorInvocationTests.scala index 2c3c5a20b2ab..c6a05511822d 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConstructorInvocationTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ConstructorInvocationTests.scala @@ -262,20 +262,20 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { case List(method) => val List(_: Local, assign: Call, init: Call) = method.astChildren.isBlock.astChildren.l: @unchecked - assign.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + assign.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() assign.name shouldBe Operators.assignment val alloc = assign.argument(2).asInstanceOf[Call] alloc.name shouldBe ".alloc" alloc.code shouldBe "new Bar(4, 2)" - alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() alloc.methodFullName shouldBe ".alloc" alloc.typeFullName shouldBe "Bar" alloc.argument.size shouldBe 0 init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" - init.callOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init._methodViaCallOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.typeFullName shouldBe "void" init.signature shouldBe "void(int,int)" init.code shouldBe "new Bar(4, 2)" @@ -303,20 +303,20 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { case List(method) => val List(assign: Call, init: Call) = method.astChildren.isBlock.astChildren.l: @unchecked - assign.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + assign.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() assign.name shouldBe Operators.assignment val alloc = assign.argument(2).asInstanceOf[Call] alloc.name shouldBe ".alloc" alloc.code shouldBe "new Bar(4, 2)" - alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() alloc.methodFullName shouldBe ".alloc" alloc.typeFullName shouldBe "Bar" alloc.argument.size shouldBe 0 init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" - init.callOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init._methodViaCallOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int,int)" + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.typeFullName shouldBe "void" init.signature shouldBe "void(int,int)" init.code shouldBe "new Bar(4, 2)" @@ -362,16 +362,16 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { alloc.order shouldBe 2 alloc.argumentIndex shouldBe 2 alloc.code shouldBe "new Bar(42)" - alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() alloc.typeFullName shouldBe "Bar" alloc.argument.size shouldBe 0 init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" - init.callOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" + init._methodViaCallOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" init.signature shouldBe "void(int)" init.code shouldBe "new Bar(42)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.argument.size shouldBe 2 val List(obj: Identifier, initArg1: Literal) = init.argument.l: @unchecked @@ -411,16 +411,16 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { alloc.order shouldBe 2 alloc.argumentIndex shouldBe 2 alloc.code shouldBe "new Bar(42)" - alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + alloc.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() alloc.typeFullName shouldBe "Bar" alloc.argument.size shouldBe 0 init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" - init.callOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" + init._methodViaCallOut.head.fullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" init.signature shouldBe "void(int)" init.code shouldBe "new Bar(42)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.argument.size shouldBe 2 val List(obj: Identifier, initArg1: Literal) = init.argument.l: @unchecked @@ -447,7 +447,7 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { val List(init: Call) = method.astChildren.isBlock.astChildren.l: @unchecked init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Bar.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.typeFullName shouldBe "void" init.signature shouldBe "void(int)" @@ -475,7 +475,7 @@ class ConstructorInvocationTests extends JavaSrcCode2CpgFixture { val List(init: Call) = method.astChildren.isBlock.astChildren.l: @unchecked init.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName init.methodFullName shouldBe s"Foo.${io.joern.x2cpg.Defines.ConstructorMethodName}:void(int)" - init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.toString + init.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH.name() init.typeFullName shouldBe "void" init.signature shouldBe "void(int)" diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ControlStructureTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ControlStructureTests.scala index e1fbe59ce842..c26cd0355f5b 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ControlStructureTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ControlStructureTests.scala @@ -13,10 +13,9 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ Local, Return } -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.toNodeTraversal +import io.shiftleft.semanticcpg.language.* -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class NewControlStructureTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/EnumTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/EnumTests.scala index 3d111c7ccfb3..5130397d3462 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/EnumTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/EnumTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.Literal -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class EnumTests extends JavaSrcCode2CpgFixture { val cpg = code(""" @@ -59,7 +59,7 @@ class EnumTests extends JavaSrcCode2CpgFixture { cpg.typeDecl.name(".*Color.*").member.size shouldBe 3 val List(r, b, l) = cpg.typeDecl.name(".*Color.*").member.l - l.code shouldBe "java.lang.String label" + l.code shouldBe "String label" r.code shouldBe "RED(\"Red\")" r.astChildren.size shouldBe 0 diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/FileTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/FileTests.scala index bd64f35330a9..728ffbdb36f1 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/FileTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/FileTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import org.scalatest.Ignore diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/GenericsTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/GenericsTests.scala index 8e7d24934c0b..8620f7318b31 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/GenericsTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/GenericsTests.scala @@ -1,198 +1,305 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class GenericsTests extends JavaSrcCode2CpgFixture { + "unresolved generic type declarations" should { + val cpg = code("""import box.Box; + | + |public class Foo { + | public static void test() { + | Box b = new Box<>(0); + | b.get(); + | } + |} + |""".stripMargin) - val cpg = code(""" - |import java.util.function.Function; - | - |// Box - |class Box { - | - | // java.lang.Object - | private T item; - | - | // Box.getItem:java.lang.Object() - | public T getItem() { - | return item; - | } - | - | public void setItem(T item) { - | this.item = item; - | } - | - | // Box.map:Box(java.util.function.Function) - | public Box map(Function f) { - | // java.util.function.Function.apply: java.lang.Object(java.lang.Object) - | G newValue = f.apply(item); - | // Box.:void() - | Box newBox = new Box(); - | return newBox.withValue(newValue); - | } - | - | // Box.withValue:Box(java.lang.Object) - | public Box withValue(T value) { - | this.item = value; - | return this; - | } - | - | public String toString() { - | return "Box(" + item.toString() + ")"; - | } - | - | // Box.idk:java.lang.Number(java.lang.Number) - | public static K idK(K item) { - | return item; - | } - | - | // Box.idKC:java.lang.Number(java.lang.Number) - | public static K idKC(K item) { - | return item; - | } - | - | // Box.idC:java.lang.Comparable(java.lang.Comparable) - | public static K idC(K item) { - | return item; - | } - | - | // Box.testWildCard:void(Box) - | public static void testWildCard(Box b) { - | System.out.println(b); - | } - | - | // Box.testWildCardLower:void(Box) - | public static void testWildCardLower(Box b) { - | System.out.println(b); - | } - |} - | - | - |// inheritsFrom Box - |public class Test extends Box {} - |""".stripMargin) + "use erased types for the method full name in the constructor invocation" in { + cpg.call.nameExact("").methodFullName.l shouldBe List("box.Box.:(1)") + } - "it should create the correct generic typeDecl name" in { - cpg.typeDecl.nameExact("Box").l match { - case decl :: Nil => decl.fullName shouldBe "Box" + "use erased types for the method full name in the get method invocation" in { + cpg.call.nameExact("get").methodFullName.l shouldBe List("box.Box.get:(0)") + } - case res => fail(s"Expected typeDecl Box but got $res") + "not include generic types in type full names of objects" in { + cpg.method.name("test").local.name("b").typeFullName.l shouldBe List("box.Box") } } - "it should default to Object for a simple generic type" in { - cpg.method.name("getItem").l match { - case method :: Nil => - method.fullName shouldBe "Box.getItem:java.lang.Object()" - method.signature shouldBe "java.lang.Object()" + "generic methods" should { + val cpg = code("""package foo; + | + |class Foo { + | public T foo(S s) { return null; } + | + | static void test(Foo f) { + | f.foo(0); + | } + |} + |""".stripMargin) + + "use erased types in the method fullName" in { + cpg.method.name("foo").fullName.l shouldBe List("foo.Foo.foo:java.lang.Object(java.lang.Object)") + } - case res => fail(s"Expected method getItem but got $res") + "use erased types in the call methodFullName" in { + cpg.method.name("test").call.name("foo").methodFullName.l shouldBe List( + "foo.Foo.foo:java.lang.Object(java.lang.Object)" + ) } } - "it should default to Object for simple generic parameters" in { - cpg.method.name("setItem").l match { - case method :: Nil => - method.fullName shouldBe "Box.setItem:void(java.lang.Object)" - method.signature shouldBe "void(java.lang.Object)" + "methods returning parameterized types" should { + val cpg = code("""package foo; + | + |class Box { + | public Box into() { return null; } + | + | public T get() { return null; } + | + | static void test(Box stringBox) { + | stringBox.into().get(); + | } + |} + |""".stripMargin) - case res => fail(s"Expected method setItem but got $res") + "not have the generic types in the methodFullName for calls" in { + cpg.call.name("into").methodFullName.l shouldBe List("foo.Box.into:foo.Box()") + + cpg.call.name("get").methodFullName.l shouldBe List("foo.Box.get:java.lang.Object()") } - cpg.method.name("setItem").parameter.name("item").l match { - case node :: Nil => - node.typeFullName shouldBe "java.lang.Object" + } + + "unresolved generic variable types" should { + val cpg = code("""package foo; + |import a.*; + |import b.*; + | + |class Foo { + | + | void foo(Bar b) { + | b.bar(); + | } + |} + |""".stripMargin) - case res => fail(s"Expected param item but got $res") + "contain generic type information in the variable typeFullName" in { + cpg.method.name("foo").parameter.name("b").typeFullName.l shouldBe List(".Bar") } - } - "it should erase generic types in parameters" in { - val List(method) = cpg.method.name("map").l - method.fullName shouldBe "Box.map:Box(java.util.function.Function)" - method.signature shouldBe "Box(java.util.function.Function)" + "not contain generic type information in the bar call methodFullName" in { + cpg.call.name("bar").methodFullName.l shouldBe List(".Bar.bar:(0)") + } - val List(param) = cpg.method.name("map").parameter.name("f").l - param.typeFullName shouldBe "java.util.function.Function" } - "it should create correct constructor calls" in { - cpg.method.name("map").call.nameExact(io.joern.x2cpg.Defines.ConstructorMethodName).l match { - case const :: Nil => - const.methodFullName shouldBe s"Box.${io.joern.x2cpg.Defines.ConstructorMethodName}:void()" - const.signature shouldBe "void()" + "fields with generic types" should { + val cpg = code(""" + |package foo; + |class Box {} + | + |class Foo { + | Box box; + |} + |""".stripMargin) - case res => fail(s"Expected call to but got $res") + "not have the generic types in field type full names" in { + cpg.typeDecl.name("Foo").member.name("box").typeFullName.l shouldBe List("foo.Box") } } - "it should correctly handle generic return types" in { - cpg.method.name("withValue").l match { - case method :: Nil => - method.fullName shouldBe "Box.withValue:Box(java.lang.Object)" - method.signature shouldBe "Box(java.lang.Object)" + "old generics tests" should { + val cpg = code("""import java.util.function.Function; + | + |// Box + |class Box { + | + | // java.lang.Object + | private T item; + | + | // Box.getItem:java.lang.Object() + | public T getItem() { + | return item; + | } + | + | public void setItem(T item) { + | this.item = item; + | } + | + | // Box.map:Box(java.util.function.Function) + | public Box map(Function f) { + | // java.util.function.Function.apply: java.lang.Object(java.lang.Object) + | G newValue = f.apply(item); + | // Box.:void() + | Box newBox = new Box(); + | return newBox.withValue(newValue); + | } + | + | // Box.withValue:Box(java.lang.Object) + | public Box withValue(T value) { + | this.item = value; + | return this; + | } + | + | public String toString() { + | return "Box(" + item.toString() + ")"; + | } + | + | // Box.idk:java.lang.Number(java.lang.Number) + | public static K idK(K item) { + | return item; + | } + | + | // Box.idKC:java.lang.Number(java.lang.Number) + | public static K idKC(K item) { + | return item; + | } + | + | // Box.idC:java.lang.Comparable(java.lang.Comparable) + | public static K idC(K item) { + | return item; + | } + | + | // Box.testWildCard:void(Box) + | public static void testWildCard(Box b) { + | System.out.println(b); + | } + | + | // Box.testWildCardLower:void(Box) + | public static void testWildCardLower(Box b) { + | System.out.println(b); + | } + |} + | + | + |// inheritsFrom Box + |public class Test extends Box {} + |""".stripMargin) - case res => fail(s"Expected method withValue but got $res") + "it should create the correct generic typeDecl name" in { + cpg.typeDecl.nameExact("Box").l match { + case decl :: Nil => decl.fullName shouldBe "Box" + + case res => fail(s"Expected typeDecl Box but got $res") + } } - } - "it should handle generics with upper bounds" in { - cpg.method.name("idK").l match { - case method :: Nil => - method.fullName shouldBe "Box.idK:java.lang.Number(java.lang.Number)" - method.signature shouldBe "java.lang.Number(java.lang.Number)" + "it should default to Object for a simple generic type" in { + cpg.method.name("getItem").l match { + case method :: Nil => + method.fullName shouldBe "Box.getItem:java.lang.Object()" + method.signature shouldBe "java.lang.Object()" - case res => fail(s"Expected method idK but found $res") + case res => fail(s"Expected method getItem but got $res") + } } - } - "it should handle generics with compound upper bounds" in { - cpg.method.name("idKC").l match { - case method :: Nil => - method.fullName shouldBe "Box.idKC:java.lang.Number(java.lang.Number)" - method.signature shouldBe "java.lang.Number(java.lang.Number)" + "it should default to Object for simple generic parameters" in { + cpg.method.name("setItem").l match { + case method :: Nil => + method.fullName shouldBe "Box.setItem:void(java.lang.Object)" + method.signature shouldBe "void(java.lang.Object)" + + case res => fail(s"Expected method setItem but got $res") + } + + cpg.method.name("setItem").parameter.name("item").l match { + case node :: Nil => + node.typeFullName shouldBe "java.lang.Object" - case res => fail(s"Expected method idKC but found $res") + case res => fail(s"Expected param item but got $res") + } } - } - "it should handle generics with an interface upper bound" in { - cpg.method.name("idC").l match { - case method :: Nil => - method.fullName shouldBe "Box.idC:java.lang.Comparable(java.lang.Comparable)" - method.signature shouldBe "java.lang.Comparable(java.lang.Comparable)" + "it should erase generic types in parameters" in { + val List(method) = cpg.method.name("map").l + method.fullName shouldBe "Box.map:Box(java.util.function.Function)" + method.signature shouldBe "Box(java.util.function.Function)" - case res => fail(s"Expected method idC but found $res") + val List(param) = cpg.method.name("map").parameter.name("f").l + param.typeFullName shouldBe "java.util.function.Function" } - } - "it should handle wildcard subclass generics" in { - cpg.method.name("testWildCard").l match { - case method :: Nil => - method.fullName shouldBe "Box.testWildCard:void(Box)" - method.signature shouldBe "void(Box)" + "it should create correct constructor calls" in { + cpg.method.name("map").call.nameExact(io.joern.x2cpg.Defines.ConstructorMethodName).l match { + case const :: Nil => + const.methodFullName shouldBe s"Box.${io.joern.x2cpg.Defines.ConstructorMethodName}:void()" + const.signature shouldBe "void()" - case res => fail(s"Expected method testWildCard but found $res") + case res => fail(s"Expected call to but got $res") + } } - } - "it should handle wildcard superclass generics" in { - cpg.method.name("testWildCardLower").l match { - case method :: Nil => - method.fullName shouldBe "Box.testWildCardLower:void(Box)" - method.signature shouldBe "void(Box)" + "it should correctly handle generic return types" in { + cpg.method.name("withValue").l match { + case method :: Nil => + method.fullName shouldBe "Box.withValue:Box(java.lang.Object)" + method.signature shouldBe "Box(java.lang.Object)" - case res => fail(s"Expected method testWildCardLower but found $res") + case res => fail(s"Expected method withValue but got $res") + } + } + + "it should handle generics with upper bounds" in { + cpg.method.name("idK").l match { + case method :: Nil => + method.fullName shouldBe "Box.idK:java.lang.Number(java.lang.Number)" + method.signature shouldBe "java.lang.Number(java.lang.Number)" + + case res => fail(s"Expected method idK but found $res") + } + } + + "it should handle generics with compound upper bounds" in { + cpg.method.name("idKC").l match { + case method :: Nil => + method.fullName shouldBe "Box.idKC:java.lang.Number(java.lang.Number)" + method.signature shouldBe "java.lang.Number(java.lang.Number)" + + case res => fail(s"Expected method idKC but found $res") + } + } + + "it should handle generics with an interface upper bound" in { + cpg.method.name("idC").l match { + case method :: Nil => + method.fullName shouldBe "Box.idC:java.lang.Comparable(java.lang.Comparable)" + method.signature shouldBe "java.lang.Comparable(java.lang.Comparable)" + + case res => fail(s"Expected method idC but found $res") + } + } + + "it should handle wildcard subclass generics" in { + cpg.method.name("testWildCard").l match { + case method :: Nil => + method.fullName shouldBe "Box.testWildCard:void(Box)" + method.signature shouldBe "void(Box)" + + case res => fail(s"Expected method testWildCard but found $res") + } + } + + "it should handle wildcard superclass generics" in { + cpg.method.name("testWildCardLower").l match { + case method :: Nil => + method.fullName shouldBe "Box.testWildCardLower:void(Box)" + method.signature shouldBe "void(Box)" + + case res => fail(s"Expected method testWildCardLower but found $res") + } } - } - "it should handle generic inheritance" in { - cpg.typeDecl.name("Test").l match { - case decl :: Nil => - decl.inheritsFromTypeFullName.head shouldBe "Box" + "it should handle generic inheritance" in { + cpg.typeDecl.name("Test").l match { + case decl :: Nil => + decl.inheritsFromTypeFullName.head shouldBe "Box" - case res => fail(s"Expected typeDecl Test but found $res") + case res => fail(s"Expected typeDecl Test but found $res") + } } } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ImportTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ImportTests.scala index 8e01a0910bd9..aa26b95d1eab 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ImportTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ImportTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ImportTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/InferenceJarTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/InferenceJarTests.scala index 1d6b65f6dc97..48d405fdfb17 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/InferenceJarTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/InferenceJarTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.JavaSrc2CpgTestContext import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants import io.joern.x2cpg.Defines -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.utils.ProjectRoot import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LambdaTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LambdaTests.scala index 7a67dd20ef00..aecb56aa7fd2 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LambdaTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LambdaTests.scala @@ -742,4 +742,72 @@ class LambdaTests extends JavaSrcCode2CpgFixture { cpg.call.nameExact("").count(_.argument.isEmpty) shouldBe 0 } } + + "calls on captured variables in lambdas contained in anonymous classes" should { + val cpg = code(""" + | + |public class Foo { + | + | public static void sink(String s) {}; + | + | public static Object test(Bar captured) { + | Visitor v = new Visitor() { + | public void visit(Visited visited) { + | visited.getList().forEach(lambdaParam -> captured.remove(lambdaParam)); + | } + | }; + | } + |} + |""".stripMargin) + + // TODO: This behaviour isn't exactly correct, but is on par with how we currently handle field captures in lambdas. + "have the correct receiver ast" in { + inside(cpg.call.name("remove").receiver.l) { case List(fieldAccessCall: Call) => + fieldAccessCall.name shouldBe Operators.fieldAccess + + inside(fieldAccessCall.argument.l) { case List(identifier: Identifier, fieldIdentifier: FieldIdentifier) => + identifier.name shouldBe "this" + identifier.typeFullName shouldBe "Foo.test.Visitor$0" + + fieldIdentifier.canonicalName shouldBe "captured" + + fieldAccessCall.typeFullName shouldBe ".Bar" + } + } + } + } + + // TODO: These tests exist to document current behaviour, but the current behaviour is wrong. + "lambdas capturing parameters" should { + val cpg = code(""" + |import java.util.function.Consumer; + | + |public class Foo { + | public String capturedField; + | + | public void foo() { + | Consumer consumer = lambdaParam -> System.out.println(capturedField); + | } + |} + |""".stripMargin) + + "represent the captured field as a field access" in { + inside(cpg.method.name(".*lambda.*").call.name("println").argument.l) { case List(_, fieldAccessCall: Call) => + fieldAccessCall.name shouldBe Operators.fieldAccess + + inside(fieldAccessCall.argument.l) { case List(identifier: Identifier, fieldIdentifier: FieldIdentifier) => + identifier.name shouldBe "this" + identifier.typeFullName shouldBe "Foo" + + fieldIdentifier.canonicalName shouldBe "capturedField" + } + } + } + + // TODO: It should, but it doesn't. + "have a captured local for the enclosing class" in { + // There should be an `outerClass` local which captures the outer method `this`. + cpg.method.name(".*lambda.*").local.name("this").typeFullName(".*Foo.*").isEmpty shouldBe true + } + } } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LiteralTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LiteralTests.scala index ebb4c50a1907..4b95846be327 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LiteralTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LiteralTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import com.github.javaparser.ast.expr.LiteralExpr import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LiteralTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LocalTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LocalTests.scala index 6c2024b75004..7ba4a1df0eae 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LocalTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LocalTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.Local -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocalTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LombokTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LombokTests.scala index c8697f6fdef9..ca15ffbfe948 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LombokTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/LombokTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants import io.joern.x2cpg.Defines -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.joern.javasrc2cpg.Config class LombokTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MemberTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MemberTests.scala index 0a82f5ac3063..8e707b219888 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MemberTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MemberTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, ModifierTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, Literal, Member} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class NewMemberTests extends JavaSrcCode2CpgFixture { "locals shadowing members" should { @@ -82,7 +82,7 @@ class NewMemberTests extends JavaSrcCode2CpgFixture { cpg.member .name("consumer") .typeFullName - .head shouldBe "org.apache.kafka.clients.consumer.Consumer" + .head shouldBe "org.apache.kafka.clients.consumer.Consumer" } "have a resolved package name in methodFullName" in { @@ -91,7 +91,7 @@ class NewMemberTests extends JavaSrcCode2CpgFixture { .methodFullName .head .split(":") - .head shouldBe "org.apache.kafka.clients.consumer.Consumer.poll" + .head shouldBe "org.apache.kafka.clients.consumer.Consumer.poll" } } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MetaDataTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MetaDataTests.scala index ea2f134d41fc..2a307d8ef928 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MetaDataTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MetaDataTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodParameterTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodParameterTests.scala index b0149ece816c..5462b381f3b9 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodParameterTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodParameterTests.scala @@ -2,7 +2,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.EvaluationStrategies -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodParameterTests2 extends JavaSrcCode2CpgFixture { "non generic method" should { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodReturnTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodReturnTests.scala index 67f350880208..ba6c505cc449 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodReturnTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodReturnTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.Ignore class MethodReturnTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodTests.scala index a93782a0b32a..03213b5d2467 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/MethodTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File @@ -174,4 +174,25 @@ class MethodTests4 extends JavaSrcCode2CpgFixture { } } + "Method parameters interspersed with comments" should { + val cpg = code(""" + |class Foo { + | abstract void run( + | /* comment for 1st argument */ + | int arg1, + | int arg2, // comment for arg2 + | int arg3); + |} + |""".stripMargin) + + "have correct `code` fields" in { + cpg.method("run").parameter.indexFrom(1).l match + case List(arg1, arg2, arg3) => + arg1.code shouldBe "int arg1" + arg2.code shouldBe "int arg2" + arg3.code shouldBe "int arg3" + case result => fail(s"Expected 3 parameters but got $result") + } + } + } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/NamespaceBlockTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/NamespaceBlockTests.scala index 77fca2f6ef15..b5d45219eb0d 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/NamespaceBlockTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/NamespaceBlockTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class NamespaceBlockTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ScopeTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ScopeTests.scala index 34944d78812c..92ce9102f707 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ScopeTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/ScopeTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ScopeTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SpecialOperatorTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SpecialOperatorTests.scala index 9dbf0dfc7380..99a6dd5520d0 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SpecialOperatorTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SpecialOperatorTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, TypeRef} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SpecialOperatorTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SynchronizedTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SynchronizedTests.scala index 66eeb14c0d67..48b215d300c8 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SynchronizedTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/SynchronizedTests.scala @@ -11,7 +11,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ Modifier, Return } -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SynchronizedTests extends JavaSrcCode2CpgFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeDeclTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeDeclTests.scala index 3d4857c67aca..8e287021afb9 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeDeclTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeDeclTests.scala @@ -3,7 +3,7 @@ package io.joern.javasrc2cpg.querying import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.shiftleft.codepropertygraph.generated.ModifierTypes import io.shiftleft.codepropertygraph.generated.nodes.Return -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.File diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeInferenceTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeInferenceTests.scala index 5f2562cbd982..ce3a116dd730 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeInferenceTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeInferenceTests.scala @@ -4,7 +4,7 @@ import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeTests.scala index 7ef189482af9..1e37c6ed4139 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/TypeTests.scala @@ -5,7 +5,7 @@ import io.joern.javasrc2cpg.typesolvers.TypeInfoCalculator.TypeConstants import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier} import io.shiftleft.proto.cpg.Cpg.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class NewTypeTests extends JavaSrcCode2CpgFixture { "processing wildcard types should not crash (smoke test)" when { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala index b058a3db581a..a14cfa4e4781 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala @@ -203,7 +203,7 @@ class VarDeclTests extends JavaSrcCode2CpgFixture { .codeExact("new FlinkKafkaProducer(\"kafka-topic\", schema, kafkaProps)") .filterNot(_.name == Operators.alloc) .map(_.methodFullName) - .head shouldBe "org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer.:(3)" + .head shouldBe "org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer.:(3)" } } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ArrayTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ArrayTests.scala index 4dc784776b8d..e146937fda67 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ArrayTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ArrayTests.scala @@ -1,9 +1,9 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class ArrayTests extends JavaDataflowFixture { behavior of "Dataflow through arrays" diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/FunctionCallTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/FunctionCallTests.scala index bb3b4b15a230..53a5570b7d6b 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/FunctionCallTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/FunctionCallTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.{JavaDataflowFixture, JavaSrcCode2CpgFixture} -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* class NewFunctionCallTests extends JavaSrcCode2CpgFixture(withOssDataflow = true) { "Dataflow through function calls" should { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/IfTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/IfTests.scala index 0a85145fd59f..f5384cab3c8c 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/IfTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/IfTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* class IfTests extends JavaDataflowFixture { behavior of "Dataflow through IF structures" diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LambdaTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LambdaTests.scala index 2ae5354391e6..c18f615eedcc 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LambdaTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LambdaTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LambdaTests extends JavaSrcCode2CpgFixture(withOssDataflow = true) { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LoopTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LoopTests.scala index 556a263e0588..d664633ca5ef 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LoopTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/LoopTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* class LoopTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MemberTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MemberTests.scala index 2d104271385c..76a9cc9d6c2f 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MemberTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MemberTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.{JavaDataflowFixture, JavaSrcCode2CpgFixture} -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* class MemberTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MethodReturnTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MethodReturnTests.scala index 1f39c507cbef..e1db74388037 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MethodReturnTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/MethodReturnTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* class MethodReturnTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ObjectTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ObjectTests.scala index babcb1667967..0e261e9e7446 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ObjectTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ObjectTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* class ObjectTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/OperatorTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/OperatorTests.scala index 6a463d4e3819..b549f8ce6e50 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/OperatorTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/OperatorTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* class OperatorTests extends JavaDataflowFixture { behavior of "Dataflow through operators" diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ReturnTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ReturnTests.scala index 6125def15d45..d2fd5859aec4 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ReturnTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/ReturnTests.scala @@ -1,8 +1,8 @@ package io.joern.javasrc2cpg.querying.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ReturnTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SemanticTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SemanticTests.scala index 8401b458b68d..f212f592607f 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SemanticTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SemanticTests.scala @@ -1,10 +1,10 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.{EngineContext, EngineConfig} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import io.joern.dataflowengineoss.DefaultSemantics import io.joern.dataflowengineoss.semanticsloader.FlowSemantic diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SwitchTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SwitchTests.scala index 89131994d336..ba82845d22f1 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SwitchTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/SwitchTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* class SwitchTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/TryTests.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/TryTests.scala index 9f205a153558..8939c875e2a3 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/TryTests.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/dataflow/TryTests.scala @@ -1,7 +1,7 @@ package io.joern.javasrc2cpg.querying.dataflow import io.joern.javasrc2cpg.testfixtures.JavaDataflowFixture -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* class TryTests extends JavaDataflowFixture { diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaDataflowFixture.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaDataflowFixture.scala index ce294f9b4000..ec6881f697e3 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaDataflowFixture.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaDataflowFixture.scala @@ -4,7 +4,7 @@ import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.javasrc2cpg.JavaSrc2CpgTestContext -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Expression, Literal} import io.shiftleft.semanticcpg.language.* import org.scalatest.flatspec.AnyFlatSpec @@ -48,5 +48,5 @@ class JavaDataflowFixture(extraFlows: List[FlowSemantic] = List.empty) extends A (source, sink) } - protected def flowToResultPairs(path: Path): List[(String, Option[Integer])] = path.resultPairs() + protected def flowToResultPairs(path: Path): List[(String, Option[Int])] = path.resultPairs() } diff --git a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaSrcCodeToCpgFixture.scala b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaSrcCodeToCpgFixture.scala index 4dcc30290c91..717ce7bc3d95 100644 --- a/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaSrcCodeToCpgFixture.scala +++ b/joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/testfixtures/JavaSrcCodeToCpgFixture.scala @@ -5,8 +5,10 @@ import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.dataflowengineoss.testfixtures.{SemanticCpgTestFixture, SemanticTestCpg} import io.joern.javasrc2cpg.{Config, JavaSrc2Cpg} import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.javasrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.testfixtures.{Code2CpgFixture, DefaultTestCpg, LanguageFrontend, TestCpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Expression, Literal} import io.shiftleft.semanticcpg.language.* @@ -31,7 +33,8 @@ class JavaSrcTestCpg(enableTypeRecovery: Boolean = false) override protected def applyPasses(): Unit = { super.applyPasses() - if (enableTypeRecovery) JavaSrc2Cpg.typeRecoveryPasses(this).foreach(_.createAndApply()) + if (enableTypeRecovery) + javasrc2cpg.typeRecoveryPasses(this, XTypeRecoveryConfig(enabledDummyTypes = true)).foreach(_.createAndApply()) applyOssDataFlow() } diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Jimple2Cpg.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Jimple2Cpg.scala index 932a970a88e6..941da1b2b652 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Jimple2Cpg.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Jimple2Cpg.scala @@ -8,7 +8,7 @@ import io.joern.x2cpg.X2Cpg.withNewEmptyCpg import io.joern.x2cpg.X2CpgFrontend import io.joern.x2cpg.datastructures.Global import io.joern.x2cpg.passes.frontend.{JavaConfigFileCreationPass, MetaDataPass, TypeNodePass} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import org.slf4j.LoggerFactory import soot.options.Options import soot.{G, Scene} diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Main.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Main.scala index cc383563ea52..9f57cf44aa4f 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Main.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Main.scala @@ -1,6 +1,6 @@ package io.joern.jimple2cpg -import io.joern.jimple2cpg.Frontend._ +import io.joern.jimple2cpg.Frontend.* import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} import scopt.OParser diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/AstCreator.scala index 1be301e581e0..6f248ffa494b 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/AstCreator.scala @@ -11,7 +11,7 @@ import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* import org.objectweb.asm.Type import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import soot.jimple.* import soot.tagkit.* import soot.{Unit as SUnit, Local as _, *} @@ -264,21 +264,21 @@ class AstCreator( } } - override def line(node: Host): Option[Integer] = { + override def line(node: Host): Option[Int] = { if (node == null) None else if (node.getJavaSourceStartLineNumber == -1) None else Option(node.getJavaSourceStartLineNumber) } - override def column(node: Host): Option[Integer] = { + override def column(node: Host): Option[Int] = { if (node == null) None else if (node.getJavaSourceStartColumnNumber == -1) None else Option(node.getJavaSourceStartColumnNumber) } - override def columnEnd(node: Host): Option[Integer] = None + override def columnEnd(node: Host): Option[Int] = None - override def lineEnd(node: Host): Option[Integer] = None + override def lineEnd(node: Host): Option[Int] = None override def code(node: Host): String = node.toString diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/declarations/AstForDeclarationsCreator.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/declarations/AstForDeclarationsCreator.scala index a2af7244d5f3..e9286134bce8 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/declarations/AstForDeclarationsCreator.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/astcreation/declarations/AstForDeclarationsCreator.scala @@ -11,6 +11,7 @@ import soot.tagkit.* import scala.collection.mutable import scala.collection.mutable.ListBuffer import scala.jdk.CollectionConverters.CollectionHasAsScala + trait AstForDeclarationsCreator(implicit withSchemaValidation: ValidationMode) extends AstForTypeDeclsCreator with AstForMethodsCreator { this: AstCreator => diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/AstCreationPass.scala index f5fc8a6924a4..6cce01d39262 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/AstCreationPass.scala @@ -4,8 +4,8 @@ import io.joern.jimple2cpg.Config import io.joern.jimple2cpg.astcreation.AstCreator import io.joern.jimple2cpg.util.ProgramHandlingUtil.ClassFile import io.joern.x2cpg.datastructures.Global -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import better.files.{DefaultCharset, File} import io.shiftleft.utils.IOUtils @@ -21,7 +21,7 @@ import scala.util.Try * The CPG to add to */ class AstCreationPass(classFiles: List[ClassFile], cpg: Cpg, config: Config) - extends ConcurrentWriterCpgPass[ClassFile](cpg) { + extends ForkJoinParallelCpgPass[ClassFile](cpg) { val global: Global = new Global() private val logger = LoggerFactory.getLogger(classOf[AstCreationPass]) diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/DeclarationRefPass.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/DeclarationRefPass.scala index 1814b17ea76a..cd0b7d849b3a 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/DeclarationRefPass.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/DeclarationRefPass.scala @@ -1,15 +1,15 @@ package io.joern.jimple2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{Declaration, Method} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* /** Links declarations to their identifier nodes. Due to the flat AST of bytecode, we don't need to account for varying * scope. */ -class DeclarationRefPass(cpg: Cpg) extends ConcurrentWriterCpgPass[Method](cpg) { +class DeclarationRefPass(cpg: Cpg) extends ForkJoinParallelCpgPass[Method](cpg) { override def generateParts(): Array[Method] = cpg.method.toArray diff --git a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/SootAstCreationPass.scala b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/SootAstCreationPass.scala index f2d4058a3a3f..e21debcef71b 100644 --- a/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/SootAstCreationPass.scala +++ b/joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/passes/SootAstCreationPass.scala @@ -3,14 +3,14 @@ package io.joern.jimple2cpg.passes import io.joern.jimple2cpg.Config import io.joern.jimple2cpg.astcreation.AstCreator import io.joern.x2cpg.datastructures.Global -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import soot.{Scene, SootClass, SourceLocator} /** Creates the AST layer from the given class file and stores all types in the given global parameter. */ -class SootAstCreationPass(cpg: Cpg, config: Config) extends ConcurrentWriterCpgPass[SootClass](cpg) { +class SootAstCreationPass(cpg: Cpg, config: Config) extends ForkJoinParallelCpgPass[SootClass](cpg) { val global: Global = new Global() private val logger = LoggerFactory.getLogger(classOf[AstCreationPass]) diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/AnnotationTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/AnnotationTests.scala index 7f253e52beb3..dd4e5c7f83fe 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/AnnotationTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/AnnotationTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Annotation, AnnotationLiteral, ArrayInitializer} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AnnotationTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArithmeticOperationsTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArithmeticOperationsTests.scala index fc52efd2da2f..c6c3a3351813 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArithmeticOperationsTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArithmeticOperationsTests.scala @@ -1,7 +1,7 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Identifier import io.shiftleft.semanticcpg.language.{toNodeTypeStarters, _} diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArrayTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArrayTests.scala index 6c853886c7af..cd97abf470bf 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArrayTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ArrayTests.scala @@ -1,10 +1,10 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.Failed class ArrayTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CallTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CallTests.scala index 4aca5e805887..7e7ec640a6dc 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CallTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CallTests.scala @@ -1,7 +1,7 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes import io.shiftleft.semanticcpg.language.{NoResolve, _} diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CfgTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CfgTests.scala index 9b1380018f22..57325ce9c37f 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CfgTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CfgTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class CfgTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CodeDumperTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CodeDumperTests.scala index 80b3a7c0fd1d..08d772ddac75 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CodeDumperTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/CodeDumperTests.scala @@ -2,8 +2,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.Config import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class CodeDumperTests extends JimpleCode2CpgFixture { private val config = Config().withDisableFileContent(false) diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ConstructorInvocationTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ConstructorInvocationTests.scala index ff873d5e4473..9bca4df2876c 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ConstructorInvocationTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ConstructorInvocationTests.scala @@ -1,11 +1,11 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.proto.cpg.Cpg.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* /** These tests are based off of those found in javasrc2cpg but modified to fit to Jimple's 3-address code rule and flat * AST. diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/EnumTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/EnumTests.scala index a1204ba6a8e0..2c5deae1521f 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/EnumTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/EnumTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.Literal -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class EnumTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FieldAccessTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FieldAccessTests.scala index e29ab06bbd5a..233c5a3a65e9 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FieldAccessTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FieldAccessTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class FieldAccessTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FileTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FileTests.scala index fd19640d939b..b0878237e449 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FileTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/FileTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.{File => JFile} diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/IfGotoTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/IfGotoTests.scala index b8a0bfabd866..20cc5fe5c232 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/IfGotoTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/IfGotoTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, Unknown} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class IfGotoTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ImplementsInterfaceTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ImplementsInterfaceTests.scala index fb682673d63d..8a1e81d2fbd0 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ImplementsInterfaceTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ImplementsInterfaceTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.File diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/InterfaceTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/InterfaceTests.scala index b922d1cccd5f..e457ecf7108d 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/InterfaceTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/InterfaceTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.ModifierTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/LocalTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/LocalTests.scala index 17d677d6b907..8762d9b2f9ee 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/LocalTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/LocalTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Local -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.Ignore class LocalTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MemberTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MemberTests.scala index 83bac1e4aacb..b86d2a728c6d 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MemberTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MemberTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import org.scalatest.Ignore class MemberTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MetaDataTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MetaDataTests.scala index c66d2e787f59..1830f176ce88 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MetaDataTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MetaDataTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends JimpleCode2CpgFixture { @@ -19,8 +19,8 @@ class MetaDataTests extends JimpleCode2CpgFixture { "should not have any incoming or outgoing edges" in { cpg.metaData.size shouldBe 1 - cpg.metaData.in().l shouldBe List() - cpg.metaData.out().l shouldBe List() + cpg.metaData.in.l shouldBe List() + cpg.metaData.out.l shouldBe List() } } diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodParameterTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodParameterTests.scala index 95cf09773376..953ee19f0e25 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodParameterTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodParameterTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EvaluationStrategies -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodParameterTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodReturnTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodReturnTests.scala index af8889baa68e..90394c197098 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodReturnTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodReturnTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class MethodReturnTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodTests.scala index 19d273994608..fa5284f4b101 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/MethodTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/NamespaceBlockTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/NamespaceBlockTests.scala index 4aadfa22916a..b2b389bdd073 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/NamespaceBlockTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/NamespaceBlockTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class NamespaceBlockTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ReflectionTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ReflectionTests.scala index e3a6b5524336..5b50d987c98c 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ReflectionTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/ReflectionTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* /** Right now reflection is mostly unsupported. This should be extended in later when it is. */ diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SpecialOperatorTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SpecialOperatorTests.scala index dadb5cecec68..3cb0f35d077e 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SpecialOperatorTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SpecialOperatorTests.scala @@ -1,10 +1,10 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, TypeRef} import io.shiftleft.proto.cpg.Cpg.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SpecialOperatorTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/StaticCallGraphTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/StaticCallGraphTests.scala index e9eddd0324cd..b32fee649550 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/StaticCallGraphTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/StaticCallGraphTests.scala @@ -1,7 +1,7 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.{NoResolve, _} class StaticCallGraphTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SwitchTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SwitchTests.scala index 8cfdc5939335..2214335eb27b 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SwitchTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SwitchTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.JumpTarget -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SwitchTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SynchronizedTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SynchronizedTests.scala index 289f2e2b7df4..ce4481faaee6 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SynchronizedTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/SynchronizedTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class SynchronizedTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeDeclTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeDeclTests.scala index ca2107ba08d6..78bf627e2ac4 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeDeclTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeDeclTests.scala @@ -1,9 +1,9 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.ModifierTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.File diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeTests.scala index fd628cf13698..8108fcbef372 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/TypeTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying import io.joern.jimple2cpg.testfixtures.JimpleCode2CpgFixture -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* class TypeTests extends JimpleCode2CpgFixture { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ArrayTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ArrayTests.scala index b36a9e75e763..a375017251e0 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ArrayTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ArrayTests.scala @@ -1,6 +1,6 @@ package io.joern.jimple2cpg.querying.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.jimple2cpg.testfixtures.{JimpleDataFlowCodeToCpgSuite, JimpleDataflowTestCpg} class ArrayTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/FunctionCallTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/FunctionCallTests.scala index 507f2f90e26c..942d79905634 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/FunctionCallTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/FunctionCallTests.scala @@ -2,8 +2,8 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.Operators class FunctionCallTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/IfTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/IfTests.scala index 5a2ce3296a77..6d6a502879ee 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/IfTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/IfTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class IfTests extends JimpleDataFlowCodeToCpgSuite { "dataflow through IF structures" should { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/LoopTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/LoopTests.scala index cbbe789b744f..7e0082be7805 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/LoopTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/LoopTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class LoopTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ObjectTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ObjectTests.scala index 22abb4744201..8a77e7b4a680 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ObjectTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/ObjectTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class ObjectTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/OperatorTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/OperatorTests.scala index b32d61a35f70..fb3991ee7946 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/OperatorTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/OperatorTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class OperatorTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SemanticTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SemanticTests.scala index 2cf966788c4d..e88ec1a145c0 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SemanticTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SemanticTests.scala @@ -1,6 +1,6 @@ package io.joern.jimple2cpg.querying.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.jimple2cpg.testfixtures.{JimpleDataFlowCodeToCpgSuite, JimpleDataflowTestCpg} import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.x2cpg.Defines diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/StaticMemberTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/StaticMemberTests.scala index 7b20789f69b5..659ad6176f70 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/StaticMemberTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/StaticMemberTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.* import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* /** These tests are added as a wishlist for static member accesses. These results are consistent with static members in diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SwitchTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SwitchTests.scala index 0ebc3e7eca94..2611292db34a 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SwitchTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/SwitchTests.scala @@ -1,8 +1,8 @@ package io.joern.jimple2cpg.querying.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class SwitchTests extends JimpleDataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/TryTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/TryTests.scala index 6ca4c98e7239..a74fd9e3c5fb 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/TryTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/querying/dataflow/TryTests.scala @@ -2,7 +2,7 @@ package io.joern.jimple2cpg.querying.dataflow import io.joern.dataflowengineoss.language.* import io.joern.jimple2cpg.testfixtures.JimpleDataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/testfixtures/JimpleCodeToCpgFixture.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/testfixtures/JimpleCodeToCpgFixture.scala index 466b01ae3b7e..3d754650d482 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/testfixtures/JimpleCodeToCpgFixture.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/testfixtures/JimpleCodeToCpgFixture.scala @@ -5,7 +5,7 @@ import io.joern.dataflowengineoss.testfixtures.{SemanticCpgTestFixture, Semantic import io.joern.jimple2cpg.{Config, Jimple2Cpg} import io.joern.x2cpg.X2Cpg import io.joern.x2cpg.testfixtures.{Code2CpgFixture, DefaultTestCpg, LanguageFrontend, TestCpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.io.File import java.nio.file.Path diff --git a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/unpacking/JarUnpackingTests.scala b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/unpacking/JarUnpackingTests.scala index f6b8ae4ed86d..5f641af9a7b7 100644 --- a/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/unpacking/JarUnpackingTests.scala +++ b/joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/unpacking/JarUnpackingTests.scala @@ -3,7 +3,7 @@ package io.joern.jimple2cpg.unpacking import better.files.File import io.joern.jimple2cpg.{Config, Jimple2Cpg} import io.joern.jimple2cpg.util.ProgramHandlingUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import io.shiftleft.utils.ProjectRoot import org.scalatest.BeforeAndAfterAll @@ -12,14 +12,15 @@ import org.scalatest.matchers.should.Matchers.* import org.scalatest.wordspec.AnyWordSpec import java.nio.file.{Files, Path, Paths} +import scala.compiletime.uninitialized import scala.util.{Failure, Success, Try} class JarUnpackingTests extends AnyWordSpec with Matchers with BeforeAndAfterAll { - var recurseCpgs: Map[String, Cpg] = scala.compiletime.uninitialized - var noRecurseCpgs: Map[String, Cpg] = scala.compiletime.uninitialized - var depthsCpgs: Map[String, Cpg] = scala.compiletime.uninitialized - var slippyCpg: Cpg = scala.compiletime.uninitialized + var recurseCpgs: Map[String, Cpg] = uninitialized + var noRecurseCpgs: Map[String, Cpg] = uninitialized + var depthsCpgs: Map[String, Cpg] = uninitialized + var slippyCpg: Cpg = uninitialized override protected def beforeAll(): Unit = { super.beforeAll() diff --git a/joern-cli/frontends/jssrc2cpg/build.sbt b/joern-cli/frontends/jssrc2cpg/build.sbt index f9f797347f70..92c700f9fc90 100644 --- a/joern-cli/frontends/jssrc2cpg/build.sbt +++ b/joern-cli/frontends/jssrc2cpg/build.sbt @@ -29,10 +29,11 @@ Test / fork := false enablePlugins(JavaAppPackaging, LauncherJarPlugin) -lazy val AstgenWin = "astgen-win.exe" -lazy val AstgenLinux = "astgen-linux" -lazy val AstgenMac = "astgen-macos" -lazy val AstgenMacArm = "astgen-macos-arm" +lazy val AstgenWinAmd64 = "astgen-win.exe" +lazy val AstgenLinuxAmd64 = "astgen-linux" +lazy val AstgenLinuxArmV8 = "astgen-linux-arm" +lazy val AstgenMacAmd64 = "astgen-macos" +lazy val AstgenMacArmV8 = "astgen-macos-arm" lazy val astGenDlUrl = settingKey[String]("astgen download url") astGenDlUrl := s"https://github.com/joernio/astgen/releases/download/v${astGenVersion.value}/" @@ -50,20 +51,15 @@ astGenBinaryNames := { if (hasCompatibleAstGenVersion(astGenVersion.value)) { Seq.empty } else if (sys.props.get("ALL_PLATFORMS").contains("TRUE")) { - Seq(AstgenWin, AstgenLinux, AstgenMac, AstgenMacArm) + Seq(AstgenWinAmd64, AstgenLinuxAmd64, AstgenLinuxArmV8, AstgenMacAmd64, AstgenMacArmV8) } else { - Environment.operatingSystem match { - case Environment.OperatingSystemType.Windows => - Seq(AstgenWin) - case Environment.OperatingSystemType.Linux => - Seq(AstgenLinux) - case Environment.OperatingSystemType.Mac => - Environment.architecture match { - case Environment.ArchitectureType.X86 => Seq(AstgenMac) - case Environment.ArchitectureType.ARM => Seq(AstgenMacArm) - } - case Environment.OperatingSystemType.Unknown => - Seq(AstgenWin, AstgenLinux, AstgenMac, AstgenMacArm) + (Environment.operatingSystem, Environment.architecture) match { + case (Environment.OperatingSystemType.Windows, _) => Seq(AstgenWinAmd64) + case (Environment.OperatingSystemType.Linux, Environment.ArchitectureType.X86) => Seq(AstgenLinuxAmd64) + case (Environment.OperatingSystemType.Linux, Environment.ArchitectureType.ARMv8) => Seq(AstgenLinuxArmV8) + case (Environment.OperatingSystemType.Mac, Environment.ArchitectureType.X86) => Seq(AstgenMacAmd64) + case (Environment.OperatingSystemType.Mac, Environment.ArchitectureType.ARMv8) => Seq(AstgenMacArmV8) + case _ => Seq(AstgenWinAmd64, AstgenLinuxAmd64, AstgenLinuxArmV8, AstgenMacAmd64, AstgenMacArmV8) } } } diff --git a/joern-cli/frontends/jssrc2cpg/jssrc2cpg.sh b/joern-cli/frontends/jssrc2cpg/jssrc2cpg.sh index fcd57dde5471..a955423f089d 100755 --- a/joern-cli/frontends/jssrc2cpg/jssrc2cpg.sh +++ b/joern-cli/frontends/jssrc2cpg/jssrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/jssrc2cpg.sh $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/jssrc2cpg.sh" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/JsSrc2Cpg.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/JsSrc2Cpg.scala index 2d0af92f0ec4..22b3ce8120a4 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/JsSrc2Cpg.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/JsSrc2Cpg.scala @@ -2,15 +2,15 @@ package io.joern.jssrc2cpg import better.files.File import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} -import io.joern.jssrc2cpg.JsSrc2Cpg.postProcessingPasses import io.joern.jssrc2cpg.passes.* import io.joern.jssrc2cpg.utils.AstGenRunner import io.joern.x2cpg.X2Cpg.withNewEmptyCpg import io.joern.x2cpg.X2CpgFrontend +import io.joern.x2cpg.frontendspecific.jssrc2cpg.postProcessingPasses import io.joern.x2cpg.passes.callgraph.NaiveCallLinker import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.utils.{HashUtil, Report} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.layers.LayerCreatorContext @@ -46,23 +46,10 @@ class JsSrc2Cpg extends X2CpgFrontend[Config] { val maybeCpg = createCpgWithOverlays(config) maybeCpg.map { cpg => new OssDataFlow(new OssDataFlowOptions()).run(new LayerCreatorContext(cpg)) - postProcessingPasses(cpg, Option(config)).foreach(_.createAndApply()) + val typeRecoveryConfig = XTypeRecoveryConfig(config.typePropagationIterations, !config.disableDummyTypes) + postProcessingPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) cpg } } } - -object JsSrc2Cpg { - - def postProcessingPasses(cpg: Cpg, config: Option[Config] = None): List[CpgPassBase] = { - val typeRecoveryConfig = config - .map(c => XTypeRecoveryConfig(c.typePropagationIterations, !c.disableDummyTypes)) - .getOrElse(XTypeRecoveryConfig()) - List(new JavaScriptInheritanceNamePass(cpg), new ConstClosurePass(cpg), new JavaScriptImportResolverPass(cpg)) - ++ - new JavaScriptTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() ++ - List(new JavaScriptTypeHintCallLinker(cpg), new NaiveCallLinker(cpg)) - } - -} diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/Main.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/Main.scala index e80774e85156..a18931fe83c2 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/Main.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/Main.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg import io.joern.jssrc2cpg.Frontend.* -import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery} +import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery, XTypeRecoveryConfig} import io.joern.x2cpg.utils.Environment import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} import scopt.OParser @@ -38,7 +38,7 @@ object Frontend { .hidden() .action((nodeOptions, c) => c.withNodeOptions(nodeOptions)) .text("node options to be used with astGen"), - XTypeRecovery.parserOptions + XTypeRecoveryConfig.parserOptionsForParserConfig ) } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala index 4fa73133db56..b9ef1295c560 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreator.scala @@ -5,8 +5,8 @@ import io.joern.jssrc2cpg.datastructures.{MethodScope, Scope} import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelJsonParser.ParseResult import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.utils.NodeBuilders.{newMethodReturnNode, newModifierNode} import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode, AstNodeBuilder as X2CpgAstNodeBuilder} import io.joern.x2cpg.datastructures.Global @@ -18,7 +18,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.NewNode import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl import io.shiftleft.codepropertygraph.generated.nodes.NewTypeRef import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import ujson.Value import scala.collection.mutable @@ -79,7 +79,7 @@ class AstCreator(val config: Config, val global: Global, val parserResult: Parse val columnNumber = astNodeInfo.columnNumber val lineNumberEnd = astNodeInfo.lineNumberEnd val columnNumberEnd = astNodeInfo.columnNumberEnd - val name = ":program" + val name = Defines.Program val fullName = s"$path:$name" val programMethod = @@ -253,11 +253,11 @@ class AstCreator(val config: Config, val global: Global, val parserResult: Parse private def astsForProgram(program: BabelNodeInfo): List[Ast] = createBlockStatementAsts(program.json("body")) - protected def line(node: BabelNodeInfo): Option[Integer] = node.lineNumber - protected def column(node: BabelNodeInfo): Option[Integer] = node.columnNumber - protected def lineEnd(node: BabelNodeInfo): Option[Integer] = node.lineNumberEnd - protected def columnEnd(node: BabelNodeInfo): Option[Integer] = node.columnNumberEnd - protected def code(node: BabelNodeInfo): String = node.code + protected def line(node: BabelNodeInfo): Option[Int] = node.lineNumber + protected def column(node: BabelNodeInfo): Option[Int] = node.columnNumber + protected def lineEnd(node: BabelNodeInfo): Option[Int] = node.lineNumberEnd + protected def columnEnd(node: BabelNodeInfo): Option[Int] = node.columnNumberEnd + protected def code(node: BabelNodeInfo): String = node.code protected def nodeOffsets(node: Value): Option[(Int, Int)] = { for { diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala index 56ecedcbdb88..d5108eaa24c1 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstCreatorHelper.scala @@ -3,13 +3,13 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.datastructures.* import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.utils.NodeBuilders.{newClosureBindingNode, newLocalNode} import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{EdgeTypes, EvaluationStrategies} import io.shiftleft.codepropertygraph.generated.nodes.File.PropertyDefaults -import io.shiftleft.passes.IntervalKeyPool import ujson.Value import scala.collection.{mutable, SortedMap} @@ -105,13 +105,13 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As protected def pos(node: Value): Option[Int] = Try(node("start").num.toInt).toOption - protected def line(node: Value): Option[Integer] = start(node).map(getLineOfSource) + protected def line(node: Value): Option[Int] = start(node).map(getLineOfSource) - protected def lineEnd(node: Value): Option[Integer] = end(node).map(getLineOfSource) + protected def lineEnd(node: Value): Option[Int] = end(node).map(getLineOfSource) - protected def column(node: Value): Option[Integer] = start(node).map(getColumnOfSource) + protected def column(node: Value): Option[Int] = start(node).map(getColumnOfSource) - protected def columnEnd(node: Value): Option[Integer] = end(node).map(getColumnOfSource) + protected def columnEnd(node: Value): Option[Int] = end(node).map(getColumnOfSource) // Returns the line number for a given position in the source. private def getLineOfSource(position: Int): Int = { diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala index 127427652ae1..e30ee495dc96 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForDeclarationsCreator.scala @@ -3,9 +3,9 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.datastructures.{BlockScope, MethodScope, ScopeType} import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.{Ast, ValidationMode} import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.utils.NodeBuilders.newDependencyNode import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewImport} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes} diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala index 89dcc8a32b4a..851c1657e641 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala @@ -2,7 +2,8 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.{Defines, EcmaBuiltins, GlobalBuiltins} +import io.joern.jssrc2cpg.passes.EcmaBuiltins +import io.joern.x2cpg.frontendspecific.jssrc2cpg.{Defines, GlobalBuiltins} import io.joern.x2cpg.{Ast, ValidationMode} import io.joern.x2cpg.datastructures.Stack.* import io.shiftleft.codepropertygraph.generated.nodes.NewNode @@ -20,9 +21,8 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { case MemberExpression => code(callee.json("property")) case _ => callee.code } - val callNode = - createStaticCallNode(callExpr.code, callName, fullName, callee.lineNumber, callee.columnNumber) - val argAsts = astForNodes(callExpr.json("arguments").arr.toList) + val callNode = createStaticCallNode(callExpr.code, callName, fullName, callee.lineNumber, callee.columnNumber) + val argAsts = astForNodes(callExpr.json("arguments").arr.toList) callAst(callNode, argAsts) } @@ -113,9 +113,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { diffGraph.addEdge(localAstParentStack.head, localTmpAllocNode, EdgeTypes.AST) scope.addVariableReference(tmpAllocName, tmpAllocNode1) - val allocCallNode = - callNode(newExpr, ".alloc", Operators.alloc, DispatchTypes.STATIC_DISPATCH) - + val allocCallNode = callNode(newExpr, ".alloc", Operators.alloc, DispatchTypes.STATIC_DISPATCH) val assignmentTmpAllocCallNode = createAssignmentCallAst( tmpAllocNode1, @@ -125,13 +123,9 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { newExpr.columnNumber ) - val tmpAllocNode2 = identifierNode(newExpr, tmpAllocName) - - val receiverNode = astForNodeWithFunctionReference(callee) - - // TODO: place ".new" into the schema - val callAst = handleCallNodeArgs(newExpr, receiverNode, tmpAllocNode2, ".new") - + val tmpAllocNode2 = identifierNode(newExpr, tmpAllocName) + val receiverNode = astForNodeWithFunctionReference(callee) + val callAst = handleCallNodeArgs(newExpr, receiverNode, tmpAllocNode2, Defines.OperatorsNew) val tmpAllocReturnNode = Ast(identifierNode(newExpr, tmpAllocName)) scope.popScope() @@ -217,31 +211,21 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { astForBinaryExpression(logicalExpr) protected def astForTSNonNullExpression(nonNullExpr: BabelNodeInfo): Ast = { - val op = Operators.notNullAssert - val callNode_ = - callNode(nonNullExpr, nonNullExpr.code, op, DispatchTypes.STATIC_DISPATCH) - val argAsts = List(astForNodeWithFunctionReference(nonNullExpr.json("expression"))) + val op = Operators.notNullAssert + val callNode_ = callNode(nonNullExpr, nonNullExpr.code, op, DispatchTypes.STATIC_DISPATCH) + val argAsts = List(astForNodeWithFunctionReference(nonNullExpr.json("expression"))) callAst(callNode_, argAsts) } protected def astForCastExpression(castExpr: BabelNodeInfo): Ast = { - val op = Operators.cast - val lhsNode = castExpr.json("typeAnnotation") - val rhsAst = astForNodeWithFunctionReference(castExpr.json("expression")) - typeFor(castExpr) match { - case tpe if GlobalBuiltins.builtins.contains(tpe) || Defines.isBuiltinType(tpe) => - val lhsAst = Ast(literalNode(castExpr, code(lhsNode), Option(tpe))) - val node = - callNode(castExpr, castExpr.code, op, DispatchTypes.STATIC_DISPATCH).dynamicTypeHintFullName(Seq(tpe)) - val argAsts = List(lhsAst, rhsAst) - callAst(node, argAsts) - case t => - val possibleTypes = Seq(t) - val lhsAst = Ast(literalNode(castExpr, code(lhsNode), None).possibleTypes(possibleTypes)) - val node = callNode(castExpr, castExpr.code, op, DispatchTypes.STATIC_DISPATCH).possibleTypes(possibleTypes) - val argAsts = List(lhsAst, rhsAst) - callAst(node, argAsts) - } + val op = Operators.cast + val lhsNode = castExpr.json("typeAnnotation") + val rhsAst = astForNodeWithFunctionReference(castExpr.json("expression")) + val possibleTypes = Seq(typeFor(castExpr)) + val lhsAst = Ast(literalNode(castExpr, code(lhsNode), None).possibleTypes(possibleTypes)) + val node = callNode(castExpr, castExpr.code, op, DispatchTypes.STATIC_DISPATCH).possibleTypes(possibleTypes) + val argAsts = List(lhsAst, rhsAst) + callAst(node, argAsts) } protected def astForBinaryExpression(binExpr: BabelNodeInfo): Ast = { @@ -340,8 +324,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } protected def astForAwaitExpression(awaitExpr: BabelNodeInfo): Ast = { - val node = - callNode(awaitExpr, awaitExpr.code, ".await", DispatchTypes.STATIC_DISPATCH) + val node = callNode(awaitExpr, awaitExpr.code, ".await", DispatchTypes.STATIC_DISPATCH) val argAsts = List(astForNodeWithFunctionReference(awaitExpr.json("argument"))) callAst(node, argAsts) } @@ -417,12 +400,11 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } def astForTemplateExpression(templateExpr: BabelNodeInfo): Ast = { - val argumentAst = astForNodeWithFunctionReference(templateExpr.json("quasi")) - val callName = code(templateExpr.json("tag")) - val callCode = s"$callName(${codeOf(argumentAst.nodes.head)})" - val templateExprCall = - callNode(templateExpr, callCode, callName, DispatchTypes.STATIC_DISPATCH) - val argAsts = List(argumentAst) + val argumentAst = astForNodeWithFunctionReference(templateExpr.json("quasi")) + val callName = code(templateExpr.json("tag")) + val callCode = s"$callName(${codeOf(argumentAst.nodes.head)})" + val templateExprCall = callNode(templateExpr, callCode, callName, DispatchTypes.STATIC_DISPATCH) + val argAsts = List(argumentAst) callAst(templateExprCall, argAsts) } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForFunctionsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForFunctionsCreator.scala index d1a8304f8751..c357f76de027 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForFunctionsCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForFunctionsCreator.scala @@ -3,9 +3,9 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.datastructures.{BlockScope, MethodScope} import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.datastructures.Stack.* -import io.joern.x2cpg.utils.NodeBuilders.{newBindingNode, newModifierNode} +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines +import io.joern.x2cpg.utils.NodeBuilders.newModifierNode import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.{Identifier as _, *} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, EvaluationStrategies, ModifierTypes} @@ -325,10 +325,13 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th } protected def astForTSDeclareFunction(func: BabelNodeInfo): Ast = { - val functionNode = createMethodDefinitionNode(func) - val bindingNode = newBindingNode("", "", "") - diffGraph.addEdge(getParentTypeDecl, bindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(bindingNode, functionNode, EdgeTypes.REF) + val functionNode = createMethodDefinitionNode(func) + val tpe = typeFor(func) + val possibleTypes = Seq(tpe) + val typeFullName = if (Defines.isBuiltinType(tpe)) tpe else Defines.Any + val memberNode_ = memberNode(func, functionNode.name, func.code, typeFullName, Seq(functionNode.fullName)) + .possibleTypes(possibleTypes) + diffGraph.addEdge(getParentTypeDecl, memberNode_, EdgeTypes.AST) addModifier(functionNode, func.json) Ast(functionNode) } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala index 182a62435418..c12fd657a3e5 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForPrimitivesCreator.scala @@ -1,8 +1,8 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} trait AstForPrimitivesCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala index 5df1c618d119..a93d430c841f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForStatementsCreator.scala @@ -2,16 +2,15 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.NewJumpLabel -import io.shiftleft.codepropertygraph.generated.nodes.NewJumpTarget import ujson.Obj import ujson.Value @@ -102,37 +101,31 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForTryStatement(tryStmt: BabelNodeInfo): Ast = { - val tryNode = createControlStructureNode(tryStmt, ControlStructureTypes.TRY) + val tryNode = controlStructureNode(tryStmt, ControlStructureTypes.TRY, code(tryStmt)) val bodyAst = astForNodeWithFunctionReference(tryStmt.json("block")) - val catchAst = safeObj(tryStmt.json, "handler") + val catchAst = safeObj(tryStmt.json, "handler").toList .map { handler => val catchNodeInfo = createBabelNodeInfo(Obj(handler)) - val catchNode = createControlStructureNode(catchNodeInfo, ControlStructureTypes.CATCH) + val catchNode = controlStructureNode(catchNodeInfo, ControlStructureTypes.CATCH, code(catchNodeInfo)) val catchAst = astForCatchClause(catchNodeInfo) Ast(catchNode).withChild(catchAst) } - .getOrElse(Ast()) val finalizerAst = safeObj(tryStmt.json, "finalizer") .map { finalizer => val finalNodeInfo = createBabelNodeInfo(Obj(finalizer)) - val finalNode = createControlStructureNode(finalNodeInfo, ControlStructureTypes.FINALLY) + val finalNode = controlStructureNode(finalNodeInfo, ControlStructureTypes.FINALLY, code(finalNodeInfo)) val finalAst = astForNodeWithFunctionReference(finalNodeInfo.json) Ast(finalNode).withChild(finalAst) } - .getOrElse(Ast()) - val childrenAsts = List(bodyAst, catchAst, finalizerAst) - setArgumentIndices(childrenAsts) - Ast(tryNode).withChildren(childrenAsts) + tryCatchAst(tryNode, bodyAst, catchAst, finalizerAst) } def astForIfStatement(ifStmt: BabelNodeInfo): Ast = { - val ifNode = createControlStructureNode(ifStmt, ControlStructureTypes.IF) + val ifNode = controlStructureNode(ifStmt, ControlStructureTypes.IF, code(ifStmt)) val testAst = astForNodeWithFunctionReference(ifStmt.json("test")) val consequentAst = astForNodeWithFunctionReference(ifStmt.json("consequent")) val alternateAst = safeObj(ifStmt.json, "alternate") - .map { alternate => - astForNodeWithFunctionReference(Obj(alternate)) - } + .map { alternate => astForNodeWithFunctionReference(Obj(alternate)) } .getOrElse(Ast()) // The semantics of if statement children is partially defined by their order value. // The consequentAst must have order == 2 and alternateAst must have order == 3. @@ -149,7 +142,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForDoWhileStatement(doWhileStmt: BabelNodeInfo): Ast = { - val whileNode = createControlStructureNode(doWhileStmt, ControlStructureTypes.DO) + val whileNode = controlStructureNode(doWhileStmt, ControlStructureTypes.DO, code(doWhileStmt)) val testAst = astForNodeWithFunctionReference(doWhileStmt.json("test")) val bodyAst = astForNodeWithFunctionReference(doWhileStmt.json("body")) // The semantics of do-while statement children is partially defined by their order value. @@ -161,7 +154,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForWhileStatement(whileStmt: BabelNodeInfo): Ast = { - val whileNode = createControlStructureNode(whileStmt, ControlStructureTypes.WHILE) + val whileNode = controlStructureNode(whileStmt, ControlStructureTypes.WHILE, code(whileStmt)) val testAst = astForNodeWithFunctionReference(whileStmt.json("test")) val bodyAst = astForNodeWithFunctionReference(whileStmt.json("body")) // The semantics of while statement children is partially defined by their order value. @@ -173,7 +166,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForForStatement(forStmt: BabelNodeInfo): Ast = { - val forNode = createControlStructureNode(forStmt, ControlStructureTypes.FOR) + val forNode = controlStructureNode(forStmt, ControlStructureTypes.FOR, code(forStmt)) val initAst = safeObj(forStmt.json, "init") .map { init => astForNodeWithFunctionReference(Obj(init)) @@ -202,13 +195,8 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForLabeledStatement(labelStmt: BabelNodeInfo): Ast = { - val labelName = code(labelStmt.json("label")) - val labeledNode = NewJumpTarget() - .parserTypeName(labelStmt.node.toString) - .name(labelName) - .code(s"$labelName:") - .lineNumber(labelStmt.lineNumber) - .columnNumber(labelStmt.columnNumber) + val labelName = code(labelStmt.json("label")) + val labeledNode = jumpTargetNode(labelStmt, labelName, s"$labelName:", Option(labelStmt.node.toString)) val blockNode = createBlockNode(labelStmt) scope.pushNewBlockScope(blockNode) @@ -223,26 +211,24 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForBreakStatement(breakStmt: BabelNodeInfo): Ast = { - val labelAst = safeObj(breakStmt.json, "label") - .map { label => - val labelNode = Obj(label) - val labelCode = code(labelNode) - Ast( - NewJumpLabel() - .parserTypeName(breakStmt.node.toString) - .name(labelCode) - .code(labelCode) - .lineNumber(breakStmt.lineNumber) - .columnNumber(breakStmt.columnNumber) - .order(1) - ) - } - .getOrElse(Ast()) - Ast(createControlStructureNode(breakStmt, ControlStructureTypes.BREAK)).withChild(labelAst) + val labelAst = safeObj(breakStmt.json, "label").toList.map { label => + val labelNode = Obj(label) + val labelCode = code(labelNode) + Ast( + NewJumpLabel() + .parserTypeName(breakStmt.node.toString) + .name(labelCode) + .code(labelCode) + .lineNumber(breakStmt.lineNumber) + .columnNumber(breakStmt.columnNumber) + .order(1) + ) + } + Ast(controlStructureNode(breakStmt, ControlStructureTypes.BREAK, code(breakStmt))).withChildren(labelAst) } protected def astForContinueStatement(continueStmt: BabelNodeInfo): Ast = { - val labelAst = safeObj(continueStmt.json, "label") + val labelAst = safeObj(continueStmt.json, "label").toList .map { label => val labelNode = Obj(label) val labelCode = code(labelNode) @@ -256,8 +242,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t .order(1) ) } - .getOrElse(Ast()) - Ast(createControlStructureNode(continueStmt, ControlStructureTypes.CONTINUE)).withChild(labelAst) + Ast(controlStructureNode(continueStmt, ControlStructureTypes.CONTINUE, code(continueStmt))).withChildren(labelAst) } protected def astForThrowStatement(throwStmt: BabelNodeInfo): Ast = { @@ -276,7 +261,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } protected def astForSwitchStatement(switchStmt: BabelNodeInfo): Ast = { - val switchNode = createControlStructureNode(switchStmt, ControlStructureTypes.SWITCH) + val switchNode = controlStructureNode(switchStmt, ControlStructureTypes.SWITCH, code(switchStmt)) // The semantics of switch statement children is partially defined by their order value. // The blockAst must have order == 2. Only to avoid collision we set switchExpressionAst to 1 @@ -287,10 +272,8 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t val blockNode = createBlockNode(switchStmt).order(2) scope.pushNewBlockScope(blockNode) localAstParentStack.push(blockNode) - val casesAsts = switchStmt.json("cases").arr.flatMap(c => astsForSwitchCase(createBabelNodeInfo(c))) setArgumentIndices(casesAsts.toList) - scope.popScope() localAstParentStack.pop() @@ -364,7 +347,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t scope.addVariableReference(loopVariableName, loopVariableNode) // while loop: - val whileLoopNode = createControlStructureNode(forInOfStmt, ControlStructureTypes.WHILE) + val whileLoopNode = controlStructureNode(forInOfStmt, ControlStructureTypes.WHILE, code(forInOfStmt)) // while loop test: val testCallNode = @@ -507,7 +490,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t scope.addVariableReference(resultName, resultNode) // while loop: - val whileLoopNode = createControlStructureNode(forInOfStmt, ControlStructureTypes.WHILE) + val whileLoopNode = controlStructureNode(forInOfStmt, ControlStructureTypes.WHILE, code(forInOfStmt)) // while loop test: val testCallNode = @@ -658,7 +641,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } // while loop: - val whileLoopNode = createControlStructureNode(forInOfStmt, ControlStructureTypes.WHILE) + val whileLoopNode = controlStructureNode(forInOfStmt, ControlStructureTypes.WHILE, code(forInOfStmt)) // while loop test: val testCallNode = @@ -811,7 +794,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } // while loop: - val whileLoopNode = createControlStructureNode(forInOfStmt, ControlStructureTypes.WHILE) + val whileLoopNode = controlStructureNode(forInOfStmt, ControlStructureTypes.WHILE, code(forInOfStmt)) // while loop test: val testCallNode = diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala index a5068c6f7053..20233415203f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForTypesCreator.scala @@ -3,12 +3,11 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.datastructures.BlockScope import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg.{Ast, ValidationMode} import io.joern.x2cpg.datastructures.Stack.* -import io.joern.x2cpg.utils.NodeBuilders.newBindingNode +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, ModifierTypes, Operators} +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, ModifierTypes, Operators, PropertyNames} import ujson.Value import scala.util.Try @@ -30,7 +29,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: } else nameTpe val astParentType = methodAstParentStack.head.label - val astParentFullName = methodAstParentStack.head.properties("FULL_NAME").toString + val astParentFullName = methodAstParentStack.head.properties(PropertyNames.FULL_NAME).toString val aliasTypeDeclNode = typeDeclNode(alias, aliasName, aliasFullName, parserResult.filename, alias.code, astParentType, astParentFullName) @@ -180,18 +179,12 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: val typeFullName = if (Defines.isBuiltinType(tpe)) tpe else Defines.Any val memberNode_ = nodeInfo.node match { case TSDeclareMethod | TSDeclareFunction => - val function = createMethodDefinitionNode(nodeInfo) - val bindingNode = newBindingNode("", "", "") - diffGraph.addEdge(typeDeclNode, bindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(bindingNode, function, EdgeTypes.REF) + val function = createMethodDefinitionNode(nodeInfo) addModifier(function, nodeInfo.json) memberNode(nodeInfo, function.name, nodeInfo.code, typeFullName, Seq(function.fullName)) .possibleTypes(possibleTypes) case ClassMethod | ClassPrivateMethod => - val function = createMethodAstAndNode(nodeInfo).methodNode - val bindingNode = newBindingNode("", "", "") - diffGraph.addEdge(typeDeclNode, bindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(bindingNode, function, EdgeTypes.REF) + val function = createMethodAstAndNode(nodeInfo).methodNode addModifier(function, nodeInfo.json) memberNode(nodeInfo, function.name, nodeInfo.code, typeFullName, Seq(function.fullName)) .possibleTypes(possibleTypes) @@ -237,7 +230,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: registerType(typeFullName) val astParentType = methodAstParentStack.head.label - val astParentFullName = methodAstParentStack.head.properties("FULL_NAME").toString + val astParentFullName = methodAstParentStack.head.properties(PropertyNames.FULL_NAME).toString val typeDeclNode_ = typeDeclNode( tsEnum, @@ -319,7 +312,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: registerType(typeFullName) val astParentType = methodAstParentStack.head.label - val astParentFullName = methodAstParentStack.head.properties("FULL_NAME").toString + val astParentFullName = methodAstParentStack.head.properties(PropertyNames.FULL_NAME).toString val superClass = Try(createBabelNodeInfo(clazz.json("superClass")).code).toOption.toSeq val implements = Try(clazz.json("implements").arr.map(createBabelNodeInfo(_).code)).toOption.toSeq.flatten @@ -474,7 +467,7 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: registerType(typeFullName) val astParentType = methodAstParentStack.head.label - val astParentFullName = methodAstParentStack.head.properties("FULL_NAME").toString + val astParentFullName = methodAstParentStack.head.properties(PropertyNames.FULL_NAME).toString val extendz = Try(tsInterface.json("extends").arr.map(createBabelNodeInfo(_).code)).toOption.toSeq.flatten @@ -500,9 +493,9 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: val constructorNode = interfaceConstructor(typeName, tsInterface) diffGraph.addEdge(constructorNode, NewModifier().modifierType(ModifierTypes.CONSTRUCTOR), EdgeTypes.AST) - val constructorBindingNode = newBindingNode("", "", "") - diffGraph.addEdge(typeDeclNode_, constructorBindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(constructorBindingNode, constructorNode, EdgeTypes.REF) + val memberNode_ = + memberNode(tsInterface, constructorNode.name, constructorNode.code, typeFullName, Seq(constructorNode.fullName)) + diffGraph.addEdge(typeDeclNode_, memberNode_, EdgeTypes.AST) val interfaceBodyElements = classMembers(tsInterface, withConstructor = false) @@ -514,9 +507,6 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: val memberNodes = nodeInfo.node match { case TSCallSignatureDeclaration | TSMethodSignature => val functionNode = createMethodDefinitionNode(nodeInfo) - val bindingNode = newBindingNode("", "", "") - diffGraph.addEdge(typeDeclNode_, bindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(bindingNode, functionNode, EdgeTypes.REF) addModifier(functionNode, nodeInfo.json) Seq( memberNode(nodeInfo, functionNode.name, nodeInfo.code, typeFullName, Seq(functionNode.fullName)) diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala index 25267d84e935..2c6ccdb5dc6c 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstNodeBuilder.scala @@ -1,13 +1,12 @@ package io.joern.jssrc2cpg.astcreation import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines import io.joern.x2cpg import io.joern.x2cpg.{Ast, ValidationMode} +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.utils.NodeBuilders.newMethodReturnNode import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.codepropertygraph.generated.Operators +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, PropertyNames} trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstCreator => protected def createMethodReturnNode(func: BabelNodeInfo): NewMethodReturn = { @@ -35,17 +34,6 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC .columnNumber(switchCase.columnNumber) } - protected def createControlStructureNode(node: BabelNodeInfo, controlStructureType: String): NewControlStructure = { - val line = node.lineNumber - val column = node.columnNumber - val code = node.code - NewControlStructure() - .controlStructureType(controlStructureType) - .code(code) - .lineNumber(line) - .columnNumber(column) - } - protected def codeOf(node: NewNode): String = node match { case astNodeNew: AstNodeNew => astNodeNew.code case _ => "" @@ -54,8 +42,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createIndexAccessCallAst( baseNode: NewNode, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseNode)}[${codeOf(partNode)}]", @@ -68,12 +56,7 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC callAst(callNode, arguments) } - protected def createIndexAccessCallAst( - baseAst: Ast, - partAst: Ast, - line: Option[Integer], - column: Option[Integer] - ): Ast = { + protected def createIndexAccessCallAst(baseAst: Ast, partAst: Ast, line: Option[Int], column: Option[Int]): Ast = { val callNode = createCallNode( s"${codeOf(baseAst.nodes.head)}[${codeOf(partAst.nodes.head)}]", Operators.indexAccess, @@ -88,8 +71,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createFieldAccessCallAst( baseNode: NewNode, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseNode)}.${codeOf(partNode)}", @@ -105,8 +88,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createFieldAccessCallAst( baseAst: Ast, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseAst.nodes.head)}.${codeOf(partNode)}", @@ -123,8 +106,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC testAst: Ast, trueAst: Ast, falseAst: Ast, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val code = s"${codeOf(testAst.nodes.head)} ? ${codeOf(trueAst.nodes.head)} : ${codeOf(falseAst.nodes.head)}" val callNode = createCallNode(code, Operators.conditional, DispatchTypes.STATIC_DISPATCH, line, column) @@ -143,8 +126,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC code: String, callName: String, dispatchType: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewCall = NewCall() .code(code) .name(callName) @@ -156,14 +139,10 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC .columnNumber(column) .typeFullName(Defines.Any) - protected def createVoidCallNode(line: Option[Integer], column: Option[Integer]): NewCall = + protected def createVoidCallNode(line: Option[Int], column: Option[Int]): NewCall = createCallNode("void 0", ".void", DispatchTypes.STATIC_DISPATCH, line, column) - protected def createFieldIdentifierNode( - name: String, - line: Option[Integer], - column: Option[Integer] - ): NewFieldIdentifier = { + protected def createFieldIdentifierNode(name: String, line: Option[Int], column: Option[Int]): NewFieldIdentifier = { val cleanedName = stripQuotes(name) NewFieldIdentifier() .code(cleanedName) @@ -180,7 +159,7 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC literalNode(node, code, typeFullName, dynamicTypeOption.toList) } - protected def createEqualsCallAst(dest: Ast, source: Ast, line: Option[Integer], column: Option[Integer]): Ast = { + protected def createEqualsCallAst(dest: Ast, source: Ast, line: Option[Int], column: Option[Int]): Ast = { val code = s"${codeOf(dest.nodes.head)} === ${codeOf(source.nodes.head)}" val callNode = createCallNode(code, Operators.equals, DispatchTypes.STATIC_DISPATCH, line, column) val arguments = List(dest, source) @@ -191,8 +170,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC destId: NewNode, sourceId: NewNode, code: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode(code, Operators.assignment, DispatchTypes.STATIC_DISPATCH, line, column) val arguments = List(Ast(destId), Ast(sourceId)) @@ -203,8 +182,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC dest: Ast, source: Ast, code: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode(code, Operators.assignment, DispatchTypes.STATIC_DISPATCH, line, column) val arguments = List(dest, source) @@ -229,8 +208,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC code: String, callName: String, fullName: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewCall = NewCall() .code(code) .name(callName) @@ -244,8 +223,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createTemplateDomNode( name: String, code: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewTemplateDom = NewTemplateDom() .name(name) @@ -271,7 +250,7 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC registerType(methodFullName) val astParentType = parentNode.label - val astParentFullName = parentNode.properties("FULL_NAME").toString + val astParentFullName = parentNode.properties(PropertyNames.FULL_NAME).toString val functionTypeDeclNode = typeDeclNode( node, diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala index ab3c45165772..726106fa22ad 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/TypeHelper.scala @@ -1,8 +1,8 @@ package io.joern.jssrc2cpg.astcreation -import io.joern.jssrc2cpg.parser.BabelAst._ +import io.joern.jssrc2cpg.parser.BabelAst.* import io.joern.jssrc2cpg.parser.BabelNodeInfo -import io.joern.jssrc2cpg.passes.Defines +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import java.util.regex.Pattern @@ -110,7 +110,7 @@ trait TypeHelper { this: AstCreator => val matcher = ImportMatcher.matcher(value) this.rootTypeDecl.headOption match { case Some(typeDecl) => typeDecl.fullName - case None if matcher.matches() => matcher.group(2).stripSuffix(".js").concat(".js::program") + case None if matcher.matches() => matcher.group(2).stripSuffix(".js").concat(s".js:${Defines.Program}") case None => value } } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala index 2513121ab491..cae2a0ef5705 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelAst.scala @@ -206,6 +206,7 @@ object BabelAst { object TSIndexSignature extends BabelNode object TSIndexedAccessType extends TSType object TSInferType extends TSType + object TSInstantiationExpression extends Expression object TSInterfaceBody extends BabelNode object TSInterfaceDeclaration extends BabelNode object TSIntersectionType extends TSType diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelNodeInfo.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelNodeInfo.scala index 03d12483af18..ca467f3430c9 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelNodeInfo.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/parser/BabelNodeInfo.scala @@ -7,8 +7,8 @@ case class BabelNodeInfo( node: BabelNode, json: Value, code: String, - lineNumber: Option[Integer], - columnNumber: Option[Integer], - lineNumberEnd: Option[Integer], - columnNumberEnd: Option[Integer] + lineNumber: Option[Int], + columnNumber: Option[Int], + lineNumberEnd: Option[Int], + columnNumberEnd: Option[Int] ) diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala index 8b7bb7526c56..ad57e246e711 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/AstCreationPass.scala @@ -6,19 +6,20 @@ import io.joern.jssrc2cpg.parser.BabelJsonParser import io.joern.jssrc2cpg.utils.AstGenRunner.AstGenRunnerResult import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Global +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.utils.{Report, TimeUtils} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.utils.IOUtils import org.slf4j.{Logger, LoggerFactory} import java.nio.file.Paths import scala.util.{Failure, Success, Try} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class AstCreationPass(cpg: Cpg, astGenRunnerResult: AstGenRunnerResult, config: Config, report: Report = new Report())( implicit withSchemaValidation: ValidationMode -) extends ConcurrentWriterCpgPass[(String, String)](cpg) { +) extends ForkJoinParallelCpgPass[(String, String)](cpg) { private val logger: Logger = LoggerFactory.getLogger(classOf[AstCreationPass]) @@ -33,7 +34,7 @@ class AstCreationPass(cpg: Cpg, astGenRunnerResult: AstGenRunnerResult, config: val (rootPath, fileName) = skippedFile val filePath = Paths.get(rootPath, fileName) val fileLOC = Try(IOUtils.readLinesInFile(filePath)) match { - case Success(filecontent) => filecontent.size + case Success(fileContent) => fileContent.size case Failure(exception) => logger.warn(s"Failed to read file: '$filePath'", exception) 0 @@ -56,7 +57,7 @@ class AstCreationPass(cpg: Cpg, astGenRunnerResult: AstGenRunnerResult, config: logger.warn(s"Failed to generate a CPG for: '${parseResult.fullPath}'", exception) (false, parseResult.filename) case Success(_) => - logger.info(s"Generated a CPG for: '${parseResult.fullPath}'") + logger.debug(s"Generated a CPG for: '${parseResult.fullPath}'") (true, parseResult.filename) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala index 7b64e875f9fb..abd71cdfb9e9 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConfigPass.scala @@ -3,14 +3,15 @@ package io.joern.jssrc2cpg.passes import better.files.File import io.joern.jssrc2cpg.Config import io.joern.x2cpg.SourceFiles +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.utils.{Report, TimeUtils} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewConfigFile -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.utils.IOUtils import org.slf4j.{Logger, LoggerFactory} -class ConfigPass(cpg: Cpg, config: Config, report: Report = new Report()) extends ConcurrentWriterCpgPass[File](cpg) { +class ConfigPass(cpg: Cpg, config: Config, report: Report = new Report()) extends ForkJoinParallelCpgPass[File](cpg) { private val logger: Logger = LoggerFactory.getLogger(getClass) @@ -34,7 +35,7 @@ class ConfigPass(cpg: Cpg, config: Config, report: Report = new Report()) extend val path = File(config.inputPath).path.toAbsolutePath.relativize(file.path).toString logger.debug(s"Adding file '$path' as config.") val (gotCpg, duration) = TimeUtils.time { - val localDiff = new DiffGraphBuilder + val localDiff = Cpg.newDiffGraphBuilder val content = fileContent(file) val loc = content.size val configNode = NewConfigFile().name(path).content(content.mkString("\n")) diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala index d5d60b627a14..817d17414f4c 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/DependenciesPass.scala @@ -3,7 +3,8 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.Config import io.joern.jssrc2cpg.utils.PackageJsonParser import io.joern.x2cpg.SourceFiles -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewDependency import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ImportsPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ImportsPass.scala index 220eec82dc26..2ce72c78ef45 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ImportsPass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ImportsPass.scala @@ -2,9 +2,9 @@ package io.joern.jssrc2cpg.passes import io.joern.x2cpg.X2Cpg import io.joern.x2cpg.passes.frontend.XImportsPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment /** This pass creates `IMPORT` nodes by looking for calls to `require`. `IMPORT` nodes are linked to existing dependency diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptMetaDataPass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptMetaDataPass.scala index 471d27a358e7..0b33bb07269a 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptMetaDataPass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptMetaDataPass.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg.passes import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewMetaData import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeNodePass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeNodePass.scala index bf14b8164d81..032b34655a4f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeNodePass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeNodePass.scala @@ -1,23 +1,23 @@ package io.joern.jssrc2cpg.passes +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.joern.x2cpg.passes.frontend.TypeNodePass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* -import io.shiftleft.passes.KeyPool import scala.collection.mutable object JavaScriptTypeNodePass { - def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg, keyPool: Option[KeyPool] = None): TypeNodePass = { - new TypeNodePass(registeredTypes, cpg, keyPool, getTypesFromCpg = false) { + def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg): TypeNodePass = { + new TypeNodePass(registeredTypes, cpg, getTypesFromCpg = false) { override def fullToShortName(typeName: String): String = { typeName match { - case name if name.endsWith(":program") => ":program" - case name if name.contains("=>") => name - case name if name.contains(":") => name.split(':').lastOption.getOrElse(typeName) - case _ => typeName.split('.').lastOption.getOrElse(typeName) + case name if name.endsWith(Defines.Program) => Defines.Program + case name if name.contains("=>") => name + case name if name.contains(":") => name.split(':').lastOption.getOrElse(typeName) + case _ => typeName.split('.').lastOption.getOrElse(typeName) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala index b597c693924b..e9a353de5aaf 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/PrivateKeyFilePass.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.passes import better.files.File import io.joern.jssrc2cpg.Config import io.joern.x2cpg.utils.Report -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.utils.IOUtils import scala.util.matching.Regex diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala index 50939cd757ec..7da650da4f25 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala +++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/utils/AstGenRunner.scala @@ -103,16 +103,14 @@ object AstGenRunner { case _ => None } - lazy private val executableName = Environment.operatingSystem match { - case Environment.OperatingSystemType.Windows => "astgen-win.exe" - case Environment.OperatingSystemType.Linux => "astgen-linux" - case Environment.OperatingSystemType.Mac => - Environment.architecture match { - case Environment.ArchitectureType.X86 => "astgen-macos" - case Environment.ArchitectureType.ARM => "astgen-macos-arm" - } - case Environment.OperatingSystemType.Unknown => - logger.warn("Could not detect OS version! Defaulting to 'Linux'.") + lazy private val executableName = (Environment.operatingSystem, Environment.architecture) match { + case (Environment.OperatingSystemType.Windows, _) => "astgen-win.exe" + case (Environment.OperatingSystemType.Linux, Environment.ArchitectureType.X86) => "astgen-linux" + case (Environment.OperatingSystemType.Linux, Environment.ArchitectureType.ARMv8) => "astgen-linux-arm" + case (Environment.OperatingSystemType.Mac, Environment.ArchitectureType.X86) => "astgen-macos" + case (Environment.OperatingSystemType.Mac, Environment.ArchitectureType.ARMv8) => "astgen-macos-arm" + case _ => + logger.warn("Could not detect OS version! Defaulting to Linux/x86_64.") "astgen-linux" } @@ -138,13 +136,13 @@ object AstGenRunner { val debugMsgPath = path.getOrElse("PATH") ExternalCommand.run(s"$astGenCommand --version", localPath).toOption.map(_.mkString.strip()) match { case Some(installedVersion) - if installedVersion != "unknown" && Try(VersionHelper.compare(installedVersion, astGenVersion)).toOption - .getOrElse(-1) >= 0 => - logger.debug(s"Using astgen v$installedVersion from $debugMsgPath") + if installedVersion != "unknown" && + Try(VersionHelper.compare(installedVersion, astGenVersion)).toOption.getOrElse(-1) >= 0 => + logger.debug(s"Found astgen v$installedVersion in '$debugMsgPath'") true case Some(installedVersion) => logger.debug( - s"Found astgen v$installedVersion in $debugMsgPath but jssrc2cpg requires at least v$astGenVersion" + s"Found astgen v$installedVersion in '$debugMsgPath' but jssrc2cpg requires at least v$astGenVersion" ) false case _ => @@ -168,15 +166,16 @@ object AstGenRunner { logger.debug( s"Did not find any astgen binary on this system (environment variable ASTGEN_BIN not set and no entry in the systems PATH)" ) - val localPath = s"$executableDir/$executableName" - logger.debug(s"Using astgen from '$localPath'") + val localPath = s"$executableDir${java.io.File.separator}$executableName" localPath } private lazy val astGenCommand = { val conf = ConfigFactory.load val astGenVersion = conf.getString("jssrc2cpg.astgen_version") - compatibleAstGenPath(astGenVersion) + val astGenPath = compatibleAstGenPath(astGenVersion) + logger.info(s"Using astgen from '$astGenPath'") + astGenPath } } @@ -348,13 +347,26 @@ class AstGenRunner(config: Config) { } private def ejsFiles(in: File, out: File): Try[Seq[String]] = { - val files = SourceFiles.determine(in.pathAsString, Set(".ejs")) + val files = + SourceFiles.determine( + in.pathAsString, + Set(".ejs"), + ignoredDefaultRegex = Some(AstGenDefaultIgnoreRegex), + ignoredFilesRegex = Some(config.ignoredFilesRegex), + ignoredFilesPath = Some(config.ignoredFiles) + ) if (files.nonEmpty) processEjsFiles(in, out, files) else Success(Seq.empty) } private def vueFiles(in: File, out: File): Try[Seq[String]] = { - val files = SourceFiles.determine(in.pathAsString, Set(".vue")) + val files = SourceFiles.determine( + in.pathAsString, + Set(".vue"), + ignoredDefaultRegex = Some(AstGenDefaultIgnoreRegex), + ignoredFilesRegex = Some(config.ignoredFilesRegex), + ignoredFilesPath = Some(config.ignoredFiles) + ) if (files.nonEmpty) ExternalCommand.run(s"$astGenCommand$executableArgs -t vue -o $out", in.toString(), extraEnv = NODE_OPTIONS) else Success(Seq.empty) @@ -396,7 +408,6 @@ class AstGenRunner(config: Config) { def execute(out: File): AstGenRunnerResult = { val tmpInput = filterAndCopyFiles() val in = File(config.inputPath) - logger.info(s"Running astgen in '$tmpInput' ...") runAstGenNative(in, out) match { case Success(result) => val parsed = checkParsedFiles(filterFiles(SourceFiles.determine(out.toString(), Set(".json")), out), tmpInput) diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/dataflow/DataflowTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/dataflow/DataflowTests.scala index 72e2f132d698..6696b70e20de 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/dataflow/DataflowTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/dataflow/DataflowTests.scala @@ -1,11 +1,11 @@ package io.joern.jssrc2cpg.dataflow -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.CfgNode -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DataflowTests extends DataFlowCodeToCpgSuite { @@ -461,7 +461,7 @@ class DataflowTests extends DataFlowCodeToCpgSuite { cpg.call .code("bar.*") .outE(EdgeTypes.REACHING_DEF) - .count(_.inNode() == cpg.ret.head) shouldBe 1 + .count(_.dst == cpg.ret.head) shouldBe 1 } "Flow from outer params to inner params" in { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/CodeDumperFromFileTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/CodeDumperFromFileTests.scala index 9c27a157a302..ede0ff1342a9 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/CodeDumperFromFileTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/CodeDumperFromFileTests.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.io import better.files.File import io.joern.jssrc2cpg.testfixtures.JsSrc2CpgSuite import io.shiftleft.semanticcpg.codedumper.CodeDumper -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.util.regex.Pattern diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTests.scala index a5d4011649c1..857abcceb87f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/ProjectParseTests.scala @@ -7,7 +7,7 @@ import io.joern.jssrc2cpg.passes.AstCreationPass import io.joern.jssrc2cpg.utils.AstGenRunner import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.X2Cpg.newEmptyCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import org.scalatest.BeforeAndAfterAll diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/TranspiledFileDetectionTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/TranspiledFileDetectionTests.scala index 49416158def7..c3072e666ea1 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/TranspiledFileDetectionTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/io/TranspiledFileDetectionTests.scala @@ -5,7 +5,7 @@ import io.shiftleft.semanticcpg.language.* class TranspiledFileDetectionTests extends AstJsSrc2CpgSuite { - "Detecting transpiled files" should { + "Detecting transpiled files" ignore { "skip transpiled files correctly (with source map comment)" in { val cpg = code( """ diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/CallLinkerPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/CallLinkerPassTests.scala index 06c04a42ab42..1f6d34a4f8ef 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/CallLinkerPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/CallLinkerPassTests.scala @@ -1,9 +1,9 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallLinkerPassTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTests.scala index 84f88e479d87..3d2f165406e6 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConfigPassTests.scala @@ -2,8 +2,9 @@ package io.joern.jssrc2cpg.passes import better.files.File import io.joern.jssrc2cpg.Config -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec @@ -18,7 +19,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { fileA.write("someCodeA();") fileB.write("someCodeB();") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new ConfigPass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() val List(configFileA, configFileB) = cpg.configFile.l @@ -42,7 +43,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { fileB.write("b") fileC.write("c") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new ConfigPass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() val List(configFileA, configFileB, configFileC) = cpg.configFile.l @@ -68,7 +69,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { val d = (dir / Defines.NodeModulesFolder).createDirectory() (d / "d.json").write("d") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new ConfigPass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() val List(configFileA, configFileB, configFileC) = cpg.configFile.l @@ -92,7 +93,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { fileA.write("a") fileB.write("b") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new ConfigPass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() val List(configFileA, configFileB) = cpg.configFile.l @@ -114,7 +115,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { val fileB = dir / "b.key" fileB.write("-----BEGIN SOME OTHER KEY-----\nthis is fine\n-----END SOME OTHER KEY-----") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new PrivateKeyFilePass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() val List(configFileA) = cpg.configFile.l @@ -129,7 +130,7 @@ class ConfigPassTests extends AnyWordSpec with Matchers { val fileA = d / "a.key" fileA.write("-----BEGIN RSA PRIVATE KEY-----\n123456789\n-----END RSA PRIVATE KEY-----") - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new PrivateKeyFilePass(cpg, Config().withInputPath(dir.pathAsString)).createAndApply() cpg.configFile shouldBe empty diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConstClosurePassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConstClosurePassTests.scala index 6abed767948d..f1acaba369fa 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConstClosurePassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ConstClosurePassTests.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConstClosurePassTests extends DataFlowCodeToCpgSuite { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTests.scala index f3e97235437b..cf9aaae193fa 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DependenciesPassTests.scala @@ -1,6 +1,6 @@ package io.joern.jssrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import better.files.File import io.joern.jssrc2cpg.utils.PackageJsonParser diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DomPassTestsHelper.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DomPassTestsHelper.scala index dc9ac7cc858c..98433e4d23ef 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DomPassTestsHelper.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/DomPassTestsHelper.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.passes import io.shiftleft.codepropertygraph.generated.nodes.Expression import io.shiftleft.codepropertygraph.generated.nodes.TemplateDom import io.shiftleft.codepropertygraph.generated.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.apache.commons.lang3.StringUtils trait DomPassTestsHelper { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ImportsPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ImportsPassTests.scala index 8765302f5fa4..3fcdbdf9169f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ImportsPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ImportsPassTests.scala @@ -3,8 +3,10 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.JsSrc2Cpg import io.joern.jssrc2cpg.testfixtures.JsSrc2CpgFrontend import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.jssrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.testfixtures.{Code2CpgFixture, TestCpg} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ImportsPassTests extends Code2CpgFixture(() => new TestCpgWithoutDataFlow()) { @@ -47,6 +49,6 @@ class TestCpgWithoutDataFlow extends TestCpg with JsSrc2CpgFrontend { override val fileSuffix: String = ".js" override def applyPasses(): Unit = { X2Cpg.applyDefaultOverlays(this) - JsSrc2Cpg.postProcessingPasses(this).foreach(_.createAndApply()) + jssrc2cpg.postProcessingPasses(this, XTypeRecoveryConfig()).foreach(_.createAndApply()) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/InheritanceFullNamePassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/InheritanceFullNamePassTests.scala index cfccc1632b34..f580bf8cb688 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/InheritanceFullNamePassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/InheritanceFullNamePassTests.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File import scala.annotation.nowarn diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/JsMetaDataPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/JsMetaDataPassTests.scala index 626fda706b95..bba23114b188 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/JsMetaDataPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/JsMetaDataPassTests.scala @@ -1,6 +1,6 @@ package io.joern.jssrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.semanticcpg.language.* import org.scalatest.BeforeAndAfterAll @@ -14,15 +14,15 @@ import scala.jdk.CollectionConverters.* class JsMetaDataPassTests extends AnyWordSpec with Matchers with Inside { "MetaDataPass" should { - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new JavaScriptMetaDataPass(cpg, "somehash", "").createAndApply() "create exactly 1 node" in { - cpg.graph.V.asScala.size shouldBe 1 + cpg.graph.allNodes.size shouldBe 1 } "create no edges" in { - cpg.graph.E.asScala.size shouldBe 0 + cpg.graph.allNodes.outE.size shouldBe 0 } "create a metadata node with correct language" in { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/RequirePassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/RequirePassTests.scala index 672a73ca0f65..b354a9942b94 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/RequirePassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/RequirePassTests.scala @@ -1,8 +1,8 @@ package io.joern.jssrc2cpg.passes -import io.joern.dataflowengineoss.language._ +import io.joern.dataflowengineoss.language.* import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/TypeRecoveryPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/TypeRecoveryPassTests.scala index 50f7fbc1ddb9..6291db281f19 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/TypeRecoveryPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/TypeRecoveryPassTests.scala @@ -1,6 +1,8 @@ package io.joern.jssrc2cpg.passes import io.joern.jssrc2cpg.testfixtures.DataFlowCodeToCpgSuite +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines +import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.semanticcpg.language.importresolver.* import io.shiftleft.semanticcpg.language.* @@ -463,4 +465,36 @@ class TypeRecoveryPassTests extends DataFlowCodeToCpgSuite { } + "resolve a function full name called as a constructor" in { + val cpg = code(""" + |var Print = function(str) { + | console.log(str); + |} + | + |new Print("Hello") + |""".stripMargin) + + cpg.call.nameExact(Defines.OperatorsNew).methodFullName.head shouldBe "Test0.js::program:Print" + } + + "A function assigned to a member should have it's full name resolved" in { + val cpg = code(""" + |var foo = {}; + | + |foo.bar = {}; + | + |foo.bar.evaluator = function evaluator (src) { + | eval(src); + |}; + | + |foo.bar.getGlobals = function getGlobals (src) { + | "use strict"; + | var original = Object.keys(global); + | foo.bar.evaluator(src); + |}; + |""".stripMargin) + + cpg.call("evaluator").methodFullName.head shouldBe "Test0.js::program:evaluator" + } + } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/DependencyAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/DependencyAstCreationPassTests.scala index daa810ae9689..a581f7f76162 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/DependencyAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/DependencyAstCreationPassTests.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.passes.ast import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite import io.joern.x2cpg.layers.Base import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DependencyAstCreationPassTests extends AstJsSrc2CpgSuite { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/MixedAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/MixedAstCreationPassTests.scala index be5e156a9e4b..7653f019c727 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/MixedAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/MixedAstCreationPassTests.scala @@ -4,8 +4,8 @@ import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.EvaluationStrategies import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.codepropertygraph.generated.nodes.MethodParameterIn -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.{ClosureBinding, MethodParameterIn} +import io.shiftleft.semanticcpg.language.* class MixedAstCreationPassTests extends AstJsSrc2CpgSuite { @@ -285,7 +285,7 @@ class MixedAstCreationPassTests extends AstJsSrc2CpgSuite { val List(fooLocalY) = fooBlock.astChildren.isLocal.nameExact("y").l val List(barRef) = fooBlock.astChildren.isCall.astChildren.isMethodRef.l - val List(closureBindForY, closureBindForX) = barRef.captureOut.l + val List(closureBindForY, closureBindForX) = barRef.captureOut.cast[ClosureBinding].l closureBindForX.closureOriginalName shouldBe Option("x") closureBindForX.closureBindingId shouldBe Option("Test0.js::program:foo:bar:x") diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTests.scala index 05a1b8685d29..cd85aac864df 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTests.scala @@ -1,7 +1,8 @@ package io.joern.jssrc2cpg.passes.ast -import io.joern.jssrc2cpg.passes.{Defines, EcmaBuiltins} +import io.joern.jssrc2cpg.passes.EcmaBuiltins import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* @@ -858,7 +859,7 @@ class SimpleAstCreationPassTests extends AstJsSrc2CpgSuite { val List(typeDecl) = cpg.typeDecl.nameExact("method").l typeDecl.fullName should endWith("Test0.js::program:method") - val List(binding) = typeDecl.bindsOut.l + val List(binding) = typeDecl.bindsOut.cast[Binding].l binding.name shouldBe "" binding.signature shouldBe "" diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTests.scala index 5d87355d0c5e..33c2d5209640 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsAstCreationPassTests.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg.passes.ast import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite -import io.joern.jssrc2cpg.passes.Defines +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier} import io.shiftleft.semanticcpg.language.* @@ -108,8 +108,7 @@ class TsAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { arg.typeFullName shouldBe Defines.String arg.code shouldBe "arg: string" arg.index shouldBe 1 - val List(parentTypeDecl) = cpg.typeDecl.name(":program").l - parentTypeDecl.bindsOut.flatMap(_.refOut).l should contain(func) + cpg.method("foo").bindingTypeDecl.fullName.l shouldBe List("Test0.ts::program:foo") } "have correct structure for type assertion" in { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsClassesAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsClassesAstCreationPassTests.scala index 0249b1119aa6..43d24af28886 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsClassesAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsClassesAstCreationPassTests.scala @@ -1,7 +1,7 @@ package io.joern.jssrc2cpg.passes.ast -import io.joern.jssrc2cpg.passes.Defines import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.ModifierTypes import io.shiftleft.codepropertygraph.generated.nodes.CfgNode import io.shiftleft.semanticcpg.language.* @@ -191,7 +191,10 @@ class TsClassesAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { greeter.fullName shouldBe "Test0.ts::program:Greeter" greeter.filename shouldBe "Test0.ts" greeter.file.name.head shouldBe "Test0.ts" - inside(cpg.typeDecl("Greeter").member.l) { case List(greeting, name, propName, foo, anon, toString) => + inside(cpg.typeDecl("Greeter").member.l) { case List(init, greeting, name, propName, foo, anon, toString) => + init.name shouldBe "" + init.typeFullName shouldBe "Test0.ts::program:Greeter" + init.dynamicTypeHintFullName shouldBe List("Test0.ts::program:Greeter:") greeting.name shouldBe "greeting" greeting.code shouldBe "greeting: string;" name.name shouldBe "name" @@ -339,7 +342,7 @@ class TsClassesAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { val List(credentialsParam) = cpg.parameter.nameExact("credentials").l credentialsParam.typeFullName shouldBe "Test0.ts::program:Test:run:0" // should not produce dangling nodes that are meant to be inside procedures - cpg.all.collectAll[CfgNode].whereNot(_._astIn).size shouldBe 0 + cpg.all.collectAll[CfgNode].whereNot(_.astParent).size shouldBe 0 cpg.identifier.count(_.refsTo.size > 1) shouldBe 0 cpg.identifier.whereNot(_.refsTo).size shouldBe 0 // should not produce assignment calls directly under typedecls @@ -359,7 +362,7 @@ class TsClassesAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { val List(credentialsParam) = cpg.parameter.nameExact("param1_0").l credentialsParam.typeFullName shouldBe "Test0.ts::program:apiCall:0" // should not produce dangling nodes that are meant to be inside procedures - cpg.all.collectAll[CfgNode].whereNot(_._astIn).size shouldBe 0 + cpg.all.collectAll[CfgNode].whereNot(_.astParent).size shouldBe 0 cpg.identifier.count(_.refsTo.size > 1) shouldBe 0 cpg.identifier.whereNot(_.refsTo).size shouldBe 0 // should not produce assignment calls directly under typedecls diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsDecoratorAstCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsDecoratorAstCreationPassTests.scala index 3befb62f332a..38bd7b036a5c 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsDecoratorAstCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/TsDecoratorAstCreationPassTests.scala @@ -1,8 +1,7 @@ package io.joern.jssrc2cpg.passes.ast import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite -import io.joern.jssrc2cpg.passes.Defines -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TsDecoratorAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { @@ -324,308 +323,6 @@ class TsDecoratorAstCreationPassTests extends AstJsSrc2CpgSuite(".ts") { annotationD.parameterAssign.l shouldBe empty } } - - "create methods for const exports" in { - val cpg = code("export const getApiA = (req: Request) => { const user = req.user as UserDocument; }") - cpg.method.name.sorted.l shouldBe List(":program", "0") - cpg.assignment.code.l shouldBe List( - "const user = req.user as UserDocument", - "const getApiA = (req: Request) => { const user = req.user as UserDocument; }", - "exports.getApiA = getApiA" - ) - inside(cpg.method.name("0").l) { case List(anon) => - anon.fullName shouldBe "Test0.ts::program:0" - anon.ast.isIdentifier.name.l shouldBe List("user", "req") - } - } - - "have correct structure for import assignments" in { - val cpg = code(""" - |import fs = require('fs'); - |import models = require('../models/index'); - |""".stripMargin) - cpg.assignment.code.l shouldBe List("var fs = require(\"fs\")", "var models = require(\"../models/index\")") - cpg.local.code.l shouldBe List("fs", "models") - val List(fsDep, modelsDep) = cpg.dependency.l - fsDep.name shouldBe "fs" - fsDep.dependencyGroupId shouldBe Option("fs") - modelsDep.name shouldBe "models" - modelsDep.dependencyGroupId shouldBe Option("../models/index") - - val List(fs, models) = cpg.imports.l - fs.code shouldBe "import fs = require('fs')" - fs.importedEntity shouldBe Option("fs") - fs.importedAs shouldBe Option("fs") - models.code shouldBe "import models = require('../models/index')" - models.importedEntity shouldBe Option("../models/index") - models.importedAs shouldBe Option("models") - } - - "have correct structure for declared functions" in { - val cpg = code("declare function foo(arg: string): string") - val List(func) = cpg.method("foo").l - func.code shouldBe "declare function foo(arg: string): string" - func.name shouldBe "foo" - func.fullName shouldBe "Test0.ts::program:foo" - val List(_, arg) = cpg.method("foo").parameter.l - arg.name shouldBe "arg" - arg.typeFullName shouldBe Defines.String - arg.code shouldBe "arg: string" - arg.index shouldBe 1 - val List(parentTypeDecl) = cpg.typeDecl.name(":program").l - parentTypeDecl.bindsOut.flatMap(_.refOut).l should contain(func) - } - - } - - "AST generation for TS enums" should { - - "have correct structure for simple enum" in { - val cpg = code(""" - |enum Direction { - | Up = 1, - | Down, - | Left, - | Right, - |} - |""".stripMargin) - inside(cpg.typeDecl("Direction").l) { case List(direction) => - direction.name shouldBe "Direction" - direction.code shouldBe "enum Direction" - direction.fullName shouldBe "Test0.ts::program:Direction" - direction.filename shouldBe "Test0.ts" - direction.file.name.head shouldBe "Test0.ts" - inside(direction.method.name(io.joern.x2cpg.Defines.StaticInitMethodName).l) { case List(init) => - init.block.astChildren.isCall.code.head shouldBe "Up = 1" - } - inside(cpg.typeDecl("Direction").member.l) { case List(up, down, left, right) => - up.name shouldBe "Up" - up.code shouldBe "Up = 1" - down.name shouldBe "Down" - down.code shouldBe "Down" - left.name shouldBe "Left" - left.code shouldBe "Left" - right.name shouldBe "Right" - right.code shouldBe "Right" - } - } - } - - } - - "AST generation for TS classes" should { - - "have correct structure for simple classes" in { - val cpg = code(""" - |class Greeter { - | greeting: string; - | greet() { - | return "Hello, " + this.greeting; - | } - |} - |""".stripMargin) - inside(cpg.typeDecl("Greeter").l) { case List(greeter) => - greeter.name shouldBe "Greeter" - greeter.code shouldBe "class Greeter" - greeter.fullName shouldBe "Test0.ts::program:Greeter" - greeter.filename shouldBe "Test0.ts" - greeter.file.name.head shouldBe "Test0.ts" - val constructor = greeter.method.nameExact(io.joern.x2cpg.Defines.ConstructorMethodName).head - greeter.method.isConstructor.head shouldBe constructor - constructor.fullName shouldBe s"Test0.ts::program:Greeter:${io.joern.x2cpg.Defines.ConstructorMethodName}" - inside(cpg.typeDecl("Greeter").member.l) { case List(greeting, greet) => - greeting.name shouldBe "greeting" - greeting.code shouldBe "greeting: string;" - greet.name shouldBe "greet" - greet.dynamicTypeHintFullName shouldBe Seq("Test0.ts::program:Greeter:greet") - } - } - } - - "have correct structure for declared classes with empty constructor" in { - val cpg = code(""" - |declare class Greeter { - | greeting: string; - | constructor(arg: string); - |} - |""".stripMargin) - inside(cpg.typeDecl("Greeter").l) { case List(greeter) => - greeter.name shouldBe "Greeter" - greeter.code shouldBe "class Greeter" - greeter.fullName shouldBe "Test0.ts::program:Greeter" - greeter.filename shouldBe "Test0.ts" - greeter.file.name.head shouldBe "Test0.ts" - val constructor = greeter.method.nameExact(io.joern.x2cpg.Defines.ConstructorMethodName).head - constructor.fullName shouldBe s"Test0.ts::program:Greeter:${io.joern.x2cpg.Defines.ConstructorMethodName}" - greeter.method.isConstructor.head shouldBe constructor - inside(cpg.typeDecl("Greeter").member.l) { case List(greeting) => - greeting.name shouldBe "greeting" - greeting.code shouldBe "greeting: string;" - } - } - } - - "have correct modifier" in { - val cpg = code(""" - |abstract class Greeter { - | static a: string; - | private b: string; - | public c: string; - | protected d: string; - | #e: string; // also private - |} - |""".stripMargin) - inside(cpg.typeDecl.name("Greeter.*").l) { case List(greeter) => - greeter.name shouldBe "Greeter" - cpg.typeDecl.isAbstract.head shouldBe greeter - greeter.member.isStatic.head shouldBe greeter.member.name("a").head - greeter.member.isPrivate.l shouldBe greeter.member.name("b", "e").l - greeter.member.isPublic.head shouldBe greeter.member.name("c").head - greeter.member.isProtected.head shouldBe greeter.member.name("d").head - } - } - - "have correct structure for empty interfaces" in { - val cpg = code(""" - |interface A {}; - |interface B {}; - |""".stripMargin) - cpg.method.fullName.sorted.l shouldBe List( - "Test0.ts::program", - s"Test0.ts::program:A:${io.joern.x2cpg.Defines.ConstructorMethodName}", - s"Test0.ts::program:B:${io.joern.x2cpg.Defines.ConstructorMethodName}" - ) - } - - "have correct structure for simple interfaces" in { - val cpg = code(""" - |interface Greeter { - | greeting: string; - | name?: string; - | [propName: string]: any; - | "foo": string; - | (source: string, subString: string): boolean; - |} - |""".stripMargin) - inside(cpg.typeDecl("Greeter").l) { case List(greeter) => - greeter.name shouldBe "Greeter" - greeter.code shouldBe "interface Greeter" - greeter.fullName shouldBe "Test0.ts::program:Greeter" - greeter.filename shouldBe "Test0.ts" - greeter.file.name.head shouldBe "Test0.ts" - inside(cpg.typeDecl("Greeter").member.l) { case List(greeting, name, propName, foo, anon) => - greeting.name shouldBe "greeting" - greeting.code shouldBe "greeting: string;" - name.name shouldBe "name" - name.code shouldBe "name?: string;" - propName.name shouldBe "propName" - propName.code shouldBe "[propName: string]: any;" - foo.name shouldBe "foo" - foo.code shouldBe "\"foo\": string;" - anon.name shouldBe "0" - anon.dynamicTypeHintFullName shouldBe Seq("Test0.ts::program:Greeter:0") - anon.code shouldBe "(source: string, subString: string): boolean;" - } - inside(cpg.typeDecl("Greeter").method.l) { case List(constructor, anon) => - constructor.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName - constructor.fullName shouldBe s"Test0.ts::program:Greeter:${io.joern.x2cpg.Defines.ConstructorMethodName}" - constructor.code shouldBe "new: Greeter" - greeter.method.isConstructor.head shouldBe constructor - anon.name shouldBe "0" - anon.fullName shouldBe "Test0.ts::program:Greeter:0" - anon.code shouldBe "(source: string, subString: string): boolean;" - anon.parameter.name.l shouldBe List("this", "source", "subString") - anon.parameter.code.l shouldBe List("this", "source: string", "subString: string") - } - } - } - - "have correct structure for interface constructor" in { - val cpg = code(""" - |interface Greeter { - | new (param: string) : Greeter - |} - |""".stripMargin) - inside(cpg.typeDecl("Greeter").l) { case List(greeter) => - greeter.name shouldBe "Greeter" - greeter.code shouldBe "interface Greeter" - greeter.fullName shouldBe "Test0.ts::program:Greeter" - greeter.filename shouldBe "Test0.ts" - greeter.file.name.head shouldBe "Test0.ts" - inside(cpg.typeDecl("Greeter").method.l) { case List(constructor) => - constructor.name shouldBe io.joern.x2cpg.Defines.ConstructorMethodName - constructor.fullName shouldBe s"Test0.ts::program:Greeter:${io.joern.x2cpg.Defines.ConstructorMethodName}" - constructor.code shouldBe "new (param: string) : Greeter" - constructor.parameter.name.l shouldBe List("this", "param") - constructor.parameter.code.l shouldBe List("this", "param: string") - greeter.method.isConstructor.head shouldBe constructor - } - } - } - - "have correct structure for simple namespace" in { - val cpg = code(""" - |namespace A { - | class Foo {}; - |} - |""".stripMargin) - inside(cpg.namespaceBlock("A").l) { case List(namespaceA) => - namespaceA.code should startWith("namespace A") - namespaceA.fullName shouldBe "Test0.ts::program:A" - namespaceA.typeDecl.name("Foo").head.fullName shouldBe "Test0.ts::program:A:Foo" - } - } - - "have correct structure for nested namespaces" in { - val cpg = code(""" - |namespace A { - | namespace B { - | namespace C { - | class Foo {}; - | } - | } - |} - |""".stripMargin) - inside(cpg.namespaceBlock("A").l) { case List(namespaceA) => - namespaceA.code should startWith("namespace A") - namespaceA.fullName shouldBe "Test0.ts::program:A" - namespaceA.astChildren.astChildren.isNamespaceBlock.name("B").head shouldBe cpg.namespaceBlock("B").head - } - inside(cpg.namespaceBlock("B").l) { case List(namespaceB) => - namespaceB.code should startWith("namespace B") - namespaceB.fullName shouldBe "Test0.ts::program:A:B" - namespaceB.astChildren.astChildren.isNamespaceBlock.name("C").head shouldBe cpg.namespaceBlock("C").head - } - inside(cpg.namespaceBlock("C").l) { case List(namespaceC) => - namespaceC.code should startWith("namespace C") - namespaceC.fullName shouldBe "Test0.ts::program:A:B:C" - namespaceC.typeDecl.name("Foo").head.fullName shouldBe "Test0.ts::program:A:B:C:Foo" - } - } - - "have correct structure for nested namespaces with path" in { - val cpg = code(""" - |namespace A.B.C { - | class Foo {}; - |} - |""".stripMargin) - inside(cpg.namespaceBlock("A").l) { case List(namespaceA) => - namespaceA.code should startWith("namespace A") - namespaceA.fullName shouldBe "Test0.ts::program:A" - namespaceA.astChildren.isNamespaceBlock.name("B").head shouldBe cpg.namespaceBlock("B").head - } - inside(cpg.namespaceBlock("B").l) { case List(b) => - b.code should startWith("B.C") - b.fullName shouldBe "Test0.ts::program:A:B" - b.astChildren.isNamespaceBlock.name("C").head shouldBe cpg.namespaceBlock("C").head - } - inside(cpg.namespaceBlock("C").l) { case List(c) => - c.code should startWith("C") - c.fullName shouldBe "Test0.ts::program:A:B:C" - c.typeDecl.name("Foo").head.fullName shouldBe "Test0.ts::program:A:B:C:Foo" - } - } - } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/DependencyCfgCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/DependencyCfgCreationPassTests.scala index 58e4c0a728ed..7e914d662a6f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/DependencyCfgCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/DependencyCfgCreationPassTests.scala @@ -3,23 +3,23 @@ package io.joern.jssrc2cpg.passes.cfg import io.joern.jssrc2cpg.testfixtures.JsSrcCfgTestCpg import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.AlwaysEdge import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class DependencyCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg()) { "CFG generation for global builtins" should { "be correct for JSON.parse" in { implicit val cpg: Cpg = code("""JSON.parse("foo");""") - succOf(":program") shouldBe expected((""""foo"""", AlwaysEdge)) - succOf(""""foo"""") shouldBe expected(("""JSON.parse("foo")""", AlwaysEdge)) - succOf("""JSON.parse("foo")""") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected((""""foo"""", AlwaysEdge)) + succOf(""""foo"""") should contain theSameElementsAs expected(("""JSON.parse("foo")""", AlwaysEdge)) + succOf("""JSON.parse("foo")""") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "have correct structure for JSON.stringify" in { implicit val cpg: Cpg = code("""JSON.stringify(foo);""") - succOf(":program") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("JSON.stringify(foo)", AlwaysEdge)) - succOf("JSON.stringify(foo)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("JSON.stringify(foo)", AlwaysEdge)) + succOf("JSON.stringify(foo)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/JsClassesCfgCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/JsClassesCfgCreationPassTests.scala index 8a9b5157da5f..f827e03dbaab 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/JsClassesCfgCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/JsClassesCfgCreationPassTests.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.passes.cfg import io.joern.jssrc2cpg.testfixtures.JsSrcCfgTestCpg import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.AlwaysEdge import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes class JsClassesCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg()) { @@ -11,61 +11,65 @@ class JsClassesCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTes "CFG generation for constructor" should { "be correct for simple new" in { implicit val cpg: Cpg = code("new MyClass()") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected((".alloc", AlwaysEdge)) - succOf(".alloc") shouldBe expected(("_tmp_0 = .alloc", AlwaysEdge)) - succOf("_tmp_0 = .alloc") shouldBe expected(("MyClass", AlwaysEdge)) - succOf("MyClass") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("new MyClass()", AlwaysEdge)) - succOf("new MyClass()", NodeTypes.CALL) shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("new MyClass()", AlwaysEdge)) - succOf("new MyClass()") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected((".alloc", AlwaysEdge)) + succOf(".alloc") should contain theSameElementsAs expected(("_tmp_0 = .alloc", AlwaysEdge)) + succOf("_tmp_0 = .alloc") should contain theSameElementsAs expected(("MyClass", AlwaysEdge)) + succOf("MyClass") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("new MyClass()", AlwaysEdge)) + succOf("new MyClass()", NodeTypes.CALL) should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("new MyClass()", AlwaysEdge)) + succOf("new MyClass()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for simple new with arguments" in { implicit val cpg: Cpg = code("new MyClass(arg1, arg2)") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected((".alloc", AlwaysEdge)) - succOf(".alloc") shouldBe expected(("_tmp_0 = .alloc", AlwaysEdge)) - succOf("_tmp_0 = .alloc") shouldBe expected(("MyClass", AlwaysEdge)) - succOf("MyClass") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("arg1", AlwaysEdge)) - succOf("arg1") shouldBe expected(("arg2", AlwaysEdge)) - succOf("arg2") shouldBe expected(("new MyClass(arg1, arg2)", AlwaysEdge)) - succOf("new MyClass(arg1, arg2)", NodeTypes.CALL) shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("new MyClass(arg1, arg2)", AlwaysEdge)) - succOf("new MyClass(arg1, arg2)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected((".alloc", AlwaysEdge)) + succOf(".alloc") should contain theSameElementsAs expected(("_tmp_0 = .alloc", AlwaysEdge)) + succOf("_tmp_0 = .alloc") should contain theSameElementsAs expected(("MyClass", AlwaysEdge)) + succOf("MyClass") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("arg1", AlwaysEdge)) + succOf("arg1") should contain theSameElementsAs expected(("arg2", AlwaysEdge)) + succOf("arg2") should contain theSameElementsAs expected(("new MyClass(arg1, arg2)", AlwaysEdge)) + succOf("new MyClass(arg1, arg2)", NodeTypes.CALL) should contain theSameElementsAs expected( + ("_tmp_0", 2, AlwaysEdge) + ) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("new MyClass(arg1, arg2)", AlwaysEdge)) + succOf("new MyClass(arg1, arg2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for new with access path" in { implicit val cpg: Cpg = code("new foo.bar.MyClass()") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected((".alloc", AlwaysEdge)) - succOf(".alloc") shouldBe expected(("_tmp_0 = .alloc", AlwaysEdge)) - succOf("_tmp_0 = .alloc") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("bar", AlwaysEdge)) - succOf("bar") shouldBe expected(("foo.bar", AlwaysEdge)) - succOf("foo.bar") shouldBe expected(("MyClass", AlwaysEdge)) - succOf("MyClass") shouldBe expected(("foo.bar.MyClass", AlwaysEdge)) - succOf("foo.bar.MyClass") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("new foo.bar.MyClass()", AlwaysEdge)) - succOf("new foo.bar.MyClass()", NodeTypes.CALL) shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("new foo.bar.MyClass()", AlwaysEdge)) - succOf("new foo.bar.MyClass()") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected((".alloc", AlwaysEdge)) + succOf(".alloc") should contain theSameElementsAs expected(("_tmp_0 = .alloc", AlwaysEdge)) + succOf("_tmp_0 = .alloc") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("bar", AlwaysEdge)) + succOf("bar") should contain theSameElementsAs expected(("foo.bar", AlwaysEdge)) + succOf("foo.bar") should contain theSameElementsAs expected(("MyClass", AlwaysEdge)) + succOf("MyClass") should contain theSameElementsAs expected(("foo.bar.MyClass", AlwaysEdge)) + succOf("foo.bar.MyClass") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("new foo.bar.MyClass()", AlwaysEdge)) + succOf("new foo.bar.MyClass()", NodeTypes.CALL) should contain theSameElementsAs expected( + ("_tmp_0", 2, AlwaysEdge) + ) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("new foo.bar.MyClass()", AlwaysEdge)) + succOf("new foo.bar.MyClass()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be structure for throw new exceptions" in { implicit val cpg: Cpg = code("function foo() { throw new Foo() }") - succOf("foo", NodeTypes.METHOD) shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected((".alloc", AlwaysEdge)) - succOf(".alloc") shouldBe expected(("_tmp_0 = .alloc", AlwaysEdge)) - succOf("_tmp_0 = .alloc") shouldBe expected(("Foo", AlwaysEdge)) - succOf("Foo") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("new Foo()", AlwaysEdge)) - succOf("new Foo()", NodeTypes.CALL) shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("new Foo()", AlwaysEdge)) - succOf("new Foo()") shouldBe expected(("throw new Foo()", AlwaysEdge)) - succOf("throw new Foo()") shouldBe expected(("RET", AlwaysEdge)) + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected((".alloc", AlwaysEdge)) + succOf(".alloc") should contain theSameElementsAs expected(("_tmp_0 = .alloc", AlwaysEdge)) + succOf("_tmp_0 = .alloc") should contain theSameElementsAs expected(("Foo", AlwaysEdge)) + succOf("Foo") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("new Foo()", AlwaysEdge)) + succOf("new Foo()", NodeTypes.CALL) should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("new Foo()", AlwaysEdge)) + succOf("new Foo()") should contain theSameElementsAs expected(("throw new Foo()", AlwaysEdge)) + succOf("throw new Foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } @@ -78,10 +82,10 @@ class JsClassesCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTes | } |} |""".stripMargin) - succOf("foo", NodeTypes.METHOD) shouldBe expected(("bar", AlwaysEdge)) - succOf("bar") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("bar()", AlwaysEdge)) - succOf("bar()") shouldBe expected(("RET", 2, AlwaysEdge)) + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("bar", AlwaysEdge)) + succOf("bar") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("bar()", AlwaysEdge)) + succOf("bar()") should contain theSameElementsAs expected(("RET", 2, AlwaysEdge)) } "be correct for methods in class type decls with assignment" in { @@ -92,17 +96,17 @@ class JsClassesCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTes | } |} |""".stripMargin) - succOf(":program") shouldBe expected(("a", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) // call to constructor of ClassA - succOf("a") shouldBe expected(("class ClassA", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("class ClassA", AlwaysEdge)) } "be correct for outer method of anonymous class declaration" in { implicit val cpg: Cpg = code("var a = class {}") - succOf(":program") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("class 0", AlwaysEdge)) - succOf("class 0") shouldBe expected(("var a = class {}", AlwaysEdge)) - succOf("var a = class {}") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("class 0", AlwaysEdge)) + succOf("class 0") should contain theSameElementsAs expected(("var a = class {}", AlwaysEdge)) + succOf("var a = class {}") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/MixedCfgCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/MixedCfgCreationPassTests.scala index e05be2e78fab..f3c619eed31c 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/MixedCfgCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/MixedCfgCreationPassTests.scala @@ -5,166 +5,174 @@ import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.AlwaysEdge import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.FalseEdge import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.TrueEdge import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MixedCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg()) { "CFG generation for destructing assignment" should { "be correct for object destruction assignment with declaration" in { implicit val cpg: Cpg = code("var {a, b} = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("_tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a") shouldBe expected(("a = _tmp_0.a", AlwaysEdge)) - - succOf("a = _tmp_0.a") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("_tmp_0.b", AlwaysEdge)) - succOf("_tmp_0.b") shouldBe expected(("b = _tmp_0.b", AlwaysEdge)) - succOf("b = _tmp_0.b") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("var {a, b} = x", AlwaysEdge)) - succOf("var {a, b} = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("_tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a") should contain theSameElementsAs expected(("a = _tmp_0.a", AlwaysEdge)) + + succOf("a = _tmp_0.a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("_tmp_0.b", AlwaysEdge)) + succOf("_tmp_0.b") should contain theSameElementsAs expected(("b = _tmp_0.b", AlwaysEdge)) + succOf("b = _tmp_0.b") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var {a, b} = x", AlwaysEdge)) + succOf("var {a, b} = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for object destruction assignment with declaration and ternary init" in { implicit val cpg: Cpg = code("const { a, b } = test() ? foo() : bar()") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("test", AlwaysEdge)) - succOf("test") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("test()", AlwaysEdge)) - succOf("test()") shouldBe expected(("foo", TrueEdge), ("bar", FalseEdge)) - succOf("foo") shouldBe expected(("this", 1, AlwaysEdge)) - succOf("this", 2) shouldBe expected(("foo()", AlwaysEdge)) - succOf("bar()") shouldBe expected(("test() ? foo() : bar()", AlwaysEdge)) - succOf("foo()") shouldBe expected(("test() ? foo() : bar()", AlwaysEdge)) - succOf("test() ? foo() : bar()") shouldBe expected(("_tmp_0 = test() ? foo() : bar()", AlwaysEdge)) - succOf("_tmp_0 = test() ? foo() : bar()") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("_tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a") shouldBe expected(("a = _tmp_0.a", AlwaysEdge)) - succOf("a = _tmp_0.a") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("_tmp_0.b", AlwaysEdge)) - succOf("_tmp_0.b") shouldBe expected(("b = _tmp_0.b", AlwaysEdge)) - succOf("b = _tmp_0.b") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("const { a, b } = test() ? foo() : bar()", AlwaysEdge)) - succOf("const { a, b } = test() ? foo() : bar()") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("test", AlwaysEdge)) + succOf("test") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("test()", AlwaysEdge)) + succOf("test()") should contain theSameElementsAs expected(("foo", TrueEdge), ("bar", FalseEdge)) + succOf("foo") should contain theSameElementsAs expected(("this", 1, AlwaysEdge)) + succOf("this", 2) should contain theSameElementsAs expected(("foo()", AlwaysEdge)) + succOf("bar()") should contain theSameElementsAs expected(("test() ? foo() : bar()", AlwaysEdge)) + succOf("foo()") should contain theSameElementsAs expected(("test() ? foo() : bar()", AlwaysEdge)) + succOf("test() ? foo() : bar()") should contain theSameElementsAs expected( + ("_tmp_0 = test() ? foo() : bar()", AlwaysEdge) + ) + succOf("_tmp_0 = test() ? foo() : bar()") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("_tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a") should contain theSameElementsAs expected(("a = _tmp_0.a", AlwaysEdge)) + succOf("a = _tmp_0.a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("_tmp_0.b", AlwaysEdge)) + succOf("_tmp_0.b") should contain theSameElementsAs expected(("b = _tmp_0.b", AlwaysEdge)) + succOf("b = _tmp_0.b") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected( + ("const { a, b } = test() ? foo() : bar()", AlwaysEdge) + ) + succOf("const { a, b } = test() ? foo() : bar()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for object destruction assignment with reassignment" in { implicit val cpg: Cpg = code("var {a: n, b: m} = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("n", AlwaysEdge)) - succOf("n") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("_tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a") shouldBe expected(("n = _tmp_0.a", AlwaysEdge)) - - succOf("n = _tmp_0.a") shouldBe expected(("m", AlwaysEdge)) - succOf("m") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0.b", AlwaysEdge)) - succOf("_tmp_0.b") shouldBe expected(("m = _tmp_0.b", AlwaysEdge)) - succOf("m = _tmp_0.b") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("var {a: n, b: m} = x", AlwaysEdge)) - succOf("var {a: n, b: m} = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("n", AlwaysEdge)) + succOf("n") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a") should contain theSameElementsAs expected(("n = _tmp_0.a", AlwaysEdge)) + + succOf("n = _tmp_0.a") should contain theSameElementsAs expected(("m", AlwaysEdge)) + succOf("m") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0.b", AlwaysEdge)) + succOf("_tmp_0.b") should contain theSameElementsAs expected(("m = _tmp_0.b", AlwaysEdge)) + succOf("m = _tmp_0.b") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var {a: n, b: m} = x", AlwaysEdge)) + succOf("var {a: n, b: m} = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for object destruction assignment with reassignment and defaults" in { implicit val cpg: Cpg = code("var {a: n = 1, b: m = 2} = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - succOf("_tmp_0 = x") shouldBe expected(("n", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("n", AlwaysEdge)) // test statement - succOf("n") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("_tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a") shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("_tmp_0.a === void 0", AlwaysEdge)) + succOf("n") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a") should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("_tmp_0.a === void 0", AlwaysEdge)) // true, false cases - succOf("_tmp_0.a === void 0") shouldBe expected(("1", TrueEdge), ("_tmp_0", 2, FalseEdge)) - succOf("_tmp_0", 2) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("_tmp_0.a", 1, AlwaysEdge)) - succOf("_tmp_0.a", 1) shouldBe expected(("_tmp_0.a === void 0 ? 1 : _tmp_0.a", AlwaysEdge)) - succOf("1") shouldBe expected(("_tmp_0.a === void 0 ? 1 : _tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a === void 0 ? 1 : _tmp_0.a") shouldBe + succOf("_tmp_0.a === void 0") should contain theSameElementsAs expected(("1", TrueEdge), ("_tmp_0", 2, FalseEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("_tmp_0.a", 1, AlwaysEdge)) + succOf("_tmp_0.a", 1) should contain theSameElementsAs expected( + ("_tmp_0.a === void 0 ? 1 : _tmp_0.a", AlwaysEdge) + ) + succOf("1") should contain theSameElementsAs expected(("_tmp_0.a === void 0 ? 1 : _tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a === void 0 ? 1 : _tmp_0.a") should contain theSameElementsAs expected(("n = _tmp_0.a === void 0 ? 1 : _tmp_0.a", AlwaysEdge)) - succOf("n = _tmp_0.a === void 0 ? 1 : _tmp_0.a") shouldBe + succOf("n = _tmp_0.a === void 0 ? 1 : _tmp_0.a") should contain theSameElementsAs expected(("m", AlwaysEdge)) // test statement - succOf("m") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0.b", AlwaysEdge)) - succOf("_tmp_0.b") shouldBe expected(("void 0", 1, AlwaysEdge)) - succOf("void 0", 1) shouldBe expected(("_tmp_0.b === void 0", AlwaysEdge)) + succOf("m") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0.b", AlwaysEdge)) + succOf("_tmp_0.b") should contain theSameElementsAs expected(("void 0", 1, AlwaysEdge)) + succOf("void 0", 1) should contain theSameElementsAs expected(("_tmp_0.b === void 0", AlwaysEdge)) // true, false cases - succOf("_tmp_0.b === void 0") shouldBe expected(("2", TrueEdge), ("_tmp_0", 4, FalseEdge)) - succOf("_tmp_0", 4) shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("_tmp_0.b", 1, AlwaysEdge)) - succOf("_tmp_0.b", 1) shouldBe expected(("_tmp_0.b === void 0 ? 2 : _tmp_0.b", AlwaysEdge)) - succOf("2") shouldBe expected(("_tmp_0.b === void 0 ? 2 : _tmp_0.b", AlwaysEdge)) - succOf("_tmp_0.b === void 0 ? 2 : _tmp_0.b") shouldBe + succOf("_tmp_0.b === void 0") should contain theSameElementsAs expected(("2", TrueEdge), ("_tmp_0", 4, FalseEdge)) + succOf("_tmp_0", 4) should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("_tmp_0.b", 1, AlwaysEdge)) + succOf("_tmp_0.b", 1) should contain theSameElementsAs expected( + ("_tmp_0.b === void 0 ? 2 : _tmp_0.b", AlwaysEdge) + ) + succOf("2") should contain theSameElementsAs expected(("_tmp_0.b === void 0 ? 2 : _tmp_0.b", AlwaysEdge)) + succOf("_tmp_0.b === void 0 ? 2 : _tmp_0.b") should contain theSameElementsAs expected(("m = _tmp_0.b === void 0 ? 2 : _tmp_0.b", AlwaysEdge)) - succOf("m = _tmp_0.b === void 0 ? 2 : _tmp_0.b") shouldBe + succOf("m = _tmp_0.b === void 0 ? 2 : _tmp_0.b") should contain theSameElementsAs expected(("_tmp_0", 5, AlwaysEdge)) - succOf("_tmp_0", 5) shouldBe expected(("var {a: n = 1, b: m = 2} = x", AlwaysEdge)) - succOf("var {a: n = 1, b: m = 2} = x") shouldBe expected(("RET", AlwaysEdge)) + succOf("_tmp_0", 5) should contain theSameElementsAs expected(("var {a: n = 1, b: m = 2} = x", AlwaysEdge)) + succOf("var {a: n = 1, b: m = 2} = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for object destruction assignment with rest" in { implicit val cpg: Cpg = code("var {a, ...rest} = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("_tmp_0.a", AlwaysEdge)) - succOf("_tmp_0.a") shouldBe expected(("a = _tmp_0.a", AlwaysEdge)) - - succOf("a = _tmp_0.a") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("rest", AlwaysEdge)) - succOf("rest") shouldBe expected(("...rest", AlwaysEdge)) - succOf("...rest") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - - succOf("_tmp_0", 3) shouldBe expected(("var {a, ...rest} = x", AlwaysEdge)) - succOf("var {a, ...rest} = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("_tmp_0.a", AlwaysEdge)) + succOf("_tmp_0.a") should contain theSameElementsAs expected(("a = _tmp_0.a", AlwaysEdge)) + + succOf("a = _tmp_0.a") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("rest", AlwaysEdge)) + succOf("rest") should contain theSameElementsAs expected(("...rest", AlwaysEdge)) + succOf("...rest") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var {a, ...rest} = x", AlwaysEdge)) + succOf("var {a, ...rest} = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for object destruction assignment with computed property name" in { implicit val cpg: Cpg = code("var {[propName]: n} = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("n", AlwaysEdge)) - succOf("n") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("propName", AlwaysEdge)) - succOf("propName") shouldBe expected(("_tmp_0.propName", AlwaysEdge)) - succOf("_tmp_0.propName") shouldBe expected(("n = _tmp_0.propName", AlwaysEdge)) - - succOf("n = _tmp_0.propName") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("var {[propName]: n} = x", AlwaysEdge)) - succOf("var {[propName]: n} = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("n", AlwaysEdge)) + succOf("n") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("propName", AlwaysEdge)) + succOf("propName") should contain theSameElementsAs expected(("_tmp_0.propName", AlwaysEdge)) + succOf("_tmp_0.propName") should contain theSameElementsAs expected(("n = _tmp_0.propName", AlwaysEdge)) + + succOf("n = _tmp_0.propName") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("var {[propName]: n} = x", AlwaysEdge)) + succOf("var {[propName]: n} = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested object destruction assignment with defaults as parameter" in { @@ -172,46 +180,50 @@ class MixedCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg |function userId({id = {}, b} = {}) { | return id |}""".stripMargin) - succOf("userId", NodeTypes.METHOD) shouldBe expected(("_tmp_1", AlwaysEdge)) - succOf("_tmp_1") shouldBe expected(("param1_0", AlwaysEdge)) - succOf("param1_0") shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("param1_0 === void 0", AlwaysEdge)) - succOf("param1_0 === void 0") shouldBe expected( + succOf("userId", NodeTypes.METHOD) should contain theSameElementsAs expected(("_tmp_1", AlwaysEdge)) + succOf("_tmp_1") should contain theSameElementsAs expected(("param1_0", AlwaysEdge)) + succOf("param1_0") should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("param1_0 === void 0", AlwaysEdge)) + succOf("param1_0 === void 0") should contain theSameElementsAs expected( ("_tmp_0", TrueEdge), // holds {} ("param1_0", 1, FalseEdge) ) - succOf("param1_0", 1) shouldBe expected(("param1_0 === void 0 ? {} : param1_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("param1_0 === void 0 ? {} : param1_0", AlwaysEdge)) - succOf("param1_0 === void 0 ? {} : param1_0") shouldBe expected( + succOf("param1_0", 1) should contain theSameElementsAs expected( + ("param1_0 === void 0 ? {} : param1_0", AlwaysEdge) + ) + succOf("_tmp_0") should contain theSameElementsAs expected(("param1_0 === void 0 ? {} : param1_0", AlwaysEdge)) + succOf("param1_0 === void 0 ? {} : param1_0") should contain theSameElementsAs expected( ("_tmp_1 = param1_0 === void 0 ? {} : param1_0", AlwaysEdge) ) - succOf("_tmp_1 = param1_0 === void 0 ? {} : param1_0") shouldBe expected(("id", AlwaysEdge)) - succOf("id") shouldBe expected(("_tmp_1", 1, AlwaysEdge)) - succOf("_tmp_1", 1) shouldBe expected(("id", 1, AlwaysEdge)) - succOf("id", 1) shouldBe expected(("_tmp_1.id", AlwaysEdge)) - succOf("_tmp_1.id") shouldBe expected(("void 0", 1, AlwaysEdge)) - succOf("void 0", 1) shouldBe expected(("_tmp_1.id === void 0", AlwaysEdge)) - succOf("_tmp_1.id === void 0") shouldBe expected( + succOf("_tmp_1 = param1_0 === void 0 ? {} : param1_0") should contain theSameElementsAs expected( + ("id", AlwaysEdge) + ) + succOf("id") should contain theSameElementsAs expected(("_tmp_1", 1, AlwaysEdge)) + succOf("_tmp_1", 1) should contain theSameElementsAs expected(("id", 1, AlwaysEdge)) + succOf("id", 1) should contain theSameElementsAs expected(("_tmp_1.id", AlwaysEdge)) + succOf("_tmp_1.id") should contain theSameElementsAs expected(("void 0", 1, AlwaysEdge)) + succOf("void 0", 1) should contain theSameElementsAs expected(("_tmp_1.id === void 0", AlwaysEdge)) + succOf("_tmp_1.id === void 0") should contain theSameElementsAs expected( ("_tmp_2", TrueEdge), // holds {} ("_tmp_1", 2, FalseEdge) ) - succOf("_tmp_2") shouldBe expected(("_tmp_1.id === void 0 ? {} : _tmp_1.id", AlwaysEdge)) - succOf("_tmp_1", 2) shouldBe expected(("id", 2, AlwaysEdge)) + succOf("_tmp_2") should contain theSameElementsAs expected(("_tmp_1.id === void 0 ? {} : _tmp_1.id", AlwaysEdge)) + succOf("_tmp_1", 2) should contain theSameElementsAs expected(("id", 2, AlwaysEdge)) - succOf("_tmp_1.id === void 0 ? {} : _tmp_1.id") shouldBe expected( + succOf("_tmp_1.id === void 0 ? {} : _tmp_1.id") should contain theSameElementsAs expected( ("id = _tmp_1.id === void 0 ? {} : _tmp_1.id", AlwaysEdge) ) - succOf("id", 2) shouldBe expected(("_tmp_1.id", 1, AlwaysEdge)) + succOf("id", 2) should contain theSameElementsAs expected(("_tmp_1.id", 1, AlwaysEdge)) - succOf("id = _tmp_1.id === void 0 ? {} : _tmp_1.id") shouldBe expected(("b", AlwaysEdge)) + succOf("id = _tmp_1.id === void 0 ? {} : _tmp_1.id") should contain theSameElementsAs expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_1", 3, AlwaysEdge)) - succOf("_tmp_1", 3) shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("_tmp_1.b", AlwaysEdge)) - succOf("_tmp_1.b") shouldBe expected(("b = _tmp_1.b", AlwaysEdge)) - succOf("b = _tmp_1.b") shouldBe expected(("_tmp_1", 4, AlwaysEdge)) - succOf("_tmp_1", 4) shouldBe expected(("{id = {}, b} = {}", 1, AlwaysEdge)) - succOf("{id = {}, b} = {}", 1) shouldBe expected(("id", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_1", 3, AlwaysEdge)) + succOf("_tmp_1", 3) should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("_tmp_1.b", AlwaysEdge)) + succOf("_tmp_1.b") should contain theSameElementsAs expected(("b = _tmp_1.b", AlwaysEdge)) + succOf("b = _tmp_1.b") should contain theSameElementsAs expected(("_tmp_1", 4, AlwaysEdge)) + succOf("_tmp_1", 4) should contain theSameElementsAs expected(("{id = {}, b} = {}", 1, AlwaysEdge)) + succOf("{id = {}, b} = {}", 1) should contain theSameElementsAs expected(("id", AlwaysEdge)) } @@ -220,151 +232,163 @@ class MixedCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg |function userId({id}) { | return id |}""".stripMargin) - succOf("userId", NodeTypes.METHOD) shouldBe expected(("id", AlwaysEdge)) - succOf("id") shouldBe expected(("param1_0", AlwaysEdge)) - succOf("param1_0") shouldBe expected(("id", 1, AlwaysEdge)) - succOf("id", 1) shouldBe expected(("param1_0.id", AlwaysEdge)) - succOf("param1_0.id") shouldBe expected(("id = param1_0.id", AlwaysEdge)) - succOf("id = param1_0.id") shouldBe expected(("id", 2, AlwaysEdge)) - succOf("id", 2) shouldBe expected(("return id", AlwaysEdge)) - succOf("return id") shouldBe expected(("RET", AlwaysEdge)) + succOf("userId", NodeTypes.METHOD) should contain theSameElementsAs expected(("id", AlwaysEdge)) + succOf("id") should contain theSameElementsAs expected(("param1_0", AlwaysEdge)) + succOf("param1_0") should contain theSameElementsAs expected(("id", 1, AlwaysEdge)) + succOf("id", 1) should contain theSameElementsAs expected(("param1_0.id", AlwaysEdge)) + succOf("param1_0.id") should contain theSameElementsAs expected(("id = param1_0.id", AlwaysEdge)) + succOf("id = param1_0.id") should contain theSameElementsAs expected(("id", 2, AlwaysEdge)) + succOf("id", 2) should contain theSameElementsAs expected(("return id", AlwaysEdge)) + succOf("return id") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment with declaration" in { implicit val cpg: Cpg = code("var [a, b] = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("_tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0]") shouldBe expected(("a = _tmp_0[0]", AlwaysEdge)) - - succOf("a = _tmp_0[0]") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("_tmp_0[1]", AlwaysEdge)) - succOf("_tmp_0[1]") shouldBe expected(("b = _tmp_0[1]", AlwaysEdge)) - succOf("b = _tmp_0[1]") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("var [a, b] = x", AlwaysEdge)) - succOf("var [a, b] = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("_tmp_0[0]", AlwaysEdge)) + succOf("_tmp_0[0]") should contain theSameElementsAs expected(("a = _tmp_0[0]", AlwaysEdge)) + + succOf("a = _tmp_0[0]") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("_tmp_0[1]", AlwaysEdge)) + succOf("_tmp_0[1]") should contain theSameElementsAs expected(("b = _tmp_0[1]", AlwaysEdge)) + succOf("b = _tmp_0[1]") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var [a, b] = x", AlwaysEdge)) + succOf("var [a, b] = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment without declaration" in { implicit val cpg: Cpg = code("[a, b] = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("_tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0]") shouldBe expected(("a = _tmp_0[0]", AlwaysEdge)) - - succOf("a = _tmp_0[0]") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("_tmp_0[1]", AlwaysEdge)) - succOf("_tmp_0[1]") shouldBe expected(("b = _tmp_0[1]", AlwaysEdge)) - succOf("b = _tmp_0[1]") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("[a, b] = x", AlwaysEdge)) - succOf("[a, b] = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("_tmp_0[0]", AlwaysEdge)) + succOf("_tmp_0[0]") should contain theSameElementsAs expected(("a = _tmp_0[0]", AlwaysEdge)) + + succOf("a = _tmp_0[0]") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("_tmp_0[1]", AlwaysEdge)) + succOf("_tmp_0[1]") should contain theSameElementsAs expected(("b = _tmp_0[1]", AlwaysEdge)) + succOf("b = _tmp_0[1]") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("[a, b] = x", AlwaysEdge)) + succOf("[a, b] = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment with defaults" in { implicit val cpg: Cpg = code("var [a = 1, b = 2] = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) // test statement - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("_tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0]") shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("_tmp_0[0] === void 0", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("_tmp_0[0]", AlwaysEdge)) + succOf("_tmp_0[0]") should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("_tmp_0[0] === void 0", AlwaysEdge)) // true, false cases - succOf("_tmp_0[0] === void 0") shouldBe expected(("1", TrueEdge), ("_tmp_0", 2, FalseEdge)) - succOf("_tmp_0", 2) shouldBe expected(("0", 1, AlwaysEdge)) - succOf("0", 1) shouldBe expected(("_tmp_0[0]", 1, AlwaysEdge)) - succOf("_tmp_0[0]", 1) shouldBe expected(("_tmp_0[0] === void 0 ? 1 : _tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0] === void 0 ? 1 : _tmp_0[0]") shouldBe expected( + succOf("_tmp_0[0] === void 0") should contain theSameElementsAs expected( + ("1", TrueEdge), + ("_tmp_0", 2, FalseEdge) + ) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("0", 1, AlwaysEdge)) + succOf("0", 1) should contain theSameElementsAs expected(("_tmp_0[0]", 1, AlwaysEdge)) + succOf("_tmp_0[0]", 1) should contain theSameElementsAs expected( + ("_tmp_0[0] === void 0 ? 1 : _tmp_0[0]", AlwaysEdge) + ) + succOf("_tmp_0[0] === void 0 ? 1 : _tmp_0[0]") should contain theSameElementsAs expected( ("a = _tmp_0[0] === void 0 ? 1 : _tmp_0[0]", AlwaysEdge) ) - succOf("a = _tmp_0[0] === void 0 ? 1 : _tmp_0[0]") shouldBe expected(("b", AlwaysEdge)) + succOf("a = _tmp_0[0] === void 0 ? 1 : _tmp_0[0]") should contain theSameElementsAs expected(("b", AlwaysEdge)) // test statement - succOf("b") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("1", 1, AlwaysEdge)) - succOf("1", 1) shouldBe expected(("_tmp_0[1]", AlwaysEdge)) - succOf("_tmp_0[1]") shouldBe expected(("void 0", 1, AlwaysEdge)) - succOf("void 0", 1) shouldBe expected(("_tmp_0[1] === void 0", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("1", 1, AlwaysEdge)) + succOf("1", 1) should contain theSameElementsAs expected(("_tmp_0[1]", AlwaysEdge)) + succOf("_tmp_0[1]") should contain theSameElementsAs expected(("void 0", 1, AlwaysEdge)) + succOf("void 0", 1) should contain theSameElementsAs expected(("_tmp_0[1] === void 0", AlwaysEdge)) // true, false cases - succOf("_tmp_0[1] === void 0") shouldBe expected(("2", TrueEdge), ("_tmp_0", 4, FalseEdge)) - succOf("_tmp_0", 4) shouldBe expected(("1", 2, AlwaysEdge)) - succOf("1", 2) shouldBe expected(("_tmp_0[1]", 1, AlwaysEdge)) - succOf("_tmp_0[1]", 1) shouldBe expected(("_tmp_0[1] === void 0 ? 2 : _tmp_0[1]", AlwaysEdge)) - succOf("_tmp_0[1] === void 0 ? 2 : _tmp_0[1]") shouldBe expected( + succOf("_tmp_0[1] === void 0") should contain theSameElementsAs expected( + ("2", TrueEdge), + ("_tmp_0", 4, FalseEdge) + ) + succOf("_tmp_0", 4) should contain theSameElementsAs expected(("1", 2, AlwaysEdge)) + succOf("1", 2) should contain theSameElementsAs expected(("_tmp_0[1]", 1, AlwaysEdge)) + succOf("_tmp_0[1]", 1) should contain theSameElementsAs expected( + ("_tmp_0[1] === void 0 ? 2 : _tmp_0[1]", AlwaysEdge) + ) + succOf("_tmp_0[1] === void 0 ? 2 : _tmp_0[1]") should contain theSameElementsAs expected( ("b = _tmp_0[1] === void 0 ? 2 : _tmp_0[1]", AlwaysEdge) ) - succOf("b = _tmp_0[1] === void 0 ? 2 : _tmp_0[1]") shouldBe expected(("_tmp_0", 5, AlwaysEdge)) - succOf("_tmp_0", 5) shouldBe expected(("var [a = 1, b = 2] = x", AlwaysEdge)) - succOf("var [a = 1, b = 2] = x") shouldBe expected(("RET", AlwaysEdge)) + succOf("b = _tmp_0[1] === void 0 ? 2 : _tmp_0[1]") should contain theSameElementsAs expected( + ("_tmp_0", 5, AlwaysEdge) + ) + succOf("_tmp_0", 5) should contain theSameElementsAs expected(("var [a = 1, b = 2] = x", AlwaysEdge)) + succOf("var [a = 1, b = 2] = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment with ignores" in { implicit val cpg: Cpg = code("var [a, , b] = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("_tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0]") shouldBe expected(("a = _tmp_0[0]", AlwaysEdge)) - - succOf("a = _tmp_0[0]") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("_tmp_0[2]", AlwaysEdge)) - succOf("_tmp_0[2]") shouldBe expected(("b = _tmp_0[2]", AlwaysEdge)) - succOf("b = _tmp_0[2]") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("var [a, , b] = x", AlwaysEdge)) - succOf("var [a, , b] = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("_tmp_0[0]", AlwaysEdge)) + succOf("_tmp_0[0]") should contain theSameElementsAs expected(("a = _tmp_0[0]", AlwaysEdge)) + + succOf("a = _tmp_0[0]") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("_tmp_0[2]", AlwaysEdge)) + succOf("_tmp_0[2]") should contain theSameElementsAs expected(("b = _tmp_0[2]", AlwaysEdge)) + succOf("b = _tmp_0[2]") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var [a, , b] = x", AlwaysEdge)) + succOf("var [a, , b] = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment with rest" in { implicit val cpg: Cpg = code("var [a, ...rest] = x") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0 = x", AlwaysEdge)) - - succOf("_tmp_0 = x") shouldBe expected(("a", AlwaysEdge)) - - succOf("a") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("_tmp_0[0]", AlwaysEdge)) - succOf("_tmp_0[0]") shouldBe expected(("a = _tmp_0[0]", AlwaysEdge)) - - succOf("a = _tmp_0[0]") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("_tmp_0[1]", AlwaysEdge)) - succOf("_tmp_0[1]") shouldBe expected(("rest", AlwaysEdge)) - succOf("rest") shouldBe expected(("...rest", AlwaysEdge)) - succOf("...rest") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("var [a, ...rest] = x", AlwaysEdge)) - succOf("var [a, ...rest] = x") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0 = x", AlwaysEdge)) + + succOf("_tmp_0 = x") should contain theSameElementsAs expected(("a", AlwaysEdge)) + + succOf("a") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("_tmp_0[0]", AlwaysEdge)) + succOf("_tmp_0[0]") should contain theSameElementsAs expected(("a = _tmp_0[0]", AlwaysEdge)) + + succOf("a = _tmp_0[0]") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("_tmp_0[1]", AlwaysEdge)) + succOf("_tmp_0[1]") should contain theSameElementsAs expected(("rest", AlwaysEdge)) + succOf("rest") should contain theSameElementsAs expected(("...rest", AlwaysEdge)) + succOf("...rest") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("var [a, ...rest] = x", AlwaysEdge)) + succOf("var [a, ...rest] = x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for array destruction assignment as parameter" in { @@ -373,25 +397,25 @@ class MixedCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg | return id |} |""".stripMargin) - succOf("userId", NodeTypes.METHOD) shouldBe expected(("id", AlwaysEdge)) - succOf("id") shouldBe expected(("param1_0", AlwaysEdge)) - succOf("param1_0") shouldBe expected(("id", 1, AlwaysEdge)) - succOf("id", 1) shouldBe expected(("param1_0.id", AlwaysEdge)) - succOf("param1_0.id") shouldBe expected(("id = param1_0.id", AlwaysEdge)) - succOf("id = param1_0.id") shouldBe expected(("id", 2, AlwaysEdge)) - succOf("id", 2) shouldBe expected(("return id", AlwaysEdge)) - succOf("return id") shouldBe expected(("RET", AlwaysEdge)) + succOf("userId", NodeTypes.METHOD) should contain theSameElementsAs expected(("id", AlwaysEdge)) + succOf("id") should contain theSameElementsAs expected(("param1_0", AlwaysEdge)) + succOf("param1_0") should contain theSameElementsAs expected(("id", 1, AlwaysEdge)) + succOf("id", 1) should contain theSameElementsAs expected(("param1_0.id", AlwaysEdge)) + succOf("param1_0.id") should contain theSameElementsAs expected(("id = param1_0.id", AlwaysEdge)) + succOf("id = param1_0.id") should contain theSameElementsAs expected(("id", 2, AlwaysEdge)) + succOf("id", 2) should contain theSameElementsAs expected(("return id", AlwaysEdge)) + succOf("return id") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "CFG generation for spread arguments" should { "have correct structure for method spread argument" in { implicit val cpg: Cpg = code("foo(...args)") - succOf(":program") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("args", AlwaysEdge)) - succOf("args") shouldBe expected(("...args", AlwaysEdge)) - succOf("...args") shouldBe expected(("foo(...args)", AlwaysEdge)) - succOf("foo(...args)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("args", AlwaysEdge)) + succOf("args") should contain theSameElementsAs expected(("...args", AlwaysEdge)) + succOf("...args") should contain theSameElementsAs expected(("foo(...args)", AlwaysEdge)) + succOf("foo(...args)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } @@ -400,110 +424,110 @@ class MixedCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg "CFG generation for await/async" should { "be correct for await/async" in { implicit val cpg: Cpg = code("async function x(foo) { await foo() }") - succOf("x", NodeTypes.METHOD) shouldBe expected(("foo", AlwaysEdge)) - succOf("foo", NodeTypes.IDENTIFIER) shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("foo()", AlwaysEdge)) - succOf("foo()") shouldBe expected(("await foo()", AlwaysEdge)) - succOf("await foo()") shouldBe expected(("RET", AlwaysEdge)) + succOf("x", NodeTypes.METHOD) should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("foo()", AlwaysEdge)) + succOf("foo()") should contain theSameElementsAs expected(("await foo()", AlwaysEdge)) + succOf("await foo()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } "CFG generation for instanceof/delete" should { "be correct for instanceof" in { implicit val cpg: Cpg = code("x instanceof Foo") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("Foo", AlwaysEdge)) - succOf("Foo") shouldBe expected(("x instanceof Foo", AlwaysEdge)) - succOf("x instanceof Foo", NodeTypes.CALL) shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("Foo", AlwaysEdge)) + succOf("Foo") should contain theSameElementsAs expected(("x instanceof Foo", AlwaysEdge)) + succOf("x instanceof Foo", NodeTypes.CALL) should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for delete" in { implicit val cpg: Cpg = code("delete foo.x") - succOf(":program") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("foo.x", AlwaysEdge)) - succOf("foo.x") shouldBe expected(("delete foo.x", AlwaysEdge)) - succOf("delete foo.x", NodeTypes.CALL) shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("foo.x", AlwaysEdge)) + succOf("foo.x") should contain theSameElementsAs expected(("delete foo.x", AlwaysEdge)) + succOf("delete foo.x", NodeTypes.CALL) should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } "CFG generation for default parameters" should { "be correct for method parameter with default" in { implicit val cpg: Cpg = code("function foo(a = 1) { }") - cpg.method.nameExact("foo").parameter.code.l shouldBe List("this", "a = 1") - - succOf("foo", NodeTypes.METHOD) shouldBe expected(("a", AlwaysEdge)) - succOf("a", NodeTypes.IDENTIFIER) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("a === void 0", AlwaysEdge)) - succOf("a === void 0") shouldBe expected(("1", TrueEdge), ("a", 2, FalseEdge)) - succOf("1") shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a", 2) shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a === void 0 ? 1 : a") shouldBe expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a = a === void 0 ? 1 : a") shouldBe expected(("RET", AlwaysEdge)) + cpg.method.nameExact("foo").parameter.code.l should contain theSameElementsAs List("this", "a = 1") + + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("a === void 0", AlwaysEdge)) + succOf("a === void 0") should contain theSameElementsAs expected(("1", TrueEdge), ("a", 2, FalseEdge)) + succOf("1") should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a", 2) should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a === void 0 ? 1 : a") should contain theSameElementsAs expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a = a === void 0 ? 1 : a") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for multiple method parameters with default" in { implicit val cpg: Cpg = code("function foo(a = 1, b = 2) { }") - cpg.method.nameExact("foo").parameter.code.l shouldBe List("this", "a = 1", "b = 2") - - succOf("foo", NodeTypes.METHOD) shouldBe expected(("a", AlwaysEdge)) - succOf("a", NodeTypes.IDENTIFIER) shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("a === void 0", AlwaysEdge)) - succOf("a === void 0") shouldBe expected(("1", TrueEdge), ("a", 2, FalseEdge)) - succOf("1") shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a", 2) shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a === void 0 ? 1 : a") shouldBe expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a = a === void 0 ? 1 : a") shouldBe expected(("b", AlwaysEdge)) - - succOf("b", NodeTypes.IDENTIFIER) shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("void 0", 1, AlwaysEdge)) - succOf("void 0", 1) shouldBe expected(("b === void 0", AlwaysEdge)) - succOf("b === void 0") shouldBe expected(("2", TrueEdge), ("b", 2, FalseEdge)) - succOf("2") shouldBe expected(("b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b", 2) shouldBe expected(("b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b === void 0 ? 2 : b") shouldBe expected(("b = b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b = b === void 0 ? 2 : b") shouldBe expected(("RET", AlwaysEdge)) + cpg.method.nameExact("foo").parameter.code.l should contain theSameElementsAs List("this", "a = 1", "b = 2") + + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("a === void 0", AlwaysEdge)) + succOf("a === void 0") should contain theSameElementsAs expected(("1", TrueEdge), ("a", 2, FalseEdge)) + succOf("1") should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a", 2) should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a === void 0 ? 1 : a") should contain theSameElementsAs expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a = a === void 0 ? 1 : a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + + succOf("b", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("void 0", 1, AlwaysEdge)) + succOf("void 0", 1) should contain theSameElementsAs expected(("b === void 0", AlwaysEdge)) + succOf("b === void 0") should contain theSameElementsAs expected(("2", TrueEdge), ("b", 2, FalseEdge)) + succOf("2") should contain theSameElementsAs expected(("b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b", 2) should contain theSameElementsAs expected(("b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b === void 0 ? 2 : b") should contain theSameElementsAs expected(("b = b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b = b === void 0 ? 2 : b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for method mixed parameters with default" in { implicit val cpg: Cpg = code("function foo(a, b = 1) { }") - cpg.method.nameExact("foo").parameter.code.l shouldBe List("this", "a", "b = 1") - - succOf("foo", NodeTypes.METHOD) shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("b === void 0", AlwaysEdge)) - succOf("b === void 0") shouldBe expected(("1", TrueEdge), ("b", 2, FalseEdge)) - succOf("1") shouldBe expected(("b === void 0 ? 1 : b", AlwaysEdge)) - succOf("b", 2) shouldBe expected(("b === void 0 ? 1 : b", AlwaysEdge)) - succOf("b === void 0 ? 1 : b") shouldBe expected(("b = b === void 0 ? 1 : b", AlwaysEdge)) - succOf("b = b === void 0 ? 1 : b") shouldBe expected(("RET", AlwaysEdge)) + cpg.method.nameExact("foo").parameter.code.l should contain theSameElementsAs List("this", "a", "b = 1") + + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("b === void 0", AlwaysEdge)) + succOf("b === void 0") should contain theSameElementsAs expected(("1", TrueEdge), ("b", 2, FalseEdge)) + succOf("1") should contain theSameElementsAs expected(("b === void 0 ? 1 : b", AlwaysEdge)) + succOf("b", 2) should contain theSameElementsAs expected(("b === void 0 ? 1 : b", AlwaysEdge)) + succOf("b === void 0 ? 1 : b") should contain theSameElementsAs expected(("b = b === void 0 ? 1 : b", AlwaysEdge)) + succOf("b = b === void 0 ? 1 : b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for multiple method mixed parameters with default" in { implicit val cpg: Cpg = code("function foo(x, a = 1, b = 2) { }") - cpg.method.nameExact("foo").parameter.code.l shouldBe List("this", "x", "a = 1", "b = 2") - - succOf("foo", NodeTypes.METHOD) shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("a", 1, AlwaysEdge)) - succOf("a", 1) shouldBe expected(("void 0", AlwaysEdge)) - succOf("void 0") shouldBe expected(("a === void 0", AlwaysEdge)) - succOf("a === void 0") shouldBe expected(("1", TrueEdge), ("a", 2, FalseEdge)) - succOf("1") shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a", 2) shouldBe expected(("a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a === void 0 ? 1 : a") shouldBe expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) - succOf("a = a === void 0 ? 1 : a") shouldBe expected(("b", AlwaysEdge)) - - succOf("b") shouldBe expected(("b", 1, AlwaysEdge)) - succOf("b", 1) shouldBe expected(("void 0", 1, AlwaysEdge)) - succOf("void 0", 1) shouldBe expected(("b === void 0", AlwaysEdge)) - succOf("b === void 0") shouldBe expected(("2", TrueEdge), ("b", 2, FalseEdge)) - succOf("2") shouldBe expected(("b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b", 2) shouldBe expected(("b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b === void 0 ? 2 : b") shouldBe expected(("b = b === void 0 ? 2 : b", AlwaysEdge)) - succOf("b = b === void 0 ? 2 : b") shouldBe expected(("RET", AlwaysEdge)) + cpg.method.nameExact("foo").parameter.code.l should contain theSameElementsAs List("this", "x", "a = 1", "b = 2") + + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("a", 1, AlwaysEdge)) + succOf("a", 1) should contain theSameElementsAs expected(("void 0", AlwaysEdge)) + succOf("void 0") should contain theSameElementsAs expected(("a === void 0", AlwaysEdge)) + succOf("a === void 0") should contain theSameElementsAs expected(("1", TrueEdge), ("a", 2, FalseEdge)) + succOf("1") should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a", 2) should contain theSameElementsAs expected(("a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a === void 0 ? 1 : a") should contain theSameElementsAs expected(("a = a === void 0 ? 1 : a", AlwaysEdge)) + succOf("a = a === void 0 ? 1 : a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + + succOf("b") should contain theSameElementsAs expected(("b", 1, AlwaysEdge)) + succOf("b", 1) should contain theSameElementsAs expected(("void 0", 1, AlwaysEdge)) + succOf("void 0", 1) should contain theSameElementsAs expected(("b === void 0", AlwaysEdge)) + succOf("b === void 0") should contain theSameElementsAs expected(("2", TrueEdge), ("b", 2, FalseEdge)) + succOf("2") should contain theSameElementsAs expected(("b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b", 2) should contain theSameElementsAs expected(("b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b === void 0 ? 2 : b") should contain theSameElementsAs expected(("b = b === void 0 ? 2 : b", AlwaysEdge)) + succOf("b = b === void 0 ? 2 : b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/SimpleCfgCreationPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/SimpleCfgCreationPassTests.scala index ec763e411565..35caf9728ac7 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/SimpleCfgCreationPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/cfg/SimpleCfgCreationPassTests.scala @@ -3,7 +3,7 @@ package io.joern.jssrc2cpg.passes.cfg import io.joern.jssrc2cpg.testfixtures.JsSrcCfgTestCpg import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.{AlwaysEdge, CaseEdge, FalseEdge, TrueEdge} import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{NodeTypes, Operators} class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCpg()) { @@ -11,85 +11,99 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp "CFG generation for simple fragments" should { "have correct structure for block expression" in { implicit val cpg: Cpg = code("let x = (class Foo {}, bar())") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("class Foo", AlwaysEdge)) - succOf("class Foo") shouldBe expected(("bar", AlwaysEdge)) - succOf("bar") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("bar()", AlwaysEdge)) - succOf("bar()") shouldBe expected(("class Foo {}, bar()", AlwaysEdge)) - succOf("class Foo {}, bar()") shouldBe expected(("let x = (class Foo {}, bar())", AlwaysEdge)) - succOf("let x = (class Foo {}, bar())") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("class Foo", AlwaysEdge)) + succOf("class Foo") should contain theSameElementsAs expected(("bar", AlwaysEdge)) + succOf("bar") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("bar()", AlwaysEdge)) + succOf("bar()") should contain theSameElementsAs expected(("class Foo {}, bar()", AlwaysEdge)) + succOf("class Foo {}, bar()") should contain theSameElementsAs expected( + ("let x = (class Foo {}, bar())", AlwaysEdge) + ) + succOf("let x = (class Foo {}, bar())") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "have correct structure for empty array literal" in { implicit val cpg: Cpg = code("var x = []") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("__ecma.Array.factory()", AlwaysEdge)) - succOf("__ecma.Array.factory()") shouldBe expected(("var x = []", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("__ecma.Array.factory()", AlwaysEdge)) + succOf("__ecma.Array.factory()") should contain theSameElementsAs expected(("var x = []", AlwaysEdge)) } "have correct structure for array literal with values" in { implicit val cpg: Cpg = code("var x = [1, 2]") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("__ecma.Array.factory()", AlwaysEdge)) - succOf("__ecma.Array.factory()") shouldBe expected(("_tmp_0 = __ecma.Array.factory()", AlwaysEdge)) - - succOf("_tmp_0 = __ecma.Array.factory()") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("push", AlwaysEdge)) - succOf("push") shouldBe expected(("_tmp_0.push", AlwaysEdge)) - succOf("_tmp_0.push") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("_tmp_0.push(1)", AlwaysEdge)) - - succOf("_tmp_0.push(1)") shouldBe expected(("_tmp_0", 3, AlwaysEdge)) - succOf("_tmp_0", 3) shouldBe expected(("push", 1, AlwaysEdge)) - succOf("push", 1) shouldBe expected(("_tmp_0.push", 1, AlwaysEdge)) - succOf("_tmp_0.push", 1) shouldBe expected(("_tmp_0", 4, AlwaysEdge)) - succOf("_tmp_0", 4) shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("_tmp_0.push(2)", AlwaysEdge)) - - succOf("_tmp_0.push(2)") shouldBe expected(("_tmp_0", 5, AlwaysEdge)) - succOf("_tmp_0", 5) shouldBe expected(("[1, 2]", AlwaysEdge)) - succOf("[1, 2]") shouldBe expected(("var x = [1, 2]", AlwaysEdge)) - succOf("var x = [1, 2]") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("__ecma.Array.factory()", AlwaysEdge)) + succOf("__ecma.Array.factory()") should contain theSameElementsAs expected( + ("_tmp_0 = __ecma.Array.factory()", AlwaysEdge) + ) + + succOf("_tmp_0 = __ecma.Array.factory()") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("push", AlwaysEdge)) + succOf("push") should contain theSameElementsAs expected(("_tmp_0.push", AlwaysEdge)) + succOf("_tmp_0.push") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("_tmp_0.push(1)", AlwaysEdge)) + + succOf("_tmp_0.push(1)") should contain theSameElementsAs expected(("_tmp_0", 3, AlwaysEdge)) + succOf("_tmp_0", 3) should contain theSameElementsAs expected(("push", 1, AlwaysEdge)) + succOf("push", 1) should contain theSameElementsAs expected(("_tmp_0.push", 1, AlwaysEdge)) + succOf("_tmp_0.push", 1) should contain theSameElementsAs expected(("_tmp_0", 4, AlwaysEdge)) + succOf("_tmp_0", 4) should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("_tmp_0.push(2)", AlwaysEdge)) + + succOf("_tmp_0.push(2)") should contain theSameElementsAs expected(("_tmp_0", 5, AlwaysEdge)) + succOf("_tmp_0", 5) should contain theSameElementsAs expected(("[1, 2]", AlwaysEdge)) + succOf("[1, 2]") should contain theSameElementsAs expected(("var x = [1, 2]", AlwaysEdge)) + succOf("var x = [1, 2]") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "have correct structure for untagged runtime node in call" in { implicit val cpg: Cpg = code(s"foo(`Hello $${world}!`)") - succOf(":program") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("\"Hello \"", AlwaysEdge)) - succOf("\"Hello \"") shouldBe expected(("world", AlwaysEdge)) - succOf("world") shouldBe expected(("\"!\"", AlwaysEdge)) - succOf("\"!\"") shouldBe expected((s"${Operators.formatString}(\"Hello \", world, \"!\")", AlwaysEdge)) - succOf(s"${Operators.formatString}(\"Hello \", world, \"!\")") shouldBe expected( + succOf(":program") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("\"Hello \"", AlwaysEdge)) + succOf("\"Hello \"") should contain theSameElementsAs expected(("world", AlwaysEdge)) + succOf("world") should contain theSameElementsAs expected(("\"!\"", AlwaysEdge)) + succOf("\"!\"") should contain theSameElementsAs expected( + (s"${Operators.formatString}(\"Hello \", world, \"!\")", AlwaysEdge) + ) + succOf(s"${Operators.formatString}(\"Hello \", world, \"!\")") should contain theSameElementsAs expected( (s"foo(`Hello $${world}!`)", AlwaysEdge) ) - succOf(s"foo(`Hello $${world}!`)") shouldBe expected(("RET", AlwaysEdge)) + succOf(s"foo(`Hello $${world}!`)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "have correct structure for untagged runtime node" in { implicit val cpg: Cpg = code(s"`$${x + 1}`") - succOf(":program") shouldBe expected(("\"\"", AlwaysEdge)) - succOf("\"\"") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x + 1", AlwaysEdge)) - succOf("x + 1") shouldBe expected(("\"\"", 1, AlwaysEdge)) - succOf("\"\"", 1) shouldBe expected((s"${Operators.formatString}(\"\", x + 1, \"\")", AlwaysEdge)) - succOf(s"${Operators.formatString}(\"\", x + 1, \"\")") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("\"\"", AlwaysEdge)) + succOf("\"\"") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x + 1", AlwaysEdge)) + succOf("x + 1") should contain theSameElementsAs expected(("\"\"", 1, AlwaysEdge)) + succOf("\"\"", 1) should contain theSameElementsAs expected( + (s"${Operators.formatString}(\"\", x + 1, \"\")", AlwaysEdge) + ) + succOf(s"${Operators.formatString}(\"\", x + 1, \"\")") should contain theSameElementsAs expected( + ("RET", AlwaysEdge) + ) } "have correct structure for tagged runtime node" in { implicit val cpg: Cpg = code(s"String.raw`../$${42}\\..`") - succOf(":program") shouldBe expected(("\"../\"", AlwaysEdge)) - succOf("\"../\"") shouldBe expected(("42", AlwaysEdge)) - succOf("42") shouldBe expected(("\"\\..\"", AlwaysEdge)) - succOf("\"\\..\"") shouldBe expected((s"${Operators.formatString}(\"../\", 42, \"\\..\")", AlwaysEdge)) - succOf(s"${Operators.formatString}(\"../\", 42, \"\\..\")") shouldBe expected( + succOf(":program") should contain theSameElementsAs expected(("\"../\"", AlwaysEdge)) + succOf("\"../\"") should contain theSameElementsAs expected(("42", AlwaysEdge)) + succOf("42") should contain theSameElementsAs expected(("\"\\..\"", AlwaysEdge)) + succOf("\"\\..\"") should contain theSameElementsAs expected( + (s"${Operators.formatString}(\"../\", 42, \"\\..\")", AlwaysEdge) + ) + succOf(s"${Operators.formatString}(\"../\", 42, \"\\..\")") should contain theSameElementsAs expected( (s"String.raw(${Operators.formatString}(\"../\", 42, \"\\..\"))", AlwaysEdge) ) - succOf(s"String.raw(${Operators.formatString}(\"../\", 42, \"\\..\"))") shouldBe expected(("RET", AlwaysEdge)) + succOf(s"String.raw(${Operators.formatString}(\"../\", 42, \"\\..\"))") should contain theSameElementsAs expected( + ("RET", AlwaysEdge) + ) } "be correct for try" in { @@ -102,13 +116,13 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp | close() |} |""".stripMargin) - succOf(":program") shouldBe expected(("open", AlwaysEdge)) - succOf("open") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("open()", AlwaysEdge)) - succOf("open()") shouldBe expected(("err", AlwaysEdge), ("close", AlwaysEdge)) - succOf("err") shouldBe expected(("handle", AlwaysEdge)) - succOf("handle()") shouldBe expected(("close", AlwaysEdge)) - succOf("close()") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("open", AlwaysEdge)) + succOf("open") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("open()", AlwaysEdge)) + succOf("open()") should contain theSameElementsAs expected(("err", AlwaysEdge), ("close", AlwaysEdge)) + succOf("err") should contain theSameElementsAs expected(("handle", AlwaysEdge)) + succOf("handle()") should contain theSameElementsAs expected(("close", AlwaysEdge)) + succOf("close()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for try with multiple CFG exit nodes in try block" in { @@ -125,14 +139,14 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp | close() |} |""".stripMargin) - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("doA", TrueEdge), ("doB", FalseEdge)) - succOf("doA()") shouldBe expected(("err", AlwaysEdge), ("close", AlwaysEdge)) - succOf("err") shouldBe expected(("handle", AlwaysEdge)) - succOf("doB()") shouldBe expected(("err", AlwaysEdge), ("close", AlwaysEdge)) - succOf("err") shouldBe expected(("handle", AlwaysEdge)) - succOf("handle()") shouldBe expected(("close", AlwaysEdge)) - succOf("close()") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("doA", TrueEdge), ("doB", FalseEdge)) + succOf("doA()") should contain theSameElementsAs expected(("err", AlwaysEdge), ("close", AlwaysEdge)) + succOf("err") should contain theSameElementsAs expected(("handle", AlwaysEdge)) + succOf("doB()") should contain theSameElementsAs expected(("err", AlwaysEdge), ("close", AlwaysEdge)) + succOf("err") should contain theSameElementsAs expected(("handle", AlwaysEdge)) + succOf("handle()") should contain theSameElementsAs expected(("close", AlwaysEdge)) + succOf("close()") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for 1 object with simple values" in { @@ -142,133 +156,135 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp | key2: 2 |} |""".stripMargin) - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("key1", AlwaysEdge)) - succOf("key1") shouldBe expected(("_tmp_0.key1", AlwaysEdge)) - succOf("_tmp_0.key1") shouldBe expected(("\"value\"", AlwaysEdge)) - succOf("\"value\"") shouldBe expected(("_tmp_0.key1 = \"value\"", AlwaysEdge)) - - succOf("_tmp_0.key1 = \"value\"") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("key2", AlwaysEdge)) - succOf("key2") shouldBe expected(("_tmp_0.key2", AlwaysEdge)) - succOf("_tmp_0.key2") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("_tmp_0.key2 = 2", AlwaysEdge)) - - succOf("_tmp_0.key2 = 2") shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("{\n key1: \"value\",\n key2: 2\n}", AlwaysEdge)) - succOf("{\n key1: \"value\",\n key2: 2\n}") shouldBe expected( + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("key1", AlwaysEdge)) + succOf("key1") should contain theSameElementsAs expected(("_tmp_0.key1", AlwaysEdge)) + succOf("_tmp_0.key1") should contain theSameElementsAs expected(("\"value\"", AlwaysEdge)) + succOf("\"value\"") should contain theSameElementsAs expected(("_tmp_0.key1 = \"value\"", AlwaysEdge)) + + succOf("_tmp_0.key1 = \"value\"") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("key2", AlwaysEdge)) + succOf("key2") should contain theSameElementsAs expected(("_tmp_0.key2", AlwaysEdge)) + succOf("_tmp_0.key2") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("_tmp_0.key2 = 2", AlwaysEdge)) + + succOf("_tmp_0.key2 = 2") should contain theSameElementsAs expected(("_tmp_0", 2, AlwaysEdge)) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("{\n key1: \"value\",\n key2: 2\n}", AlwaysEdge)) + succOf("{\n key1: \"value\",\n key2: 2\n}") should contain theSameElementsAs expected( ("var x = {\n key1: \"value\",\n key2: 2\n}", AlwaysEdge) ) - succOf("var x = {\n key1: \"value\",\n key2: 2\n}") shouldBe expected(("RET", AlwaysEdge)) + succOf("var x = {\n key1: \"value\",\n key2: 2\n}") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for member access used in an assignment (chained)" in { implicit val cpg: Cpg = code("a.b = c.z;") - succOf(":program") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("a.b", AlwaysEdge)) - succOf("a.b") shouldBe expected(("c", AlwaysEdge)) - succOf("c") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("c.z", AlwaysEdge)) - succOf("c.z") shouldBe expected(("a.b = c.z", AlwaysEdge)) - succOf("a.b = c.z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("a.b", AlwaysEdge)) + succOf("a.b") should contain theSameElementsAs expected(("c", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("c.z", AlwaysEdge)) + succOf("c.z") should contain theSameElementsAs expected(("a.b = c.z", AlwaysEdge)) + succOf("a.b = c.z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for decl statement with assignment" in { implicit val cpg: Cpg = code("var x = 1;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("var x = 1", AlwaysEdge)) - succOf("var x = 1") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("var x = 1", AlwaysEdge)) + succOf("var x = 1") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested expression" in { implicit val cpg: Cpg = code("x = y + 1;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y + 1", AlwaysEdge)) - succOf("y + 1") shouldBe expected(("x = y + 1", AlwaysEdge)) - succOf("x = y + 1") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y + 1", AlwaysEdge)) + succOf("y + 1") should contain theSameElementsAs expected(("x = y + 1", AlwaysEdge)) + succOf("x = y + 1") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for return statement" in { implicit val cpg: Cpg = code("function foo(x) { return x; }") - succOf("foo", NodeTypes.METHOD) shouldBe expected(("x", AlwaysEdge)) - succOf("x", NodeTypes.IDENTIFIER) shouldBe expected(("return x", AlwaysEdge)) - succOf("return x") shouldBe expected(("RET", AlwaysEdge)) + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("return x", AlwaysEdge)) + succOf("return x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for consecutive return statements" in { implicit val cpg: Cpg = code("function foo(x, y) { return x; return y; }") - succOf("foo", NodeTypes.METHOD) shouldBe expected(("x", AlwaysEdge)) - succOf("x", NodeTypes.IDENTIFIER) shouldBe expected(("return x", AlwaysEdge)) - succOf("y", NodeTypes.IDENTIFIER) shouldBe expected(("return y", AlwaysEdge)) - succOf("return x") shouldBe expected(("RET", AlwaysEdge)) - succOf("return y") shouldBe expected(("RET", AlwaysEdge)) + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("return x", AlwaysEdge)) + succOf("y", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("return y", AlwaysEdge)) + succOf("return x") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("return y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for outer program function which declares foo function object" in { implicit val cpg: Cpg = code("function foo(x, y) { return; }") - succOf(":program", NodeTypes.METHOD) shouldBe expected(("foo", 2, AlwaysEdge)) - succOf("foo", NodeTypes.IDENTIFIER) shouldBe expected(("foo", 3, AlwaysEdge)) - succOf("foo", NodeTypes.METHOD_REF) shouldBe expected( + succOf(":program", NodeTypes.METHOD) should contain theSameElementsAs expected(("foo", 2, AlwaysEdge)) + succOf("foo", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("foo", 3, AlwaysEdge)) + succOf("foo", NodeTypes.METHOD_REF) should contain theSameElementsAs expected( ("function foo = function foo(x, y) { return; }", AlwaysEdge) ) - succOf("function foo = function foo(x, y) { return; }") shouldBe expected(("RET", AlwaysEdge)) + succOf("function foo = function foo(x, y) { return; }") should contain theSameElementsAs expected( + ("RET", AlwaysEdge) + ) } "be correct for void return statement" in { implicit val cpg: Cpg = code("function foo() { return; }") - succOf("foo", NodeTypes.METHOD) shouldBe expected(("return", AlwaysEdge)) - succOf("return") shouldBe expected(("RET", AlwaysEdge)) + succOf("foo", NodeTypes.METHOD) should contain theSameElementsAs expected(("return", AlwaysEdge)) + succOf("return") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for call expression" in { implicit val cpg: Cpg = code("foo(a + 1, b);") - succOf(":program") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("this", AlwaysEdge)) - succOf("this", NodeTypes.IDENTIFIER) shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("a + 1", AlwaysEdge)) - succOf("a + 1") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("foo(a + 1, b)", AlwaysEdge)) - succOf("foo(a + 1, b)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("this", AlwaysEdge)) + succOf("this", NodeTypes.IDENTIFIER) should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("a + 1", AlwaysEdge)) + succOf("a + 1") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("foo(a + 1, b)", AlwaysEdge)) + succOf("foo(a + 1, b)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for chained calls" in { implicit val cpg: Cpg = code("x.foo(y).bar(z)") - succOf(":program") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("x.foo", AlwaysEdge)) - succOf("x.foo") shouldBe expected(("x", 1, AlwaysEdge)) - succOf("x", 1) shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("x.foo(y)", AlwaysEdge)) - succOf("x.foo(y)") shouldBe expected(("(_tmp_0 = x.foo(y))", AlwaysEdge)) - succOf("(_tmp_0 = x.foo(y))") shouldBe expected(("bar", AlwaysEdge)) - succOf("bar") shouldBe expected(("(_tmp_0 = x.foo(y)).bar", AlwaysEdge)) - succOf("(_tmp_0 = x.foo(y)).bar") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("x.foo(y).bar(z)", AlwaysEdge)) - succOf("x.foo(y).bar(z)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("x.foo", AlwaysEdge)) + succOf("x.foo") should contain theSameElementsAs expected(("x", 1, AlwaysEdge)) + succOf("x", 1) should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x.foo(y)", AlwaysEdge)) + succOf("x.foo(y)") should contain theSameElementsAs expected(("(_tmp_0 = x.foo(y))", AlwaysEdge)) + succOf("(_tmp_0 = x.foo(y))") should contain theSameElementsAs expected(("bar", AlwaysEdge)) + succOf("bar") should contain theSameElementsAs expected(("(_tmp_0 = x.foo(y)).bar", AlwaysEdge)) + succOf("(_tmp_0 = x.foo(y)).bar") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("x.foo(y).bar(z)", AlwaysEdge)) + succOf("x.foo(y).bar(z)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for unary expression '++'" in { implicit val cpg: Cpg = code("x++") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("x++", AlwaysEdge)) - succOf("x++") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("x++", AlwaysEdge)) + succOf("x++") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for conditional expression" in { implicit val cpg: Cpg = code("x ? y : z;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("z", FalseEdge)) - succOf("y") shouldBe expected(("x ? y : z", AlwaysEdge)) - succOf("z") shouldBe expected(("x ? y : z", AlwaysEdge)) - succOf("x ? y : z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("z", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("x ? y : z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("x ? y : z", AlwaysEdge)) + succOf("x ? y : z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for labeled expressions with continue" in { @@ -283,98 +299,101 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp | } |} |""".stripMargin) - succOf(":program") shouldBe expected(("var i, j;", AlwaysEdge)) - succOf("loop1:") shouldBe expected(("i", AlwaysEdge)) - succOf("i") shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("i = 0", AlwaysEdge)) - succOf("i = 0") shouldBe expected(("i", 1, AlwaysEdge)) - succOf("i", 1) shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("i < 3", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("var i, j;", AlwaysEdge)) + succOf("loop1:") should contain theSameElementsAs expected(("i", AlwaysEdge)) + succOf("i") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("i = 0", AlwaysEdge)) + succOf("i = 0") should contain theSameElementsAs expected(("i", 1, AlwaysEdge)) + succOf("i", 1) should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("i < 3", AlwaysEdge)) import io.shiftleft.semanticcpg.language._ val codeStr = cpg.method.ast.code(".*loop1:.*").code.head - succOf("i < 3") shouldBe expected(("loop2:", AlwaysEdge), (codeStr, AlwaysEdge)) - succOf(codeStr) shouldBe expected(("RET", AlwaysEdge)) + succOf("i < 3") should contain theSameElementsAs expected(("loop2:", AlwaysEdge), (codeStr, AlwaysEdge)) + succOf(codeStr) should contain theSameElementsAs expected(("RET", AlwaysEdge)) - succOf("loop2:") shouldBe expected(("j", AlwaysEdge)) - succOf("j") shouldBe expected(("0", 1, AlwaysEdge)) - succOf("0", 1) shouldBe expected(("j = 0", AlwaysEdge)) - succOf("j = 0") shouldBe expected(("j", 1, AlwaysEdge)) - succOf("j", 1) shouldBe expected(("3", 1, AlwaysEdge)) - succOf("3", 1) shouldBe expected(("j < 3", AlwaysEdge)) + succOf("loop2:") should contain theSameElementsAs expected(("j", AlwaysEdge)) + succOf("j") should contain theSameElementsAs expected(("0", 1, AlwaysEdge)) + succOf("0", 1) should contain theSameElementsAs expected(("j = 0", AlwaysEdge)) + succOf("j = 0") should contain theSameElementsAs expected(("j", 1, AlwaysEdge)) + succOf("j", 1) should contain theSameElementsAs expected(("3", 1, AlwaysEdge)) + succOf("3", 1) should contain theSameElementsAs expected(("j < 3", AlwaysEdge)) val code2 = cpg.method.ast.isBlock.code("loop2: for.*").code.head - succOf("j < 3") shouldBe expected((code2, AlwaysEdge), ("i", 2, AlwaysEdge)) - succOf(code2) shouldBe expected(("i", 2, AlwaysEdge)) - - succOf("i", 2) shouldBe expected(("i++", AlwaysEdge)) - succOf("i++") shouldBe expected(("i", 3, AlwaysEdge)) - succOf("i", 3) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("i === 1", AlwaysEdge)) - succOf("i === 1") shouldBe expected(("j", AlwaysEdge), ("i === 1 && j === 1", AlwaysEdge)) - succOf("i === 1 && j === 1") shouldBe expected(("continue loop1;", AlwaysEdge), ("console", AlwaysEdge)) - succOf("continue loop1;") shouldBe expected(("loop1:", AlwaysEdge)) - succOf("console") shouldBe expected(("log", AlwaysEdge)) - succOf("log") shouldBe expected(("console.log", AlwaysEdge)) + succOf("j < 3") should contain theSameElementsAs expected((code2, AlwaysEdge), ("i", 2, AlwaysEdge)) + succOf(code2) should contain theSameElementsAs expected(("i", 2, AlwaysEdge)) + + succOf("i", 2) should contain theSameElementsAs expected(("i++", AlwaysEdge)) + succOf("i++") should contain theSameElementsAs expected(("i", 3, AlwaysEdge)) + succOf("i", 3) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("i === 1", AlwaysEdge)) + succOf("i === 1") should contain theSameElementsAs expected(("j", AlwaysEdge), ("i === 1 && j === 1", AlwaysEdge)) + succOf("i === 1 && j === 1") should contain theSameElementsAs expected( + ("continue loop1;", AlwaysEdge), + ("console", AlwaysEdge) + ) + succOf("continue loop1;") should contain theSameElementsAs expected(("loop1:", AlwaysEdge)) + succOf("console") should contain theSameElementsAs expected(("log", AlwaysEdge)) + succOf("log") should contain theSameElementsAs expected(("console.log", AlwaysEdge)) } "be correct for plain while loop" in { implicit val cpg: Cpg = code("while (x < 1) { y = 2; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y = 2", AlwaysEdge)) - succOf("y = 2") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y = 2", AlwaysEdge)) + succOf("y = 2") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) } "be correct for plain while loop with break" in { implicit val cpg: Cpg = code("while (x < 1) { break; y; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct for plain while loop with continue" in { implicit val cpg: Cpg = code("while (x < 1) { continue; y; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) - succOf("continue;") shouldBe expected(("x", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("continue;") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) } "be correct for nested while loop" in { implicit val cpg: Cpg = code("while (x) {while(y) {z;}}") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("z", TrueEdge), ("x", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("z", TrueEdge), ("x", FalseEdge)) } "be correct for nested while loop with break" in { implicit val cpg: Cpg = code("while (x) { while(y) { break; z;} a;} b;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("b", FalseEdge)) - succOf("y") shouldBe expected(("break;", TrueEdge), ("a", FalseEdge)) - succOf("a") shouldBe expected(("x", AlwaysEdge)) - succOf("b") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("b", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", TrueEdge), ("a", FalseEdge)) + succOf("a") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for another nested while loop with break" in { implicit val cpg: Cpg = code("while (x) { while(y) { break; z;} a; break; b; } c;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("c", FalseEdge)) - succOf("y") shouldBe expected(("break;", TrueEdge), ("a", FalseEdge)) - succOf("break;") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("break;", 1, AlwaysEdge)) - succOf("break;", 1) shouldBe expected(("c", AlwaysEdge)) - succOf("c") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("c", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", TrueEdge), ("a", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("break;", 1, AlwaysEdge)) + succOf("break;", 1) should contain theSameElementsAs expected(("c", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "nested while loop with conditional break" in { @@ -388,134 +407,134 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp | } |} """.stripMargin) - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("break;", TrueEdge), ("z", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("break;", 1) shouldBe expected(("x", AlwaysEdge)) - succOf("z") shouldBe expected(("break;", 1, TrueEdge), ("x", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", TrueEdge), ("z", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("break;", 1) should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("break;", 1, TrueEdge), ("x", FalseEdge)) } // DO-WHILE Loops "be correct for plain do-while loop" in { implicit val cpg: Cpg = code("do { y = 2; } while (x < 1);") - succOf(":program") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y = 2", AlwaysEdge)) - succOf("y = 2") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y = 2", AlwaysEdge)) + succOf("y = 2") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) } "be correct for plain do-while loop with break" in { implicit val cpg: Cpg = code("do { break; y; } while (x < 1);") - succOf(":program") shouldBe expected(("break;", AlwaysEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("break;", AlwaysEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) } "be correct for plain do-while loop with continue" in { implicit val cpg: Cpg = code("do { continue; y; } while (x < 1);") - succOf(":program") shouldBe expected(("continue;", AlwaysEdge)) - succOf("continue;") shouldBe expected(("x", AlwaysEdge)) - succOf("y") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("continue;", AlwaysEdge)) + succOf("continue;") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) } "be correct for nested do-while loop with continue" in { implicit val cpg: Cpg = code("do { do { x; } while (y); } while (z);") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("x", TrueEdge), ("z", FalseEdge)) - succOf("z") shouldBe expected(("x", TrueEdge), ("RET", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("x", TrueEdge), ("z", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("x", TrueEdge), ("RET", FalseEdge)) } "be correct for nested while/do-while loops with break" in { implicit val cpg: Cpg = code("while (x) { do { while(y) { break; a; } z; } while (x < 1); } c;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("c", FalseEdge)) - succOf("y") shouldBe expected(("break;", TrueEdge), ("z", FalseEdge)) - succOf("break;") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("x", 1, AlwaysEdge)) - succOf("x", 1) shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("x < 1", AlwaysEdge)) - succOf("x < 1") shouldBe expected(("y", TrueEdge), ("x", FalseEdge)) - succOf("c") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("c", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", TrueEdge), ("z", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("x", 1, AlwaysEdge)) + succOf("x", 1) should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x < 1", AlwaysEdge)) + succOf("x < 1") should contain theSameElementsAs expected(("y", TrueEdge), ("x", FalseEdge)) + succOf("c") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested while/do-while loops with break and continue" in { implicit val cpg: Cpg = code("while(x) { do { break; } while (y) } o;") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("break;", TrueEdge), ("o", FalseEdge)) - succOf("break;") shouldBe expected(("x", AlwaysEdge)) - succOf("o") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("break;", TrueEdge), ("o", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("o") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for two nested while loop with inner break" in { implicit val cpg: Cpg = code("while(y) { while(z) { break; x; } }") - succOf(":program") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("z", TrueEdge), ("RET", FalseEdge)) - succOf("z") shouldBe expected(("break;", TrueEdge), ("y", FalseEdge)) - succOf("break;") shouldBe expected(("y", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("z", TrueEdge), ("RET", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("break;", TrueEdge), ("y", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("y", AlwaysEdge)) } // FOR Loops "be correct for plain for-loop" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { a = 3; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("x = 0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("a", TrueEdge), ("RET", FalseEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("x = 0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("a", TrueEdge), ("RET", FalseEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct for plain for-loop with break" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { break; a = 3; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct for plain for-loop with continue" in { implicit val cpg: Cpg = code("for (x = 0; y < 1; z += 2) { continue; a = 3; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("0", AlwaysEdge)) - succOf("0") shouldBe expected(("x = 0", AlwaysEdge)) - succOf("x = 0") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y < 1", AlwaysEdge)) - succOf("y < 1") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) - succOf("continue;") shouldBe expected(("z", AlwaysEdge)) - succOf("a") shouldBe expected(("3", AlwaysEdge)) - succOf("3") shouldBe expected(("a = 3", AlwaysEdge)) - succOf("a = 3") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z += 2", AlwaysEdge)) - succOf("z += 2") shouldBe expected(("y", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("0", AlwaysEdge)) + succOf("0") should contain theSameElementsAs expected(("x = 0", AlwaysEdge)) + succOf("x = 0") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y < 1", AlwaysEdge)) + succOf("y < 1") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("continue;") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("3", AlwaysEdge)) + succOf("3") should contain theSameElementsAs expected(("a = 3", AlwaysEdge)) + succOf("a = 3") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z += 2", AlwaysEdge)) + succOf("z += 2") should contain theSameElementsAs expected(("y", AlwaysEdge)) } "be correct for for-loop with for-in" in { @@ -530,193 +549,214 @@ class SimpleCfgCreationPassTests extends CfgTestFixture(() => new JsSrcCfgTestCp "be correct for nested for-loop" in { implicit val cpg: Cpg = code("for (x; y; z) { for (a; b; c) { u; } }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("a", TrueEdge), ("RET", FalseEdge)) - succOf("z") shouldBe expected(("y", AlwaysEdge)) - succOf("a") shouldBe expected(("b", AlwaysEdge)) - succOf("b") shouldBe expected(("u", TrueEdge), ("z", FalseEdge)) - succOf("c") shouldBe expected(("b", AlwaysEdge)) - succOf("u") shouldBe expected(("c", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("a", TrueEdge), ("RET", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("u", TrueEdge), ("z", FalseEdge)) + succOf("c") should contain theSameElementsAs expected(("b", AlwaysEdge)) + succOf("u") should contain theSameElementsAs expected(("c", AlwaysEdge)) } "be correct for for-loop with empty condition" in { implicit val cpg: Cpg = code("for (;;) { a = 1; }") - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("a", TrueEdge), ("RET", FalseEdge)) - succOf("a") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("a = 1", AlwaysEdge)) - succOf("a = 1") shouldBe expected(("true", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("a", TrueEdge), ("RET", FalseEdge)) + succOf("a") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("a = 1", AlwaysEdge)) + succOf("a = 1") should contain theSameElementsAs expected(("true", AlwaysEdge)) } "be correct for for-loop with empty condition and break" in { implicit val cpg: Cpg = code("for (;;) { break; }") - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("break;", TrueEdge), ("RET", FalseEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("break;", TrueEdge), ("RET", FalseEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for for-loop with empty condition and continue" in { implicit val cpg: Cpg = code("for (;;) { continue; }") - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("continue;", TrueEdge), ("RET", FalseEdge)) - succOf("continue;") shouldBe expected(("true", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("continue;", TrueEdge), ("RET", FalseEdge)) + succOf("continue;") should contain theSameElementsAs expected(("true", AlwaysEdge)) } "be correct with empty condition with nested empty for-loop" in { implicit val cpg: Cpg = code("for (;;) { for (;;) { x; } }") - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("true", 1, TrueEdge), ("RET", FalseEdge)) - succOf("true", 1) shouldBe expected(("x", TrueEdge), ("true", 0, FalseEdge)) - succOf("x") shouldBe expected(("true", 1, AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("true", 1, TrueEdge), ("RET", FalseEdge)) + succOf("true", 1) should contain theSameElementsAs expected(("x", TrueEdge), ("true", 0, FalseEdge)) + succOf("x") should contain theSameElementsAs expected(("true", 1, AlwaysEdge)) } "be correct for for-loop with empty block" in { implicit val cpg: Cpg = code("for (;;) ;") - succOf(":program") shouldBe expected(("true", AlwaysEdge)) - succOf("true") shouldBe expected(("true", TrueEdge), ("RET", FalseEdge)) + succOf(":program") should contain theSameElementsAs expected(("true", AlwaysEdge)) + succOf("true") should contain theSameElementsAs expected(("true", TrueEdge), ("RET", FalseEdge)) } "be correct for simple if statement" in { implicit val cpg: Cpg = code("if (x) { y; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for simple if statement with else block" in { implicit val cpg: Cpg = code("if (x) { y; } else { z; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("z", FalseEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("z", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested if statement" in { implicit val cpg: Cpg = code("if (x) { if (y) { z; } }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("y", TrueEdge), ("RET", FalseEdge)) - succOf("y") shouldBe expected(("z", TrueEdge), ("RET", FalseEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("y", TrueEdge), ("RET", FalseEdge)) + succOf("y") should contain theSameElementsAs expected(("z", TrueEdge), ("RET", FalseEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for nested if statement with else-if chains" in { implicit val cpg: Cpg = code("if (a) { b; } else if (c) { d;} else { e; }") - succOf(":program") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("b", TrueEdge), ("c", FalseEdge)) - succOf("b") shouldBe expected(("RET", AlwaysEdge)) - succOf("c") shouldBe expected(("d", TrueEdge), ("e", FalseEdge)) - succOf("d") shouldBe expected(("RET", AlwaysEdge)) - succOf("e") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("b", TrueEdge), ("c", FalseEdge)) + succOf("b") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("d", TrueEdge), ("e", FalseEdge)) + succOf("d") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("e") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch-case with single case" in { implicit val cpg: Cpg = code("switch (x) { case 1: y;}") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("case 1:", CaseEdge), ("RET", CaseEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch-case with multiple cases" in { implicit val cpg: Cpg = code("switch (x) { case 1: y; case 2: z;}") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("case 2:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("case 2:", AlwaysEdge)) - succOf("case 2:") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected( + ("case 1:", CaseEdge), + ("case 2:", CaseEdge), + ("RET", CaseEdge) + ) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("case 2:", AlwaysEdge)) + succOf("case 2:") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch-case with multiple cases on the same spot" in { implicit val cpg: Cpg = code("switch (x) { case 1: case 2: y; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("case 2:", CaseEdge), ("RET", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("case 2:", AlwaysEdge)) - succOf("case 2:") shouldBe expected(("2", AlwaysEdge)) - succOf("2") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected( + ("case 1:", CaseEdge), + ("case 2:", CaseEdge), + ("RET", CaseEdge) + ) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("case 2:", AlwaysEdge)) + succOf("case 2:") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch-case with default case" in { implicit val cpg: Cpg = code("switch (x) { default: y; }") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("default:", CaseEdge)) - succOf("default:") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("default:", CaseEdge)) + succOf("default:") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for switch-case with multiple cases and default combined" in { implicit val cpg: Cpg = code("switch (x) { case 1: y; break; default: z;}") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("case 1:", CaseEdge), ("default:", CaseEdge)) - succOf("case 1:") shouldBe expected(("1", AlwaysEdge)) - succOf("1") shouldBe expected(("y", AlwaysEdge)) - succOf("y") shouldBe expected(("break;", AlwaysEdge)) - succOf("break;") shouldBe expected(("RET", AlwaysEdge)) - succOf("default:") shouldBe expected(("z", AlwaysEdge)) - succOf("z") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("case 1:", CaseEdge), ("default:", CaseEdge)) + succOf("case 1:") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("y", AlwaysEdge)) + succOf("y") should contain theSameElementsAs expected(("break;", AlwaysEdge)) + succOf("break;") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("default:") should contain theSameElementsAs expected(("z", AlwaysEdge)) + succOf("z") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for constructor call with new" in { implicit val cpg: Cpg = code("""var x = new MyClass(arg1, arg2)""") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("_tmp_0", AlwaysEdge)) - succOf("_tmp_0") shouldBe expected((".alloc", AlwaysEdge)) - succOf(".alloc") shouldBe expected(("_tmp_0 = .alloc", AlwaysEdge)) - succOf("_tmp_0 = .alloc") shouldBe expected(("MyClass", AlwaysEdge)) - succOf("MyClass") shouldBe expected(("_tmp_0", 1, AlwaysEdge)) - succOf("_tmp_0", 1) shouldBe expected(("arg1", AlwaysEdge)) - succOf("arg1") shouldBe expected(("arg2", AlwaysEdge)) - succOf("arg2") shouldBe expected(("new MyClass(arg1, arg2)", AlwaysEdge)) - succOf("new MyClass(arg1, arg2)", NodeTypes.CALL) shouldBe expected(("_tmp_0", 2, AlwaysEdge)) - succOf("_tmp_0", 2) shouldBe expected(("new MyClass(arg1, arg2)", AlwaysEdge)) - succOf("new MyClass(arg1, arg2)") shouldBe expected(("var x = new MyClass(arg1, arg2)", AlwaysEdge)) - succOf("var x = new MyClass(arg1, arg2)") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("_tmp_0", AlwaysEdge)) + succOf("_tmp_0") should contain theSameElementsAs expected((".alloc", AlwaysEdge)) + succOf(".alloc") should contain theSameElementsAs expected(("_tmp_0 = .alloc", AlwaysEdge)) + succOf("_tmp_0 = .alloc") should contain theSameElementsAs expected(("MyClass", AlwaysEdge)) + succOf("MyClass") should contain theSameElementsAs expected(("_tmp_0", 1, AlwaysEdge)) + succOf("_tmp_0", 1) should contain theSameElementsAs expected(("arg1", AlwaysEdge)) + succOf("arg1") should contain theSameElementsAs expected(("arg2", AlwaysEdge)) + succOf("arg2") should contain theSameElementsAs expected(("new MyClass(arg1, arg2)", AlwaysEdge)) + succOf("new MyClass(arg1, arg2)", NodeTypes.CALL) should contain theSameElementsAs expected( + ("_tmp_0", 2, AlwaysEdge) + ) + succOf("_tmp_0", 2) should contain theSameElementsAs expected(("new MyClass(arg1, arg2)", AlwaysEdge)) + succOf("new MyClass(arg1, arg2)") should contain theSameElementsAs expected( + ("var x = new MyClass(arg1, arg2)", AlwaysEdge) + ) + succOf("var x = new MyClass(arg1, arg2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } private def testForInOrOf()(implicit cpg: Cpg): Unit = { - succOf(":program") shouldBe expected(("_iterator_0", AlwaysEdge)) - succOf("_iterator_0") shouldBe expected(("arr", AlwaysEdge)) - succOf("arr") shouldBe expected((".iterator(arr)", AlwaysEdge)) - succOf(".iterator(arr)") shouldBe expected(("_iterator_0 = .iterator(arr)", AlwaysEdge)) - succOf("_iterator_0 = .iterator(arr)") shouldBe expected(("_result_0", AlwaysEdge)) - succOf("_result_0") shouldBe expected(("i", AlwaysEdge)) - succOf("i") shouldBe expected(("_result_0", 1, AlwaysEdge)) - succOf("_result_0", 1) shouldBe expected(("_iterator_0", 1, AlwaysEdge)) - succOf("_iterator_0", 1) shouldBe expected(("next", AlwaysEdge)) - succOf("next") shouldBe expected(("_iterator_0.next", AlwaysEdge)) - succOf("_iterator_0.next") shouldBe expected(("_iterator_0", 2, AlwaysEdge)) - succOf("_iterator_0", 2) shouldBe expected(("_iterator_0.next()", AlwaysEdge)) - succOf("_iterator_0.next()") shouldBe expected(("(_result_0 = _iterator_0.next())", AlwaysEdge)) - succOf("(_result_0 = _iterator_0.next())") shouldBe expected(("done", AlwaysEdge)) - succOf("done") shouldBe expected(("(_result_0 = _iterator_0.next()).done", AlwaysEdge)) - succOf("(_result_0 = _iterator_0.next()).done") shouldBe expected( + succOf(":program") should contain theSameElementsAs expected(("_iterator_0", AlwaysEdge)) + succOf("_iterator_0") should contain theSameElementsAs expected(("arr", AlwaysEdge)) + succOf("arr") should contain theSameElementsAs expected((".iterator(arr)", AlwaysEdge)) + succOf(".iterator(arr)") should contain theSameElementsAs expected( + ("_iterator_0 = .iterator(arr)", AlwaysEdge) + ) + succOf("_iterator_0 = .iterator(arr)") should contain theSameElementsAs expected( + ("_result_0", AlwaysEdge) + ) + succOf("_result_0") should contain theSameElementsAs expected(("i", AlwaysEdge)) + succOf("i") should contain theSameElementsAs expected(("_result_0", 1, AlwaysEdge)) + succOf("_result_0", 1) should contain theSameElementsAs expected(("_iterator_0", 1, AlwaysEdge)) + succOf("_iterator_0", 1) should contain theSameElementsAs expected(("next", AlwaysEdge)) + succOf("next") should contain theSameElementsAs expected(("_iterator_0.next", AlwaysEdge)) + succOf("_iterator_0.next") should contain theSameElementsAs expected(("_iterator_0", 2, AlwaysEdge)) + succOf("_iterator_0", 2) should contain theSameElementsAs expected(("_iterator_0.next()", AlwaysEdge)) + succOf("_iterator_0.next()") should contain theSameElementsAs expected( + ("(_result_0 = _iterator_0.next())", AlwaysEdge) + ) + succOf("(_result_0 = _iterator_0.next())") should contain theSameElementsAs expected(("done", AlwaysEdge)) + succOf("done") should contain theSameElementsAs expected(("(_result_0 = _iterator_0.next()).done", AlwaysEdge)) + succOf("(_result_0 = _iterator_0.next()).done") should contain theSameElementsAs expected( ("!(_result_0 = _iterator_0.next()).done", AlwaysEdge) ) import io.shiftleft.semanticcpg.language._ val code = cpg.method.ast.isBlock.code("for \\(var i.*foo.*}").code.head - succOf("!(_result_0 = _iterator_0.next()).done") shouldBe expected(("i", 1, TrueEdge), (code, FalseEdge)) - succOf(code) shouldBe expected(("RET", AlwaysEdge)) - - succOf("i", 1) shouldBe expected(("_result_0", 2, AlwaysEdge)) - succOf("_result_0", 2) shouldBe expected(("value", AlwaysEdge)) - succOf("value") shouldBe expected(("_result_0.value", AlwaysEdge)) - succOf("_result_0.value") shouldBe expected(("i = _result_0.value", AlwaysEdge)) - succOf("i = _result_0.value") shouldBe expected(("foo", AlwaysEdge)) - succOf("foo") shouldBe expected(("this", 1, AlwaysEdge)) - succOf("this", 1) shouldBe expected(("i", 2, AlwaysEdge)) - succOf("i", 2) shouldBe expected(("foo(i)", AlwaysEdge)) + succOf("!(_result_0 = _iterator_0.next()).done") should contain theSameElementsAs expected( + ("i", 1, TrueEdge), + (code, FalseEdge) + ) + succOf(code) should contain theSameElementsAs expected(("RET", AlwaysEdge)) + + succOf("i", 1) should contain theSameElementsAs expected(("_result_0", 2, AlwaysEdge)) + succOf("_result_0", 2) should contain theSameElementsAs expected(("value", AlwaysEdge)) + succOf("value") should contain theSameElementsAs expected(("_result_0.value", AlwaysEdge)) + succOf("_result_0.value") should contain theSameElementsAs expected(("i = _result_0.value", AlwaysEdge)) + succOf("i = _result_0.value") should contain theSameElementsAs expected(("foo", AlwaysEdge)) + succOf("foo") should contain theSameElementsAs expected(("this", 1, AlwaysEdge)) + succOf("this", 1) should contain theSameElementsAs expected(("i", 2, AlwaysEdge)) + succOf("i", 2) should contain theSameElementsAs expected(("foo(i)", AlwaysEdge)) val code2 = "{ foo(i) }" - succOf("foo(i)") shouldBe expected((code2, AlwaysEdge)) - succOf(code2) shouldBe expected(("_result_0", 1, AlwaysEdge)) + succOf("foo(i)") should contain theSameElementsAs expected((code2, AlwaysEdge)) + succOf(code2) should contain theSameElementsAs expected(("_result_0", 1, AlwaysEdge)) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/preprocessing/EjsPassTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/preprocessing/EjsPassTests.scala index 7eda70ca7a15..750602fb5413 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/preprocessing/EjsPassTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/preprocessing/EjsPassTests.scala @@ -5,9 +5,9 @@ import io.shiftleft.semanticcpg.language.* class EjsPassTests extends AstJsSrc2CpgSuite { - "ejs files" should { + "ejs files" ignore { - "be renamed correctly " in { + "be renamed correctly" in { val cpg = code( """ | @@ -20,6 +20,20 @@ class EjsPassTests extends AstJsSrc2CpgSuite { cpg.call.code.l.sorted shouldBe List("user.name") } + "be ignored at folders excluded by default" in { + val codeString = """ + | + |

Welcome <%= user.name %>

+ | + |""".stripMargin + val cpg = code(codeString, "index.js.ejs") + .moreCode(codeString, "node_modules/foo.js.ejs") + .moreCode(codeString, "vendor/bar.js.ejs") + .moreCode(codeString, "www/baz.js.ejs") + cpg.file.name.l shouldBe List("index.js.ejs") + cpg.call.code.l.sorted shouldBe List("user.name") + } + "be handled correctly" in { val cpg = code( """ diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/AstJsSrc2CpgFrontend.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/AstJsSrc2CpgFrontend.scala index 62d6b21553b5..0ae67cba764c 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/AstJsSrc2CpgFrontend.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/AstJsSrc2CpgFrontend.scala @@ -8,7 +8,7 @@ import io.joern.jssrc2cpg.utils.AstGenRunner import io.joern.x2cpg.testfixtures.LanguageFrontend import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.X2Cpg.newEmptyCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait AstJsSrc2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala index 562a461ce9ef..3e6a9fdaab97 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala @@ -6,6 +6,8 @@ import io.joern.dataflowengineoss.layers.dataflows.OssDataFlowOptions import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.jssrc2cpg.JsSrc2Cpg import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.jssrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.testfixtures.Code2CpgFixture import io.joern.x2cpg.testfixtures.TestCpg import io.shiftleft.semanticcpg.layers.LayerCreatorContext @@ -19,7 +21,7 @@ class DataFlowTestCpg extends TestCpg with JsSrc2CpgFrontend { val context = new LayerCreatorContext(this) val options = new OssDataFlowOptions() new OssDataFlow(options).run(context) - JsSrc2Cpg.postProcessingPasses(this).foreach(_.createAndApply()) + jssrc2cpg.postProcessingPasses(this, XTypeRecoveryConfig()).foreach(_.createAndApply()) } } @@ -29,7 +31,7 @@ class DataFlowCodeToCpgSuite extends Code2CpgFixture(() => new DataFlowTestCpg() protected implicit val context: EngineContext = EngineContext() protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + path.resultPairs().collect { case (firstElement: String, secondElement) => (firstElement, secondElement.getOrElse(-1)) } } diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/JsSrc2CpgFrontend.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/JsSrc2CpgFrontend.scala index 15ec2593a152..aa0968d074fc 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/JsSrc2CpgFrontend.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/testfixtures/JsSrc2CpgFrontend.scala @@ -4,7 +4,7 @@ import better.files.File import io.joern.jssrc2cpg.Config import io.joern.jssrc2cpg.JsSrc2Cpg import io.joern.x2cpg.testfixtures.LanguageFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait JsSrc2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTests.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTests.scala index 5a2f4ece7755..23960cba4848 100644 --- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTests.scala +++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/types/TSTypesTests.scala @@ -1,8 +1,8 @@ package io.joern.jssrc2cpg.types import io.joern.jssrc2cpg.testfixtures.AstJsSrc2CpgSuite -import io.joern.jssrc2cpg.passes.Defines import io.joern.jssrc2cpg.Config +import io.joern.x2cpg.frontendspecific.jssrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/kotlin2cpg/kotlin2cpg.sh b/joern-cli/frontends/kotlin2cpg/kotlin2cpg.sh index c47504ccc9f1..862d743c82bd 100755 --- a/joern-cli/frontends/kotlin2cpg/kotlin2cpg.sh +++ b/joern-cli/frontends/kotlin2cpg/kotlin2cpg.sh @@ -1,6 +1,4 @@ -#!/usr/bin/env bash - -# Script starts here +#!/usr/bin/env sh readonly SCRIPT_DIR=$(dirname "$(realpath "$0")") readonly BIN="${SCRIPT_DIR}/target/universal/stage/bin/kotlin2cpg" diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstCreator.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstCreator.scala index d806897cf6f0..dd0c80b012b4 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstCreator.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstCreator.scala @@ -13,11 +13,11 @@ import io.joern.x2cpg.Defines import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Global import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.utils.NodeBuilders import io.joern.x2cpg.utils.NodeBuilders.newMethodReturnNode import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.passes.IntervalKeyPool import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.jetbrains.kotlin.com.intellij.psi.PsiElement @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* import org.slf4j.Logger import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import java.io.PrintWriter import java.io.StringWriter @@ -87,7 +87,7 @@ class AstCreator(fileWithMeta: KtFileWithMeta, xTypeInfoProvider: TypeInfoProvid // TODO: use this everywhere in kotlin2cpg instead of manual .getText calls override def code(element: PsiElement): String = shortenCode(element.getText) - override def line(element: PsiElement): Option[Integer] = { + override def line(element: PsiElement): Option[Int] = { try { Some( element.getContainingFile.getViewProvider.getDocument @@ -98,7 +98,7 @@ class AstCreator(fileWithMeta: KtFileWithMeta, xTypeInfoProvider: TypeInfoProvid } } - override def column(element: PsiElement): Option[Integer] = { + override def column(element: PsiElement): Option[Int] = { try { val lineNumber = element.getContainingFile.getViewProvider.getDocument @@ -111,7 +111,7 @@ class AstCreator(fileWithMeta: KtFileWithMeta, xTypeInfoProvider: TypeInfoProvid } } - override def lineEnd(element: PsiElement): Option[Integer] = { + override def lineEnd(element: PsiElement): Option[Int] = { val lastElement = element match { case namedFn: KtNamedFunction => Option(namedFn.getBodyBlockExpression) @@ -122,7 +122,7 @@ class AstCreator(fileWithMeta: KtFileWithMeta, xTypeInfoProvider: TypeInfoProvid line(lastElement) } - override def columnEnd(element: PsiElement): Option[Integer] = { + override def columnEnd(element: PsiElement): Option[Int] = { val lastElement = element match { case namedFn: KtNamedFunction => Option(namedFn.getBodyBlockExpression) @@ -134,7 +134,7 @@ class AstCreator(fileWithMeta: KtFileWithMeta, xTypeInfoProvider: TypeInfoProvid } protected def getName(node: NewImport): String = { - val isWildcard = node.isWildcard.getOrElse(false: java.lang.Boolean) + val isWildcard = node.isWildcard.getOrElse(false) if (isWildcard) Constants.wildcardImportName else node.importedEntity.getOrElse("") } diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstForStatementsCreator.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstForStatementsCreator.scala index 34731b0b9e66..f083d75d63af 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstForStatementsCreator.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/ast/AstForStatementsCreator.scala @@ -62,7 +62,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { // private def astForForWithDestructuringLHS(expr: KtForExpression)(implicit typeInfoProvider: TypeInfoProvider): Ast = { val loopRangeText = expr.getLoopRange.getText - val iteratorName = s"${Constants.iteratorPrefix}${iteratorKeyPool.next()}" + val iteratorName = s"${Constants.iteratorPrefix}${iteratorKeyPool.next}" val localForIterator = localNode(expr, iteratorName, iteratorName, TypeConstants.any) val iteratorAssignmentLhs = newIdentifierNode(iteratorName, TypeConstants.any) val iteratorLocalAst = Ast(localForIterator).withRefEdge(iteratorAssignmentLhs, localForIterator) @@ -182,7 +182,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { // private def astForForWithSimpleVarLHS(expr: KtForExpression)(implicit typeInfoProvider: TypeInfoProvider): Ast = { val loopRangeText = expr.getLoopRange.getText - val iteratorName = s"${Constants.iteratorPrefix}${iteratorKeyPool.next()}" + val iteratorName = s"${Constants.iteratorPrefix}${iteratorKeyPool.next}" val iteratorLocal = localNode(expr, iteratorName, iteratorName, TypeConstants.any) val iteratorAssignmentLhs = newIdentifierNode(iteratorName, TypeConstants.any) val iteratorLocalAst = Ast(iteratorLocal).withRefEdge(iteratorAssignmentLhs, iteratorLocal) @@ -492,7 +492,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { private def astForTryAsStatement(expr: KtTryExpression)(implicit typeInfoProvider: TypeInfoProvider): Ast = { val tryAst = astsForExpression(expr.getTryBlock, None).headOption.getOrElse(Ast()) - val clauseAsts = expr.getCatchClauses.asScala.map { catchClause => + val clauseAsts = expr.getCatchClauses.asScala.toSeq.map { catchClause => val catchNode = controlStructureNode(catchClause, ControlStructureTypes.CATCH, catchClause.getText) val childrenAsts = astsForExpression(catchClause.getCatchBody, None) Ast(catchNode).withChildren(childrenAsts) @@ -504,9 +504,8 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { val childrenAsts = astsForExpression(finallyBlock, None) Ast(finallyNode).withChildren(childrenAsts) } - .getOrElse(Ast()) - val node = controlStructureNode(expr, ControlStructureTypes.TRY, expr.getText) - controlStructureAst(node, None, (tryAst +: clauseAsts :+ finallyAst).toList) + val tryNode = controlStructureNode(expr, ControlStructureTypes.TRY, expr.getText) + tryCatchAst(tryNode, tryAst, clauseAsts, finallyAst) } private def astForTryAsExpression( diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/interop/JavasrcInterop.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/interop/JavasrcInterop.scala index b60cd6459e3d..1f67fb891864 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/interop/JavasrcInterop.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/interop/JavasrcInterop.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.interop import io.joern.javasrc2cpg.passes.{AstCreationPass => JavaSrcAstCreationPass} import io.joern.javasrc2cpg.JavaSrc2Cpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg object JavasrcInterop { def astCreationPass(inputPath: String, paths: List[String], cpg: Cpg): JavaSrcAstCreationPass = { diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/AstCreationPass.scala index 82114093365c..cd9f367ff0a1 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/AstCreationPass.scala @@ -5,15 +5,15 @@ import io.joern.kotlin2cpg.ast.AstCreator import io.joern.kotlin2cpg.types.TypeInfoProvider import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Global -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.EnumerationHasAsScala class AstCreationPass(filesWithMeta: Iterable[KtFileWithMeta], typeInfoProvider: TypeInfoProvider, cpg: Cpg)(implicit withSchemaValidation: ValidationMode -) extends ConcurrentWriterCpgPass[KtFileWithMeta](cpg) { +) extends ForkJoinParallelCpgPass[KtFileWithMeta](cpg) { private val logger = LoggerFactory.getLogger(getClass) private val global: Global = new Global() diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/ConfigPass.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/ConfigPass.scala index 897eb8f4bff4..4ded9128d079 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/ConfigPass.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/ConfigPass.scala @@ -1,13 +1,13 @@ package io.joern.kotlin2cpg.passes import io.joern.kotlin2cpg.FileContentAtPath -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewConfigFile -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory class ConfigPass(fileContentsAtPath: Iterable[FileContentAtPath], cpg: Cpg) - extends ConcurrentWriterCpgPass[FileContentAtPath](cpg) { + extends ForkJoinParallelCpgPass[FileContentAtPath](cpg) { private val logger = LoggerFactory.getLogger(getClass) diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/DependenciesFromMavenCoordinatesPass.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/DependenciesFromMavenCoordinatesPass.scala index eb64a1510016..18a210fa1ffa 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/DependenciesFromMavenCoordinatesPass.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/DependenciesFromMavenCoordinatesPass.scala @@ -1,6 +1,6 @@ package io.joern.kotlin2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPass import io.shiftleft.codepropertygraph.generated.nodes.NewDependency diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeHintCallLinker.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeHintCallLinker.scala index 3fa58cedb634..31ed0b375ce5 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeHintCallLinker.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeHintCallLinker.scala @@ -2,9 +2,9 @@ package io.joern.kotlin2cpg.passes import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.util.regex.Pattern diff --git a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeRecoveryPassGenerator.scala b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeRecoveryPassGenerator.scala index 67e09fdcfb20..e4614d139906 100644 --- a/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeRecoveryPassGenerator.scala +++ b/joern-cli/frontends/kotlin2cpg/src/main/scala/io/joern/kotlin2cpg/passes/KotlinTypeRecoveryPassGenerator.scala @@ -3,11 +3,11 @@ package io.joern.kotlin2cpg.passes import io.joern.kotlin2cpg.Constants import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class KotlinTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) extends XTypeRecoveryPassGenerator[File](cpg, config) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/DefaultRegisteredTypesTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/DefaultRegisteredTypesTests.scala index 1978c0e3d840..50915958495e 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/DefaultRegisteredTypesTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/DefaultRegisteredTypesTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DefaultRegisteredTypesTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/compiler/JavaInteroperabilityTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/compiler/JavaInteroperabilityTests.scala index 580b2056da24..55f047956f61 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/compiler/JavaInteroperabilityTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/compiler/JavaInteroperabilityTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.compiler import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class JavaInteroperabilityTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with Java interop" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/CollectionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/CollectionsTests.scala index c9bb114aba6a..baaa894378a8 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/CollectionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/CollectionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CollectionsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ControlExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ControlExpressionsTests.scala index 83742fc2916a..99031a2c5510 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ControlExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ControlExpressionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ControlExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/DestructuringTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/DestructuringTests.scala index 23d0a75e2e71..108ae3e4fab1 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/DestructuringTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/DestructuringTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DestructuringTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ExtensionFnsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ExtensionFnsTests.scala index ef42c65d7aac..d6df51061783 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ExtensionFnsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ExtensionFnsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ExtensionFnsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ForTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ForTests.scala index 5b52128e351f..a810b2f050f9 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ForTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ForTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ForTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/FunctionCallTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/FunctionCallTests.scala index bffc61e47053..f5e138aec00c 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/FunctionCallTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/FunctionCallTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class FunctionCallTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/GenericsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/GenericsTests.scala index 6510a41d156f..7c4528652d61 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/GenericsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/GenericsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class GenericsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/IfTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/IfTests.scala index 39b9a9a03f59..3c2b48e764b2 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/IfTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/IfTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class IfTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/InterproceduralTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/InterproceduralTests.scala index 6d0d9ea0f607..474fd0b25863 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/InterproceduralTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/InterproceduralTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class InterproceduralTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/JavaInteroperabilityTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/JavaInteroperabilityTests.scala index 3219e96572f6..b6e998601691 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/JavaInteroperabilityTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/JavaInteroperabilityTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class JavaInteroperabilityTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/LambdaTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/LambdaTests.scala index 3946446c2657..c13308cd1448 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/LambdaTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/LambdaTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LambdaTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ObjectExpressionsAndDeclarationsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ObjectExpressionsAndDeclarationsTests.scala index 7ab56c2b3df4..f1a7e87f961d 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ObjectExpressionsAndDeclarationsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ObjectExpressionsAndDeclarationsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ObjectExpressionsAndDeclarationsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/OperatorTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/OperatorTests.scala index 927c9dcf8069..8e095ce30420 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/OperatorTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/OperatorTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class OperatorTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ScopeFunctionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ScopeFunctionsTests.scala index 7e70895c5772..690d7eaec9bd 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ScopeFunctionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/ScopeFunctionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ScopeFunctionsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/SimpleDataFlowTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/SimpleDataFlowTests.scala index ac54ea19e525..987bd4bd9c10 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/SimpleDataFlowTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/SimpleDataFlowTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SimpleDataFlowTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/TryTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/TryTests.scala index 7002f4da3b0e..d25e5e83c117 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/TryTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/TryTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TryTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhenTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhenTests.scala index 0c94cf520002..021fc3198813 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhenTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhenTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class WhenTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhileTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhileTests.scala index 74beb35f10fd..aa7e419eabda 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhileTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/dataflow/WhileTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class WhileTests extends KotlinCode2CpgFixture(withOssDataflow = true) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/postProcessing/TypeRecoveryPassTest.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/postProcessing/TypeRecoveryPassTest.scala index 6e241e7e2afd..06276c0ec95f 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/postProcessing/TypeRecoveryPassTest.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/postProcessing/TypeRecoveryPassTest.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.postProcessing import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TypeRecoveryPassTest extends KotlinCode2CpgFixture(withPostProcessing = true) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnnotationsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnnotationsTests.scala index 71d1ee17cc51..767cd7bdcbb4 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnnotationsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnnotationsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Annotation, AnnotationLiteral} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AnnotationsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with two identical calls, one annotated and one not" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnonymousFunctionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnonymousFunctionsTests.scala index fad29eeaf8b4..49c85dae7c6c 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnonymousFunctionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AnonymousFunctionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{EvaluationStrategies, ModifierTypes} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.Ignore import scala.annotation.unused diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArithmeticOperationsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArithmeticOperationsTests.scala index 1116622eaeaa..80f1d9695263 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArithmeticOperationsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArithmeticOperationsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ArithmeticOperationsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArrayAccessExprsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArrayAccessExprsTests.scala index 5a9b5767607c..84632d3f4acf 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArrayAccessExprsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ArrayAccessExprsTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ArrayAccessExprsTests extends KotlinCode2CpgFixture(withOssDataflow = true) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AssignmentTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AssignmentTests.scala index 25ddaea2e3ef..4ef82a053da0 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AssignmentTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/AssignmentTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AssignmentTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/BooleanLogicTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/BooleanLogicTests.scala index 3e6ed13c3b82..922a64926e35 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/BooleanLogicTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/BooleanLogicTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class BooleanLogicTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallGraphTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallGraphTests.scala index 794edfec1c3e..ddd91f3f1f80 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallGraphTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallGraphTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallGraphTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallableReferenceTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallableReferenceTests.scala index e5edd465e017..da0b64126080 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallableReferenceTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallableReferenceTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallableReferenceTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallbackTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallbackTests.scala index d6c2814bafc0..97631a4a5475 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallbackTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallbackTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallbackTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallsToConstructorTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallsToConstructorTests.scala index 49335321c273..aeb59738be64 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallsToConstructorTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CallsToConstructorTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal, Local} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallsToConstructorTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CfgTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CfgTests.scala index 3ca374924968..8455d8aeb781 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CfgTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CfgTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CfgTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ClassLiteralTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ClassLiteralTests.scala index 0fe33a3b79ee..77a1fb225fb1 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ClassLiteralTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ClassLiteralTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ClassLiteralTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CollectionAccessTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CollectionAccessTests.scala index 3d30027b02e5..aaddb05e6db2 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CollectionAccessTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CollectionAccessTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CollectionAccessTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CompanionObjectTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CompanionObjectTests.scala index bcb0948837db..6916bbe07d10 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CompanionObjectTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/CompanionObjectTests.scala @@ -4,7 +4,7 @@ import io.joern.kotlin2cpg.Constants import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, Member} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CompanionObjectTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComparisonOperatorTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComparisonOperatorTests.scala index 9057c973301e..6fc007434046 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComparisonOperatorTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComparisonOperatorTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ComparisonOperatorTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComplexExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComplexExpressionsTests.scala index 7e31ba806ead..b469e6f84ca1 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComplexExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ComplexExpressionsTests.scala @@ -3,8 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.edges.Argument -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.jIteratortoTraversal +import io.shiftleft.semanticcpg.language.* class ComplexExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with _and_/_or_ operator and try-catch as one of the arguments" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConfigFileTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConfigFileTests.scala index e0fdc9238657..99fca7000164 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConfigFileTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConfigFileTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConfigFileTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConstructorTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConstructorTests.scala index ecf3222d003b..09e8df5cb759 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConstructorTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ConstructorTests.scala @@ -4,7 +4,7 @@ import io.joern.kotlin2cpg.Constants import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, MethodParameterIn} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConstructorTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ControlStructureTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ControlStructureTests.scala index 4c14ced555f7..367c7e7f0fd3 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ControlStructureTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ControlStructureTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, ControlStructure, Identifier, Local} import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ControlStructureTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple if-else" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DataClassTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DataClassTests.scala index b5bc553d1b4e..bee57af468ad 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DataClassTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DataClassTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DataClassTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple data class" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DefaultContentRootsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DefaultContentRootsTests.scala index c53f42ab2b96..02b442bbbaf8 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DefaultContentRootsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DefaultContentRootsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DefaultContentRootsTests extends KotlinCode2CpgFixture(withOssDataflow = false, withDefaultJars = true) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DelegatedPropertiesTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DelegatedPropertiesTests.scala index 7fc0b7dc4649..9f53a65e7f21 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DelegatedPropertiesTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DelegatedPropertiesTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DelegatedPropertiesTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DestructuringTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DestructuringTests.scala index c0d046f962ed..96d03e1a589c 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DestructuringTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/DestructuringTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal, Local} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DestructuringTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/EnumTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/EnumTests.scala index 8feb1ba5df25..3d4e6ad56dea 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/EnumTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/EnumTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class EnumTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ExtensionTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ExtensionTests.scala index 7c1e535826ea..2dd7156c2f5c 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ExtensionTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ExtensionTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ExtensionTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple extension function declarations" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FieldAccessTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FieldAccessTests.scala index fd8521787396..df05efd93966 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FieldAccessTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FieldAccessTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{FieldIdentifier, Identifier} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class FieldAccessTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FileTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FileTests.scala index 098c7f9329ba..4dae7d002d57 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FileTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/FileTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import java.io.File diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GenericsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GenericsTests.scala index d0a78b7ec837..55100727bac4 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GenericsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GenericsTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class GenericsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GlobalsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GlobalsTests.scala index ff11e7d51c86..8e3eed81a92f 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GlobalsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/GlobalsTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class GlobalsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code simple global declaration" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/IdentifierTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/IdentifierTests.scala index 0650814cb889..6c4c0745afa4 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/IdentifierTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/IdentifierTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class IdentifierTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with two simple methods" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ImportTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ImportTests.scala index 00b79d34b1ea..38bdb3aba291 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ImportTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ImportTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ImportTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/InnerClassesTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/InnerClassesTests.scala index 7bc06f15d41e..b81c62b036ca 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/InnerClassesTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/InnerClassesTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.Ignore class InnerClassesTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LabeledExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LabeledExpressionsTests.scala index b4243faf88c0..dc0fb0b566f9 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LabeledExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LabeledExpressionsTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LabeledExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LambdaTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LambdaTests.scala index 6de2838c017e..3a681cef31b0 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LambdaTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LambdaTests.scala @@ -17,7 +17,6 @@ import io.shiftleft.codepropertygraph.generated.nodes.MethodRef import io.shiftleft.codepropertygraph.generated.nodes.Return import io.shiftleft.codepropertygraph.generated.nodes.TypeDecl import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.jIteratortoTraversal class LambdaTests extends KotlinCode2CpgFixture(withOssDataflow = false, withDefaultJars = true) { "CPG for code with a simple lambda which captures a method parameter" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LiteralTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LiteralTests.scala index ba4288736d87..5a5c8475318a 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LiteralTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LiteralTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LiteralTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalClassesTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalClassesTests.scala index bb57eb21932b..42a261fe5f83 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalClassesTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalClassesTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.TypeDecl -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocalClassesTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalTests.scala index a0c49d8842ca..07635e8dd1d4 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/LocalTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocalTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code simple local declarations" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MemberTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MemberTests.scala index 19457372c82d..4d0db375a81f 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MemberTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MemberTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MemberTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MetaDataTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MetaDataTests.scala index 40695e336c24..1f54baae7bc2 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MetaDataTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MetaDataTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodParameterTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodParameterTests.scala index 5e5db29df2dc..3a610e47ab1a 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodParameterTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodParameterTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.MethodParameterIn -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodParameterTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodReturnTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodReturnTests.scala index d34372b3d2d9..fc332dade842 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodReturnTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodReturnTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.EvaluationStrategies -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodReturnTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodTests.scala index efc0e016c1e9..f6c472a5b0a9 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/MethodTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Return} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MethodTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple method defined at package-level" should { @@ -174,7 +174,7 @@ class MethodTests extends KotlinCode2CpgFixture(withOssDataflow = false) { |""".stripMargin) "pass the lambda to a `sortedWith` call which is then under the method `sorted`" in { - inside(cpg.methodRef(".*.*").inCall.l) { + inside(cpg.methodRefWithName(".*.*").inCall.l) { case sortedWith :: Nil => sortedWith.name shouldBe "sortedWith" sortedWith.method.name shouldBe "sorted" diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ModifierTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ModifierTests.scala index 3b686142e41b..605185f136b9 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ModifierTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ModifierTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ModifierTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with various modifiers applied to various functions" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/NamespaceBlockTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/NamespaceBlockTests.scala index 33cf5c4be855..200ff2a9a41b 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/NamespaceBlockTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/NamespaceBlockTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class NamespaceBlockTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple namespace declaration" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ObjectDeclarationsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ObjectDeclarationsTests.scala index 81118e41fe2a..310aa4086717 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ObjectDeclarationsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ObjectDeclarationsTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ObjectDeclarationsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple object declaration" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ParenthesizedExpressionTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ParenthesizedExpressionTests.scala index da0f5858545c..bd1548c9e909 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ParenthesizedExpressionTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ParenthesizedExpressionTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ParenthesizedExpressionTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/QualifiedExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/QualifiedExpressionsTests.scala index 824698ecce4a..570ec15821b2 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/QualifiedExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/QualifiedExpressionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class QualifiedExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with qualified expression with QE as a receiver" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ResolutionErrorsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ResolutionErrorsTests.scala index c4e676596e97..652e2f7e2253 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ResolutionErrorsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ResolutionErrorsTests.scala @@ -4,7 +4,7 @@ import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.joern.kotlin2cpg.types.TypeConstants import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ResolutionErrorsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with QE of receiver for which the type cannot be inferred" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SafeQualifiedExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SafeQualifiedExpressionsTests.scala index 28267aa5ef34..f340e39dd835 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SafeQualifiedExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SafeQualifiedExpressionsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SafeQualifiedExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ScopeFunctionTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ScopeFunctionTests.scala index 8d5a75d91e27..2881fdf26380 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ScopeFunctionTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ScopeFunctionTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Block, Return} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ScopeFunctionTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code call to `also` scope function without an explicitly-defined parameter" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SpecialOperatorsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SpecialOperatorsTests.scala index a307d4b01dda..78078f2cf511 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SpecialOperatorsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SpecialOperatorsTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SpecialOperatorsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StdLibTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StdLibTests.scala index 72498ccfea49..4dd6884d94ea 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StdLibTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StdLibTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class StdLibTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with call to `takeIf`" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StringInterpolationTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StringInterpolationTests.scala index 644435182656..7253fbbf3221 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StringInterpolationTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/StringInterpolationTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class StringInterpolationTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SuperTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SuperTests.scala index 79de86e710b2..00d832760d29 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SuperTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/SuperTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SuperTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple call using _super_" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ThisTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ThisTests.scala index 8af6d9af6548..d976133041d6 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ThisTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/ThisTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ThisTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with calls to functions of same name, but different scope" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TryExpressionsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TryExpressionsTests.scala index ce5b2fc7ce02..473aa0e84c5c 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TryExpressionsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TryExpressionsTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TryExpressionsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with simple `try`-expression" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeAliasTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeAliasTests.scala index d76b92786d78..3af134f92b59 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeAliasTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeAliasTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.joern.x2cpg.Defines -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class TypeAliasTests extends KotlinCode2CpgFixture(withOssDataflow = false, withDefaultJars = true) { "CPG for code with simple typealias to Int" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeDeclTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeDeclTests.scala index e05da10d7311..3ee7dc51b82d 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeDeclTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/TypeDeclTests.scala @@ -11,7 +11,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ MethodParameterIn } import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal class TypeDeclTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/UnaryOpTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/UnaryOpTests.scala index 7c6aa3617877..4ca47bfc65aa 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/UnaryOpTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/querying/UnaryOpTests.scala @@ -2,7 +2,7 @@ package io.joern.kotlin2cpg.querying import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class UnaryOpTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/testfixtures/KotlinCodeToCpgFixture.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/testfixtures/KotlinCodeToCpgFixture.scala index 31dc5646a73c..486654812a20 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/testfixtures/KotlinCodeToCpgFixture.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/testfixtures/KotlinCodeToCpgFixture.scala @@ -10,7 +10,7 @@ import io.joern.kotlin2cpg.Kotlin2Cpg import io.joern.x2cpg.testfixtures.Code2CpgFixture import io.joern.x2cpg.testfixtures.DefaultTestCpg import io.joern.x2cpg.testfixtures.LanguageFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.utils.ProjectRoot import java.io.File @@ -66,5 +66,5 @@ class KotlinCode2CpgFixture( ) with SemanticCpgTestFixture(extraFlows) { - protected def flowToResultPairs(path: Path): List[(String, Option[Integer])] = path.resultPairs() + protected def flowToResultPairs(path: Path): List[(String, Option[Int])] = path.resultPairs() } diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/DefaultImportsTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/DefaultImportsTests.scala index 2e381352d259..607313386ce5 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/DefaultImportsTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/DefaultImportsTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.validation import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class DefaultImportsTests extends KotlinCode2CpgFixture(withOssDataflow = false) { // It tests if we take into consideration default imports: https://kotlinlang.org/docs/packages.html#default-imports diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/IdentifierReferencesTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/IdentifierReferencesTests.scala index c24e30d6d6b7..02e94913b2ae 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/IdentifierReferencesTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/IdentifierReferencesTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.validation import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Local, MethodParameterIn} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* // TODO: also add test with refs inside TYPE_DECL diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/MissingTypeInformationTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/MissingTypeInformationTests.scala index c435499d3310..14e375b0d9ac 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/MissingTypeInformationTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/MissingTypeInformationTests.scala @@ -3,7 +3,7 @@ package io.joern.kotlin2cpg.validation import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MissingTypeInformationTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with CALL to Java stdlib fn with argument of unknown type" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/PrimitiveArrayTypeMappingTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/PrimitiveArrayTypeMappingTests.scala index afb57d324c9f..e4191018c6ad 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/PrimitiveArrayTypeMappingTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/PrimitiveArrayTypeMappingTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.validation import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class PrimitiveArrayTypeMappingTests extends KotlinCode2CpgFixture(withOssDataflow = false) { "CPG for code with usage of `kotlin.BooleanArray`" should { diff --git a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/UnitTypeMappingTests.scala b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/UnitTypeMappingTests.scala index dc2f0f467378..8ee9dde0d2e1 100644 --- a/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/UnitTypeMappingTests.scala +++ b/joern-cli/frontends/kotlin2cpg/src/test/scala/io/joern/kotlin2cpg/validation/UnitTypeMappingTests.scala @@ -1,7 +1,7 @@ package io.joern.kotlin2cpg.validation import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class UnitTypeMappingTests extends KotlinCode2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/php2cpg/php2cpg.sh b/joern-cli/frontends/php2cpg/php2cpg.sh index ed80f0177ec9..45d1f8f537b7 100755 --- a/joern-cli/frontends/php2cpg/php2cpg.sh +++ b/joern-cli/frontends/php2cpg/php2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/php2cpg.sh $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/php2cpg.sh" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Main.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Main.scala index cd4bbb53cf84..66c2e2c6507d 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Main.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Main.scala @@ -49,7 +49,7 @@ object Frontend { opt[String]("php-parser-bin") .action((x, c) => c.withPhpParserBin(x)) .text("path to php-parser.phar binary. Defaults to php-parser shipped with Joern."), - XTypeRecovery.parserOptions, + XTypeRecoveryConfig.parserOptionsForParserConfig, XTypeStubsParser.parserOptions, DependencyDownloadConfig.parserOptions ) diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Php2Cpg.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Php2Cpg.scala index 1b21a5f47d05..d0230fd616d5 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Php2Cpg.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/Php2Cpg.scala @@ -4,12 +4,10 @@ import io.joern.php2cpg.parser.PhpParser import io.joern.php2cpg.passes.* import io.joern.php2cpg.utils.DependencyDownloader import io.joern.x2cpg.X2Cpg.withNewEmptyCpg -import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass, XTypeRecoveryConfig, XTypeStubsParserConfig} +import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass} import io.joern.x2cpg.utils.ExternalCommand import io.joern.x2cpg.{SourceFiles, X2CpgFrontend} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.passes.CpgPassBase +import io.shiftleft.codepropertygraph.generated.{Cpg, Languages} import org.slf4j.LoggerFactory import scala.collection.mutable @@ -90,19 +88,3 @@ class Php2Cpg extends X2CpgFrontend[Config] { .filter(_.endsWith("composer.json")) } } - -object Php2Cpg { - - def postProcessingPasses(cpg: Cpg, config: Option[Config] = None): List[CpgPassBase] = { - val typeRecoveryConfig = config - .map(c => XTypeRecoveryConfig(c.typePropagationIterations, !c.disableDummyTypes)) - .getOrElse(XTypeRecoveryConfig(iterations = 3)) - val setKnownTypesConfig = config - .map(c => XTypeStubsParserConfig(c.typeStubsFilePath)) - .getOrElse(XTypeStubsParserConfig()) - List( - new ComposerAutoloadPass(cpg), - new PhpTypeStubsParserPass(cpg, setKnownTypesConfig) - ) ++ new PhpTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() :+ PhpTypeHintCallLinker(cpg) - } -} diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/astcreation/AstCreator.scala index 101e27f80168..5708008f8e17 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/astcreation/AstCreator.scala @@ -8,16 +8,16 @@ import io.joern.php2cpg.utils.Scope import io.joern.x2cpg.Ast.storeInDiffGraph import io.joern.x2cpg.Defines.{StaticInitMethodName, UnresolvedNamespace, UnresolvedSignature} import io.joern.x2cpg.utils.AstPropertiesUtil.RootProperties +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.utils.NodeBuilders.* import io.joern.x2cpg.{Ast, AstCreatorBase, AstNodeBuilder, ValidationMode} import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.passes.IntervalKeyPool import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate import java.nio.charset.StandardCharsets +import scala.collection.mutable class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], disableFileContent: Boolean)(implicit withSchemaValidation: ValidationMode @@ -31,7 +31,7 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], private def getNewTmpName(prefix: String = "tmp"): String = s"$prefix${tmpKeyPool.next.toString}" - override def createAst(): BatchedUpdate.DiffGraphBuilder = { + override def createAst(): DiffGraphBuilder = { val ast = astForPhpFile(phpAst) storeInDiffGraph(ast, diffGraph) diffGraph @@ -166,7 +166,7 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], Ast(thisNode) } - private def thisIdentifier(lineNumber: Option[Integer]): NewIdentifier = { + private def thisIdentifier(lineNumber: Option[Int]): NewIdentifier = { val typ = scope.getEnclosingTypeDeclTypeName newIdentifierNode(NameConstants.This, typ.getOrElse("ANY"), typ.toList, lineNumber) .code(s"$$${NameConstants.This}") @@ -431,7 +431,6 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], } val tryNode = controlStructureNode(stmt, ControlStructureTypes.TRY, "try { ... }") - setArgumentIndices(tryBody +: (catches ++ finallyBody.toSeq)) tryCatchAst(tryNode, tryBody, catches, finallyBody) } @@ -563,7 +562,7 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], wrapMultipleInBlock(imports, line(stmt)) } - private def astForKeyValPair(key: PhpExpr, value: PhpExpr, lineNo: Option[Integer]): Ast = { + private def astForKeyValPair(key: PhpExpr, value: PhpExpr, lineNo: Option[Int]): Ast = { val keyAst = astForExpr(key) val valueAst = astForExpr(value) @@ -575,6 +574,7 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], private def astForForeachStmt(stmt: PhpForeachStmt): Ast = { val iterIdentifier = getTmpIdentifier(stmt, maybeTypeFullName = None, prefix = "iter_") + // keep this just used to construct the `code` field val assignItemTargetAst = stmt.keyVar match { case Some(key) => astForKeyValPair(key, stmt.valueVar, line(stmt)) case None => astForExpr(stmt.valueVar) @@ -586,7 +586,7 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], val iteratorAssignAst = simpleAssignAst(Ast(iterIdentifier), iterValue, line(stmt)) // - Assigned item assign - val itemInitAst = getItemAssignAstForForeach(stmt, assignItemTargetAst, iterIdentifier.copy) + val itemInitAst = getItemAssignAstForForeach(stmt, iterIdentifier.copy) // Condition ast val isNullName = PhpOperators.isNull @@ -632,37 +632,66 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], .withConditionEdges(foreachNode, conditionAst.root.toList) } - private def getItemAssignAstForForeach( - stmt: PhpForeachStmt, - assignItemTargetAst: Ast, - iteratorIdentifier: NewIdentifier - ): Ast = { - val iteratorIdentifierAst = Ast(iteratorIdentifier) - val currentCallSignature = s"$UnresolvedSignature(0)" - val currentCallCode = s"${iteratorIdentifierAst.rootCodeOrEmpty}->current()" - val currentCallNode = callNode( - stmt, - currentCallCode, - "current", - "Iterator.current", - DispatchTypes.DYNAMIC_DISPATCH, - Some(currentCallSignature), - Some(TypeConstants.Any) + private def getItemAssignAstForForeach(stmt: PhpForeachStmt, iteratorIdentifier: NewIdentifier): Ast = { + // create assignment for value-part + val valueAssign = { + val iteratorIdentifierAst = Ast(iteratorIdentifier) + val currentCallSignature = s"$UnresolvedSignature(0)" + val currentCallCode = s"${iteratorIdentifierAst.rootCodeOrEmpty}->current()" + // `current` function is used to get the current element of given array + // see https://www.php.net/manual/en/function.current.php & https://www.php.net/manual/en/iterator.current.php + val currentCallNode = callNode( + stmt, + currentCallCode, + "current", + "Iterator.current", + DispatchTypes.DYNAMIC_DISPATCH, + Some(currentCallSignature), + Some(TypeConstants.Any) + ) + val currentCallAst = callAst(currentCallNode, base = Option(iteratorIdentifierAst)) + + val valueAst = if (stmt.assignByRef) { + val addressOfCode = s"&${currentCallAst.rootCodeOrEmpty}" + val addressOfCall = newOperatorCallNode(Operators.addressOf, addressOfCode, line = line(stmt)) + callAst(addressOfCall, currentCallAst :: Nil) + } else { + currentCallAst + } + simpleAssignAst(astForExpr(stmt.valueVar), valueAst, line(stmt)) + } + + // try to create assignment for key-part + val keyAssignOption = stmt.keyVar.map(keyVar => + val iteratorIdentifierAst = Ast(iteratorIdentifier.copy) + val keyCallSignature = s"$UnresolvedSignature(0)" + val keyCallCode = s"${iteratorIdentifierAst.rootCodeOrEmpty}->key()" + // `key` function is used to get the key of the current element + // see https://www.php.net/manual/en/function.key.php & https://www.php.net/manual/en/iterator.key.php + val keyCallNode = callNode( + stmt, + keyCallCode, + "key", + "Iterator.key", + DispatchTypes.DYNAMIC_DISPATCH, + Some(keyCallSignature), + Some(TypeConstants.Any) + ) + val keyCallAst = callAst(keyCallNode, base = Option(iteratorIdentifierAst)) + simpleAssignAst(astForExpr(keyVar), keyCallAst, line(stmt)) ) - val currentCallAst = callAst(currentCallNode, base = Option(iteratorIdentifierAst)) - val valueAst = if (stmt.assignByRef) { - val addressOfCode = s"&${currentCallAst.rootCodeOrEmpty}" - val addressOfCall = newOperatorCallNode(Operators.addressOf, addressOfCode, line = line(stmt)) - callAst(addressOfCall, currentCallAst :: Nil) - } else { - currentCallAst + keyAssignOption match { + case Some(keyAssign) => + Ast(blockNode(stmt)) + .withChild(keyAssign) + .withChild(valueAssign) + case None => + valueAssign } - - simpleAssignAst(assignItemTargetAst, valueAst, line(stmt)) } - private def simpleAssignAst(target: Ast, source: Ast, lineNo: Option[Integer]): Ast = { + private def simpleAssignAst(target: Ast, source: Ast, lineNo: Option[Int]): Ast = { val code = s"${target.rootCodeOrEmpty} = ${source.rootCodeOrEmpty}" val callNode = newOperatorCallNode(Operators.assignment, code, line = lineNo) callAst(callNode, target :: source :: Nil) @@ -1098,12 +1127,103 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], arrayPushAst } + /** Lower the array/list unpack. For example `[$a, $b] = $arr;` will be lowered to `$a = $arr[0]; $b = $arr[1];` + */ + private def astForArrayUnpack(assignment: PhpAssignment, target: PhpArrayExpr | PhpListExpr): Ast = { + val loweredAssignNodes = mutable.ListBuffer.empty[Ast] + + // create a Identifier ast for given name + def createIdentifier(name: String): Ast = Ast(identifierNode(assignment, name, s"$$$name", TypeConstants.Any)) + + def createIndexAccessChain( + targetAst: Ast, + sourceAst: Ast, + idxTracker: ArrayIndexTracker, + item: PhpArrayItem + ): Ast = { + // copy from `assignForArrayItem` to handle the case where key exists, such as `list("id" => $a, "name" => $b) = $arr;` + val dimension = item.key match { + case Some(key: PhpSimpleScalar) => dimensionFromSimpleScalar(key, idxTracker) + case Some(key) => key + case None => PhpInt(idxTracker.next, item.attributes) + } + val dimensionAst = astForExpr(dimension) + val indexAccessCode = s"${sourceAst.rootCodeOrEmpty}[${dimensionAst.rootCodeOrEmpty}]" + // .indexAccess(sourceAst, index) + val indexAccessNode = callAst( + newOperatorCallNode(Operators.indexAccess, indexAccessCode, line = line(item)), + sourceAst :: dimensionAst :: Nil + ) + val assignCode = s"${targetAst.rootCodeOrEmpty} = $indexAccessCode" + val assignNode = newOperatorCallNode(Operators.assignment, assignCode, line = line(item)) + // targetAst = .indexAccess(sourceAst, index) + callAst(assignNode, targetAst :: indexAccessNode :: Nil) + } + + // Take `[[$a, $b], $c] = $arr;` as an example + def handleUnpackLowering( + target: PhpArrayExpr | PhpListExpr, + itemsOf: PhpArrayExpr | PhpListExpr => List[Option[PhpArrayItem]], + sourceAst: Ast + ): Unit = { + val idxTracker = new ArrayIndexTracker + + // create an alias identifier of $arr + val sourceAliasName = getNewTmpName() + val sourceAliasIdentifier = createIdentifier(sourceAliasName) + val assignCode = s"${sourceAliasIdentifier.rootCodeOrEmpty} = ${sourceAst.rootCodeOrEmpty}" + val assignNode = newOperatorCallNode(Operators.assignment, assignCode, line = line(assignment)) + loweredAssignNodes += callAst(assignNode, sourceAliasIdentifier :: sourceAst :: Nil) + + itemsOf(target).foreach { + case Some(item) => + item.value match { + case nested: (PhpArrayExpr | PhpListExpr) => // item is [$a, $b] + // create tmp variable for [$a, $b] to receive the result of .indexAccess($arr, 0) + val tmpIdentifierName = getNewTmpName() + // tmpVar = .indexAccess($arr, 0) + val targetAssignNode = + createIndexAccessChain( + createIdentifier(tmpIdentifierName), + createIdentifier(sourceAliasName), + idxTracker, + item + ) + loweredAssignNodes += targetAssignNode + handleUnpackLowering(nested, itemsOf, createIdentifier(tmpIdentifierName)) + case phpVar: PhpVariable => // item is $c + val identifier = astForExpr(phpVar) + // $c = .indexAccess($arr, 1) + val targetAssignNode = + createIndexAccessChain(identifier, createIdentifier(sourceAliasName), idxTracker, item) + loweredAssignNodes += targetAssignNode + case _ => + // unknown case + idxTracker.next + } + case None => + idxTracker.next + } + } + + val sourceAst = astForExpr(assignment.source) + val itemsOf = (exp: PhpArrayExpr | PhpListExpr) => + exp match { + case x: PhpArrayExpr => x.items + case x: PhpListExpr => x.items + } + handleUnpackLowering(target, itemsOf, sourceAst) + Ast(blockNode(assignment)) + .withChildren(loweredAssignNodes.toList) + } + private def astForAssignment(assignment: PhpAssignment): Ast = { assignment.target match { case arrayDimFetch: PhpArrayDimFetchExpr if arrayDimFetch.dimension.isEmpty => // Rewrite `$xs[] = ` as `array_push($xs, )` to simplify finding dataflows. astForEmptyArrayDimAssign(assignment, arrayDimFetch) - + case arrayExpr: (PhpArrayExpr | PhpListExpr) => + astForArrayUnpack(assignment, arrayExpr) case _ => val operatorName = assignment.assignOp @@ -1294,10 +1414,30 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], private def astForArrayExpr(expr: PhpArrayExpr): Ast = { val idxTracker = new ArrayIndexTracker - val tmpIdentifier = getTmpIdentifier(expr, Some(TypeConstants.Array)) + val tmpName = getNewTmpName() + + def newTmpIdentifier: Ast = Ast(identifierNode(expr, tmpName, s"$$$tmpName", TypeConstants.Array)) + + val tmpIdentifierAssignNode = { + // use array() function to create an empty array. see https://www.php.net/manual/zh/function.array.php + val initArrayNode = callNode( + expr, + "array()", + "array", + "array", + DispatchTypes.STATIC_DISPATCH, + Some("array()"), + Some(TypeConstants.Array) + ) + val initArrayCallAst = callAst(initArrayNode) + + val assignCode = s"$$$tmpName = ${initArrayCallAst.rootCodeOrEmpty}" + val assignNode = newOperatorCallNode(Operators.assignment, assignCode, line = line(expr)) + callAst(assignNode, newTmpIdentifier :: initArrayCallAst :: Nil) + } val itemAssignments = expr.items.flatMap { - case Some(item) => Option(assignForArrayItem(item, tmpIdentifier.name, idxTracker)) + case Some(item) => Option(assignForArrayItem(item, tmpName, idxTracker)) case None => idxTracker.next // Skip an index None @@ -1305,8 +1445,9 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], val arrayBlock = blockNode(expr) Ast(arrayBlock) + .withChild(tmpIdentifierAssignNode) .withChildren(itemAssignments) - .withChild(Ast(tmpIdentifier)) + .withChild(newTmpIdentifier) } private def astForListExpr(expr: PhpListExpr): Ast = { @@ -1724,11 +1865,11 @@ class AstCreator(filename: String, phpAst: PhpFile, fileContent: Option[String], } } - protected def line(phpNode: PhpNode): Option[Integer] = phpNode.attributes.lineNumber - protected def column(phpNode: PhpNode): Option[Integer] = None - protected def lineEnd(phpNode: PhpNode): Option[Integer] = None - protected def columnEnd(phpNode: PhpNode): Option[Integer] = None - protected def code(phpNode: PhpNode): String = "" // Sadly, the Php AST does not carry any code fields + protected def line(phpNode: PhpNode): Option[Int] = phpNode.attributes.lineNumber + protected def column(phpNode: PhpNode): Option[Int] = None + protected def lineEnd(phpNode: PhpNode): Option[Int] = None + protected def columnEnd(phpNode: PhpNode): Option[Int] = None + protected def code(phpNode: PhpNode): String = "" // Sadly, the Php AST does not carry any code fields override protected def offset(phpNode: PhpNode): Option[(Int, Int)] = { Option.when(!disableFileContent) { diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/parser/Domain.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/parser/Domain.scala index c6b351426233..eab3c44b3a6e 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/parser/Domain.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/parser/Domain.scala @@ -82,14 +82,14 @@ object Domain { // Used for creating the default constructor. val ConstructorMethodName = "__construct" - final case class PhpAttributes(lineNumber: Option[Integer], kind: Option[Int], startFilePos: Int, endFilePos: Int) + final case class PhpAttributes(lineNumber: Option[Int], kind: Option[Int], startFilePos: Int, endFilePos: Int) object PhpAttributes { val Empty: PhpAttributes = PhpAttributes(None, None, -1, -1) def apply(json: Value): PhpAttributes = { Try(json("attributes")) match { case Success(Obj(attributes)) => - val startLine = attributes.get("startLine").map(num => Integer.valueOf(num.num.toInt)) + val startLine = attributes.get("startLine").map(_.num.toInt) val kind = attributes.get("kind").map(_.num.toInt) val startFilePos = attributes.get("startFilePos").map(_.num.toInt).getOrElse(-1) val endFilePos = attributes.get("endFilePos").map(_.num.toInt + 1).getOrElse(-1) diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AnyTypePass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AnyTypePass.scala index 3b57ec173694..c65478137eb0 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AnyTypePass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AnyTypePass.scala @@ -1,19 +1,19 @@ package io.joern.php2cpg.passes import io.joern.php2cpg.astcreation.AstCreator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.codepropertygraph.generated.nodes.AstNode import io.shiftleft.codepropertygraph.generated.nodes.Call.PropertyDefaults -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* // TODO This is a hack for a customer issue. Either extend this to handle type full names properly, // or do it elsewhere. -class AnyTypePass(cpg: Cpg) extends ConcurrentWriterCpgPass[AstNode](cpg) { +class AnyTypePass(cpg: Cpg) extends ForkJoinParallelCpgPass[AstNode](cpg) { override def generateParts(): Array[AstNode] = { - cpg.has(PropertyNames.TYPE_FULL_NAME, PropertyDefaults.TypeFullName).collectAll[AstNode].toArray + cpg.graph.nodesWithProperty(PropertyNames.TYPE_FULL_NAME, PropertyDefaults.TypeFullName).collectAll[AstNode].toArray } override def runOnPart(diffGraph: DiffGraphBuilder, node: AstNode): Unit = { diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstCreationPass.scala index a353310fe512..8de34aa75a68 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstCreationPass.scala @@ -5,14 +5,14 @@ import io.joern.php2cpg.Config import io.joern.php2cpg.astcreation.AstCreator import io.joern.php2cpg.parser.PhpParser import io.joern.x2cpg.{SourceFiles, ValidationMode} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* class AstCreationPass(config: Config, cpg: Cpg, parser: PhpParser)(implicit withSchemaValidation: ValidationMode) - extends ConcurrentWriterCpgPass[String](cpg) { + extends ForkJoinParallelCpgPass[String](cpg) { private val logger = LoggerFactory.getLogger(this.getClass) diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstParentInfoPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstParentInfoPass.scala index 6da46de857ba..701b7523d033 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstParentInfoPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/AstParentInfoPass.scala @@ -1,12 +1,11 @@ package io.joern.php2cpg.passes -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.{Cpg, Properties, PropertyNames} import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, NamespaceBlock, Method, TypeDecl} -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* -class AstParentInfoPass(cpg: Cpg) extends ConcurrentWriterCpgPass[AstNode](cpg) { +class AstParentInfoPass(cpg: Cpg) extends ForkJoinParallelCpgPass[AstNode](cpg) { override def generateParts(): Array[AstNode] = { (cpg.method ++ cpg.typeDecl).toArray @@ -15,7 +14,7 @@ class AstParentInfoPass(cpg: Cpg) extends ConcurrentWriterCpgPass[AstNode](cpg) override def runOnPart(diffGraph: DiffGraphBuilder, node: AstNode): Unit = { findParent(node).foreach { parentNode => val astParentType = parentNode.label - val astParentFullName = parentNode.property(PropertyNames.FULL_NAME) + val astParentFullName = parentNode.property(Properties.FullName) diffGraph.setNodeProperty(node, PropertyNames.AST_PARENT_TYPE, astParentType) diffGraph.setNodeProperty(node, PropertyNames.AST_PARENT_FULL_NAME, astParentFullName) diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ClosureRefPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ClosureRefPass.scala index 5bc47f4820ab..c5c2c289a54c 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ClosureRefPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ClosureRefPass.scala @@ -1,15 +1,15 @@ package io.joern.php2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{ClosureBinding, Method, MethodRef} -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.AstNode import io.shiftleft.codepropertygraph.generated.nodes.Local -class ClosureRefPass(cpg: Cpg) extends ConcurrentWriterCpgPass[ClosureBinding](cpg) { +class ClosureRefPass(cpg: Cpg) extends ForkJoinParallelCpgPass[ClosureBinding](cpg) { private val logger = LoggerFactory.getLogger(this.getClass) override def generateParts(): Array[ClosureBinding] = cpg.all.collectAll[ClosureBinding].toArray @@ -22,7 +22,7 @@ class ClosureRefPass(cpg: Cpg) extends ConcurrentWriterCpgPass[ClosureBinding](c * that is the scope in which the closure would have originally been created. */ override def runOnPart(diffGraph: DiffGraphBuilder, closureBinding: ClosureBinding): Unit = { - closureBinding.captureIn.collectAll[MethodRef].toList match { + closureBinding._methodRefViaCaptureIn.toList match { case Nil => logger.error(s"No MethodRef corresponding to closureBinding ${closureBinding.closureBindingId}") diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencyPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencyPass.scala index 003efcc8d33c..8b56de0fa15e 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencyPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencyPass.scala @@ -6,7 +6,6 @@ import io.shiftleft.codepropertygraph.generated.nodes.{NewDependency, NewTag} import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes} import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate import upickle.default.* import scala.annotation.targetName diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencySymbolsPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencySymbolsPass.scala index 6458b59033d1..666fe17e776a 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencySymbolsPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/DependencySymbolsPass.scala @@ -8,7 +8,7 @@ import io.joern.x2cpg.passes.base.MethodStubCreator import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.{NewMethod, NewTypeDecl} import io.shiftleft.codepropertygraph.generated.{Cpg, DispatchTypes, NodeTypes} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.slf4j.LoggerFactory @@ -20,7 +20,7 @@ import scala.util.{Failure, Success} * @param dependencyDir * the directory holding the downloaded dependencies. */ -class DependencySymbolsPass(cpg: Cpg, dependencyDir: File) extends ConcurrentWriterCpgPass[ClassParserClass](cpg) { +class DependencySymbolsPass(cpg: Cpg, dependencyDir: File) extends ForkJoinParallelCpgPass[ClassParserClass](cpg) { private val logger = LoggerFactory.getLogger(this.getClass) implicit val validationMode: ValidationMode = ValidationMode.Disabled diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/LocalCreationPass.scala b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/LocalCreationPass.scala index 4a714ff04925..2e113b80ae0a 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/LocalCreationPass.scala +++ b/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/LocalCreationPass.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.passes -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{ AstNode, @@ -13,7 +13,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ NewNode, TypeDecl } -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.joern.php2cpg.astcreation.AstCreator import io.joern.php2cpg.parser.Domain import io.joern.php2cpg.parser.Domain.PhpOperators @@ -26,13 +26,13 @@ object LocalCreationPass { } abstract class LocalCreationPass[ScopeType <: AstNode](cpg: Cpg) - extends ConcurrentWriterCpgPass[ScopeType](cpg) + extends ForkJoinParallelCpgPass[ScopeType](cpg) with AstNodeBuilder[AstNode, LocalCreationPass[ScopeType]] { - override protected def line(node: AstNode) = node.lineNumber - override protected def column(node: AstNode) = node.columnNumber - override protected def lineEnd(node: AstNode): Option[Integer] = None - override protected def columnEnd(node: AstNode): Option[Integer] = None - override protected def code(node: AstNode): String = node.code + override protected def line(node: AstNode) = node.lineNumber + override protected def column(node: AstNode) = node.columnNumber + override protected def lineEnd(node: AstNode): Option[Int] = None + override protected def columnEnd(node: AstNode): Option[Int] = None + override protected def code(node: AstNode): String = node.code protected def getIdentifiersInScope(node: AstNode): List[Identifier] = { node match { @@ -96,7 +96,7 @@ abstract class LocalCreationPass[ScopeType <: AstNode](cpg: Cpg) ): Unit = { val identifierMap = getIdentifiersInScope(bodyNode) - .filter(_.refOut.isEmpty) + .filter(_._refOut.isEmpty) .filterNot(excludeIdentifierFn) .groupBy(_.name) diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/dataflow/IntraMethodDataflowTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/dataflow/IntraMethodDataflowTests.scala index 737898f2bc05..7d680770be71 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/dataflow/IntraMethodDataflowTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/dataflow/IntraMethodDataflowTests.scala @@ -1,8 +1,8 @@ package io.joern.php2cpg.dataflow import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* class IntraMethodDataflowTests extends PhpCode2CpgFixture(runOssDataflow = true) { "flows from parameters to corresponding identifiers should be found" in { @@ -29,4 +29,50 @@ class IntraMethodDataflowTests extends PhpCode2CpgFixture(runOssDataflow = true) flows.size shouldBe 1 } + + "flow from single layer array unpacking should be found" in { + val cpg = code(""" $value) { + | echo $key; + | echo $value; + |} + |""".stripMargin) + val source = cpg.identifier("arr") + val sink = cpg.call("echo").argument(1) + val flows = sink.reachableByFlows(source) + flows.size shouldBe 2 + } } diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/CfgCreationPassTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/CfgCreationPassTests.scala index 9b06bd11cd1d..b602b6c82784 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/CfgCreationPassTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/CfgCreationPassTests.scala @@ -3,7 +3,7 @@ package io.joern.php2cpg.passes import io.joern.php2cpg.testfixtures.PhpFrontend import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.AlwaysEdge import io.joern.x2cpg.testfixtures.{CfgTestCpg, CfgTestFixture} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class PhpCfgTestCpg extends CfgTestCpg with PhpFrontend @@ -29,7 +29,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("break(1)") shouldBe expected(("$i", AlwaysEdge)) + succOf("break(1)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } "be correct for break with level 2" in { @@ -40,7 +40,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("break(2)") shouldBe expected(("RET", AlwaysEdge)) + succOf("break(2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for continue with level 1" in { @@ -51,7 +51,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("continue(1)") shouldBe expected(("$j", AlwaysEdge)) + succOf("continue(1)") should contain theSameElementsAs expected(("$j", AlwaysEdge)) } "be correct for continue with level 2" in { @@ -62,7 +62,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("continue(2)") shouldBe expected(("$i", AlwaysEdge)) + succOf("continue(2)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } } @@ -75,7 +75,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } while ($j < 1); |} while ($i < 1) |""".stripMargin) - succOf("break(1)") shouldBe expected(("$i", AlwaysEdge)) + succOf("break(1)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } "be correct for break with level 2" in { @@ -86,7 +86,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } while ($j < 1); |} while ($i < 1) |""".stripMargin) - succOf("break(2)") shouldBe expected(("RET", AlwaysEdge)) + succOf("break(2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for continue with level 1" in { @@ -97,7 +97,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } while ($j < 1); |} while ($i < 1) |""".stripMargin) - succOf("continue(1)") shouldBe expected(("$j", AlwaysEdge)) + succOf("continue(1)") should contain theSameElementsAs expected(("$j", AlwaysEdge)) } "be correct for continue with level 2" in { @@ -108,7 +108,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } while ($j < 1); |} while ($i < 1) |""".stripMargin) - succOf("continue(2)") shouldBe expected(("$i", AlwaysEdge)) + succOf("continue(2)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } } @@ -121,7 +121,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("break(1)") shouldBe expected(("$i", AlwaysEdge)) + succOf("break(1)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } "be correct for break with level 2" in { @@ -132,7 +132,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("break(2)") shouldBe expected(("RET", AlwaysEdge)) + succOf("break(2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "be correct for continue with level 1" in { @@ -143,7 +143,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("continue(1)") shouldBe expected(("$j", AlwaysEdge)) + succOf("continue(1)") should contain theSameElementsAs expected(("$j", AlwaysEdge)) } "be correct for continue with level 2" in { @@ -154,7 +154,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | } |} |""".stripMargin) - succOf("continue(2)") shouldBe expected(("$i", AlwaysEdge)) + succOf("continue(2)") should contain theSameElementsAs expected(("$i", AlwaysEdge)) } } @@ -170,7 +170,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | $k; |} |""".stripMargin) - succOf("break(1)") shouldBe expected(("$k", AlwaysEdge)) + succOf("break(1)") should contain theSameElementsAs expected(("$k", AlwaysEdge)) } "be correct for break with level 2" in { @@ -184,7 +184,7 @@ class CfgCreationPassTests extends CfgTestFixture(() => new PhpCfgTestCpg) { | $k; |} |""".stripMargin) - succOf("break(2)") shouldBe expected(("RET", AlwaysEdge)) + succOf("break(2)") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } } diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/PhpTypeRecoveryPassTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/PhpTypeRecoveryPassTests.scala index 4ac51f5779d8..0384627d1110 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/PhpTypeRecoveryPassTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/passes/PhpTypeRecoveryPassTests.scala @@ -525,7 +525,7 @@ class PhpTypeRecoveryPassTests extends PhpCode2CpgFixture() { "propagate this QueryBuilder type to the identifier assigned to the inherited call for the wrapped `createQueryBuilder`" in { cpg.method .nameExact("findSomething") - ._containsOut + .containsOut .collectAll[Identifier] .nameExact("queryBuilder") .typeFullName @@ -543,7 +543,103 @@ class PhpTypeRecoveryPassTests extends PhpCode2CpgFixture() { "resolve the correct full name for `setParameter` based on the QueryBuilder return value" in { inside(cpg.call.nameExact("setParameter").l) { case setParamCall :: Nil => - setParamCall.methodFullName shouldBe "Doctrine\\ORM\\QueryBuilder->leftJoin->->setParameter" + setParamCall.methodFullName shouldBe "Doctrine\\ORM\\QueryBuilder->leftJoin->setParameter" + case xs => fail(s"Expected one call, instead got [$xs]") + } + } + } + + "a reference to a field of some external type (propagated via inherited and chained calls)" should { + val cpg = code( + """ + |entityManager = $entityManager; + | } + | + | protected function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder + | { + | return $this->entityManager->createQueryBuilder()->select($alias) + | ->from("ABC", $alias, $indexBy); + | } + |} + |""".stripMargin, + "AbstractEntity.php" + ).moreCode( + """ + |getRootAlias(); + | $userAlias = $this->aliasHelper->getAliasForClass(User::class); + | $productAlias = $this->aliasHelper->getAliasForClass(Product::class); + | $creditRedemptionAlias = $this->aliasHelper->getAliasForClass(CreditRedemption::class); + | $accountAlias = $this->aliasHelper->getAliasForClass(Account::class); + | $queryBuilder = $this->createQueryBuilder($rootAlias); + | + | $queryBuilder + | ->leftJoin(sprintf('%s.creditRedemptions', $rootAlias), $creditRedemptionAlias) + | ->leftJoin(sprintf('%s.product', $rootAlias), $productAlias) + | ->leftJoin(sprintf('%s.account', $rootAlias), $accountAlias) + | ->andWhere( + | $expr->andX( + | $expr->eq(sprintf('%s.account', $rootAlias), ':accountId'), + | $expr->eq(sprintf('%s.type', $productAlias), ':productType'), + | $expr->lte(sprintf('%s.validFrom', $rootAlias), ':date'), + | $expr->gte(sprintf('%s.validTo', $rootAlias), ':date') + | ) + | ) + | ->groupBy(sprintf('%s.id', $rootAlias)) + | ->having( + | $expr->gt( + | sprintf('%s.quantity', $rootAlias), + | $expr->count(sprintf('%s.id', $creditRedemptionAlias)) + | ) + | ) + | ->orderBy(sprintf('%s.validTo', $rootAlias), 'asc') + | ->setParameter('accountId', $accountId); + | + | return $queryBuilder->getQuery()->execute()[0] ?? null; + | } + |} + |""".stripMargin, + "User.php" + ) + + "resolve the correct full name for `setParameter` in a long call chain based on the QueryBuilder return value" in { + inside(cpg.method("findSomethingElse").call.nameExact("setParameter").l) { + case setParamCall :: Nil => + setParamCall.methodFullName shouldBe + "Doctrine\\ORM\\QueryBuilder->leftJoin->leftJoin->leftJoin->andWhere->groupBy->having->orderBy->setParameter" case xs => fail(s"Expected one call, instead got [$xs]") } } diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ArrayTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ArrayTests.scala index 7e671a914683..bf213794b2c6 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ArrayTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ArrayTests.scala @@ -3,7 +3,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal, Local} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ArrayTests extends PhpCode2CpgFixture { "array accesses with variable keys should be represented as index accesses" in { @@ -77,16 +77,20 @@ class ArrayTests extends PhpCode2CpgFixture { tmpLocal.name shouldBe "tmp0" tmpLocal.code shouldBe "$tmp0" - inside(arrayBlock.astChildren.l) { case List(aAssign: Call, bAssign: Call, tmpIdent: Identifier) => - aAssign.code shouldBe "$tmp0[\"A\"] = 1" - aAssign.lineNumber shouldBe Some(3) + inside(arrayBlock.astChildren.l) { + case List(initAssign: Call, aAssign: Call, bAssign: Call, tmpIdent: Identifier) => + initAssign.code shouldBe "$tmp0 = array()" + initAssign.lineNumber shouldBe Some(2) - bAssign.code shouldBe "$tmp0[\"B\"] = 2" - bAssign.lineNumber shouldBe Some(4) + aAssign.code shouldBe "$tmp0[\"A\"] = 1" + aAssign.lineNumber shouldBe Some(3) - tmpIdent.name shouldBe "tmp0" - tmpIdent.code shouldBe "$tmp0" - tmpIdent._localViaRefOut should contain(tmpLocal) + bAssign.code shouldBe "$tmp0[\"B\"] = 2" + bAssign.lineNumber shouldBe Some(4) + + tmpIdent.name shouldBe "tmp0" + tmpIdent.code shouldBe "$tmp0" + tmpIdent._localViaRefOut should contain(tmpLocal) } } } @@ -103,16 +107,20 @@ class ArrayTests extends PhpCode2CpgFixture { tmpLocal.name shouldBe "tmp0" tmpLocal.code shouldBe "$tmp0" - inside(arrayBlock.astChildren.l) { case List(aAssign: Call, bAssign: Call, tmpIdent: Identifier) => - aAssign.code shouldBe "$tmp0[0] = \"A\"" - aAssign.lineNumber shouldBe Some(3) + inside(arrayBlock.astChildren.l) { + case List(initAssign: Call, aAssign: Call, bAssign: Call, tmpIdent: Identifier) => + initAssign.code shouldBe "$tmp0 = array()" + initAssign.lineNumber shouldBe Some(2) + + aAssign.code shouldBe "$tmp0[0] = \"A\"" + aAssign.lineNumber shouldBe Some(3) - bAssign.code shouldBe "$tmp0[1] = \"B\"" - bAssign.lineNumber shouldBe Some(4) + bAssign.code shouldBe "$tmp0[1] = \"B\"" + bAssign.lineNumber shouldBe Some(4) - tmpIdent.name shouldBe "tmp0" - tmpIdent.code shouldBe "$tmp0" - tmpIdent._localViaRefOut should contain(tmpLocal) + tmpIdent.name shouldBe "tmp0" + tmpIdent.code shouldBe "$tmp0" + tmpIdent._localViaRefOut should contain(tmpLocal) } } } @@ -128,7 +136,10 @@ class ArrayTests extends PhpCode2CpgFixture { tmpLocal.name shouldBe "tmp0" tmpLocal.code shouldBe "$tmp0" - inside(arrayBlock.astChildren.l) { case List(assign: Call, tmpIdent: Identifier) => + inside(arrayBlock.astChildren.l) { case List(initAssign: Call, assign: Call, tmpIdent: Identifier) => + initAssign.code shouldBe "$tmp0 = array()" + initAssign.lineNumber shouldBe Some(2) + assign.code shouldBe "$tmp0[2] = \"A\"" inside(assign.argument.collectAll[Call].argument.l) { case List(array: Identifier, index: Literal) => array.name shouldBe "tmp0" @@ -164,6 +175,7 @@ class ArrayTests extends PhpCode2CpgFixture { inside(arrayBlock.astChildren.l) { case List( + initAssign: Call, aAssign: Call, cAssign: Call, fourAssign: Call, @@ -173,6 +185,9 @@ class ArrayTests extends PhpCode2CpgFixture { eightAssign: Call, tmpIdent: Identifier ) => + initAssign.code shouldBe "$tmp0 = array()" + initAssign.lineNumber shouldBe Some(2) + aAssign.code shouldBe "$tmp0[\"A\"] = \"B\"" cAssign.code shouldBe "$tmp0[0] = \"C\"" fourAssign.code shouldBe "$tmp0[4] = \"D\"" diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CallTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CallTests.scala index 9e554bb19725..7297935b2db3 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CallTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CallTests.scala @@ -5,7 +5,7 @@ import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CallTests extends PhpCode2CpgFixture { "variable call arguments with names matching methods should not have a methodref" in { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CfgTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CfgTests.scala index c630338e7794..49f9c79a2708 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CfgTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CfgTests.scala @@ -3,7 +3,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.parser.Domain.PhpOperators import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Call, JumpTarget} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CfgTests extends PhpCode2CpgFixture { "the CFG for match constructs" when { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CommentTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CommentTests.scala index c7b490ff6922..26728291ee45 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CommentTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/CommentTests.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CommentTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ControlStructureTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ControlStructureTests.scala index c67fe7bbc2a4..419d1d83d446 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ControlStructureTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ControlStructureTests.scala @@ -14,7 +14,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ Literal, Local } -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.AstNode import scala.util.Try @@ -1261,17 +1261,24 @@ class ControlStructureTests extends PhpCode2CpgFixture { (initAsts, updateAsts, body) } - inside(initAsts.astChildren.l) { case List(_: Call, valInit: Call) => - valInit.name shouldBe Operators.assignment - valInit.code shouldBe "$key => $val = $iter_tmp0->current()" - inside(valInit.argument.l) { case List(valPair: Call, currentCall: Call) => - valPair.name shouldBe PhpOperators.doubleArrow - valPair.code shouldBe "$key => $val" - inside(valPair.argument.l) { case List(keyId: Identifier, valId: Identifier) => - keyId.name shouldBe "key" - valId.name shouldBe "val" + inside(initAsts.assignment.l) { case List(_: Call, keyInit: Call, valInit: Call) => + keyInit.name shouldBe Operators.assignment + keyInit.code shouldBe "$key = $iter_tmp0->key()" + inside(keyInit.argument.l) { case List(target: Identifier, keyCall: Call) => + target.name shouldBe "key" + keyCall.name shouldBe "key" + keyCall.methodFullName shouldBe s"Iterator.key" + keyCall.code shouldBe "$iter_tmp0->key()" + inside(keyCall.argument(0).start.l) { case List(iterRecv: Identifier) => + iterRecv.name shouldBe "iter_tmp0" + iterRecv.argumentIndex shouldBe 0 } + } + valInit.name shouldBe Operators.assignment + valInit.code shouldBe "$val = $iter_tmp0->current()" + inside(valInit.argument.l) { case List(target: Identifier, currentCall: Call) => + target.name shouldBe "val" currentCall.name shouldBe "current" currentCall.methodFullName shouldBe s"Iterator.current" currentCall.code shouldBe "$iter_tmp0->current()" @@ -1282,9 +1289,12 @@ class ControlStructureTests extends PhpCode2CpgFixture { } } - inside(updateAsts.astChildren.l) { case List(_: Call, valAssign: Call) => - valAssign.name shouldBe Operators.assignment - valAssign.code shouldBe "$key => $val = $iter_tmp0->current()" + inside(updateAsts.astChildren.l) { case List(_: Call, updateBlock: Block) => + val tmp = updateBlock.astChildren.l + inside(updateBlock.assignment.l) { case List(keyInit: Call, valInit: Call) => + keyInit.code shouldBe "$key = $iter_tmp0->key()" + valInit.code shouldBe "$val = $iter_tmp0->current()" + } } inside(body.astChildren.l) { case List(echoCall: Call) => diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/FieldAccessTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/FieldAccessTests.scala index c016b8c0fadb..3925ebd2d799 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/FieldAccessTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/FieldAccessTests.scala @@ -3,7 +3,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{FieldIdentifier, Identifier} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class FieldAccessTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/LocalTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/LocalTests.scala index 322bd1a5a79d..ec99c5e84002 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/LocalTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/LocalTests.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class LocalTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/MemberTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/MemberTests.scala index 087fb9e578c8..a69a4334520c 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/MemberTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/MemberTests.scala @@ -5,7 +5,7 @@ import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.{ModifierTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MemberTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/NamespaceTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/NamespaceTests.scala index 4b5ff757d74b..b8e062767765 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/NamespaceTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/NamespaceTests.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.Method class NamespaceTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/OperatorTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/OperatorTests.scala index cc0c46830db0..1d5b184888a1 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/OperatorTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/OperatorTests.scala @@ -4,10 +4,10 @@ import io.joern.php2cpg.astcreation.AstCreator.TypeConstants import io.joern.php2cpg.parser.Domain.{PhpDomainTypeConstants, PhpOperators} import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.joern.x2cpg.Defines -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} +import io.joern.x2cpg.utils.IntervalKeyPool +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, NodeTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal, TypeRef} -import io.shiftleft.passes.IntervalKeyPool -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal class OperatorTests extends PhpCode2CpgFixture { @@ -497,29 +497,6 @@ class OperatorTests extends PhpCode2CpgFixture { } } - "temporary list implementation should work" in { - // TODO This is a simple placeholder implementation that represents most of the useful information - // in the AST, while being pretty much unusable for dataflow. A better implementation needs to follow. - val cpg = code(""" - listCall.methodFullName shouldBe PhpOperators.listFunc - listCall.code shouldBe "list($a,$b)" - listCall.lineNumber shouldBe Some(2) - inside(listCall.argument.l) { case List(aArg: Identifier, bArg: Identifier) => - aArg.name shouldBe "a" - aArg.code shouldBe "$a" - aArg.lineNumber shouldBe Some(2) - - bArg.name shouldBe "b" - bArg.code shouldBe "$b" - bArg.lineNumber shouldBe Some(2) - } - } - } - "include calls" should { "be correctly represented for normal includes" in { val cpg = code(""" $d) = $arr; + |""".stripMargin) + // finds the block containing the assignments + val block = cpg.all.collect { case block: Block if block.lineNumber.contains(2) => block }.head + inside(block.astChildren.assignment.l) { case tmp0 :: tmp1 :: tmp2 :: a :: b :: c :: d :: Nil => + tmp0.code shouldBe "$tmp0 = $arr" + tmp0.source.label shouldBe NodeTypes.IDENTIFIER + tmp0.source.code shouldBe "$arr" + tmp0.target.label shouldBe NodeTypes.IDENTIFIER + tmp0.target.code shouldBe "$tmp0" + + tmp1.code shouldBe "$tmp1 = $tmp0[0]" + tmp1.source.label shouldBe NodeTypes.CALL + tmp1.source.asInstanceOf[Call].name shouldBe Operators.indexAccess + tmp1.source.code shouldBe "$tmp0[0]" + tmp1.target.label shouldBe NodeTypes.IDENTIFIER + tmp1.target.code shouldBe "$tmp1" + + tmp2.code shouldBe "$tmp2 = $tmp1" + tmp2.source.label shouldBe NodeTypes.IDENTIFIER + tmp2.source.code shouldBe "$tmp1" + tmp2.target.label shouldBe NodeTypes.IDENTIFIER + tmp2.target.code shouldBe "$tmp2" + + a.code shouldBe "$a = $tmp2[0]" + a.source.label shouldBe NodeTypes.CALL + a.source.asInstanceOf[Call].name shouldBe Operators.indexAccess + a.source.code shouldBe "$tmp2[0]" + a.target.label shouldBe NodeTypes.IDENTIFIER + a.target.code shouldBe "$a" + + b.code shouldBe "$b = $tmp2[1]" + b.source.label shouldBe NodeTypes.CALL + b.source.asInstanceOf[Call].name shouldBe Operators.indexAccess + b.source.code shouldBe "$tmp2[1]" + b.target.label shouldBe NodeTypes.IDENTIFIER + b.target.code shouldBe "$b" + + c.code shouldBe "$c = $tmp0[1]" + c.source.label shouldBe NodeTypes.CALL + c.source.asInstanceOf[Call].name shouldBe Operators.indexAccess + c.source.code shouldBe "$tmp0[1]" + c.target.label shouldBe NodeTypes.IDENTIFIER + c.target.code shouldBe "$c" + + d.code shouldBe "$d = $tmp0[\"d\"]" + d.source.label shouldBe NodeTypes.CALL + d.source.asInstanceOf[Call].name shouldBe Operators.indexAccess + d.source.code shouldBe "$tmp0[\"d\"]" + d.target.label shouldBe NodeTypes.IDENTIFIER + d.target.code shouldBe "$d" + } + } } diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/PocTest.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/PocTest.scala index 83a8b537fce1..ca17c9c06936 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/PocTest.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/PocTest.scala @@ -4,7 +4,7 @@ import io.joern.php2cpg.astcreation.AstCreator.TypeConstants import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class PocTest extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ScalarTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ScalarTests.scala index 0d913e2fa4cd..2f3b4e530e94 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ScalarTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/ScalarTests.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Literal} class ScalarTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/TypeNodeTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/TypeNodeTests.scala index c26317f4dc3f..f2a6ce23bd03 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/TypeNodeTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/TypeNodeTests.scala @@ -4,7 +4,7 @@ import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.{ModifierTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal, Local, Member, Method} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.Block class TypeNodeTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/UseTests.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/UseTests.scala index f9c911f8c617..040966272f3c 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/UseTests.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/querying/UseTests.scala @@ -1,7 +1,7 @@ package io.joern.php2cpg.querying import io.joern.php2cpg.testfixtures.PhpCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class UseTests extends PhpCode2CpgFixture { diff --git a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/testfixtures/PhpCode2CpgFixture.scala b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/testfixtures/PhpCode2CpgFixture.scala index a5eb2e5d46c3..cb848636f420 100644 --- a/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/testfixtures/PhpCode2CpgFixture.scala +++ b/joern-cli/frontends/php2cpg/src/test/scala/io/joern/php2cpg/testfixtures/PhpCode2CpgFixture.scala @@ -3,8 +3,9 @@ package io.joern.php2cpg.testfixtures import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.dataflowengineoss.testfixtures.{SemanticCpgTestFixture, SemanticTestCpg} import io.joern.php2cpg.{Config, Php2Cpg} +import io.joern.x2cpg.frontendspecific.php2cpg import io.joern.x2cpg.testfixtures.{Code2CpgFixture, LanguageFrontend, DefaultTestCpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} import java.io.File @@ -26,7 +27,7 @@ class PhpTestCpg extends DefaultTestCpg with PhpFrontend with SemanticTestCpg { } override protected def applyPostProcessingPasses(): Unit = - Php2Cpg.postProcessingPasses(this).foreach(_.createAndApply()) + php2cpg.postProcessingPasses(this).foreach(_.createAndApply()) } diff --git a/joern-cli/frontends/pysrc2cpg/pythonGrammar.jj b/joern-cli/frontends/pysrc2cpg/pythonGrammar.jj index c3918bb1f5e6..37b748432235 100644 --- a/joern-cli/frontends/pysrc2cpg/pythonGrammar.jj +++ b/joern-cli/frontends/pysrc2cpg/pythonGrammar.jj @@ -34,11 +34,12 @@ public class PythonParser { } ErrorStatement recoverAndCreateErrorStmt(Token lastCorrectToken, Exception exception) { - Token prevToken = token; + Token lastErrorToken = null; try { getNextToken(); + lastErrorToken = token; while (token.kind != SEMICOLON && token.kind != NEWLINE && token.kind != EOF) { - prevToken = token; + lastErrorToken = token; getNextToken(); } } catch (Exception e) { @@ -50,7 +51,7 @@ public class PythonParser { } Token errorStartToken = lastCorrectToken.next; - ErrorStatement errorStmt = new ErrorStatement(exception, attributes(errorStartToken, prevToken)); + ErrorStatement errorStmt = new ErrorStatement(exception, attributes(errorStartToken, lastErrorToken)); errors.add(errorStmt); return errorStmt; } diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/CodeToCpg.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/CodeToCpg.scala index b8d31698e5a5..11fe69f76218 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/CodeToCpg.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/CodeToCpg.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.joern.pysrc2cpg.Py2Cpg.InputProvider import io.joern.pythonparser.PyParser import io.joern.x2cpg.ValidationMode @@ -12,7 +12,7 @@ class CodeToCpg( inputProvider: Iterable[InputProvider], schemaValidationMode: ValidationMode, enableFileContent: Boolean -) extends ConcurrentWriterCpgPass[InputProvider](cpg) { +) extends ForkJoinParallelCpgPass[InputProvider](cpg) { import CodeToCpg.logger override def generateParts(): Array[InputProvider] = inputProvider.toArray diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ConfigFileCreationPass.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ConfigFileCreationPass.scala index 1a89650d0b7f..fdf737a98ecb 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ConfigFileCreationPass.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ConfigFileCreationPass.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg import better.files.File import io.joern.x2cpg.passes.frontend.XConfigFileCreationPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class ConfigFileCreationPass(cpg: Cpg, requirementsTxt: String = "requirement.txt") extends XConfigFileCreationPass(cpg) { diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ContextStack.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ContextStack.scala index b1ec59b4181e..0baefe4c5a6c 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ContextStack.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ContextStack.scala @@ -1,9 +1,10 @@ package io.joern.pysrc2cpg import io.joern.pysrc2cpg.ContextStack.transferLineColInfo -import io.joern.pysrc2cpg.memop._ +import io.joern.pysrc2cpg.memop.* +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import org.slf4j.LoggerFactory import scala.collection.mutable diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DependenciesFromRequirementsTxtPass.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DependenciesFromRequirementsTxtPass.scala index 67ab741a53b3..01a932277c44 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DependenciesFromRequirementsTxtPass.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DependenciesFromRequirementsTxtPass.scala @@ -1,8 +1,8 @@ package io.joern.pysrc2cpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.{NewDependency} import org.slf4j.{Logger, LoggerFactory} diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/EdgeBuilder.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/EdgeBuilder.scala index fdb409d6ab0b..2973108ba84d 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/EdgeBuilder.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/EdgeBuilder.scala @@ -23,7 +23,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ NewUnknown } import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class EdgeBuilder(diffGraph: DiffGraphBuilder) { def astEdge(dstNode: nodes.NewNode, srcNode: nodes.NewNode, order: Int): Unit = { diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Main.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Main.scala index c511b91cb941..2ab54ea2c507 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Main.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Main.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg import io.joern.pysrc2cpg.Frontend.cmdLineParser import io.joern.x2cpg.X2CpgMain -import io.joern.x2cpg.passes.frontend.XTypeRecovery +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import scopt.OParser import java.nio.file.Paths @@ -33,7 +33,7 @@ private object Frontend { "Excludes all files where the relative path from input-dir contains at least one of names specified here." ) .action((value, config) => config.withIgnoreDirNames(value)), - XTypeRecovery.parserOptions + XTypeRecoveryConfig.parserOptionsForParserConfig ) } } diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/NodeBuilder.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/NodeBuilder.scala index 2ba76d0a9d99..369c192d3532 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/NodeBuilder.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/NodeBuilder.scala @@ -1,12 +1,13 @@ package io.joern.pysrc2cpg import io.joern.pysrc2cpg.PythonAstVisitor.{allBuiltinClasses, typingClassesV3, typingPrefix} -import io.joern.pysrc2cpg.Constants.builtinPrefix +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants.builtinPrefix import io.joern.pythonparser.ast import io.joern.x2cpg.Defines +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.joern.x2cpg.utils.NodeBuilders import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EvaluationStrategies, nodes} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class NodeBuilder(diffGraph: DiffGraphBuilder) { diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2Cpg.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2Cpg.scala index 71d6c17d488f..b8ab7f82051b 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2Cpg.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2Cpg.scala @@ -1,10 +1,11 @@ package io.joern.pysrc2cpg import io.joern.x2cpg.ValidationMode -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants +import io.shiftleft.codepropertygraph.generated.{Cpg, DiffGraphBuilder} import io.shiftleft.codepropertygraph.generated.Languages -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder +import flatgraph.DiffGraphApplier +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder object Py2Cpg { case class InputPair(content: String, relFileName: String) @@ -32,7 +33,7 @@ class Py2Cpg( schemaValidationMode: ValidationMode, enableFileContent: Boolean ) { - private val diffGraph = new DiffGraphBuilder() + private val diffGraph = Cpg.newDiffGraphBuilder private val nodeBuilder = new NodeBuilder(diffGraph) private val edgeBuilder = new EdgeBuilder(diffGraph) @@ -44,7 +45,7 @@ class Py2Cpg( val anyTypeDecl = nodeBuilder.typeDeclNode(Constants.ANY, Constants.ANY, "N/A", Nil, LineAndColumn(1, 1, 1, 1, 1, 1)) edgeBuilder.astEdge(anyTypeDecl, globalNamespaceBlock, 0) - BatchedUpdate.applyDiff(outputCpg.graph, diffGraph) + DiffGraphApplier.applyDiff(outputCpg.graph, diffGraph) new CodeToCpg(outputCpg, inputProviders, schemaValidationMode, enableFileContent).createAndApply() new ConfigFileCreationPass(outputCpg, requirementsTxt).createAndApply() new DependenciesFromRequirementsTxtPass(outputCpg).createAndApply() diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2CpgOnFileSystem.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2CpgOnFileSystem.scala index a5b96efcaf01..391e044dca21 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2CpgOnFileSystem.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Py2CpgOnFileSystem.scala @@ -2,13 +2,13 @@ package io.joern.pysrc2cpg import io.joern.x2cpg.passes.frontend.TypeRecoveryParserConfig import io.joern.x2cpg.{SourceFiles, X2Cpg, X2CpgConfig, X2CpgFrontend} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.utils.IOUtils import org.slf4j.LoggerFactory import java.nio.file.* import scala.util.Try -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* case class Py2CpgOnFileSystemConfig( venvDir: Option[Path] = None, diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitor.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitor.scala index 2cab1643d465..fe5053bf0b29 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitor.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitor.scala @@ -2,13 +2,14 @@ package io.joern.pysrc2cpg import PythonAstVisitor.{logger, metaClassSuffix, noLineAndColumn} import io.joern.pysrc2cpg.memop.* -import io.joern.pysrc2cpg.Constants.builtinPrefix +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants.builtinPrefix import io.joern.pythonparser.ast +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.joern.x2cpg.{AstCreatorBase, ValidationMode} import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewIdentifier, NewNode, NewTypeDecl} import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import scala.collection.mutable @@ -33,7 +34,7 @@ class PythonAstVisitor( extends AstCreatorBase(relFileName) with PythonAstVisitorHelpers { - private val diffGraph = new DiffGraphBuilder() + private val diffGraph = Cpg.newDiffGraphBuilder protected val nodeBuilder = new NodeBuilder(diffGraph) protected val edgeBuilder = new EdgeBuilder(diffGraph) @@ -1293,7 +1294,10 @@ class PythonAstVisitor( val code = nodeToCode.getCode(errorStatement) val line = errorStatement.attributeProvider.lineno val column = errorStatement.attributeProvider.col_offset - logger.warn(s"Could not parse file $relFileName at line $line column $column. Invalid code: $code") + logger.warn( + s"Could not parse file $relFileName at line $line column $column. Invalid code: $code" + + s"\nParser exception message: ${errorStatement.exception.getMessage}" + ) nodeBuilder.unknownNode(errorStatement.toString, errorStatement.getClass.getName, lineAndColOf(errorStatement)) } diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitorHelpers.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitorHelpers.scala index 005f92ad64f7..fc66232a2103 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitorHelpers.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonAstVisitorHelpers.scala @@ -53,8 +53,7 @@ trait PythonAstVisitorHelpers(implicit withSchemaValidation: ValidationMode) { t orElseBlock: Iterable[NewNode], lineAndColumn: LineAndColumn ): NewNode = { - val controlStructureNode = - nodeBuilder.controlStructureNode("try: ...", ControlStructureTypes.TRY, lineAndColumn) + val controlStructureNode = nodeBuilder.controlStructureNode("try: ...", ControlStructureTypes.TRY, lineAndColumn) val bodyBlockNode = createBlock(body, lineAndColumn).asInstanceOf[NewBlock] val handlersBlockNodes = handlers.map(x => createBlock(Iterable(x), lineAndColumn).asInstanceOf[NewBlock]).toSeq diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstPrinter.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstPrinter.scala index 18a3cb30d32c..3e8864537c8b 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstPrinter.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstPrinter.scala @@ -1,5 +1,5 @@ package io.joern.pythonparser -import io.joern.pythonparser.ast._ +import io.joern.pythonparser.ast.* import scala.collection.immutable class AstPrinter(indentStr: String) extends AstVisitor[String] { diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstVisitor.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstVisitor.scala index 4a9617055bdd..167c2287c689 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstVisitor.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/AstVisitor.scala @@ -1,6 +1,6 @@ package io.joern.pythonparser -import io.joern.pythonparser.ast._ +import io.joern.pythonparser.ast.* trait AstVisitor[T] { def visit(ast: iast): T diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/PyParser.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/PyParser.scala index 36040ca8274b..826960e7f439 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/PyParser.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/PyParser.scala @@ -6,7 +6,7 @@ import io.joern.pythonparser.ast.{ErrorStatement, iast} import java.io.{BufferedReader, ByteArrayInputStream, InputStream, Reader} import java.nio.charset.StandardCharsets -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class PyParser { private var pythonParser: PythonParser = scala.compiletime.uninitialized diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/ast/Ast.scala b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/ast/Ast.scala index 02c5272c4df7..0ba09590deb0 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/ast/Ast.scala +++ b/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pythonparser/ast/Ast.scala @@ -3,7 +3,7 @@ package io.joern.pythonparser.ast import io.joern.pythonparser.AstVisitor import java.util -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* // This file describes the AST classes. // It tries to stay as close as possible to the AST defined by CPython at diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/Py2CpgTestContext.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/Py2CpgTestContext.scala index bad18bae8bc2..6b3facb4d231 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/Py2CpgTestContext.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/Py2CpgTestContext.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.X2Cpg.defaultOverlayCreators -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.layers.LayerCreatorContext import scala.collection.mutable diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/PySrc2CpgFixture.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/PySrc2CpgFixture.scala index 5ecfd7697d30..ec18bfcc32a7 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/PySrc2CpgFixture.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/PySrc2CpgFixture.scala @@ -7,10 +7,18 @@ import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.{FlowSemantic, Semantics} import io.joern.dataflowengineoss.testfixtures.{SemanticCpgTestFixture, SemanticTestCpg} import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.pysrc2cpg.{ + DynamicTypeHintFullNamePass, + ImportsPass, + PythonImportResolverPass, + PythonInheritanceNamePass, + PythonTypeHintCallLinker, + PythonTypeRecoveryPassGenerator +} import io.joern.x2cpg.passes.base.AstLinkerPass import io.joern.x2cpg.passes.callgraph.NaiveCallLinker import io.joern.x2cpg.testfixtures.{Code2CpgFixture, DefaultTestCpg, LanguageFrontend, TestCpg} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} import io.shiftleft.semanticcpg.layers.LayerCreatorContext @@ -63,7 +71,7 @@ class PySrc2CpgFixture( implicit val resolver: ICallResolver = NoResolve protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + path.resultPairs().collect { case (firstElement: String, secondElement) => (firstElement, secondElement.getOrElse(-1)) } } diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssertCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssertCpgTests.scala index 1f7ef899b70f..3861a8fb9f43 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssertCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssertCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssignCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssignCpgTests.scala index dca961f63eef..dfd12f7901db 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssignCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AssignCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, nodes} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AttributeCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AttributeCpgTests.scala index e64fb1369e79..fb009aa002a0 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AttributeCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/AttributeCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BinOpCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BinOpCpgTests.scala index 1e2dc03cb42c..32965a724e30 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BinOpCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BinOpCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BoolOpCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BoolOpCpgTests.scala index 0d5ffa521e3a..d9e6ce6e5163 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BoolOpCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BoolOpCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BuiltinIdentifierTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BuiltinIdentifierTests.scala index fff6c7d5889c..ab82b9b8b083 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BuiltinIdentifierTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BuiltinIdentifierTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BytesLiteralCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BytesLiteralCpgTests.scala index fc0a7d9f41fe..1238e6ed089b 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BytesLiteralCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/BytesLiteralCpgTests.scala @@ -1,6 +1,7 @@ package io.joern.pysrc2cpg.cpg -import io.joern.pysrc2cpg.{Constants, Py2CpgTestContext} +import io.joern.pysrc2cpg.Py2CpgTestContext +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CallCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CallCpgTests.scala index 7ec13f219950..503becf26f54 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CallCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CallCpgTests.scala @@ -2,8 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.PySrc2CpgFixture import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.NodeOps +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ClassCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ClassCpgTests.scala index aed25d40e211..aa85ab8bbd06 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ClassCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ClassCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ClassCpgTests extends PySrc2CpgFixture(withOssDataflow = false) { "class" should { diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CompareCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CompareCpgTests.scala index f01d5f698aa7..7fc6fcc9955f 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CompareCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/CompareCpgTests.scala @@ -3,7 +3,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/DeleteCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/DeleteCpgTests.scala index cc1aa72bf86f..5fd9dbd26c11 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/DeleteCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/DeleteCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FormatStringCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FormatStringCpgTests.scala index 113401a91718..6f7e592a7a48 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FormatStringCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FormatStringCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FunctionDefCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FunctionDefCpgTests.scala index 12eac3001311..c818c5c53431 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FunctionDefCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/FunctionDefCpgTests.scala @@ -1,6 +1,7 @@ package io.joern.pysrc2cpg.cpg -import io.joern.pysrc2cpg.{Constants, Py2CpgTestContext} +import io.joern.pysrc2cpg.Py2CpgTestContext +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.shiftleft.codepropertygraph.generated.ModifierTypes import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* @@ -54,12 +55,12 @@ class FunctionDefCpgTests extends AnyFreeSpec with Matchers { } "test function method ref" in { - cpg.methodRef("func").referencedMethod.fullName.head shouldBe + cpg.methodRefWithName("func").referencedMethod.fullName.head shouldBe "test.py:.func" } "test assignment of method ref to local variable" in { - val assignNode = cpg.methodRef("func").astParent.isCall.head + val assignNode = cpg.methodRefWithName("func").astParent.isCall.head assignNode.code shouldBe "func = def func(...)" } @@ -131,7 +132,7 @@ class FunctionDefCpgTests extends AnyFreeSpec with Matchers { |""".stripMargin) "test decorator wrapping of method reference" in { - val (staticMethod: Call) :: Nil = cpg.methodRef("func").astParent.l: @unchecked + val (staticMethod: Call) :: Nil = cpg.methodRefWithName("func").astParent.l: @unchecked staticMethod.code shouldBe "staticmethod(def func(...))" staticMethod.name shouldBe "staticmethod" val (abc: Call) :: Nil = staticMethod.start.astParent.l: @unchecked diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IfCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IfCpgTests.scala index cbb02e48d5ba..c9e0512606a4 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IfCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IfCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, nodes} import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IntLiteralCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IntLiteralCpgTests.scala index 98ac89e8aeb5..5ae76bdb79f7 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IntLiteralCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/IntLiteralCpgTests.scala @@ -1,6 +1,7 @@ package io.joern.pysrc2cpg.cpg -import io.joern.pysrc2cpg.{Constants, Py2CpgTestContext} +import io.joern.pysrc2cpg.Py2CpgTestContext +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ListCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ListCpgTests.scala index 73f85aa73fab..378c47532e30 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ListCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ListCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MemberCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MemberCpgTests.scala index f8e88367fc3c..5e1171d10070 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MemberCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MemberCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext import io.shiftleft.codepropertygraph.generated.nodes.Member -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MethodCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MethodCpgTests.scala index 6e03d0808b92..0fa7609e8490 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MethodCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/MethodCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ModuleFunctionCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ModuleFunctionCpgTests.scala index 57c274c7502d..ced1d8d5ce99 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ModuleFunctionCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ModuleFunctionCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/PatternMatchingTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/PatternMatchingTests.scala index 75bacc6c1dac..32adc0bc7394 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/PatternMatchingTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/PatternMatchingTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.PySrc2CpgFixture import io.shiftleft.codepropertygraph.generated.NodeTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class PatternMatchingTests extends PySrc2CpgFixture() { "pattern matching" should { diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/RaiseCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/RaiseCpgTests.scala index 58dd9b40fae4..48b154ac8d5e 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/RaiseCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/RaiseCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.Operators import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ReturnCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ReturnCpgTests.scala index 631bddb4aa5e..031df1583f3c 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ReturnCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/ReturnCpgTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StarredCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StarredCpgTests.scala index 67c53bd02f5a..3f8aa59df120 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StarredCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StarredCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StrLiteralCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StrLiteralCpgTests.scala index f1528e114628..2cf2a22b2cda 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StrLiteralCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StrLiteralCpgTests.scala @@ -1,6 +1,7 @@ package io.joern.pysrc2cpg.cpg -import io.joern.pysrc2cpg.{Constants, Py2CpgTestContext} +import io.joern.pysrc2cpg.Py2CpgTestContext +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StringExpressionListCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StringExpressionListCpgTests.scala index e926441a1940..c3e730932133 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StringExpressionListCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/StringExpressionListCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/SubscriptCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/SubscriptCpgTests.scala index 134d0bd16608..e5186682a86d 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/SubscriptCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/SubscriptCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/UnaryOpCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/UnaryOpCpgTests.scala index 0c7739cda935..182b0fbfff05 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/UnaryOpCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/UnaryOpCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/VariableReferencingCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/VariableReferencingCpgTests.scala index 9da932fb2023..bcd4dc12a3c7 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/VariableReferencingCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/VariableReferencingCpgTests.scala @@ -2,7 +2,7 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext import io.shiftleft.codepropertygraph.generated.EvaluationStrategies -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers @@ -149,7 +149,7 @@ class VariableReferencingCpgTests extends AnyFreeSpec with Matchers { } "test method reference closure binding" in { - val methodRefNode = cpg.methodRef("f").head + val methodRefNode = cpg.methodRefWithName("f").head val closureBinding = methodRefNode._closureBindingViaCaptureOut.next() closureBinding.closureBindingId shouldBe Some("test.py:.f:x") closureBinding.evaluationStrategy shouldBe EvaluationStrategies.BY_REFERENCE @@ -185,7 +185,7 @@ class VariableReferencingCpgTests extends AnyFreeSpec with Matchers { } "test method reference closure binding" in { - val methodRefNode = cpg.methodRef("f").head + val methodRefNode = cpg.methodRefWithName("f").head val closureBinding = methodRefNode._closureBindingViaCaptureOut.next() closureBinding.closureBindingId shouldBe Some("test.py:.f:x") closureBinding.evaluationStrategy shouldBe EvaluationStrategies.BY_REFERENCE @@ -223,7 +223,7 @@ class VariableReferencingCpgTests extends AnyFreeSpec with Matchers { } "test method reference closure binding of f in g" in { - val methodRefNode = cpg.methodRef("f").head + val methodRefNode = cpg.methodRefWithName("f").head val closureBinding = methodRefNode._closureBindingViaCaptureOut.next() closureBinding.closureBindingId shouldBe Some("test.py:.g.f:x") closureBinding.evaluationStrategy shouldBe EvaluationStrategies.BY_REFERENCE @@ -240,7 +240,7 @@ class VariableReferencingCpgTests extends AnyFreeSpec with Matchers { } "test method reference closure binding of g in module" in { - val methodRefNode = cpg.methodRef("g").head + val methodRefNode = cpg.methodRefWithName("g").head val closureBinding = methodRefNode._closureBindingViaCaptureOut.next() closureBinding.closureBindingId shouldBe Some("test.py:.g:x") closureBinding.evaluationStrategy shouldBe EvaluationStrategies.BY_REFERENCE diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/WhileCpgTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/WhileCpgTests.scala index 661c3bf6cb5e..f06eee5e617b 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/WhileCpgTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/cpg/WhileCpgTests.scala @@ -1,6 +1,6 @@ package io.joern.pysrc2cpg.cpg import io.joern.pysrc2cpg.Py2CpgTestContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, nodes} import org.scalatest.freespec.AnyFreeSpec import org.scalatest.matchers.should.Matchers diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/dataflow/DataFlowTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/dataflow/DataFlowTests.scala index 40121307df04..adf566fbc8ab 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/dataflow/DataFlowTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/dataflow/DataFlowTests.scala @@ -1,9 +1,9 @@ package io.joern.pysrc2cpg.dataflow import io.joern.dataflowengineoss.language.toExtendedCfgNode -import io.joern.dataflowengineoss.semanticsloader.FlowSemantic +import io.joern.dataflowengineoss.semanticsloader.{FlowMapping, FlowSemantic, PassThroughMapping} import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Literal, Member, Method} import io.shiftleft.semanticcpg.language.* @@ -452,6 +452,113 @@ class DataFlowTests extends PySrc2CpgFixture(withOssDataflow = true) { flow shouldBe List(("a.run(\"X\")", 4), ("x = a.run(\"X\")", 4), ("tmp0[\"x\"] = x", 6)) } + "flow from literals in dictionary literal assignment and first argument to second argument" in { + val cpg = code(""" + |x = {'x': 10} + |print(1, x) + |""".stripMargin) + + def source = cpg.literal + def sink = cpg.call("print").argument(2) + val List(flow1, flow10) = sink.reachableByFlows(source).map(flowToResultPairs).sortBy(_.length).l + flow1 shouldBe List(("print(1, x)", 3)) + flow10 shouldBe List( + ("tmp0['x'] = 10", 2), + ("tmp0", 2), + ("x = tmp0 = {}\ntmp0['x'] = 10\ntmp0", 2), + ("print(1, x)", 3) + ) + } + + "flow from literal in dictionary literal assignment to second argument, using custom flows" in { + val cpg = code(""" + |x = {'x': 10} + |print(1, x) + |""".stripMargin) + .withExtraFlows(List(FlowSemantic(".*print", List(PassThroughMapping), true))) + + def source = cpg.literal + def sink = cpg.call("print").argument.argumentIndex(2) + val List(flow10) = sink.reachableByFlows(source).map(flowToResultPairs).l + flow10 shouldBe List( + ("tmp0['x'] = 10", 2), + ("tmp0", 2), + ("x = tmp0 = {}\ntmp0['x'] = 10\ntmp0", 2), + ("print(1, x)", 3) + ) + } + + "flow from literals in dictionary literal and first argument to second argument" in { + val cpg = code(""" + |print(1, {'x': 10}) + |""".stripMargin) + + def source = cpg.literal + def sink = cpg.call("print").argument.argumentIndex(2) + val List(flow10) = sink.reachableByFlows(source).map(flowToResultPairs).l + flow10 shouldBe List(("tmp0['x'] = 10", 2), ("tmp0", 2)) + } + + "flow from literals into a dictionary literal used as an argument to an external call" in { + val cpg = code(""" + |import bar + |x = 100 + |bar.foo('D').baz(A='A', B=b, C={'Property': x}) + |""".stripMargin) + + def source = cpg.literal + def sink = cpg.call("baz").argument.argumentName("C") + val List(flow100) = sink.reachableByFlows(source).map(flowToResultPairs).l + flow100 shouldBe List(("x = 100", 3), ("tmp0['Property'] = x", 4), ("tmp0", 4)) + } + + "flow from literal in an imported dictionary literal to `print`" in { + val cpg = code( + """ + |from p1.bar import baz + |print(baz) + |""".stripMargin, + "foo.py" + ).moreCode( + """ + |baz = {"Property1": "foo"} + |""".stripMargin, + "p1/bar.py" + ) + val source = cpg.literal("\"foo\"") + val sink = cpg.call("print").argument(1) + val List(flow) = sink.reachableByFlows(source).map(flowToResultPairs).l + + flow shouldBe List(("tmp0[\"Property1\"] = \"foo\"", 2), ("baz = import(p1.bar, baz)", 2), ("print(baz)", 3)) + } + + "flow from literal in an imported method-returned dictionary to `print`" in { + val cpg = code( + """ + |import bar + |print(bar.baz()) + |""".stripMargin, + "main.py" + ).moreCode( + """ + |def baz(): + | return {"Property": "foo"} + |""".stripMargin, + "bar.py" + ) + val source = cpg.literal("\"foo\"") + val sink = cpg.call("print").argument(1) + val List(flow) = sink.reachableByFlows(source).map(flowToResultPairs).l + + flow shouldBe List( + ("tmp0[\"Property\"] = \"foo\"", 3), + ("tmp0", 3), + ("return {\"Property\": \"foo\"}", 3), + ("RET", 2), + ("bar.baz()", 3) + ) + } + "flow from global variable defined in imported file and used as argument to `print`" in { val cpg = code(""" |from models import FOOBAR @@ -677,8 +784,8 @@ class RegexDefinedFlowsDataFlowTests |print(Foo.func()) |""".stripMargin) "be found" in { - val src = cpg.call.code("Foo.func").l - val snk = cpg.call("print").l + val src = cpg.call.code("Foo.func") + val snk = cpg.call("print") snk.argument.reachableByFlows(src).size shouldBe 1 } } diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ConfigPassTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ConfigPassTests.scala index 930affce1d65..379ad722456f 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ConfigPassTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ConfigPassTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.passes import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConfigPassTests extends PySrc2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/DynamicTypeHintFullNamePassTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/DynamicTypeHintFullNamePassTests.scala index 284fb6b27408..af54b4d96685 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/DynamicTypeHintFullNamePassTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/DynamicTypeHintFullNamePassTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.passes import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ImportsPassTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ImportsPassTests.scala index 1a8f338cb498..506a5be71027 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ImportsPassTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/ImportsPassTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.passes import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ImportsPassTests extends PySrc2CpgFixture(withOssDataflow = false) { diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/InheritanceFullNamePassTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/InheritanceFullNamePassTests.scala index 71e90af7761e..43d91d177418 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/InheritanceFullNamePassTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/InheritanceFullNamePassTests.scala @@ -1,7 +1,7 @@ package io.joern.pysrc2cpg.passes import io.joern.pysrc2cpg.PySrc2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.io.File diff --git a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/TypeRecoveryPassTests.scala b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/TypeRecoveryPassTests.scala index ccf17765dc7b..1c75942ef685 100644 --- a/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/TypeRecoveryPassTests.scala +++ b/joern-cli/frontends/pysrc2cpg/src/test/scala/io/joern/pysrc2cpg/passes/TypeRecoveryPassTests.scala @@ -2,6 +2,7 @@ package io.joern.pysrc2cpg.passes import io.joern.pysrc2cpg.PySrc2CpgFixture import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker +import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Member} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.* @@ -1050,7 +1051,7 @@ class TypeRecoveryPassTests extends PySrc2CpgFixture(withOssDataflow = false) { "assert the method properties in RedisDB, especially quoted type hints" in { val Some(redisDB) = cpg.typeDecl.nameExact("RedisDB").method.nameExact("").headOption: @unchecked - val List(instanceM, getRedisM, setM) = redisDB.astOut.isMethod.nameExact("instance", "get_redis", "set").l + val List(instanceM, getRedisM, setM) = redisDB.astChildren.isMethod.nameExact("instance", "get_redis", "set").l instanceM.methodReturn.typeFullName shouldBe Seq("db", "redis.py:.RedisDB").mkString(File.separator) getRedisM.methodReturn.typeFullName shouldBe "aioredis.py:.Redis" @@ -1323,12 +1324,9 @@ class TypeRecoveryPassTests extends PySrc2CpgFixture(withOssDataflow = false) { val variables = cpg.moduleVariables .where(_.typeFullName(".*FastAPI.*")) .l - val appIncludeRouterCalls = - variables.invokingCalls - .nameExact("include_router") - .l - val includedRouters = appIncludeRouterCalls.argument.argumentIndexGte(1).moduleVariables.l - val definitionsOfRouters = includedRouters.definitions.whereNot(_.source.isCall.nameExact("import")).l + val appIncludeRouterCalls = variables.invokingCalls.nameExact("include_router") + val includedRouters = appIncludeRouterCalls.argument.argumentIndexGte(1).moduleVariables + val definitionsOfRouters = includedRouters.definitions.whereNot(_.source.isCall.nameExact("import")) val List(adminRouter, normalRouter, itemsRouter) = definitionsOfRouters.map(x => (x.code, x.method.fullName)).sortBy(_._1).l: @unchecked @@ -1370,4 +1368,274 @@ class TypeRecoveryPassTests extends PySrc2CpgFixture(withOssDataflow = false) { } } + "`__builtin.print` call with a `+` binary operation for argument" should { + val cpg = code(""" + |print(1 + 2) + |""".stripMargin) + + "have correct methodFullName for `print`" in { + cpg.call("print").l match { + case List(printCall) => printCall.methodFullName shouldBe "__builtin.print" + case result => fail(s"Expected single print call but got $result") + } + } + + "have correct methodFullName for `+`" in { + cpg.call("print").argument(1).isCall.l match { + case List(plusCall) => plusCall.methodFullName shouldBe ".addition" + case result => fail(s"Expected single + call but got $result") + } + } + } + + "`__builtin.print` call with an external non-imported call for argument" should { + val cpg = code(""" + |print(foo(10)) + |""".stripMargin) + + "have correct methodFullName for `print`" in { + cpg.call("print").l match { + case List(printCall) => printCall.methodFullName shouldBe "__builtin.print" + case result => fail(s"Expected single print call but got $result") + } + } + + "have correct methodFullName for `foo`" in { + cpg.call("foo").l match { + case List(fooCall) => fooCall.methodFullName shouldBe "" + case result => fail(s"Expected single foo call but got $result") + } + } + } + + "`__builtin.print` call with an external non-imported call result variable for argument" should { + val cpg = code(""" + |a = foo(10) + |print(a) + |""".stripMargin) + + "have correct methodFullName for `print`" in { + cpg.call("print").l match { + case List(printCall) => printCall.methodFullName shouldBe "__builtin.print" + case result => fail(s"Expected single print call but got $result") + } + } + + "have correct methodFullName for `foo`" in { + cpg.call("foo").l match { + case List(fooCall) => fooCall.methodFullName shouldBe "" + case result => fail(s"Expected single foo call but got $result") + } + } + + "provide meaningful typeFullName for the target of assignment" in { + cpg.assignment.target.isIdentifier.name("a").l match { + case List(a) => a.typeFullName shouldBe "foo." + case result => fail(s"Expected single assignment to a, but got $result") + } + } + } + + "external non imported call with int variable for argument" should { + val cpg = code(""" + |a = 10 + |foo(a) + |""".stripMargin) + + "have correct methodFullName for `foo`" in { + cpg.call("foo").l match { + case List(fooCall) => fooCall.methodFullName shouldBe "" + case result => fail(s"Expected single foo call but got $result") + } + } + } + + "assignment to non imported call with int variable for argument" should { + val cpg = code(""" + |a = 10 + |b = foo(a) + |""".stripMargin) + + "have correct methodFullName for `foo`" in { + cpg.call("foo").l match { + case List(fooCall) => fooCall.methodFullName shouldBe "" + case result => fail(s"Expected single foo call but got $result") + } + } + + "provide meaningful typeFullName for the target of the assignment" in { + cpg.assignment.target.isIdentifier.name("b").l match { + case List(b) => b.typeFullName shouldBe "foo." + case result => fail(s"Expected single assignment to b, but got $result") + } + } + } + + "external non-imported call with int literal for argument" should { + val cpg = code(""" + |foo(10) + |""".stripMargin) + + "have correct methodFullName for `foo`" in { + cpg.call("foo").l match { + case List(fooCall) => fooCall.methodFullName shouldBe "" + case result => fail(s"Expected single foo call but got $result") + } + } + } + + "assignment to imported method call" should { + val cpg = code(""" + |from helpers import foo + |x = foo() + |""".stripMargin) + + "provide meaningful typeFullName for the target of the assignment" in { + cpg.assignment.target.isIdentifier.name("x").l match { + case List(x) => x.typeFullName shouldBe "helpers.py:.foo." + case result => fail(s"Expected single assignment to x, but got $result") + } + } + } + + "assignment to non-chained index access of an imported method call" should { + val cpg = code(""" + |from helpers import foo + |x = foo() + |y = x[0] + |""".stripMargin) + + "provide meaningful typeFullName for the target of the assignment" in { + cpg.assignment.target.isIdentifier.name("y").l match { + case List(y) => y.typeFullName shouldBe "helpers.py:.foo.." + case result => fail(s"Expected single assignment to y, but got $result") + } + } + } + + "assignment to chained index access of an imported method call" should { + val cpg = code(""" + |from helpers import foo + |x = foo()[0] + |""".stripMargin) + + "provide meaningful typeFullName for the target of the assignment" in { + cpg.assignment.target.isIdentifier.name("x").l match { + case List(x) => x.typeFullName shouldBe "helpers.py:.foo.." + case result => fail(s"Expected single assignment to x, but got $result") + } + } + } + + "assignment to non-chained index access of an imported member method call" should { + val cpg = code(""" + |import foo + |x = foo.bar() + |y = x[0] + |""".stripMargin) + + "provide meaningful typeFullName for the target of the first assignment" in { + cpg.assignment.target.isIdentifier.name("x").l match { + case List(x) => x.typeFullName shouldBe "foo.py:.bar." + case result => fail(s"Expected single assignment to x, but got $result") + } + } + + "provide meaningful typeFullName for the target of the second assignment" in { + cpg.assignment.target.isIdentifier.name("y").l match { + case List(y) => y.typeFullName shouldBe "foo.py:.bar.." + case result => fail(s"Expected single assignment to y, but got $result") + } + } + } + + "assignment to chained index access of an imported member method call" should { + val cpg = code(""" + |import foo + |y = foo.bar()[0] + |""".stripMargin) + + "provide meaningful typeFullName for the target of the assignment" in { + cpg.assignment.target.isIdentifier.name("y").l match { + case List(y) => y.typeFullName shouldBe "foo.py:.bar.." + case result => fail(s"Expected single assignment to y, but got $result") + } + } + } + + "assignment to interspersed index access with imported method calls" should { + val cpg = code(""" + |import foo + |x = foo.bar()[0].baz() + |""".stripMargin) + + "have correct methodFullName for `bar`" in { + cpg.call.name("bar").l match { + case List(bar) => bar.methodFullName shouldBe "foo.py:.bar" + case result => fail(s"Expected single call to bar, but got $result") + } + } + + "have correct methodFullName for `baz`" in { + cpg.call.name("baz").l match { + case List(baz) => baz.methodFullName shouldBe "foo.py:.bar...baz" + case result => fail(s"Expected single call to baz, but got $result") + } + } + + // TODO: Missing the last . Needs to take into account the lowering of consecutive + // field accesses into three-address code blocks. + "provide meaningful typeFullName for the target of the assignment" ignore { + cpg.assignment.target.isIdentifier.name("x").l match { + case List(x) => x.typeFullName shouldBe "foo.py:.bar...baz." + case result => fail(s"Expected single assignment to x, but got $result") + } + } + } + + "call to interspersed index access with imported method calls and constructors" should { + val cpg = code(""" + |import boto3 + |sqs = boto3.resource('sqs') + |queue = sqs.Queue('url') + |queue.receive_messages()[0].delete() + |""".stripMargin) + + "have correct methodFullName for `delete`" in { + cpg.call.name("delete").l match { + case List(delete) => + delete.methodFullName shouldBe "boto3.py:.resource..Queue.receive_messages...delete" + case result => fail(s"Expected single call to delete, but got $result") + } + } + + "have correct methodFullName for `resource`" in { + cpg.call.name("resource").l match { + case List(resource) => resource.methodFullName shouldBe "boto3.py:.resource" + case result => fail(s"Expected single call to resource, but got $result") + } + } + + "have correct methodFullName for `receive_messages`" in { + cpg.call.name("receive_messages").l match { + case List(recv) => + recv.methodFullName shouldBe "boto3.py:.resource..Queue.receive_messages" + case result => fail(s"Expected single call to receive_messages, but got $result") + } + } + + "provide meaningful typeFullName for `sqs`" in { + cpg.assignment.target.isIdentifier.name("sqs").l match { + case List(sqs) => sqs.typeFullName shouldBe "boto3.py:.resource." + case result => fail(s"Expected single assignment to sqs, but got $result") + } + } + + "provide meaningful typeFullName for `queue`" in { + cpg.assignment.target.isIdentifier.name("queue").l match { + case List(queue) => queue.typeFullName shouldBe "boto3.py:.resource..Queue" + case result => fail(s"Expected single assignment to queue, but got $result") + } + } + } } diff --git a/joern-cli/frontends/rubysrc2cpg/rubysrc2cpg.sh b/joern-cli/frontends/rubysrc2cpg/rubysrc2cpg.sh index 77a186ae05a3..dad0a44952a4 100755 --- a/joern-cli/frontends/rubysrc2cpg/rubysrc2cpg.sh +++ b/joern-cli/frontends/rubysrc2cpg/rubysrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/rubysrc2cpg "$@" +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/rubysrc2cpg" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyLexer.g4 b/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyLexer.g4 index 321ad6097bfe..74cc22e06b52 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyLexer.g4 +++ b/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyLexer.g4 @@ -32,96 +32,6 @@ options { superClass = RubyLexerBase; } -// -------------------------------------------------------- -// Keywords -// -------------------------------------------------------- - -LINE__:'__LINE__'; -ENCODING__: '__ENCODING__'; -FILE__: '__FILE__'; -BEGIN_: 'BEGIN'; -END_: 'END'; -ALIAS: 'alias'; -AND: 'and'; -BEGIN: 'begin'; -BREAK: 'break'; -CASE: 'case'; -CLASS: 'class'; -DEF: 'def'; -IS_DEFINED: 'defined?'; -DO: 'do'; -ELSE: 'else'; -ELSIF: 'elsif'; -END: 'end'; -ENSURE: 'ensure'; -FOR: 'for'; -FALSE: 'false'; -IF: 'if'; -IN: 'in'; -MODULE: 'module'; -NEXT: 'next'; -NIL: 'nil'; -NOT: 'not'; -OR: 'or'; -REDO: 'redo'; -RESCUE: 'rescue'; -RETRY: 'retry'; -RETURN: 'return'; -SELF: 'self'; -SUPER: 'super'; -THEN: 'then'; -TRUE: 'true'; -UNDEF: 'undef'; -UNLESS: 'unless'; -UNTIL: 'until'; -WHEN: 'when'; -WHILE: 'while'; -YIELD: 'yield'; - -fragment KEYWORD - : LINE__ - | ENCODING__ - | FILE__ - | BEGIN_ - | END_ - | ALIAS - | AND - | BEGIN - | BREAK - | CASE - | CLASS - | DEF - | IS_DEFINED - | DO - | ELSE - | ELSIF - | END - | ENSURE - | FOR - | FALSE - | IF - | IN - | MODULE - | NEXT - | NIL - | NOT - | OR - | REDO - | RESCUE - | RETRY - | RETURN - | SELF - | SUPER - | THEN - | TRUE - | UNDEF - | UNLESS - | UNTIL - | WHEN - | WHILE - | YIELD - ; - // -------------------------------------------------------- // Punctuators // -------------------------------------------------------- @@ -544,9 +454,98 @@ fragment SYMBOL_NAME // -------------------------------------------------------- // Identifiers // -------------------------------------------------------- - LOCAL_VARIABLE_IDENTIFIER - : (LOWERCASE_CHARACTER | '_') IDENTIFIER_CHARACTER* + : (LOWERCASE_CHARACTER | '_') IDENTIFIER_CHARACTER* { setKeywordTokenType(); } + ; + +// -------------------------------------------------------- +// Keywords +// -------------------------------------------------------- + +LINE__:'__LINE__'; +ENCODING__: '__ENCODING__'; +FILE__: '__FILE__'; +BEGIN_: 'BEGIN'; +END_: 'END'; +ALIAS: 'alias'; +AND: 'and'; +BEGIN: 'begin'; +BREAK: 'break'; +CASE: 'case'; +CLASS: 'class'; +DEF: 'def'; +IS_DEFINED: 'defined?'; +DO: 'do'; +ELSE: 'else'; +ELSIF: 'elsif'; +END: 'end'; +ENSURE: 'ensure'; +FOR: 'for'; +FALSE: 'false'; +IF: 'if'; +IN: 'in'; +MODULE: 'module'; +NEXT: 'next'; +NIL: 'nil'; +NOT: 'not'; +OR: 'or'; +REDO: 'redo'; +RESCUE: 'rescue'; +RETRY: 'retry'; +RETURN: 'return'; +SELF: 'self'; +SUPER: 'super'; +THEN: 'then'; +TRUE: 'true'; +UNDEF: 'undef'; +UNLESS: 'unless'; +UNTIL: 'until'; +WHEN: 'when'; +WHILE: 'while'; +YIELD: 'yield'; + +fragment KEYWORD + : LINE__ + | ENCODING__ + | FILE__ + | BEGIN_ + | END_ + | ALIAS + | AND + | BEGIN + | BREAK + | CASE + | CLASS + | DEF + | IS_DEFINED + | DO + | ELSE + | ELSIF + | END + | ENSURE + | FOR + | FALSE + | IF + | IN + | MODULE + | NEXT + | NIL + | NOT + | OR + | REDO + | RESCUE + | RETRY + | RETURN + | SELF + | SUPER + | THEN + | TRUE + | UNDEF + | UNLESS + | UNTIL + | WHEN + | WHILE + | YIELD ; GLOBAL_VARIABLE_IDENTIFIER diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyParser.g4 b/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyParser.g4 index 986106504530..34b867a2a5d6 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyParser.g4 +++ b/joern-cli/frontends/rubysrc2cpg/src/main/antlr4/io/joern/rubysrc2cpg/parser/RubyParser.g4 @@ -208,7 +208,7 @@ argumentWithParentheses argumentList : blockArgument # blockArgumentArgumentList - | splattingArgument (COMMA NL* blockArgument)? + | splattingArgument (COMMA NL* blockArgument)? (COMMA NL* operatorExpressionList)? # splattingArgumentArgumentList | operatorExpressionList (COMMA NL* associationList)? (COMMA NL* splattingArgument)? (COMMA NL* blockArgument)? # operatorsArgumentList @@ -282,7 +282,7 @@ primaryValue # assignmentWithRescue // Definitions - | CLASS classPath (LT commandOrPrimaryValueClass)? (SEMI | NL) bodyStatement END + | CLASS classPath (LT commandOrPrimaryValueClass)? (SEMI | NL)? bodyStatement END # classDefinition | CLASS LT2 commandOrPrimaryValueClass (SEMI | NL) bodyStatement END # singletonClassDefinition @@ -316,25 +316,10 @@ primaryValue # whileExpression | FOR NL* forVariable IN NL* commandOrPrimaryValue doClause END # forExpression - - // Non-nested calls - | SUPER argumentWithParentheses? block? - # superWithParentheses - | SUPER argumentList? block? - # superWithoutParentheses - | isDefinedKeyword LPAREN expressionOrCommand RPAREN - # isDefinedExpression - | isDefinedKeyword primaryValue - # isDefinedCommand - | methodOnlyIdentifier - # methodCallExpression - | methodIdentifier block - # methodCallWithBlockExpression - | methodIdentifier argumentWithParentheses block? - # methodCallWithParenthesesExpression - | variableReference - # methodCallOrVariableReference - + + | methodCallsWithParentheses + # methodCallWithParentheses + // Literals | LBRACK NL* indexingArgumentList? NL* RBRACK # bracketedArrayLiteral @@ -407,6 +392,26 @@ primaryValue # hereDocs ; +// Non-nested calls +methodCallsWithParentheses + : SUPER argumentWithParentheses? block? + # superWithParentheses + | SUPER argumentList? block? + # superWithoutParentheses + | isDefinedKeyword LPAREN expressionOrCommand RPAREN + # isDefinedExpression + | isDefinedKeyword primaryValue + # isDefinedCommand + | methodOnlyIdentifier + # methodCallExpression + | methodIdentifier block + # methodCallWithBlockExpression + | methodIdentifier argumentWithParentheses block? + # methodCallWithParenthesesExpression + | variableReference + # methodCallOrVariableReference + ; + // This is required to make chained calls work. For classes, we cannot move up the `primaryValue` due to the possible // presence of AMPDOT when inheriting (class Foo < Bar::Baz), but the command rule doesn't allow chained calls // in if statements to be created properly, and ends throwing away everything after the first call. Splitting these @@ -516,7 +521,7 @@ methodParameterPart parameterList : mandatoryOrOptionalParameterList (COMMA NL* arrayParameter)? (COMMA NL* hashParameter)? (COMMA NL* procParameter)? - | arrayParameter (COMMA NL* hashParameter)? (COMMA NL* procParameter)? + | arrayParameter (COMMA NL* hashParameter)? (COMMA NL* procParameter)? (COMMA NL* mandatoryOrOptionalParameterList)? | hashParameter (COMMA NL* procParameter)? | procParameter ; @@ -591,6 +596,9 @@ associationList association : associationKey (EQGT | COLON) NL* operatorExpression + # associationElement + | associationHashArgument + # associationHashArg ; associationKey @@ -598,6 +606,10 @@ associationKey | keyword ; +associationHashArgument + : STAR2 (LOCAL_VARIABLE_IDENTIFIER | methodCallsWithParentheses | (LPAREN methodInvocationWithoutParentheses RPAREN))? + ; + regexpLiteralContent : REGULAR_EXPRESSION_BODY | REGULAR_EXPRESSION_INTERPOLATION_BEGIN compoundStatement REGULAR_EXPRESSION_INTERPOLATION_END diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/Main.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/Main.scala index 620bab8eaa6a..5df1290e60e2 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/Main.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/Main.scala @@ -1,7 +1,7 @@ package io.joern.rubysrc2cpg import io.joern.rubysrc2cpg.Frontend.* -import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery} +import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery, XTypeRecoveryConfig} import io.joern.x2cpg.typestub.TypeStubConfig import io.joern.x2cpg.{DependencyDownloadConfig, X2CpgConfig, X2CpgMain} import scopt.OParser @@ -10,7 +10,8 @@ final case class Config( antlrCacheMemLimit: Double = 0.6d, useDeprecatedFrontend: Boolean = false, downloadDependencies: Boolean = false, - useTypeStubs: Boolean = true + useTypeStubs: Boolean = true, + antlrDebug: Boolean = false ) extends X2CpgConfig[Config] with DependencyDownloadConfig[Config] with TypeRecoveryParserConfig[Config] @@ -28,6 +29,10 @@ final case class Config( copy(useDeprecatedFrontend = value).withInheritedFields(this) } + def withAntlrDebugging(value: Boolean): Config = { + copy(antlrDebug = value).withInheritedFields(this) + } + override def withDownloadDependencies(value: Boolean): Config = { copy(downloadDependencies = value).withInheritedFields(this) } @@ -61,8 +66,14 @@ private object Frontend { opt[Unit]("useDeprecatedFrontend") .action((_, c) => c.withUseDeprecatedFrontend(true)) .text("uses the original (but deprecated) Ruby frontend (default false)"), + opt[Unit]("antlrDebug") + .hidden() + .action((_, c) => c.withAntlrDebugging(true)), + opt[Unit]("enable-file-content") + .action((_, c) => c.withDisableFileContent(false)) + .text("Enable file content"), DependencyDownloadConfig.parserOptions, - XTypeRecovery.parserOptions, + XTypeRecoveryConfig.parserOptionsForParserConfig, TypeStubConfig.parserOptions ) } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/RubySrc2Cpg.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/RubySrc2Cpg.scala index 13911f277c66..ef2dc1bdaf73 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/RubySrc2Cpg.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/RubySrc2Cpg.scala @@ -10,6 +10,7 @@ import io.joern.rubysrc2cpg.passes.{ AstCreationPass, ConfigFileCreationPass, DependencyPass, + DependencySummarySolverPass, ImplicitRequirePass, ImportsPass, RubyImportResolverPass, @@ -22,7 +23,7 @@ import io.joern.x2cpg.passes.callgraph.NaiveCallLinker import io.joern.x2cpg.passes.frontend.{MetaDataPass, TypeNodePass, XTypeRecoveryConfig} import io.joern.x2cpg.utils.{ConcurrentTaskUtil, ExternalCommand} import io.joern.x2cpg.{SourceFiles, X2CpgFrontend} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.language.* @@ -50,7 +51,7 @@ class RubySrc2Cpg extends X2CpgFrontend[Config] { } private def newCreateCpgAction(cpg: Cpg, config: Config): Unit = { - Using.resource(new parser.ResourceManagedParser(config.antlrCacheMemLimit)) { parser => + Using.resource(new parser.ResourceManagedParser(config.antlrCacheMemLimit, config.antlrDebug)) { parser => val astCreators = ConcurrentTaskUtil .runUsingThreadPool(RubySrc2Cpg.generateParserTasks(parser, config, cpg.metaData.root.headOption)) .flatMap { @@ -64,17 +65,22 @@ class RubySrc2Cpg extends X2CpgFrontend[Config] { case Failure(exception) => logger.warn(s"Unable to pre-parse Ruby file, skipping - ", exception); None case Success(summary) => Option(summary) } - .foldLeft(RubyProgramSummary(RubyProgramSummary.BuiltinTypes(config.typeStubMetaData)))(_ ++ _) + .foldLeft(RubyProgramSummary(RubyProgramSummary.BuiltinTypes(config.typeStubMetaData)))(_ ++= _) - val programSummary = if (config.downloadDependencies) { - DependencyDownloader(cpg, internalProgramSummary).download() + val dependencySummary = if (config.downloadDependencies) { + DependencyDownloader(cpg).download() } else { - internalProgramSummary + RubyProgramSummary() } + val programSummary = internalProgramSummary ++= dependencySummary + AstCreationPass(cpg, astCreators.map(_.withSummary(programSummary))).createAndApply() if (cpg.dependency.name.contains("zeitwerk")) ImplicitRequirePass(cpg, programSummary).createAndApply() ImportsPass(cpg).createAndApply() + if config.downloadDependencies then { + DependencySummarySolverPass(cpg, dependencySummary).createAndApply() + } TypeNodePass.withTypesFromCpg(cpg).createAndApply() } } @@ -184,7 +190,15 @@ object RubySrc2Cpg { .map { fileName => () => resourceManagedParser.parse(File(config.inputPath), fileName) match { case Failure(exception) => throw exception - case Success(ctx) => new AstCreator(fileName, ctx, projectRoot)(config.schemaValidation) + case Success(ctx) => + val fileContent = (File(config.inputPath) / fileName).contentAsString + new AstCreator( + fileName, + ctx, + projectRoot, + enableFileContents = !config.disableFileContent, + fileContent = fileContent + )(config.schemaValidation) } } .iterator diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreator.scala index 060097193bb3..2cd44a0b3d9d 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreator.scala @@ -1,17 +1,17 @@ package io.joern.rubysrc2cpg.astcreation +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.* import io.joern.rubysrc2cpg.datastructures.{BlockScope, NamespaceScope, RubyProgramSummary, RubyScope, RubyStubbedType} import io.joern.rubysrc2cpg.parser.{RubyNodeCreator, RubyParser} import io.joern.rubysrc2cpg.passes.Defines -import io.joern.x2cpg.utils.NodeBuilders.newModifierNode +import io.joern.x2cpg.utils.NodeBuilders.{newBindingNode, newModifierNode} import io.joern.x2cpg.{Ast, AstCreatorBase, AstNodeBuilder, ValidationMode} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, ModifierTypes, Operators} +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, ModifierTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import java.util.regex.Matcher @@ -19,7 +19,9 @@ class AstCreator( val fileName: String, protected val programCtx: RubyParser.ProgramContext, protected val projectRoot: Option[String] = None, - protected val programSummary: RubyProgramSummary = RubyProgramSummary() + protected val programSummary: RubyProgramSummary = RubyProgramSummary(), + val enableFileContents: Boolean = false, + val fileContent: String = "" )(implicit withSchemaValidation: ValidationMode) extends AstCreatorBase(fileName) with AstCreatorHelper @@ -38,20 +40,22 @@ class AstCreator( protected var parseLevel: AstParseLevel = AstParseLevel.FULL_AST + override protected def offset(node: RubyNode): Option[(Int, Int)] = node.offset + protected val relativeFileName: String = projectRoot .map(fileName.stripPrefix) .map(_.stripPrefix(java.io.File.separator)) .getOrElse(fileName) - private def internalLineAndColNum: Option[Integer] = Option(1) + private def internalLineAndColNum: Option[Int] = Option(1) /** The relative file name, in a unix path delimited format. */ private def relativeUnixStyleFileName = relativeFileName.replaceAll(Matcher.quoteReplacement(java.io.File.separator), "/") - override def createAst(): BatchedUpdate.DiffGraphBuilder = { + override def createAst(): DiffGraphBuilder = { val rootNode = new RubyNodeCreator().visit(programCtx).asInstanceOf[StatementList] val ast = astForRubyFile(rootNode) Ast.storeInDiffGraph(ast, diffGraph) @@ -63,7 +67,9 @@ class AstCreator( * allowing for a straightforward representation of out-of-method statements. */ protected def astForRubyFile(rootStatements: StatementList): Ast = { - val fileNode = NewFile().name(relativeFileName) + val fileNode = + if enableFileContents then NewFile().name(relativeFileName).content(fileContent) + else NewFile().name(relativeFileName) val fullName = s"$relativeUnixStyleFileName:${NamespaceTraversal.globalNamespaceName}" val namespaceBlock = NewNamespaceBlock() .filename(relativeFileName) @@ -71,16 +77,18 @@ class AstCreator( .fullName(fullName) scope.pushNewScope(NamespaceScope(fullName)) - val rubyFileMethod = astInFakeMethod(rootStatements) + val rubyFakeMethodAst = astInFakeMethod(rootStatements) scope.popScope() - Ast(fileNode).withChild(Ast(namespaceBlock).withChild(rubyFileMethod)) + Ast(fileNode).withChild(Ast(namespaceBlock).withChild(rubyFakeMethodAst)) } private def astInFakeMethod(rootNode: StatementList): Ast = { - val name = Defines.Program - val fullName = computeMethodFullName(name) - val code = rootNode.text + val name = Defines.Main + // From the
method onwards, we do not embed the namespace name in the full names + val fullName = + s"${scope.surroundingScopeFullName.head.stripSuffix(NamespaceTraversal.globalNamespaceName)}$name" + val code = rootNode.text val methodNode_ = methodNode( node = rootNode, name = name, @@ -96,81 +104,21 @@ class AstCreator( scope.pushNewScope(moduleScope) val block = blockNode(rootNode) scope.pushNewScope(BlockScope(block)) - val statementAsts = rootNode.statements.flatMap(astsForStatement) - val internalMethodRefAsts = methodRefNodesForInternalMethods() - val internalTypeRefAsts = typeRefNodesForInternalDecls() + val statementAsts = rootNode.statements.flatMap(astsForStatement) scope.popScope() - val bodyAst = blockAst(block, internalTypeRefAsts ++ internalMethodRefAsts ++ statementAsts) + val bodyAst = blockAst(block, statementAsts) scope.popScope() - methodAst(methodNode_, Seq.empty, bodyAst, methodReturn, newModifierNode(ModifierTypes.MODULE) :: Nil) + methodAst( + methodNode_, + Seq.empty, + bodyAst, + methodReturn, + newModifierNode(ModifierTypes.MODULE) :: newModifierNode(ModifierTypes.VIRTUAL) :: Nil + ) } .getOrElse(Ast()) } - private def methodRefNodesForInternalMethods(): List[Ast] = { - val typeNameForMethods = scope.surroundingTypeFullName - .map { x => - x.stripSuffix(s":${Defines.Program}") - } - .getOrElse(Defines.Undefined) - - scope.surroundingTypeFullName - .map { x => - val typeNameForMethods = x.stripSuffix(s":${Defines.Program}") - programSummary.namespaceToType - .filter(_._1 == typeNameForMethods) - .flatMap(_._2) - .filter(!_.isInstanceOf[RubyStubbedType]) - .flatMap(_.methods) - .map { method => - val methodRefNode = NewMethodRef() - .code(s"def ${method.name} (...)") - .methodFullName(scope.surroundingTypeFullName.map { x => s"$x:${method.name}" }.getOrElse(method.name)) - .typeFullName(Defines.Any) - .lineNumber(internalLineAndColNum) - .columnNumber(internalLineAndColNum) - - val methodRefIdent = NewIdentifier() - .code(method.name) - .name(method.name) - .typeFullName(Defines.Any) - .lineNumber(internalLineAndColNum) - .columnNumber(internalLineAndColNum) - - astForAssignment(methodRefIdent, methodRefNode, internalLineAndColNum, internalLineAndColNum) - } - .toList - } - .getOrElse(List.empty) - - } - - private def typeRefNodesForInternalDecls(): List[Ast] = { - scope.surroundingTypeFullName - .map { surroundingTypeFullName => - programSummary.namespaceToType - .filter(_._1.contains(surroundingTypeFullName)) - .flatMap(_._2) - .map { x => - val typeRefName = x.name.split("[.]").takeRight(1).head - val typeRefNode = NewTypeRef() - .code(s"class ${x.name} (...)") - .typeFullName(x.name) - - val typeRefIdent = NewIdentifier() - .code(typeRefName) - .name(typeRefName) - .typeFullName(x.name) - .lineNumber(internalLineAndColNum) - .columnNumber(internalLineAndColNum) - - astForAssignment(typeRefIdent, typeRefNode, internalLineAndColNum, internalLineAndColNum) - } - .toList - } - .getOrElse(List.empty) - - } } /** Determines till what depth the AST creator will parse until. diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreatorHelper.scala index ed259dc579fb..6adfae2b5c2a 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstCreatorHelper.scala @@ -1,5 +1,4 @@ package io.joern.rubysrc2cpg.astcreation -import io.joern.rubysrc2cpg.astcreation.GlobalTypes.{builtinFunctions, builtinPrefix} import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.{ ClassFieldIdentifier, DummyNode, @@ -9,30 +8,56 @@ import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.{ RubyNode } import io.joern.rubysrc2cpg.datastructures.{BlockScope, FieldDecl} +import io.joern.rubysrc2cpg.passes.Defines +import io.joern.rubysrc2cpg.passes.GlobalTypes +import io.joern.rubysrc2cpg.passes.GlobalTypes.{kernelFunctions, kernelPrefix} import io.joern.x2cpg.{Ast, ValidationMode} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.joern.rubysrc2cpg.passes.Defines -import io.joern.rubysrc2cpg.passes.Defines.RubyOperators +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, Operators} + +import scala.collection.mutable trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: AstCreator => - protected def computeClassFullName(name: String): String = s"${scope.surroundingScopeFullName.head}.$name" - protected def computeMethodFullName(name: String): String = s"${scope.surroundingScopeFullName.head}:$name" + private val usedFullNames = mutable.Set.empty[String] + + /** Ensures a unique full name is assigned based on the current scope. + * @param name + * the name of the entity. + * @param counter + * an optional counter, used to create unique instances in the case of redefinitions. + * @return + * a unique full name. + */ + protected def computeFullName(name: String, counter: Option[Int] = None): String = { + val candidate = counter match { + case Some(cnt) => s"${scope.surroundingScopeFullName.head}.$name$cnt" + case None => s"${scope.surroundingScopeFullName.head}.$name" + } + if (usedFullNames.contains(candidate)) { + computeFullName(name, counter.map(_ + 1).orElse(Option(0))) + } else { + usedFullNames.add(candidate) + candidate + } + } + + override def column(node: RubyNode): Option[Int] = node.column + override def columnEnd(node: RubyNode): Option[Int] = node.columnEnd + override def line(node: RubyNode): Option[Int] = node.line + override def lineEnd(node: RubyNode): Option[Int] = node.lineEnd - override def column(node: RubyNode): Option[Integer] = node.column - override def columnEnd(node: RubyNode): Option[Integer] = node.columnEnd - override def line(node: RubyNode): Option[Integer] = node.line - override def lineEnd(node: RubyNode): Option[Integer] = node.lineEnd - override def code(node: RubyNode): String = shortenCode(node.text) + override def code(node: RubyNode): String = shortenCode(node.text) - protected def isBuiltin(x: String): Boolean = builtinFunctions.contains(x) - protected def prefixAsBuiltin(x: String): String = s"$builtinPrefix$pathSep$x" - protected def pathSep = "." + protected def isBuiltin(x: String): Boolean = kernelFunctions.contains(x) + protected def prefixAsKernelDefined(x: String): String = s"$kernelPrefix$pathSep$x" + protected def prefixAsBundledType(x: String): String = s"${GlobalTypes.builtinPrefix}.$x" + protected def isBundledClass(x: String): Boolean = GlobalTypes.bundledClasses.contains(x) + protected def pathSep = "." private def astForFieldInstance(name: String, node: RubyNode & RubyFieldIdentifier): Ast = { val identName = node match { - case _: InstanceFieldIdentifier => Defines.This + case _: InstanceFieldIdentifier => Defines.Self case _: ClassFieldIdentifier => scope.surroundingTypeFullName.map(_.split("[.]").last).getOrElse(Defines.Any) } @@ -84,10 +109,14 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As protected def astForAssignment( lhs: NewNode, rhs: NewNode, - lineNumber: Option[Integer], - columnNumber: Option[Integer] + lineNumber: Option[Int], + columnNumber: Option[Int] ): Ast = { - val code = Seq(lhs, rhs).collect { case x: AstNodeNew => x.code }.mkString(" = ") + astForAssignment(Ast(lhs), Ast(rhs), lineNumber, columnNumber) + } + + protected def astForAssignment(lhs: Ast, rhs: Ast, lineNumber: Option[Int], columnNumber: Option[Int]): Ast = { + val code = Seq(lhs, rhs).flatMap(_.root).collect { case x: ExpressionNew => x.code }.mkString(" = ") val assignment = NewCall() .name(Operators.assignment) .methodFullName(Operators.assignment) @@ -96,7 +125,18 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As .lineNumber(lineNumber) .columnNumber(columnNumber) - callAst(assignment, Seq(Ast(lhs), Ast(rhs))) + callAst(assignment, Seq(lhs, rhs)) + } + + protected def memberForMethod( + method: NewMethod, + astParentType: Option[String] = None, + astParentFullName: Option[String] = None + ): NewMember = { + val member = NewMember().name(method.name).code(method.name).dynamicTypeHintFullName(Seq(method.fullName)) + astParentType.foreach(member.astParentType(_)) + astParentFullName.foreach(member.astParentFullName(_)) + member } protected val UnaryOperatorNames: Map[String, String] = Map( @@ -147,93 +187,3 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As "&&=" -> Operators.assignmentAnd ) } - -// TODO: Move this to a more appropriate place? -object GlobalTypes { - val builtinPrefix = "__builtin" - - /* Sources: - * https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/function.html - * https://ruby-doc.org/3.2.2/Kernel.html - * - * We comment-out methods that require an explicit "receiver" (target of member access.) - */ - val builtinFunctions: Set[String] = Set( - "Array", - "Complex", - "Float", - "Hash", - "Integer", - "Rational", - "String", - "__callee__", - "__dir__", - "__method__", - "abort", - "at_exit", - "autoload", - "autoload?", - "binding", - "block_given?", - "callcc", - "caller", - "caller_locations", - "catch", - "chomp", - "chomp!", - "chop", - "chop!", - // "class", - // "clone", - "eval", - "exec", - "exit", - "exit!", - "fail", - "fork", - "format", - // "frozen?", - "gets", - "global_variables", - "gsub", - "gsub!", - "iterator?", - "lambda", - "load", - "local_variables", - "loop", - "open", - "p", - "print", - "printf", - "proc", - "putc", - "puts", - "raise", - "rand", - "readline", - "readlines", - "require", - "require_relative", - "select", - "set_trace_func", - "sleep", - "spawn", - "sprintf", - "srand", - "sub", - "sub!", - "syscall", - "system", - "tap", - "test", - // "then", - "throw", - "trace_var", - // "trap", - "untrace_var", - "warn" - // "yield_self", - ) - -} diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForExpressionsCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForExpressionsCreator.scala index cd4a7b442015..b3ca467e4e05 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForExpressionsCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForExpressionsCreator.scala @@ -3,6 +3,7 @@ package io.joern.rubysrc2cpg.astcreation import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.{Unknown, Block as RubyBlock, *} import io.joern.rubysrc2cpg.datastructures.BlockScope import io.joern.rubysrc2cpg.passes.Defines +import io.joern.rubysrc2cpg.passes.GlobalTypes import io.joern.rubysrc2cpg.passes.Defines.{RubyOperators, getBuiltInType} import io.joern.rubysrc2cpg.utils.FreshNameGenerator import io.joern.x2cpg.{Ast, ValidationMode, Defines as XDefines} @@ -11,49 +12,55 @@ import io.shiftleft.codepropertygraph.generated.{ ControlStructureTypes, DispatchTypes, EdgeTypes, + NodeTypes, Operators, PropertyNames } -trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => +trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { + this: AstCreator => - val tmpGen = FreshNameGenerator(i => s"") + val tmpGen: FreshNameGenerator[String] = FreshNameGenerator(i => s"") protected def astForExpression(node: RubyNode): Ast = node match - case node: StaticLiteral => astForStaticLiteral(node) - case node: HereDocNode => astForHereDoc(node) - case node: DynamicLiteral => astForDynamicLiteral(node) - case node: UnaryExpression => astForUnary(node) - case node: BinaryExpression => astForBinary(node) - case node: MemberAccess => astForMemberAccess(node) - case node: MemberCall => astForMemberCall(node) - case node: ObjectInstantiation => astForObjectInstantiation(node) - case node: IndexAccess => astForIndexAccess(node) - case node: SingleAssignment => astForSingleAssignment(node) - case node: AttributeAssignment => astForAttributeAssignment(node) - case node: RubyIdentifier => astForSimpleIdentifier(node) - case node: SimpleCall => astForSimpleCall(node) - case node: RequireCall => astForRequireCall(node) - case node: IncludeCall => astForIncludeCall(node) - case node: YieldExpr => astForYield(node) - case node: RangeExpression => astForRange(node) - case node: ArrayLiteral => astForArrayLiteral(node) - case node: HashLiteral => astForHashLiteral(node) - case node: Association => astForAssociation(node) - case node: IfExpression => astForIfExpression(node) - case node: UnlessExpression => astForUnlessExpression(node) - case node: RescueExpression => astForRescueExpression(node) - case node: CaseExpression => blockAst(NewBlock(), astsForCaseExpression(node).toList) - case node: MandatoryParameter => astForMandatoryParameter(node) - case node: SplattingRubyNode => astForSplattingRubyNode(node) - case node: AnonymousTypeDeclaration => astForAnonymousTypeDeclaration(node) - case node: ProcOrLambdaExpr => astForProcOrLambdaExpr(node) - case node: RubyCallWithBlock[_] => astsForCallWithBlockInExpr(node) - case node: SelfIdentifier => astForSelfIdentifier(node) - case node: BreakStatement => astForBreakStatement(node) - case node: StatementList => astForStatementList(node) - case node: DummyNode => Ast(node.node) - case node: Unknown => astForUnknown(node) + case node: StaticLiteral => astForStaticLiteral(node) + case node: HereDocNode => astForHereDoc(node) + case node: DynamicLiteral => astForDynamicLiteral(node) + case node: UnaryExpression => astForUnary(node) + case node: BinaryExpression => astForBinary(node) + case node: MemberAccess => astForMemberAccess(node) + case node: MemberCall => astForMemberCall(node) + case node: ObjectInstantiation => astForObjectInstantiation(node) + case node: IndexAccess => astForIndexAccess(node) + case node: SingleAssignment => astForSingleAssignment(node) + case node: AttributeAssignment => astForAttributeAssignment(node) + case node: TypeIdentifier => astForTypeIdentifier(node) + case node: RubyIdentifier => astForSimpleIdentifier(node) + case node: SimpleCall => astForSimpleCall(node) + case node: RequireCall => astForRequireCall(node) + case node: IncludeCall => astForIncludeCall(node) + case node: YieldExpr => astForYield(node) + case node: RangeExpression => astForRange(node) + case node: ArrayLiteral => astForArrayLiteral(node) + case node: HashLiteral => astForHashLiteral(node) + case node: Association => astForAssociation(node) + case node: IfExpression => astForIfExpression(node) + case node: UnlessExpression => astForUnlessExpression(node) + case node: RescueExpression => astForRescueExpression(node) + case node: CaseExpression => blockAst(NewBlock(), astsForCaseExpression(node).toList) + case node: MandatoryParameter => astForMandatoryParameter(node) + case node: SplattingRubyNode => astForSplattingRubyNode(node) + case node: AnonymousTypeDeclaration => astForAnonymousTypeDeclaration(node) + case node: ProcOrLambdaExpr => astForProcOrLambdaExpr(node) + case node: SingletonObjectMethodDeclaration => astForSingletonObjectMethodDeclaration(node) + case node: RubyCallWithBlock[_] => astForCallWithBlock(node) + case node: SelfIdentifier => astForSelfIdentifier(node) + case node: BreakStatement => astForBreakStatement(node) + case node: StatementList => astForStatementList(node) + case node: ReturnExpression => astForReturnStatement(node) + case node: NextExpression => astForNextExpression(node) + case node: DummyNode => Ast(node.node) + case node: Unknown => astForUnknown(node) case x => logger.warn(s"Unhandled expression of type ${x.getClass.getSimpleName}") astForUnknown(node) @@ -68,7 +75,8 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { // Helper for nil literals to put in empty clauses protected def astForNilLiteral: Ast = Ast(NewLiteral().code("nil").typeFullName(getBuiltInType(Defines.NilClass))) - protected def astForNilBlock: Ast = blockAst(NewBlock(), List(astForNilLiteral)) + + protected def astForNilBlock: Ast = blockAst(NewBlock(), List(astForNilLiteral)) protected def astForDynamicLiteral(node: DynamicLiteral): Ast = { val fmtValueAsts = node.expressions.map { @@ -130,9 +138,20 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { callAst(call, Seq(lhsAst, rhsAst)) } - // Member accesses are lowered as calls, i.e. `x.y` is the call of `y` of `x` without any arguments. + // Member accesses are checked in RubyNodeCreator, i.e. `x.y` is the call of `y` of `x` without any arguments. + // where x.Y is considered a constant access as Y is capitalized. protected def astForMemberAccess(node: MemberAccess): Ast = { - astForMemberCall(MemberCall(node.target, node.op, node.memberName, List.empty)(node.span)) + node.target match { + case x: SimpleIdentifier => + val newTarget = scope.getSurroundingType(x.text).map(_.fullName) match { + case Some(surroundingType) => + val typeName = surroundingType.split('.').last + TypeIdentifier(s"$surroundingType")(x.span.spanStart(typeName)) + case None => x + } + astForFieldAccess(node.copy(target = newTarget)(node.span)) + case _ => astForFieldAccess(node) + } } /** Attempts to extract a type from the base of a member call. @@ -153,24 +172,71 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } } - protected def astForMemberCall(node: MemberCall): Ast = { - // Use the scope type recovery to attempt to obtain a receiver type for the call - // TODO: Type recovery should potentially resolve this - val receiver = astForExpression(node.target) - val fullName = receiver.root match { - case Some(x: NewMethodRef) => x.methodFullName - case _ => - typeFromCallTarget(node.target) - .map(x => s"$x:${node.methodName}") - .getOrElse(XDefines.DynamicCallUnknownFullName) - } - val argumentAsts = node.arguments.map(astForMethodCallArgument) + private def astForTypeIdentifier(node: TypeIdentifier): Ast = { + Ast(typeRefNode(node, code(node), node.typeFullName)) + } - receiver.root.collect { case x: NewCall => x.typeFullName(fullName) } + protected def astForMemberCall(node: MemberCall, isStatic: Boolean = false): Ast = { - val fieldAccessCall = callNode(node, code(node), node.methodName, fullName, DispatchTypes.DYNAMIC_DISPATCH) + def createMemberCall(n: MemberCall): Ast = { + val baseAst = n.target match { + case target: MemberAccess => astForFieldAccess(target, stripLeadingAt = true) + case _ => astForExpression(n.target) + } + val receiverAst = astForFieldAccess(MemberAccess(n.target, ".", n.methodName)(n.span), stripLeadingAt = true) + val builtinType = n.target match { + case MemberAccess(_: SelfIdentifier, _, memberName) if isBundledClass(memberName) => + Option(prefixAsBundledType(memberName)) + case x: TypeIdentifier if x.isBuiltin => Option(x.typeFullName) + case _ => None + } + val (receiverFullName, methodFullName) = receiverAst.nodes + .collectFirst { + case _ if builtinType.isDefined => builtinType.get -> s"${builtinType.get}.${n.methodName}" + case x: NewMethodRef => x.methodFullName -> x.methodFullName + case _ => + (n.target match { + case ma: MemberAccess => scope.tryResolveTypeReference(ma.memberName).map(_.name) + case _ => typeFromCallTarget(n.target) + }).map(x => x -> s"$x.${n.methodName}") + .getOrElse(XDefines.Any -> XDefines.DynamicCallUnknownFullName) + } + .getOrElse(XDefines.Any -> XDefines.DynamicCallUnknownFullName) + val argumentAsts = n.arguments.map(astForMethodCallArgument) + val dispatchType = if (isStatic) DispatchTypes.STATIC_DISPATCH else DispatchTypes.DYNAMIC_DISPATCH + + val call = callNode(n, code(n), n.methodName, XDefines.DynamicCallUnknownFullName, dispatchType) + if methodFullName != XDefines.DynamicCallUnknownFullName then call.possibleTypes(Seq(methodFullName)) + if (isStatic) { + callAst(call, argumentAsts, base = Option(baseAst)).copy(receiverEdges = Nil) + } else { + callAst(call, argumentAsts, base = Option(baseAst), receiver = Option(receiverAst)) + } + } - callAst(fieldAccessCall, argumentAsts, Option(receiver)) + def determineMemberAccessBase(target: RubyNode): RubyNode = target match { + case MemberAccess(SelfIdentifier(), _, _) => target + case x: SimpleIdentifier => + scope.getSurroundingType(x.text).map(_.fullName) match { + case Some(surroundingType) => + val typeName = surroundingType.split('.').last + TypeIdentifier(s"$surroundingType")(x.span.spanStart(typeName)) + case None if scope.lookupVariable(x.text).isDefined => x + case None => MemberAccess(SelfIdentifier()(x.span.spanStart(Defines.Self)), ".", x.text)(x.span) + } + case x @ MemberAccess(ma, op, memberName) => x.copy(target = determineMemberAccessBase(ma))(x.span) + case _ => target + } + + node.target match { + case x: SimpleIdentifier if isBundledClass(x.text) => + createMemberCall(node.copy(target = TypeIdentifier(prefixAsBundledType(x.text))(x.span))(node.span)) + case x: SimpleIdentifier => + createMemberCall(node.copy(target = determineMemberAccessBase(x))(node.span)) + case memAccess: MemberAccess => + createMemberCall(node.copy(target = determineMemberAccessBase(memAccess))(node.span)) + case x => createMemberCall(node) + } } protected def astForIndexAccess(node: IndexAccess): Ast = { @@ -187,9 +253,9 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { scope .tryResolveMethodInvocation("[]", typeFullName = Option(typeReference)) .map { m => - val expr = astForExpression(MemberCall(node.target, "::", "[]", node.indices)(node.span)) + val expr = astForExpression(MemberCall(node.target, ".", "[]", node.indices)(node.span)) expr.root.collect { case x: NewCall => - x.methodFullName(s"$typeReference:${m.name}") + x.methodFullName(s"$typeReference.${m.name}") scope.tryResolveTypeReference(m.returnType).map(_.name).foreach(x.typeFullName(_)) } expr @@ -201,10 +267,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { protected def astForObjectInstantiation(node: RubyNode & ObjectInstantiation): Ast = { val className = node.target.text - val methodName = XDefines.ConstructorMethodName + val callName = "new" + val methodName = Defines.Initialize + /* + We short-cut the call edge from `new` call to `initialize` method, however we keep the modelling of the receiver + as referring to the singleton class. + */ val (receiverTypeFullName, fullName) = scope.tryResolveTypeReference(className) match { - case Some(typeMetaData) => typeMetaData.name -> s"${typeMetaData.name}:$methodName" - case None => XDefines.Any -> XDefines.DynamicCallUnknownFullName + case Some(typeMetaData) => s"${typeMetaData.name}" -> s"${typeMetaData.name}.$methodName" + case None => XDefines.Any -> XDefines.DynamicCallUnknownFullName } /* Similarly to some other frontends, we lower the constructor into two operations, e.g., @@ -214,10 +285,15 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val block = blockNode(node) scope.pushNewScope(BlockScope(block)) - val tmp = SimpleIdentifier(Option(className))(node.span.spanStart(tmpGen.fresh)) + val tmpName = tmpGen.fresh + val tmpTypeHint = receiverTypeFullName.stripSuffix("") + val tmp = SimpleIdentifier(Option(className))(node.span.spanStart(tmpName)) + val tmpLocal = NewLocal().name(tmpName).code(tmpName).dynamicTypeHintFullName(Seq(tmpTypeHint)) + scope.addToScope(tmpName, tmpLocal) + def tmpIdentifier = { val tmpAst = astForSimpleIdentifier(tmp) - tmpAst.root.collect { case x: NewIdentifier => x.typeFullName(receiverTypeFullName) } + tmpAst.root.collect { case x: NewIdentifier => x.typeFullName(tmpTypeHint) } tmpAst } @@ -238,18 +314,17 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val argumentAsts = node match { case x: SimpleObjectInstantiation => x.arguments.map(astForMethodCallArgument) case x: ObjectInstantiationWithBlock => - val Seq(methodDecl, typeDecl, _, methodRef) = astForDoBlock(x.block): @unchecked - Ast.storeInDiffGraph(methodDecl, diffGraph) - Ast.storeInDiffGraph(typeDecl, diffGraph) - x.arguments.map(astForMethodCallArgument) :+ methodRef + val Seq(typeRef, _) = astForDoBlock(x.block): @unchecked + x.arguments.map(astForMethodCallArgument) :+ typeRef } - val constructorCall = callNode(node, code(node), methodName, fullName, DispatchTypes.DYNAMIC_DISPATCH) + val constructorCall = callNode(node, code(node), callName, fullName, DispatchTypes.DYNAMIC_DISPATCH) val constructorCallAst = callAst(constructorCall, argumentAsts, Option(tmpIdentifier)) + val retIdentifierAst = tmpIdentifier scope.popScope() // Assemble statements - blockAst(block, tmpAssignment :: constructorCallAst :: tmpIdentifier :: Nil) + blockAst(block, Ast(tmpLocal) :: tmpAssignment :: constructorCallAst :: retIdentifierAst :: Nil) } protected def astForSingleAssignment(node: SingleAssignment): Ast = { @@ -283,6 +358,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { x => reassign(node.lhs, node.op, x, transform), elseAssignNil ) + astForExpression(transform(cfNode)) case _ => // The if the LHS defines a new variable, put the local variable into scope @@ -297,6 +373,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { astForExpression(node.lhs) case _ => astForExpression(node.lhs) } + val rhsAst = astForExpression(node.rhs) // If this is a simple object instantiation assignment, we can give the LHS variable a type hint @@ -357,21 +434,34 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } } - // `x.y = 1` is lowered as `x.y=(1)`, i.e. as calling `y=` on `x` with argument `1` + // `x.y = 1` is approximated as `x.y = 1`, i.e. as calling `x.y =` assignment with argument `1` + // This has the benefit of avoiding unnecessary call resolution protected def astForAttributeAssignment(node: AttributeAssignment): Ast = { - val call = SimpleCall(node, List(node.rhs))(node.span) - val memberAccess = MemberAccess(node.target, ".", s"${node.attributeName}=")(node.span) - astForMemberCallWithoutBlock(call, memberAccess) + val memberAccess = MemberAccess(node.target, ".", s"@${node.attributeName}")( + node.span.spanStart(s"${node.target.text}.${node.attributeName}") + ) + val op = Operators.assignment + val lhsAst = astForFieldAccess(memberAccess, stripLeadingAt = true) + val rhsAst = astForExpression(node.rhs) + val call = callNode(node, code(node), op, op, DispatchTypes.STATIC_DISPATCH) + callAst(call, Seq(lhsAst, rhsAst)) } protected def astForSimpleIdentifier(node: RubyNode & RubyIdentifier): Ast = { val name = code(node) - - scope.lookupVariable(name) match { - case Some(_) => handleVariableOccurrence(node) - case None if scope.tryResolveMethodInvocation(node.text).isDefined => - astForSimpleCall(SimpleCall(node, List())(node.span)) - case None => handleVariableOccurrence(node) + if (isBundledClass(name)) { + val typeFullName = prefixAsBundledType(name) + Ast(typeRefNode(node, typeFullName, typeFullName)) + } else { + scope.lookupVariable(name) match { + case Some(_) => handleVariableOccurrence(node) + case None if scope.tryResolveMethodInvocation(node.text).isDefined => + astForSimpleCall(SimpleCall(node, List())(node.span)) + case None => + astForMemberAccess( + MemberAccess(SelfIdentifier()(node.span.spanStart(Defines.Self)), ".", node.text)(node.span) + ) + } } } @@ -402,20 +492,22 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { astForSimpleCall(node.asSimpleCall) } + /** A yield in Ruby calls an explicit (or implicit) proc parameter and returns its value. This can be lowered as + * block.call(), which is effectively how one invokes a proc parameter in any case. + */ protected def astForYield(node: YieldExpr): Ast = { scope.useProcParam match { case Some(param) => - val call = astForExpression( - SimpleCall(SimpleIdentifier()(node.span.spanStart(param)), node.arguments)(node.span) - ) - val ret = returnAst(returnNode(node, code(node))) - val cond = astForExpression( - SimpleCall(SimpleIdentifier()(node.span.spanStart(tmpGen.fresh)), List())(node.span.spanStart("")) - ) - callAst( - callNode(node, code(node), Operators.conditional, Operators.conditional, DispatchTypes.STATIC_DISPATCH), - List(cond, call, ret) - ) + // We do not know if we necessarily have an explicit proc param here, or if we need to create a new one + if (scope.lookupVariable(param).isEmpty) { + scope.anonProcParam.map { param => + val paramNode = ProcParameter(param)(node.span.spanStart(s"&$param")) + astForParameter(paramNode, -1) + } + } + val loweredCall = + MemberCall(SimpleIdentifier()(node.span.spanStart(param)), ".", "call", node.arguments)(node.span) + astForExpression(loweredCall) case None => logger.warn(s"Yield expression outside of method scope: ${code(node)} ($relativeFileName), skipping") astForUnknown(node) @@ -431,33 +523,23 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } protected def astForArrayLiteral(node: ArrayLiteral): Ast = { - if (node.isDynamic) { - logger.warn(s"Interpolated array literals are not supported yet: ${code(node)} ($relativeFileName), skipping") - astForUnknown(node) - } else { - val arguments = if (node.text.startsWith("%")) { - val argumentsType = - if (node.isStringArray) getBuiltInType(Defines.String) - else getBuiltInType(Defines.Symbol) - node.elements.map { - case element @ StaticLiteral(_) => StaticLiteral(argumentsType)(element.span) - case element => element - } - } else { - node.elements + val arguments = if (node.text.startsWith("%")) { + val argumentsType = + if (node.isStringArray) getBuiltInType(Defines.String) + else getBuiltInType(Defines.Symbol) + node.elements.map { + case element @ StaticLiteral(_) => StaticLiteral(argumentsType)(element.span) + case element @ DynamicLiteral(_, expressions) => DynamicLiteral(argumentsType, expressions)(element.span) + case element => element } - val argumentAsts = arguments.map(astForExpression) - - val call = - callNode( - node, - code(node), - Operators.arrayInitializer, - Operators.arrayInitializer, - DispatchTypes.STATIC_DISPATCH - ) - callAst(call, argumentAsts) + } else { + node.elements } + val argumentAsts = arguments.map(astForExpression) + + val call = + callNode(node, code(node), Operators.arrayInitializer, Operators.arrayInitializer, DispatchTypes.STATIC_DISPATCH) + callAst(call, argumentAsts) } protected def astForHashLiteral(node: HashLiteral): Ast = { @@ -469,10 +551,13 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val block = blockNode(node) scope.pushNewScope(BlockScope(block)) + val tmpLocal = NewLocal().name(tmp).code(tmp) + scope.addToScope(tmp, tmpLocal) val argumentAsts = node.elements.flatMap(elem => elem match - case associationNode: Association => astForAssociationHash(associationNode, tmp) + case associationNode: Association => astForAssociationHash(associationNode, tmp) + case splattingRubyNode: SplattingRubyNode => astForSplattingRubyNode(splattingRubyNode) :: Nil case node => logger.warn(s"Could not represent element: ${code(node)} ($relativeFileName), skipping") astForUnknown(node) :: Nil @@ -489,9 +574,10 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val assignment = callNode(node, code(node), Operators.assignment, Operators.assignment, DispatchTypes.STATIC_DISPATCH) val tmpAssignment = callAst(assignment, tmpAst() :: Ast(hashInitCall) :: Nil) + val tmpRetAst = tmpAst(node.elements.lastOption) scope.popScope() - blockAst(block, tmpAssignment +: argumentAsts :+ tmpAst(node.elements.lastOption)) + blockAst(block, tmpAssignment +: argumentAsts :+ tmpRetAst) } protected def astForAssociationHash(node: Association, tmp: String): List[Ast] = { @@ -515,13 +601,13 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { (node.lowerBound, node.upperBound) match { case (lb: StaticLiteral, ub: StaticLiteral) => (lb.typeFullName, ub.typeFullName) match { - case ("__builtin.Integer", "__builtin.Integer") => + case (s"${GlobalTypes.`kernelPrefix`}.Integer", s"${GlobalTypes.`kernelPrefix`}.Integer") => generateRange(lb.span.text.toInt, ub.span.text.toInt, node.rangeOperator.exclusive) .map(x => - StaticLiteral(lb.typeFullName)(TextSpan(lb.line, lb.column, lb.lineEnd, lb.columnEnd, x.toString)) + StaticLiteral(lb.typeFullName)(TextSpan(lb.line, lb.column, lb.lineEnd, lb.columnEnd, None, x.toString)) ) .toList - case ("__builtin.String", "__builtin.String") => + case (s"${GlobalTypes.`kernelPrefix`}.String", s"${GlobalTypes.`kernelPrefix`}.String") => val lbVal = lb.span.text.replaceAll("['\"]", "") val ubVal = ub.span.text.replaceAll("['\"]", "") @@ -535,7 +621,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { generateRange(lbVal(0).toInt, ubVal(0).toInt, node.rangeOperator.exclusive) .map(x => StaticLiteral(lb.typeFullName)( - TextSpan(lb.line, lb.column, lb.lineEnd, lb.columnEnd, s"\'${x.toChar.toString}\'") + TextSpan(lb.line, lb.column, lb.lineEnd, lb.columnEnd, None, s"\'${x.toChar.toString}\'") ) ) .toList @@ -564,9 +650,18 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { astForExpression( SingleAssignment( IndexAccess( - SimpleIdentifier()(TextSpan(keyNode.line, keyNode.column, keyNode.lineEnd, keyNode.columnEnd, tmp)), + SimpleIdentifier()(TextSpan(keyNode.line, keyNode.column, keyNode.lineEnd, keyNode.columnEnd, None, tmp)), List(keyNode) - )(TextSpan(keyNode.line, keyNode.column, keyNode.lineEnd, keyNode.columnEnd, s"$tmp[${keyNode.span.text}]")), + )( + TextSpan( + keyNode.line, + keyNode.column, + keyNode.lineEnd, + keyNode.columnEnd, + None, + s"$tmp[${keyNode.span.text}]" + ) + ), "=", valueNode )( @@ -575,6 +670,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { keyNode.column, keyNode.lineEnd, keyNode.columnEnd, + None, s"$tmp[${keyNode.span.text}] = ${valueNode.span.text}" ) ) @@ -595,6 +691,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val call = callNode(node, code(node), Operators.conditional, Operators.conditional, DispatchTypes.STATIC_DISPATCH) callAst(call, conditionAst :: thenAst :: elseAsts_) } + foldIfExpression(builder)(node) } @@ -623,7 +720,7 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } val elseAst = node.elseClause.map { x => astForStatementList(x.thenClause.asStatementList) } val ensureAst = node.ensureClause.map { x => astForStatementList(x.thenClause.asStatementList) } - tryCatchAst( + tryCatchAstWithOrder( NewControlStructure() .controlStructureType(ControlStructureTypes.TRY) .code(code(node)), @@ -634,7 +731,8 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { } private def astForSelfIdentifier(node: SelfIdentifier): Ast = { - val thisIdentifier = identifierNode(node, "this", code(node), scope.surroundingTypeFullName.getOrElse(Defines.Any)) + val thisIdentifier = + identifierNode(node, Defines.Self, code(node), scope.surroundingTypeFullName.getOrElse(Defines.Any)) Ast(thisIdentifier) } @@ -650,20 +748,21 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { val methodName = memberAccess.memberName // TODO: Type recovery should potentially resolve this val methodFullName = typeFromCallTarget(memberAccess.target) - .map(x => s"$x:$methodName") + .map(x => s"$x.$methodName") .getOrElse(XDefines.DynamicCallUnknownFullName) val argumentAsts = node.arguments.map(astForMethodCallArgument) - val call = callNode(node, code(node), methodName, methodFullName, DispatchTypes.DYNAMIC_DISPATCH) + val call = + callNode(node, code(node), methodName, XDefines.DynamicCallUnknownFullName, DispatchTypes.DYNAMIC_DISPATCH) + .possibleTypes(IndexedSeq(methodFullName)) callAst(call, argumentAsts, Some(receiverAst)) } private def astForMethodCallWithoutBlock(node: SimpleCall, methodIdentifier: SimpleIdentifier): Ast = { - val methodName = methodIdentifier.text - + val methodName = methodIdentifier.text lazy val defaultResult = Defines.Any -> XDefines.DynamicCallUnknownFullName - val (receiverType, methodFullName) = + val (receiverType, methodFullNameHint) = scope .tryResolveMethodInvocation( methodName, @@ -674,32 +773,44 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { ) // Check if this is a method invocation of a member imported into scope match { case Some(m) => - scope.typeForMethod(m).map(t => t.name -> s"${t.name}:${m.name}").getOrElse(defaultResult) + scope.typeForMethod(m).map(t => t.name -> s"${t.name}.${m.name}").getOrElse(defaultResult) case None => defaultResult } - val argumentAst = node.arguments.map(astForMethodCallArgument) - val call = callNode(node, code(node), methodName, methodFullName, DispatchTypes.DYNAMIC_DISPATCH) - val receiverCallName = identifierNode(node, call.name, call.name, receiverType) - callAst(call, argumentAst, Option(Ast(receiverCallName))) - } + val argumentAst = node.arguments.map(astForMethodCallArgument) + val (dispatchType, methodFullName) = + if receiverType.startsWith(GlobalTypes.builtinPrefix) then (DispatchTypes.STATIC_DISPATCH, methodFullNameHint) + else (DispatchTypes.DYNAMIC_DISPATCH, XDefines.DynamicCallUnknownFullName) - private def astForProcOrLambdaExpr(node: ProcOrLambdaExpr): Ast = { - val Seq(methodDecl, typeDecl, _, methodRef) = astForDoBlock(node.block): @unchecked + val call = callNode(node, code(node), methodName, methodFullName, dispatchType) - Ast.storeInDiffGraph(methodDecl, diffGraph) - Ast.storeInDiffGraph(typeDecl, diffGraph) + if methodFullName != methodFullNameHint then call.possibleTypes(IndexedSeq(methodFullNameHint)) + + val receiverAst = astForFieldAccess( + MemberAccess(SelfIdentifier()(node.span.spanStart(Defines.Self)), ".", call.name)(node.span), + stripLeadingAt = true + ) + val baseAst = Ast(identifierNode(node, Defines.Self, Defines.Self, receiverType)) + callAst(call, argumentAst, Option(baseAst), Option(receiverAst)) + } - methodRef + private def astForProcOrLambdaExpr(node: ProcOrLambdaExpr): Ast = { + val Seq(typeRef, _) = astForDoBlock(node.block): @unchecked + typeRef } - private def astsForCallWithBlockInExpr[C <: RubyCall](node: RubyNode & RubyCallWithBlock[C]): Ast = { - val Seq(methodDecl, typeDecl, callWithLambdaArg) = astsForCallWithBlock(node): @unchecked + private def astForSingletonObjectMethodDeclaration(node: SingletonObjectMethodDeclaration): Ast = { + val methodAstsWithRefs = astForMethodDeclaration(node, isSingletonObjectMethod = true) + + // Set span contents + methodAstsWithRefs.flatMap(_.nodes).foreach { + case m: NewMethodRef => DummyNode(m.copy)(node.body.span.spanStart(m.code)) + case _ => + } - Ast.storeInDiffGraph(methodDecl, diffGraph) - Ast.storeInDiffGraph(typeDecl, diffGraph) + val Seq(typeRef, _) = methodAstsWithRefs - callWithLambdaArg + typeRef } private def astForMethodCallArgument(node: RubyNode): Ast = { @@ -707,36 +818,63 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { // Associations in method calls are keyword arguments case assoc: Association => astForKeywordArgument(assoc) case block: RubyBlock => - val Seq(methodDecl, typeDecl, _, methodRef) = astForDoBlock(block) + val Seq(methodDecl, typeDecl, typeRef, _) = astForDoBlock(block) Ast.storeInDiffGraph(methodDecl, diffGraph) Ast.storeInDiffGraph(typeDecl, diffGraph) - methodRef + typeRef + case selfMethod: SingletonMethodDeclaration => + // Last element is the method declaration, the prefix methods would be `foo = def foo (...)` pointers in other + // contexts, but this would be empty as a method call argument + val Seq(_, methodDeclAst) = astForSingletonMethodDeclaration(selfMethod) + scope.surroundingTypeFullName.foreach { tfn => + methodDeclAst.root.collect { case m: NewMethod => + m.astParentType(NodeTypes.TYPE_DECL).astParentFullName(s"$tfn") + } + } + Ast.storeInDiffGraph(methodDeclAst, diffGraph) + scope.surroundingScopeFullName + .map(s => Ast(methodRefNode(node, selfMethod.span.text, s"$s.${selfMethod.methodName}", Defines.Any))) + .getOrElse(Ast()) case _ => astForExpression(node) } private def astForKeywordArgument(assoc: Association): Ast = { val value = astForExpression(assoc.value) - astForExpression(assoc.key).root match - case Some(keyNode: NewIdentifier) => + assoc.key match + case keyIdentifier: SimpleIdentifier => value.root.collectFirst { case x: ExpressionNew => - x.argumentName_=(Option(keyNode.name)) + x.argumentName_=(Option(keyIdentifier.text)) x.argumentIndex_=(-1) } value - case _ => astForExpression(assoc) - } + case _: (LiteralExpr | RubyCall) => astForExpression(assoc) + case x => + logger.warn(s"Not explicitly handled argument association key of type ${x.getClass.getSimpleName}") + astForExpression(assoc) + } + + protected def astForFieldAccess(node: MemberAccess, stripLeadingAt: Boolean = false): Ast = { + val (memberName, memberCode) = node.target match { + case _ if stripLeadingAt => node.memberName -> node.memberName.stripPrefix("@") + case _: TypeIdentifier => node.memberName -> node.memberName + case _ if !node.memberName.startsWith("@") && node.memberName.headOption.exists(_.isLower) => + s"@${node.memberName}" -> node.memberName + case _ => node.memberName -> node.memberName + } - protected def astForFieldAccess(node: MemberAccess): Ast = { - val fieldIdentifierAst = Ast(fieldIdentifierNode(node, node.memberName, node.memberName)) - val targetAst = astForExpression(node.target) - val code = s"${node.target.text}${node.op}${node.memberName}" + val fieldIdentifierAst = Ast(fieldIdentifierNode(node, memberName, memberCode)) + val targetAst = node.target match { + case target: MemberAccess => astForFieldAccess(target, stripLeadingAt = true) + case _ => astForExpression(node.target) + } + val code = s"${node.target.text}${node.op}$memberCode" val memberType = typeFromCallTarget(node.target) .flatMap(scope.tryResolveTypeReference) .map(_.fields) .getOrElse(List.empty) .collectFirst { - case x if x.name == node.memberName => + case x if x.name == memberName => scope.tryResolveTypeReference(x.typeName).map(_.name).getOrElse(Defines.Any) } .orElse(Option(Defines.Any)) @@ -747,8 +885,8 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { Operators.fieldAccess, DispatchTypes.STATIC_DISPATCH, signature = None, - typeFullName = memberType - ) + typeFullName = Option(Defines.Any) + ).possibleTypes(IndexedSeq(memberType.get)) callAst(fieldAccess, Seq(targetAst, fieldIdentifierAst)) } @@ -759,7 +897,9 @@ trait AstForExpressionsCreator(implicit withSchemaValidation: ValidationMode) { callAst(splattingCall, argumentAst) } - private def getBinaryOperatorName(op: String): Option[String] = BinaryOperatorNames.get(op) - private def getUnaryOperatorName(op: String): Option[String] = UnaryOperatorNames.get(op) + private def getBinaryOperatorName(op: String): Option[String] = BinaryOperatorNames.get(op) + + private def getUnaryOperatorName(op: String): Option[String] = UnaryOperatorNames.get(op) + private def getAssignmentOperatorName(op: String): Option[String] = AssignmentOperatorNames.get(op) } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForFunctionsCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForFunctionsCreator.scala index 0973f92fa8f5..e907a107297d 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForFunctionsCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForFunctionsCreator.scala @@ -12,7 +12,14 @@ import io.joern.x2cpg.utils.NodeBuilders.{ } import io.joern.x2cpg.{Ast, AstEdge, ValidationMode, Defines as XDefines} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, EvaluationStrategies, ModifierTypes, NodeTypes} +import io.shiftleft.codepropertygraph.generated.{ + DispatchTypes, + EdgeTypes, + EvaluationStrategies, + ModifierTypes, + NodeTypes, + Operators +} import io.joern.rubysrc2cpg.utils.FreshNameGenerator import scala.collection.mutable @@ -29,14 +36,22 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th * @return * a method declaration with additional refs and types if specified. */ - protected def astForMethodDeclaration(node: MethodDeclaration, isClosure: Boolean = false): Seq[Ast] = { - - // Special case constructor methods + protected def astForMethodDeclaration( + node: RubyNode & ProcedureDeclaration, + isClosure: Boolean = false, + isSingletonObjectMethod: Boolean = false + ): Seq[Ast] = { val isInTypeDecl = scope.surroundingAstLabel.contains(NodeTypes.TYPE_DECL) - val isConstructor = node.methodName == "initialize" && isInTypeDecl - val methodName = if isConstructor then XDefines.ConstructorMethodName else node.methodName + val isConstructor = (node.methodName == Defines.Initialize) && isInTypeDecl + val methodName = node.methodName + // TODO: body could be a try - val fullName = computeMethodFullName(methodName) + + val fullName = node match { + case x: SingletonObjectMethodDeclaration => computeFullName(s"class<<${x.baseClass.span.text}.$methodName") + case _ => computeFullName(methodName) + } + val method = methodNode( node = node, name = methodName, @@ -48,12 +63,14 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th astParentFullName = scope.surroundingScopeFullName ) + val isSurroundedByProgramScope = scope.isSurroundedByProgramScope if (isConstructor) scope.pushNewScope(ConstructorScope(fullName)) else scope.pushNewScope(MethodScope(fullName, procParamGen.fresh)) val thisParameterAst = Ast( newThisParameterNode( - code = Defines.This, + name = Defines.Self, + code = Defines.Self, typeFullName = scope.surroundingTypeFullName.getOrElse(Defines.Any), line = method.lineNumber, column = method.columnNumber @@ -64,59 +81,93 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th val optionalStatementList = statementListForOptionalParams(node.parameters) val methodReturn = methodReturnNode(node, Defines.Any) - val refs = - List( - typeDeclNode( - node, - methodName, - fullName, - relativeFileName, - code(node), - astParentType = scope.surroundingAstLabel.getOrElse(""), - astParentFullName = scope.surroundingScopeFullName.getOrElse("") - ), - typeRefNode(node, methodName, fullName), - methodRefNode(node, methodName, fullName, methodReturn.typeFullName) - ).map { - case x: NewTypeDecl if isClosure => Ast(x).withChild(Ast(newModifierNode(ModifierTypes.LAMBDA))) - case x => Ast(x) - } + + val refs = { + val typeRef = + if isClosure then typeRefNode(node, s"$methodName&Proc", s"$fullName&Proc") + else typeRefNode(node, methodName, fullName) + List(typeRef, methodRefNode(node, methodName, fullName, fullName)).map(Ast.apply) + } // Consider which variables are captured from the outer scope - val stmtBlockAst = if (isClosure) { + val stmtBlockAst = if (isClosure || isSingletonObjectMethod) { val baseStmtBlockAst = astForMethodBody(node.body, optionalStatementList) transformAsClosureBody(refs, baseStmtBlockAst) } else { - if (methodName != XDefines.ConstructorMethodName && node.methodName != XDefines.StaticInitMethodName) { + if (methodName == Defines.TypeDeclBody) { + val stmtList = node.body.asInstanceOf[StatementList] + astForStatementList(StatementList(stmtList.statements ++ optionalStatementList.statements)(stmtList.span)) + } else if (methodName != Defines.Initialize) { astForMethodBody(node.body, optionalStatementList) } else { astForConstructorMethodBody(node.body, optionalStatementList) } } - val anonProcParam = scope.anonProcParam.map { param => - val paramNode = ProcParameter(param)(node.span.spanStart(s"&$param")) + // For yield statements where there isn't an explicit proc parameter + val anonProcParam = scope.procParamName.map { p => val nextIndex = - parameterAsts.lastOption.flatMap(_.root).map { case m: NewMethodParameterIn => m.index + 1 }.getOrElse(0) - astForParameter(paramNode, nextIndex) + parameterAsts.flatMap(_.root).lastOption.map { case m: NewMethodParameterIn => m.index + 1 }.getOrElse(0) + + Ast(p.index(nextIndex)) } scope.popScope() + val methodTypeDeclAst = { + val typeDeclNode_ = typeDeclNode(node, methodName, fullName, relativeFileName, code(node)) + scope.surroundingAstLabel.foreach(typeDeclNode_.astParentType(_)) + scope.surroundingScopeFullName.foreach(typeDeclNode_.astParentFullName(_)) + createMethodTypeBindings(method, typeDeclNode_) + if isClosure then Ast(typeDeclNode_).withChild(Ast(newModifierNode(ModifierTypes.LAMBDA))) + else Ast(typeDeclNode_) + } + + // Due to lambdas being invoked by `call()`, this additional type ref holding that member is created. + val lambdaTypeDeclAst = if isClosure then { + val typeDeclNode_ = typeDeclNode(node, s"$methodName&Proc", s"$fullName&Proc", relativeFileName, code(node)) + scope.surroundingAstLabel.foreach(typeDeclNode_.astParentType(_)) + scope.surroundingScopeFullName.foreach(typeDeclNode_.astParentFullName(_)) + Ast(typeDeclNode_) + .withChild( + // This member refers back to itself, as itself is the type decl bound to the respective method + Ast(NewMember().name("call").code("call").dynamicTypeHintFullName(Seq(fullName)).typeFullName(Defines.Any)) + ) + } else Ast() + val modifiers = mutable.Buffer(ModifierTypes.VIRTUAL) if (isClosure) modifiers.addOne(ModifierTypes.LAMBDA) if (isConstructor) modifiers.addOne(ModifierTypes.CONSTRUCTOR) - createMethodTypeBindings(method, refs) + val prefixMemberAst = + if isClosure || isSingletonObjectMethod || isSurroundedByProgramScope then + Ast() // program scope members are set elsewhere + else { + // Singleton constructors that initialize @@ fields should have their members linked under the singleton class + val methodMember = scope.surroundingTypeFullName match { + case Some(astParentTfn) => memberForMethod(method, Option(NodeTypes.TYPE_DECL), Option(astParentTfn)) + case None => memberForMethod(method, scope.surroundingAstLabel, scope.surroundingScopeFullName) + } + Ast(memberForMethod(method, Option(NodeTypes.TYPE_DECL), scope.surroundingScopeFullName)) + } + // For closures, we also want the method/type refs for upstream use + val methodAst_ = { + val mAst = methodAst( + method, + parameterAsts ++ anonProcParam, + stmtBlockAst, + methodReturn, + modifiers.map(newModifierNode).toSeq + ) + mAst + } - methodAst( - method, - parameterAsts ++ anonProcParam, - stmtBlockAst, - methodReturn, - modifiers.map(newModifierNode).toSeq - ) :: // For closures, we also want the method/type refs for upstream use - (if isClosure then refs else refs.filter(_.root.exists(_.isInstanceOf[NewTypeDecl]))) + // Each of these ASTs are linked via AstLinker as per the astParent* properties + (prefixMemberAst :: methodAst_ :: methodTypeDeclAst :: lambdaTypeDeclAst :: Nil) + .foreach(Ast.storeInDiffGraph(_, diffGraph)) + // In the case of a closure, we expect this method to return a method ref, otherwise, we bind a pointer to a + // method ref, e.g. self.foo = def foo(...) + if isClosure || isSingletonObjectMethod then refs else createMethodRefPointer(method) :: Nil } private def transformAsClosureBody(refs: List[Ast], baseStmtBlockAst: Ast) = { @@ -135,25 +186,25 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th case _ => false }) - val methodRefOption = refs.flatMap(_.nodes).collectFirst { case x: NewMethodRef => x } + val methodRefOption = refs.flatMap(_.nodes).collectFirst { case x: NewTypeRef => x } capturedLocalNodes .collect { case local: NewLocal => - val closureBindingId = scope.surroundingScopeFullName.map(x => s"$x:${local.name}") + val closureBindingId = scope.variableScopeFullName(local.name).map(x => s"$x.${local.name}") (local, local.name, local.code, closureBindingId) case param: NewMethodParameterIn => - val closureBindingId = scope.surroundingScopeFullName.map(x => s"$x:${param.name}") + val closureBindingId = scope.variableScopeFullName(param.name).map(x => s"$x.${param.name}") (param, param.name, param.code, closureBindingId) } - .collect { case (decl, name, code, Some(closureBindingId)) => - val local = newLocalNode(name, code, Option(closureBindingId)) + .collect { case (capturedLocal, name, code, Some(closureBindingId)) => + val capturingLocal = newLocalNode(name, code, Option(closureBindingId)) val closureBinding = newClosureBindingNode(closureBindingId, name, EvaluationStrategies.BY_REFERENCE) // Create new local node for lambda, with corresponding REF edges to identifiers and closure binding - capturedBlockAst.withChild(Ast(local)) - capturedIdentifiers.filter(_.name == name).foreach(i => capturedBlockAst.withRefEdge(i, local)) - diffGraph.addEdge(closureBinding, decl, EdgeTypes.REF) + capturedBlockAst.root.foreach(rootBlock => diffGraph.addEdge(rootBlock, capturingLocal, EdgeTypes.AST)) + capturedIdentifiers.filter(_.name == name).foreach(i => diffGraph.addEdge(i, capturingLocal, EdgeTypes.REF)) + diffGraph.addEdge(closureBinding, capturedLocal, EdgeTypes.REF) methodRefOption.foreach(methodRef => diffGraph.addEdge(methodRef, closureBinding, EdgeTypes.CAPTURE)) } @@ -163,12 +214,10 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th /** Creates the bindings between the method and its types. This is useful for resolving function pointers and imports. */ - private def createMethodTypeBindings(method: NewMethod, refs: List[Ast]): Unit = { - refs.flatMap(_.root).collectFirst { case typeRef: NewTypeDecl => - val bindingNode = newBindingNode(method.name, "", method.fullName) - diffGraph.addEdge(typeRef, bindingNode, EdgeTypes.BINDS) - diffGraph.addEdge(bindingNode, method, EdgeTypes.REF) - } + protected def createMethodTypeBindings(method: NewMethod, typeDecl: NewTypeDecl): Unit = { + val bindingNode = newBindingNode("", "", method.fullName) + diffGraph.addEdge(typeDecl, bindingNode, EdgeTypes.BINDS) + diffGraph.addEdge(bindingNode, method, EdgeTypes.REF) } // TODO: remaining cases @@ -196,13 +245,12 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th evaluationStrategy = EvaluationStrategies.BY_REFERENCE, typeFullName = None ) - scope.addToScope(node.name, parameterIn) - scope.setProcParam(node.name) - Ast(parameterIn) + scope.setProcParam(node.name, parameterIn) + Ast() // The proc parameter is retrieved later under method AST creation case node: CollectionParameter => val typeFullName = node match { - case ArrayParameter(_) => prefixAsBuiltin("Array") - case HashParameter(_) => prefixAsBuiltin("Hash") + case ArrayParameter(_) => prefixAsKernelDefined("Array") + case HashParameter(_) => prefixAsKernelDefined("Hash") } val parameterIn = parameterInNode( node = node, @@ -224,7 +272,7 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th } private def generateTextSpan(node: RubyNode, text: String): TextSpan = { - TextSpan(node.span.line, node.span.column, node.span.lineEnd, node.span.columnEnd, text) + TextSpan(node.span.line, node.span.column, node.span.lineEnd, node.span.columnEnd, node.span.offset, text) } protected def statementForOptionalParam(node: OptionalParameter): RubyNode = { @@ -259,62 +307,39 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th protected def astForAnonymousTypeDeclaration(node: AnonymousTypeDeclaration): Ast = { - /** Handles the logic around singleton class behaviour, by registering that the anonymous type extends the base - * variable's type, and nothing that the base variable now may be of the singleton's type. - * @param typeDecl - * the resulting type decl of the anonymous type. - */ - def handleSingletonClassBehaviour(typeDecl: NewTypeDecl): Unit = { - typeDecl.inheritsFromTypeFullName.toList match { - case baseVariableName :: _ => - // Attempt to resolve the 'true' inheritance type - scope.lookupVariable(baseVariableName).foreach { - case x: NewLocal if x.possibleTypes.nonEmpty => typeDecl.inheritsFromTypeFullName(x.possibleTypes) - case x: NewMethodParameterIn if x.possibleTypes.nonEmpty => - typeDecl.inheritsFromTypeFullName(x.possibleTypes) - case _ => - } - scope.pushSingletonClassDeclaration(typeDecl.fullName, baseVariableName) - case _ => - } - } - // This will link the type decl to the surrounding context via base overlays - val typeDeclAst = astForClassDeclaration(node) - Ast.storeInDiffGraph(typeDeclAst, diffGraph) - - typeDeclAst.nodes - .collectFirst { case typeDecl: NewTypeDecl => - if (node.isInstanceOf[SingletonClassDeclaration]) handleSingletonClassBehaviour(typeDecl) + val Seq(typeRefAst) = astForClassDeclaration(node).take(1) - val typeIdentifier = SimpleIdentifier()(node.span.spanStart(typeDecl.name)) + typeRefAst.nodes + .collectFirst { case typRef: NewTypeRef => + val typeIdentifier = SimpleIdentifier()(node.span.spanStart(typRef.code)) // Takes the `Class.new` before the block starts or any other keyword - val newSpanText = typeDecl.code.takeWhile(_ != ' ') + val newSpanText = typRef.code astForMemberCall(MemberCall(typeIdentifier, ".", "new", List.empty)(node.span.spanStart(newSpanText))) } .getOrElse(Ast()) } - protected def astForSingletonMethodDeclaration(node: SingletonMethodDeclaration): Ast = { - node.target match + protected def astForSingletonMethodDeclaration(node: SingletonMethodDeclaration): Seq[Ast] = { + node.target match { case targetNode: SingletonMethodIdentifier => - val fullName = computeMethodFullName(node.methodName) + val fullName = computeFullName(node.methodName) val (astParentType, astParentFullName, thisParamCode, addEdge) = targetNode match { case _: SelfIdentifier => - (scope.surroundingAstLabel, scope.surroundingScopeFullName, Defines.This, false) + (scope.surroundingAstLabel, scope.surroundingScopeFullName, Defines.Self, false) case _: SimpleIdentifier => val baseType = node.target.span.text scope.surroundingTypeFullName.map(_.split("[.]").last) match { case Some(typ) if typ == baseType => - (scope.surroundingAstLabel, scope.surroundingTypeFullName, baseType, false) + (scope.surroundingAstLabel, scope.surroundingScopeFullName, baseType, false) case Some(typ) => scope.tryResolveTypeReference(baseType) match { case Some(typ) => (Option(NodeTypes.TYPE_DECL), Option(typ.name), baseType, true) - case None => (None, None, Defines.This, false) + case None => (None, None, Defines.Self, false) } - case None => (None, None, Defines.This, false) + case None => (None, None, Defines.Self, false) } } @@ -325,13 +350,24 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th fullName = fullName, code = code(node), signature = None, - fileName = relativeFileName, - astParentType = astParentType, - astParentFullName = astParentFullName + fileName = relativeFileName ) + val methodTypeDecl_ = typeDeclNode(node, node.methodName, fullName, relativeFileName, code(node)) + val methodTypeDeclAst = Ast(methodTypeDecl_) + astParentType.orElse(scope.surroundingAstLabel).foreach { t => + methodTypeDecl_.astParentType(t) + method.astParentType(t) + } + astParentFullName.orElse(scope.surroundingScopeFullName).foreach { fn => + methodTypeDecl_.astParentFullName(fn) + method.astParentFullName(fn) + } + + createMethodTypeBindings(method, methodTypeDecl_) val thisParameterAst = Ast( newThisParameterNode( + name = Defines.Self, code = thisParamCode, typeFullName = astParentFullName.getOrElse(Defines.Any), line = method.lineNumber, @@ -339,38 +375,77 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th ) ) - val parameterAsts = astForParameters(node.parameters) + val parameterAsts = thisParameterAst :: astForParameters(node.parameters) val optionalStatementList = statementListForOptionalParams(node.parameters) val stmtBlockAst = astForMethodBody(node.body, optionalStatementList) - val anonProcParam = scope.anonProcParam.map { param => - val paramNode = ProcParameter(param)(node.span.spanStart(s"&$param")) + val anonProcParam = scope.procParamName.map { p => val nextIndex = - parameterAsts.lastOption.flatMap(_.root).map { case m: NewMethodParameterIn => m.index + 1 }.getOrElse(1) - astForParameter(paramNode, nextIndex) + parameterAsts.flatMap(_.root).lastOption.map { case m: NewMethodParameterIn => m.index + 1 }.getOrElse(0) + + Ast(p.index(nextIndex)) } scope.popScope() + // The member for these types refers to the singleton class + val member = memberForMethod(method, Option(NodeTypes.TYPE_DECL), astParentFullName.map(x => s"$x")) + diffGraph.addNode(member) + val _methodAst = methodAst( method, - (thisParameterAst +: parameterAsts) ++ anonProcParam, + parameterAsts ++ anonProcParam, stmtBlockAst, - methodReturnNode(node, Defines.Any) + methodReturnNode(node, Defines.Any), + newModifierNode(ModifierTypes.VIRTUAL) :: Nil ) + + _methodAst :: methodTypeDeclAst :: Nil foreach (Ast.storeInDiffGraph(_, diffGraph)) if (addEdge) { - Ast.storeInDiffGraph(_methodAst, diffGraph) - Ast() + Nil } else { - _methodAst + createMethodRefPointer(method) :: Nil } case targetNode => logger.warn( s"Target node type for singleton method declarations are not supported yet: ${targetNode.text} (${targetNode.getClass.getSimpleName}), skipping" ) - astForUnknown(node) + astForUnknown(node) :: Nil + } + } + + private def createMethodRefPointer(method: NewMethod): Ast = { + if (scope.isSurroundedByProgramScope) { + val methodRefNode = Ast( + NewMethodRef() + .code(s"def ${method.name} (...)") + .methodFullName(method.fullName) + .typeFullName(method.fullName) + .lineNumber(method.lineNumber) + .columnNumber(method.columnNumber) + ) + + val methodRefIdent = { + val self = NewIdentifier().name(Defines.Self).code(Defines.Self).typeFullName(Defines.Any) + val fi = NewFieldIdentifier() + .code(method.name) + .canonicalName(method.name) + .lineNumber(method.lineNumber) + .columnNumber(method.columnNumber) + val fieldAccess = NewCall() + .name(Operators.fieldAccess) + .code(s"${Defines.Self}.${method.name}") + .methodFullName(Operators.fieldAccess) + .dispatchType(DispatchTypes.STATIC_DISPATCH) + .typeFullName(Defines.Any) + callAst(fieldAccess, Seq(Ast(self), Ast(fi))) + } + astForAssignment(methodRefIdent, methodRefNode, method.lineNumber, method.columnNumber) + } else { + Ast() + } } private def astForParameters(parameters: List[RubyNode]): List[Ast] = { @@ -386,25 +461,31 @@ trait AstForFunctionsCreator(implicit withSchemaValidation: ValidationMode) { th x } .map(statementForOptionalParam) - )(TextSpan(None, None, None, None, "")) + )(TextSpan(None, None, None, None, None, "")) } - private def astForMethodBody(body: RubyNode, optionalStatementList: StatementList): Ast = { + private def astForMethodBody( + body: RubyNode, + optionalStatementList: StatementList, + returnLastExpression: Boolean = true + ): Ast = { if (this.parseLevel == AstParseLevel.SIGNATURES) { Ast() } else { body match case stmtList: StatementList => - astForStatementListReturningLastExpression( + val combinedStmtList = StatementList(optionalStatementList.statements ++ stmtList.statements)(stmtList.span) - ) + if returnLastExpression then astForStatementListReturningLastExpression(combinedStmtList) + else astForStatementList(combinedStmtList) case rescueExpr: RescueExpression => astForRescueExpression(rescueExpr) case _: (StaticLiteral | BinaryExpression | SingleAssignment | SimpleIdentifier | ArrayLiteral | HashLiteral | SimpleCall | MemberAccess | MemberCall) => - astForStatementListReturningLastExpression( + val combinedStmtList = StatementList(optionalStatementList.statements ++ List(body))(body.span) - ) + if returnLastExpression then astForStatementListReturningLastExpression(combinedStmtList) + else astForStatementList(combinedStmtList) case body => logger.warn( s"Non-linear method bodies are not supported yet: ${body.text} (${body.getClass.getSimpleName}) ($relativeFileName), skipping" diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForStatementsCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForStatementsCreator.scala index e88e0b6a806a..bc417285dba9 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForStatementsCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForStatementsCreator.scala @@ -19,16 +19,17 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t case node: ForExpression => astForForExpression(node) :: Nil case node: CaseExpression => astsForCaseExpression(node) case node: StatementList => astForStatementList(node) :: Nil - case node: SimpleCallWithBlock => astsForCallWithBlock(node) - case node: MemberCallWithBlock => astsForCallWithBlock(node) + case node: SimpleCallWithBlock => astForCallWithBlock(node) :: Nil + case node: MemberCallWithBlock => astForCallWithBlock(node) :: Nil case node: ReturnExpression => astForReturnStatement(node) :: Nil case node: AnonymousTypeDeclaration => astForAnonymousTypeDeclaration(node) :: Nil - case node: TypeDeclaration => astForClassDeclaration(node) :: Nil + case node: TypeDeclaration => astForClassDeclaration(node) case node: FieldsDeclaration => astsForFieldDeclarations(node) case node: MethodDeclaration => astForMethodDeclaration(node) - case node: SingletonMethodDeclaration => astForSingletonMethodDeclaration(node) :: Nil + case node: SingletonMethodDeclaration => astForSingletonMethodDeclaration(node) case node: MultipleAssignment => node.assignments.map(astForExpression) case node: BreakStatement => astForBreakStatement(node) :: Nil + case node: SingletonStatementList => astForSingletonStatementList(node) case _ => astForExpression(node) :: Nil private def astForWhileStatement(node: WhileExpression): Ast = { @@ -194,20 +195,20 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t * foo(, ) * ``` */ - protected def astsForCallWithBlock[C <: RubyCall](node: RubyNode & RubyCallWithBlock[C]): Seq[Ast] = { - val Seq(methodDecl, typeDecl, _, methodRef) = astForDoBlock(node.block): @unchecked - val methodRefDummyNode = methodRef.root.map(DummyNode(_)(node.span)).toList + protected def astForCallWithBlock[C <: RubyCall](node: RubyNode & RubyCallWithBlock[C]): Ast = { + val Seq(typeRef, _) = astForDoBlock(node.block): @unchecked + val typeRefDummyNode = typeRef.root.map(DummyNode(_)(node.span)).toList // Create call with argument referencing the MethodRef val callWithLambdaArg = node.withoutBlock match { - case x: SimpleCall => astForSimpleCall(x.copy(arguments = x.arguments ++ methodRefDummyNode)(x.span)) - case x: MemberCall => astForMemberCall(x.copy(arguments = x.arguments ++ methodRefDummyNode)(x.span)) + case x: SimpleCall => astForSimpleCall(x.copy(arguments = x.arguments ++ typeRefDummyNode)(x.span)) + case x: MemberCall => astForMemberCall(x.copy(arguments = x.arguments ++ typeRefDummyNode)(x.span)) case x => logger.warn(s"Unhandled call-with-block type ${code(x)}, creating anonymous method structures only") Ast() } - methodDecl :: typeDecl :: callWithLambdaArg :: Nil + callWithLambdaArg } protected def astForDoBlock(block: Block & RubyNode): Seq[Ast] = { @@ -221,12 +222,6 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t astForMethodDeclaration(block.toMethodDeclaration(methodName, Option(block.parameters)), isClosure = true) } - // Set span contents - methodAstsWithRefs.flatMap(_.nodes).foreach { - case m: NewMethodRef => DummyNode(m.copy)(block.span.spanStart(m.code)) - case _ => - } - methodAstsWithRefs } @@ -236,6 +231,15 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t returnAst(returnNode_, argumentAsts) } + protected def astForNextExpression(node: NextExpression): Ast = { + val nextNode = NewControlStructure() + .controlStructureType(ControlStructureTypes.CONTINUE) + .lineNumber(line(node)) + .columnNumber(column(node)) + .code(code(node)) + Ast(nextNode) + } + protected def astForStatementListReturningLastExpression(node: StatementList): Ast = { val block = blockNode(node) scope.pushNewScope(BlockScope(block)) @@ -280,8 +284,8 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t ) case node: MemberAccess => astForReturnMemberCall(node) :: Nil case ret: ReturnExpression => astForReturnStatement(ret) :: Nil - case node: MethodDeclaration => - (astForMethodDeclaration(node) :+ astForReturnMethodDeclarationSymbolName(node)).toList + case node: (MethodDeclaration | SingletonMethodDeclaration) => + (astsForStatement(node) :+ astForReturnMethodDeclarationSymbolName(node)).toList case _: BreakStatement => astsForStatement(node).toList case node => logger.warn( @@ -291,11 +295,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t } private def returnAstForRubyCall[C <: RubyCall](node: RubyNode & RubyCallWithBlock[C]): Seq[Ast] = { - val Seq(methodDecl, typeDecl, callAst) = astsForCallWithBlock(node): @unchecked - - Ast.storeInDiffGraph(methodDecl, diffGraph) - Ast.storeInDiffGraph(typeDecl, diffGraph) - + val callAst = astForCallWithBlock(node) returnAst(returnNode(node, code(node)), List(callAst)) :: Nil } @@ -305,7 +305,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t // The evaluation of a MethodDeclaration returns its name in symbol form. // E.g. `def f = 0` ===> `:f` - private def astForReturnMethodDeclarationSymbolName(node: MethodDeclaration): Ast = { + private def astForReturnMethodDeclarationSymbolName(node: RubyNode & ProcedureDeclaration): Ast = { val literalNode_ = literalNode(node, s":${node.methodName}", getBuiltInType(Defines.Symbol)) val returnNode_ = returnNode(node, literalNode_.code) returnAst(returnNode_, Seq(Ast(literalNode_))) @@ -328,6 +328,10 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t Ast(_node) } + protected def astForSingletonStatementList(list: SingletonStatementList): Seq[Ast] = { + list.statements.map(astForExpression) + } + /** Wraps the last RubyNode with a ReturnExpression. * @param x * the node to wrap a return around. If a StatementList is given, then the ReturnExpression will wrap around the @@ -410,6 +414,7 @@ trait AstForStatementsCreator(implicit withSchemaValidation: ValidationMode) { t whenClauses.map(transform), elseClause.map(transform).orElse(defaultElseBranch(node.span)) )(node.span) + case next: NextExpression => next } } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForTypesCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForTypesCreator.scala index b7469e9c50c8..7471ad98994b 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForTypesCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstForTypesCreator.scala @@ -3,94 +3,191 @@ package io.joern.rubysrc2cpg.astcreation import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.* import io.joern.rubysrc2cpg.datastructures.{BlockScope, MethodScope, ModuleScope, TypeScope} import io.joern.rubysrc2cpg.passes.Defines -import io.joern.x2cpg.{Ast, ValidationMode, Defines as XDefines} -import io.shiftleft.codepropertygraph.generated.nodes.{NewLocal, NewMethodParameterIn} -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EvaluationStrategies, Operators} +import io.joern.x2cpg.utils.NodeBuilders.newModifierNode +import io.joern.x2cpg.{Ast, ValidationMode} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.{ + DispatchTypes, + EvaluationStrategies, + ModifierTypes, + NodeTypes, + Operators +} import scala.collection.immutable.List +import scala.collection.mutable trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: AstCreator => - protected def astForClassDeclaration(node: RubyNode & TypeDeclaration): Ast = { + protected def astForClassDeclaration(node: RubyNode & TypeDeclaration): Seq[Ast] = { node.name match case name: SimpleIdentifier => astForSimpleNamedClassDeclaration(node, name) case name => logger.warn(s"Qualified class names are not supported yet: ${name.text} ($relativeFileName), skipping") - astForUnknown(node) + astForUnknown(node) :: Nil } - private def getBaseClassName(node: RubyNode): Option[String] = { + private def getBaseClassName(node: RubyNode): String = { node match case simpleIdentifier: SimpleIdentifier => - val name = simpleIdentifier.text - scope.lookupVariable(name) match { - case Some(_) => Option(name) // in the case of singleton classes, we want to keep the variable name - case None => scope.tryResolveTypeReference(name).map(_.name).orElse(Option(name)) - } + simpleIdentifier.text case _: SelfIdentifier => - scope.surroundingTypeFullName + Defines.Self case qualifiedBaseClass: MemberAccess => - scope - .tryResolveTypeReference(qualifiedBaseClass.toString) - .map(_.name) - .orElse(Option(qualifiedBaseClass.toString)) + qualifiedBaseClass.text.replace("::", ".") + case qualifiedBaseClass: MemberCall => + qualifiedBaseClass.text.replace("::", ".") case x => logger.warn( - s"Base class names of type ${x.getClass} are not supported yet: ${code(node)} ($relativeFileName), skipping" + s"Base class names of type ${x.getClass} are not supported yet: ${code(node)} ($relativeFileName), returning string as-is" ) - None + x.text } private def astForSimpleNamedClassDeclaration( node: RubyNode & TypeDeclaration, nameIdentifier: SimpleIdentifier - ): Ast = { + ): Seq[Ast] = { val className = nameIdentifier.text - val inheritsFrom = node.baseClass.flatMap(getBaseClassName).toList - val classFullName = computeClassFullName(className) + val inheritsFrom = node.baseClass.map(getBaseClassName).toList + val classFullName = computeFullName(className) val typeDecl = typeDeclNode( node = node, name = className, fullName = classFullName, filename = relativeFileName, code = code(node), - astParentType = scope.surroundingAstLabel.getOrElse(""), - astParentFullName = scope.surroundingScopeFullName.getOrElse(""), inherits = inheritsFrom, alias = None ) - - node match { - case _: ModuleDeclaration => scope.pushNewScope(ModuleScope(classFullName)) - case _: TypeDeclaration => scope.pushNewScope(TypeScope(classFullName, List.empty)) + scope.surroundingAstLabel.foreach(typeDecl.astParentType(_)) + scope.surroundingScopeFullName.foreach(typeDecl.astParentFullName(_)) + /* + In Ruby, there are semantic differences between the ordinary class and singleton class (think "meta" class in + Python). Similar to how Java allows both static and dynamic methods/fields/etc. within the same type declaration, + Ruby allows `self` methods and @@ fields to be defined alongside ordinary methods and @ fields. However, both + classes are more dynamic and have separate behaviours in Ruby and we model it as such. + + To signify the singleton type, we add the tag. + */ + val singletonTypeDecl = typeDecl.copy + .name(s"$className") + .fullName(s"$classFullName") + .inheritsFromTypeFullName(inheritsFrom.map(x => s"$x")) + + val (classModifiers, singletonModifiers) = node match { + case _: ModuleDeclaration => + scope.pushNewScope(ModuleScope(classFullName)) + ( + ModifierTypes.VIRTUAL :: Nil map newModifierNode map Ast.apply, + ModifierTypes.VIRTUAL :: ModifierTypes.FINAL :: Nil map newModifierNode map Ast.apply + ) + case _: TypeDeclaration => + scope.pushNewScope(TypeScope(classFullName, List.empty)) + ( + ModifierTypes.VIRTUAL :: Nil map newModifierNode map Ast.apply, + ModifierTypes.VIRTUAL :: Nil map newModifierNode map Ast.apply + ) } val classBody = node.body.asInstanceOf[StatementList] // for now (bodyStatement is a superset of stmtList) - val classBodyAsts = classBody.statements.flatMap(astsForStatement) match { + def handleDefaultConstructor(bodyAsts: Seq[Ast]): Seq[Ast] = bodyAsts match { case bodyAsts if scope.shouldGenerateDefaultConstructor && this.parseLevel == AstParseLevel.FULL_AST => - val bodyStart = classBody.span.spanStart() - val initBody = StatementList(List())(bodyStart) - val methodDecl = astForMethodDeclaration( - MethodDeclaration(XDefines.ConstructorMethodName, List(), initBody)(bodyStart) - ) + val bodyStart = classBody.span.spanStart() + val initBody = StatementList(List())(bodyStart) + val methodDecl = astForMethodDeclaration(MethodDeclaration(Defines.Initialize, List(), initBody)(bodyStart)) methodDecl ++ bodyAsts case bodyAsts => bodyAsts } - val fieldMemberNodes = node match { - case classDecl: ClassDeclaration => - classDecl.fields.map { x => - val name = code(x) - Ast(memberNode(x, name, name, Defines.Any)) - } - case _ => Seq.empty + val classBodyAsts = handleDefaultConstructor(classBody.statements.flatMap(astsForStatement)) + + val fields = node match { + case classDecl: ClassDeclaration => classDecl.fields + case moduleDecl: ModuleDeclaration => moduleDecl.fields + case _ => Seq.empty } + val (fieldTypeMemberNodes, fieldSingletonMemberNodes) = fields + .map { x => + val name = code(x) + x.isInstanceOf[InstanceFieldIdentifier] -> Ast(memberNode(x, name, name, Defines.Any)) + } + .partition(_._1) scope.popScope() - Ast(typeDecl).withChildren(fieldMemberNodes).withChildren(classBodyAsts) + if scope.surroundingAstLabel.contains(NodeTypes.TYPE_DECL) then { + val typeDeclMember = NewMember() + .name(className) + .code(className) + .dynamicTypeHintFullName(Seq(s"$classFullName")) + scope.surroundingScopeFullName.map(x => s"$x").foreach { tfn => + typeDeclMember.astParentFullName(tfn) + typeDeclMember.astParentType(NodeTypes.TYPE_DECL) + } + diffGraph.addNode(typeDeclMember) + } + + val prefixAst = createTypeRefPointer(typeDecl) + val typeDeclAst = Ast(typeDecl) + .withChildren(classModifiers) + .withChildren(fieldTypeMemberNodes.map(_._2)) + .withChildren(classBodyAsts) + val singletonTypeDeclAst = + Ast(singletonTypeDecl) + .withChildren(singletonModifiers) + .withChildren(fieldSingletonMemberNodes.map(_._2)) + val bodyMemberCallAst = + node.bodyMemberCall match { + case Some(bodyMemberCall) => astForTypeDeclBodyCall(bodyMemberCall, classFullName) + case None => Ast() + } + + (typeDeclAst :: singletonTypeDeclAst :: Nil).foreach(Ast.storeInDiffGraph(_, diffGraph)) + prefixAst :: bodyMemberCallAst :: Nil + } + + private def astForTypeDeclBodyCall(node: TypeDeclBodyCall, typeFullName: String): Ast = { + val callAst = astForMemberCall(node.toMemberCall, isStatic = true) + callAst.nodes.collectFirst { + case c: NewCall if c.name == Defines.TypeDeclBody => c.methodFullName(s"$typeFullName.${Defines.TypeDeclBody}") + } + callAst + } + + private def createTypeRefPointer(typeDecl: NewTypeDecl): Ast = { + if (scope.isSurroundedByProgramScope) { + // We aim to preserve whether it's a `class` or `module` in the `code` property + val typeRefCode = s"${typeDecl.code.strip().takeWhile(_ != ' ')} ${typeDecl.name} (...)" + val typeRefNode = Ast( + NewTypeRef() + .code(typeRefCode) + .typeFullName(s"${typeDecl.fullName}") // Everything will be dispatched on the singleton + .lineNumber(typeDecl.lineNumber) + .columnNumber(typeDecl.columnNumber) + ) + + val typeRefIdent = { + val self = NewIdentifier().name(Defines.Self).code(Defines.Self).typeFullName(Defines.Any) + val fi = NewFieldIdentifier() + .code(typeDecl.name) + .canonicalName(typeDecl.name) + .lineNumber(typeDecl.lineNumber) + .columnNumber(typeDecl.columnNumber) + val fieldAccess = NewCall() + .name(Operators.fieldAccess) + .code(s"${Defines.Self}.${typeDecl.name}") + .methodFullName(Operators.fieldAccess) + .dispatchType(DispatchTypes.STATIC_DISPATCH) + .typeFullName(Defines.Any) + callAst(fieldAccess, Seq(Ast(self), Ast(fi))) + } + astForAssignment(typeRefIdent, typeRefNode, typeDecl.lineNumber, typeDecl.columnNumber) + } else { + Ast() + } } protected def astsForFieldDeclarations(node: FieldsDeclaration): Seq[Ast] = { @@ -103,78 +200,43 @@ trait AstForTypesCreator(implicit withSchemaValidation: ValidationMode) { this: val fieldName = nameAsSymbol.innerText.prepended('@') val memberNode_ = memberNode(nameAsSymbol, fieldName, code(node), Defines.Any) val memberAst = Ast(memberNode_) - val getterAst = Option.when(node.hasGetter)(astForGetterMethod(node, fieldName)) - val setterAst = Option.when(node.hasSetter)(astForSetterMethod(node, fieldName)) - Seq(memberAst) ++ getterAst.toList ++ setterAst.toList + val getterAst = Option.when(node.hasGetter)(astForGetterMethod(node, fieldName)).getOrElse(Nil) + val setterAst = Option.when(node.hasSetter)(astForSetterMethod(node, fieldName)).getOrElse(Nil) + Seq(memberAst) ++ getterAst ++ setterAst case _ => logger.warn(s"Unsupported field declaration: ${nameNode.text}, skipping") Seq() } // creates a `def () { return }` METHOD, for = @. - private def astForGetterMethod(node: FieldsDeclaration, fieldName: String): Ast = { - val name = fieldName.drop(1) - val fullName = computeMethodFullName(name) - val method = methodNode( - node = node, - name = name, - fullName = fullName, - code = s"def $name (...)", - signature = None, - fileName = relativeFileName, - astParentType = scope.surroundingAstLabel, - astParentFullName = scope.surroundingScopeFullName - ) - scope.pushNewScope(MethodScope(fullName, procParamGen.fresh)) - val block_ = blockNode(node) - scope.pushNewScope(BlockScope(block_)) - // TODO: Should it be `return this.@abc`? - val returnAst_ = { - val returnNode_ = returnNode(node, s"return $fieldName") - val fieldNameIdentifier = identifierNode(node, fieldName, fieldName, Defines.Any) - returnAst(returnNode_, Seq(Ast(fieldNameIdentifier))) - } - - val methodBody = blockAst(block_, List(returnAst_)) - scope.popScope() - scope.popScope() - methodAst(method, Seq(), methodBody, methodReturnNode(node, Defines.Any)) + private def astForGetterMethod(node: FieldsDeclaration, fieldName: String): Seq[Ast] = { + val name = fieldName.drop(1) + val code = s"def $name (...)" + val methodDecl = MethodDeclaration( + name, + Nil, + StatementList(InstanceFieldIdentifier()(node.span.spanStart(fieldName)) :: Nil)( + node.span.spanStart(s"return $fieldName") + ) + )(node.span.spanStart(code)) + astForMethodDeclaration(methodDecl) } // creates a `def =(x) { = x }` METHOD, for = @ - private def astForSetterMethod(node: FieldsDeclaration, fieldName: String): Ast = { - val name = fieldName.drop(1) + "=" - val fullName = computeMethodFullName(name) - val method = methodNode( - node = node, - name = name, - fullName = fullName, - code = s"def $name (...)", - signature = None, - fileName = relativeFileName, - astParentType = scope.surroundingAstLabel, - astParentFullName = scope.surroundingScopeFullName - ) - scope.pushNewScope(MethodScope(fullName, procParamGen.fresh)) - val parameter = parameterInNode(node, "x", "x", 1, false, EvaluationStrategies.BY_REFERENCE) - val methodBody = { - val block_ = blockNode(node) - scope.pushNewScope(BlockScope(block_)) - val lhs = identifierNode(node, fieldName, fieldName, Defines.Any) - val rhs = identifierNode(node, parameter.name, parameter.name, Defines.Any) - val assignmentCall = callNode( - node, - s"${lhs.code} = ${rhs.code}", - Operators.assignment, - Operators.assignment, - DispatchTypes.STATIC_DISPATCH - ) - val assignmentAst = callAst(assignmentCall, Seq(Ast(lhs), Ast(rhs))) - scope.popScope() - blockAst(blockNode(node), List(assignmentAst)) - } - scope.popScope() - methodAst(method, Seq(Ast(parameter)), methodBody, methodReturnNode(node, Defines.Any)) + private def astForSetterMethod(node: FieldsDeclaration, fieldName: String): Seq[Ast] = { + val name = fieldName.drop(1) + "=" + val code = s"def $name (...)" + val assignment = SingleAssignment( + InstanceFieldIdentifier()(node.span.spanStart(fieldName)), + "=", + SimpleIdentifier()(node.span.spanStart("x")) + )(node.span.spanStart(s"$fieldName = x")) + val methodDecl = MethodDeclaration( + name, + MandatoryParameter("x")(node.span.spanStart("x")) :: Nil, + StatementList(assignment :: Nil)(node.span.spanStart(s"return $fieldName")) + )(node.span.spanStart(code)) + astForMethodDeclaration(methodDecl) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstSummaryVisitor.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstSummaryVisitor.scala index 21a447ab848a..f6190ef042fe 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstSummaryVisitor.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/AstSummaryVisitor.scala @@ -1,50 +1,62 @@ package io.joern.rubysrc2cpg.astcreation +import flatgraph.DiffGraphApplier import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.StatementList import io.joern.rubysrc2cpg.datastructures.{RubyField, RubyMethod, RubyProgramSummary, RubyStubbedType, RubyType} import io.joern.rubysrc2cpg.parser.RubyNodeCreator import io.joern.rubysrc2cpg.passes.Defines -import io.joern.x2cpg.passes.base.AstLinkerPass +import io.joern.x2cpg.layers.Base +import io.joern.x2cpg.passes.base.{AstLinkerPass, FileCreationPass} import io.joern.x2cpg.{Ast, ValidationMode} +import io.shiftleft.codepropertygraph.cpgloading.CpgLoader import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Local, Member, Method, TypeDecl} import io.shiftleft.semanticcpg.language.* -import overflowdb.{BatchedUpdate, Config} import java.io.File as JavaFile import java.util.regex.Matcher +import scala.collection.mutable import scala.util.Using trait AstSummaryVisitor(implicit withSchemaValidation: ValidationMode) { this: AstCreator => def summarize(asExternal: Boolean = false): RubyProgramSummary = { this.parseLevel = AstParseLevel.SIGNATURES - Using.resource(Cpg.withConfig(Config.withoutOverflow())) { cpg => + Using.resource(Cpg.empty) { cpg => // Build and store compilation unit AST val rootNode = new RubyNodeCreator().visit(programCtx).asInstanceOf[StatementList] val ast = astForRubyFile(rootNode) Ast.storeInDiffGraph(ast, diffGraph) - BatchedUpdate.applyDiff(cpg.graph, diffGraph) + DiffGraphApplier.applyDiff(cpg.graph, diffGraph) // Link basic AST elements AstLinkerPass(cpg).createAndApply() - // Summarize findings summarize(cpg, asExternal) } } def withSummary(newSummary: RubyProgramSummary): AstCreator = { - AstCreator(fileName, programCtx, projectRoot, newSummary) + AstCreator(fileName, programCtx, projectRoot, newSummary, enableFileContents, fileContent) } private def summarize(cpg: Cpg, asExternal: Boolean): RubyProgramSummary = { + val gemName = + if relativeFileName.nonEmpty && relativeFileName.contains(JavaFile.separator) then + relativeFileName.substring(0, relativeFileName.indexOf(JavaFile.separator)) + else Option(relativeFileName).getOrElse("") + def toMethod(m: Method): RubyMethod = { + val definingTypeDeclFullName = + if asExternal then + Option(m.definingTypeDecl.map(buildFullName)).getOrElse(m.definingTypeDecl.fullName.headOption) + else m.definingTypeDecl.fullName.headOption + RubyMethod( m.name, m.parameter.map(x => x.name -> x.typeFullName).l, m.methodReturn.typeFullName, - m.definingTypeDecl.fullName.headOption + definingTypeDeclFullName ) } @@ -57,10 +69,20 @@ trait AstSummaryVisitor(implicit withSchemaValidation: ValidationMode) { this: A } def toType(m: TypeDecl): RubyType = { - if asExternal then RubyStubbedType(m.fullName, m.method.map(toMethod).l, m.member.map(toField).l) + if asExternal then RubyStubbedType(buildFullName(m), m.method.map(toMethod).l, m.member.map(toField).l) else RubyType(m.fullName, m.method.map(toMethod).l, m.member.map(toField).l) } + def buildFullName(m: TypeDecl): String = if asExternal then + m.start + .repeat(_.astParent)(_.until(_.isMethod.isModule)) + .cast[Method] + .fullName + .map(mfn => s"$gemName${m.fullName.stripPrefix(mfn)}") + .headOption + .getOrElse(m.fullName) + else m.fullName + def handleNestedTypes(t: TypeDecl, parentScope: String): Seq[(String, Set[RubyType])] = { val typeFullName = s"$parentScope.${t.name}" val childrenTypes = t.astChildren.collectAll[TypeDecl].l @@ -74,29 +96,40 @@ trait AstSummaryVisitor(implicit withSchemaValidation: ValidationMode) { this: A .replaceAll(Matcher.quoteReplacement(JavaFile.separator), "/") // handle Windows paths .stripSuffix(".rb") // Map module functions/variables - val moduleEntry = (path, namespace.fullName) -> namespace.method.map { module => + val namespaceFullName = + if asExternal then gemName + else namespace.fullName + + val moduleEntry = (path, namespaceFullName) -> namespace.method.map { module => + val moduleFullName = + if asExternal then gemName + else module.fullName + val moduleTypeMap = RubyType( - module.fullName, - module.block.astChildren.collectAll[Method].map(toMethod).l, + moduleFullName, + module.astChildren.collectAll[Method].map(toMethod).l, module.local.map(toModuleVariable).l ) moduleTypeMap }.toSet // Map module types val typeEntries = namespace.method.collectFirst { - case m: Method if m.name == Defines.Program => - val childrenTypes = m.block.astChildren.collectAll[TypeDecl].l - val fullName = s"${namespace.fullName}:${m.name}" - val nestedTypes = childrenTypes.flatMap(handleNestedTypes(_, fullName)) + case m: Method if m.name == Defines.Main => + val childrenTypes = m.astChildren.collectAll[TypeDecl].l + val fullName = + if childrenTypes.nonEmpty && asExternal then buildFullName(childrenTypes.head) else s"${m.fullName}" + val nestedTypes = childrenTypes.flatMap(handleNestedTypes(_, fullName)) (path, fullName) -> (childrenTypes.whereNot(_.methodBinding).map(toType).toSet ++ nestedTypes.flatMap(_._2)) }.toSeq moduleEntry +: typeEntries }.toList - val namespaceMappings = mappings.map { case (_, ns) -> entry => ns -> entry }.toMap - val pathMappings = mappings.map { case (path, _) -> entry => path -> entry }.toMap + val namespaceMappings: mutable.Map[String, mutable.Set[RubyType]] = + mutable.Map.from(mappings.map { case (_, ns) -> entry => ns -> mutable.Set.from(entry) }) + val pathMappings: mutable.Map[String, mutable.Set[RubyType]] = + mutable.Map.from(mappings.map { case (path, _) -> entry => path -> mutable.Set.from(entry) }) RubyProgramSummary(namespaceMappings, pathMappings) } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/RubyIntermediateAst.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/RubyIntermediateAst.scala index 0dc17603bcdc..700803afbe57 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/RubyIntermediateAst.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/astcreation/RubyIntermediateAst.scala @@ -1,6 +1,6 @@ package io.joern.rubysrc2cpg.astcreation -import io.joern.rubysrc2cpg.passes.Defines +import io.joern.rubysrc2cpg.passes.{Defines, GlobalTypes} import io.shiftleft.codepropertygraph.generated.nodes.NewNode import scala.annotation.tailrec @@ -8,23 +8,26 @@ import scala.annotation.tailrec object RubyIntermediateAst { case class TextSpan( - line: Option[Integer], - column: Option[Integer], - lineEnd: Option[Integer], - columnEnd: Option[Integer], + line: Option[Int], + column: Option[Int], + lineEnd: Option[Int], + columnEnd: Option[Int], + offset: Option[(Int, Int)], text: String ) { - def spanStart(newText: String = ""): TextSpan = TextSpan(line, column, line, column, newText) + def spanStart(newText: String = ""): TextSpan = TextSpan(line, column, line, column, offset, newText) } sealed class RubyNode(val span: TextSpan) { - def line: Option[Integer] = span.line + def line: Option[Int] = span.line - def column: Option[Integer] = span.column + def column: Option[Int] = span.column - def lineEnd: Option[Integer] = span.lineEnd + def lineEnd: Option[Int] = span.lineEnd - def columnEnd: Option[Integer] = span.columnEnd + def columnEnd: Option[Int] = span.columnEnd + + def offset: Option[(Int, Int)] = span.offset def text: String = span.text } @@ -46,15 +49,29 @@ object RubyIntermediateAst { def size: Int = statements.size } + final case class SingletonStatementList(statements: List[RubyNode])(span: TextSpan) extends RubyNode(span) { + override def text: String = statements.size match + case 0 | 1 => span.text + case _ => "(...)" + + def size: Int = statements.size + } + sealed trait AllowedTypeDeclarationChild sealed trait TypeDeclaration extends AllowedTypeDeclarationChild { def name: RubyNode def baseClass: Option[RubyNode] def body: RubyNode + def bodyMemberCall: Option[TypeDeclBodyCall] } - final case class ModuleDeclaration(name: RubyNode, body: RubyNode)(span: TextSpan) + final case class ModuleDeclaration( + name: RubyNode, + body: RubyNode, + fields: List[RubyNode & RubyFieldIdentifier], + bodyMemberCall: Option[TypeDeclBodyCall] + )(span: TextSpan) extends RubyNode(span) with TypeDeclaration { def baseClass: Option[RubyNode] = None @@ -64,21 +81,30 @@ object RubyIntermediateAst { name: RubyNode, baseClass: Option[RubyNode], body: RubyNode, - fields: List[RubyNode & RubyFieldIdentifier] + fields: List[RubyNode & RubyFieldIdentifier], + bodyMemberCall: Option[TypeDeclBodyCall] )(span: TextSpan) extends RubyNode(span) with TypeDeclaration sealed trait AnonymousTypeDeclaration extends RubyNode with TypeDeclaration - final case class AnonymousClassDeclaration(name: RubyNode, baseClass: Option[RubyNode], body: RubyNode)( - span: TextSpan - ) extends RubyNode(span) + final case class AnonymousClassDeclaration( + name: RubyNode, + baseClass: Option[RubyNode], + body: RubyNode, + bodyMemberCall: Option[TypeDeclBodyCall] = None + )(span: TextSpan) + extends RubyNode(span) with AnonymousTypeDeclaration - final case class SingletonClassDeclaration(name: RubyNode, baseClass: Option[RubyNode], body: RubyNode)( - span: TextSpan - ) extends RubyNode(span) + final case class SingletonClassDeclaration( + name: RubyNode, + baseClass: Option[RubyNode], + body: RubyNode, + bodyMemberCall: Option[TypeDeclBodyCall] = None + )(span: TextSpan) + extends RubyNode(span) with AnonymousTypeDeclaration final case class FieldsDeclaration(fieldNames: List[RubyNode])(span: TextSpan) @@ -89,8 +115,15 @@ object RubyIntermediateAst { def hasSetter: Boolean = text.startsWith("attr_writer") || text.startsWith("attr_accessor") } + sealed trait ProcedureDeclaration { + def methodName: String + def parameters: List[RubyNode] + def body: RubyNode + } + final case class MethodDeclaration(methodName: String, parameters: List[RubyNode], body: RubyNode)(span: TextSpan) extends RubyNode(span) + with ProcedureDeclaration with AllowedTypeDeclarationChild final case class SingletonMethodDeclaration( @@ -100,8 +133,18 @@ object RubyIntermediateAst { body: RubyNode )(span: TextSpan) extends RubyNode(span) + with ProcedureDeclaration with AllowedTypeDeclarationChild + final case class SingletonObjectMethodDeclaration( + methodName: String, + parameters: List[RubyNode], + body: RubyNode, + baseClass: RubyNode + )(span: TextSpan) + extends RubyNode(span) + with ProcedureDeclaration + sealed trait MethodParameter { def name: String } @@ -219,6 +262,8 @@ object RubyIntermediateAst { extends RubyNode(span) with ControlFlowClause + final case class NextExpression()(span: TextSpan) extends RubyNode(span) with ControlFlowExpression + final case class ReturnExpression(expressions: List[RubyNode])(span: TextSpan) extends RubyNode(span) /** Represents an unqualified identifier e.g. `X`, `x`, `@@x`, `$x`, `$<`, etc. */ @@ -229,6 +274,13 @@ object RubyIntermediateAst { override def toString: String = s"SimpleIdentifier(${span.text}, $typeFullName)" } + /** Represents a type reference successfully determined, e.g. module A; end; A + */ + final case class TypeIdentifier(typeFullName: String)(span: TextSpan) extends RubyNode(span) with RubyIdentifier { + def isBuiltin: Boolean = typeFullName.startsWith(GlobalTypes.builtinPrefix) + override def toString: String = s"TypeIdentifier(${span.text}, $typeFullName)" + } + /** Represents a InstanceFieldIdentifier e.g `@x` */ final case class InstanceFieldIdentifier()(span: TextSpan) extends RubyNode(span) with RubyFieldIdentifier @@ -346,6 +398,19 @@ object RubyIntermediateAst { ) extends RubyNode(span) with RubyCall + /** Special class for `` calls of type decls. + */ + final case class TypeDeclBodyCall(target: RubyNode, typeName: String)(span: TextSpan) + extends RubyNode(span) + with RubyCall { + + def toMemberCall: MemberCall = MemberCall(target, op, Defines.TypeDeclBody, arguments)(span) + + def arguments: List[RubyNode] = Nil + + def op: String = "::" + } + final case class MemberCallWithBlock( target: RubyNode, op: String, @@ -361,7 +426,6 @@ object RubyIntermediateAst { /** Represents index accesses, e.g. `x[0]`, `self.x.y[1, 2]` */ final case class IndexAccess(target: RubyNode, indices: List[RubyNode])(span: TextSpan) extends RubyNode(span) - // TODO: Might be replaced by MemberCall simply? final case class MemberAccess(target: RubyNode, op: String, memberName: String)(span: TextSpan) extends RubyNode(span) { override def toString: String = s"${target.text}.$memberName" @@ -390,7 +454,6 @@ object RubyIntermediateAst { case Some(givenParameters) => MethodDeclaration(name, givenParameters, body)(span) case None => MethodDeclaration(name, this.parameters, body)(span) } - } /** A dummy class for wrapping around `NewNode` and allowing it to integrate with RubyNode classes. diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyProgramSummary.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyProgramSummary.scala index 54ad6f6777a3..355eb8352b94 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyProgramSummary.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyProgramSummary.scala @@ -5,33 +5,31 @@ import io.joern.x2cpg.Defines as XDefines import io.joern.x2cpg.datastructures.{FieldLike, MethodLike, ProgramSummary, StubbedType, TypeLike} import io.joern.x2cpg.typestub.{TypeStubMetaData, TypeStubUtil} import org.slf4j.LoggerFactory +import io.joern.rubysrc2cpg.passes.Defines +import upickle.default.* import java.io.{ByteArrayInputStream, InputStream} -import scala.annotation.targetName -import scala.io.Source -import java.net.JarURLConnection import java.util.zip.ZipInputStream -import scala.util.{Failure, Success, Try, Using} -import scala.jdk.CollectionConverters.* -import upickle.default.* - +import scala.annotation.targetName +import scala.collection.mutable import scala.collection.mutable.ListBuffer +import scala.util.{Failure, Success, Try} -type NamespaceToTypeMap = Map[String, Set[RubyType]] +type NamespaceToTypeMap = mutable.Map[String, mutable.Set[RubyType]] class RubyProgramSummary( - initialNamespaceMap: NamespaceToTypeMap = Map.empty, - initialPathMap: NamespaceToTypeMap = Map.empty -) extends ProgramSummary[RubyType] { + initialNamespaceMap: NamespaceToTypeMap = mutable.Map.empty, + initialPathMap: NamespaceToTypeMap = mutable.Map.empty +) extends ProgramSummary[RubyType, RubyMethod, RubyField] { - override val namespaceToType: Map[String, Set[RubyType]] = initialNamespaceMap - val pathToType: Map[String, Set[RubyType]] = initialPathMap + override val namespaceToType: NamespaceToTypeMap = initialNamespaceMap + val pathToType: NamespaceToTypeMap = initialPathMap - @targetName("add") - def ++(other: RubyProgramSummary): RubyProgramSummary = { + @targetName("appendAll") + def ++=(other: RubyProgramSummary): RubyProgramSummary = { RubyProgramSummary( - ProgramSummary.combine(this.namespaceToType, other.namespaceToType), - ProgramSummary.combine(this.pathToType, other.pathToType) + ProgramSummary.merge(this.namespaceToType, other.namespaceToType), + ProgramSummary.merge(this.pathToType, other.pathToType) ) } } @@ -40,13 +38,17 @@ object RubyProgramSummary { private val logger = LoggerFactory.getLogger(getClass) def BuiltinTypes(implicit typeStubMetaData: TypeStubMetaData): NamespaceToTypeMap = { - if (typeStubMetaData.useTypeStubs) { + val typeStubDir = File(typeStubMetaData.packagePath) + if (!typeStubDir.exists || !typeStubDir.isDirectory) { + logger.warn("No builtin type stubs provided, continuing with types provided by the project") + mutable.Map.empty + } else if (typeStubMetaData.useTypeStubs) { mpkZipToInitialMapping(mergeBuiltinMpkZip) match { - case Failure(exception) => logger.warn("Unable to parse builtin types", exception); Map.empty + case Failure(exception) => logger.warn("Unable to parse builtin types", exception); mutable.Map.empty case Success(mapping) => mapping } } else { - Map.empty + mutable.Map.empty } } @@ -164,7 +166,7 @@ case class RubyType(name: String, methods: List[RubyMethod], fields: List[RubyFi } def hasConstructor: Boolean = { - methods.exists(_.name == XDefines.ConstructorMethodName) + methods.exists(_.name == Defines.Initialize) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyScope.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyScope.scala index 2da31a03f321..bc59ee105b11 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyScope.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/RubyScope.scala @@ -1,14 +1,16 @@ package io.joern.rubysrc2cpg.datastructures import better.files.File -import io.joern.rubysrc2cpg.astcreation.GlobalTypes -import io.joern.rubysrc2cpg.astcreation.GlobalTypes.builtinPrefix +import io.joern.rubysrc2cpg.passes.GlobalTypes +import io.joern.rubysrc2cpg.passes.GlobalTypes.builtinPrefix import io.joern.x2cpg.Defines import io.joern.rubysrc2cpg.passes.Defines as RDefines -import io.joern.x2cpg.datastructures.* +import io.joern.x2cpg.datastructures.{TypedScopeElement, *} import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.{DeclarationNew, NewLocal, NewMethodParameterIn} +import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal +import java.io.File as JFile import scala.collection.mutable import scala.reflect.ClassTag import scala.util.Try @@ -17,12 +19,12 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) extends Scope[String, DeclarationNew, TypedScopeElement] with TypedScope[RubyMethod, RubyField, RubyType](summary) { - private val builtinMethods = GlobalTypes.builtinFunctions - .map(m => RubyMethod(m, List.empty, Defines.Any, Some(GlobalTypes.builtinPrefix))) + private val builtinMethods = GlobalTypes.kernelFunctions + .map(m => RubyMethod(m, List.empty, Defines.Any, Some(GlobalTypes.kernelPrefix))) .toList override val typesInScope: mutable.Set[RubyType] = - mutable.Set(RubyType(GlobalTypes.builtinPrefix, builtinMethods, List.empty)) + mutable.Set(RubyType(GlobalTypes.kernelPrefix, builtinMethods, List.empty)) // Add some built-in methods that are significant // TODO: Perhaps create an offline pre-built list of methods @@ -46,7 +48,24 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) /** @return * using the stack, will initialize a new module scope object. */ - def newProgramScope: Option[ProgramScope] = surroundingScopeFullName.map(ProgramScope.apply) + def newProgramScope: Option[ProgramScope] = + surroundingScopeFullName.map(_.stripSuffix(NamespaceTraversal.globalNamespaceName)).map(ProgramScope.apply) + + /** @return + * true if the top of the stack is the program/module. + */ + def isSurroundedByProgramScope: Boolean = { + stack + .take(2) + .filterNot { + case ScopeElement(BlockScope(_), _) => true + case _ => false + } + .headOption match { + case Some(ScopeElement(ProgramScope(_), _)) => true + case _ => false + } + } def pushField(field: FieldDecl): Unit = { popScope().foreach { @@ -83,6 +102,30 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) super.pushNewScope(mappedScopeNode) } + /** Variables entering children scope persist into parent scopes, so the variables should be transferred to the + * top-level method, returning the next block so that locals can be attached. + */ + override def addToScope(identifier: String, variable: DeclarationNew): TypedScopeElement = { + variable match { + case _: NewMethodParameterIn => super.addToScope(identifier, variable) + case _ => + stack.collectFirst { + case x @ ScopeElement(_: MethodLikeScope, _) => x + case x @ ScopeElement(_: ProgramScope, _) => x + } match { + case Some(target) => + val newTarget = target.addVariable(identifier, variable) + + val targetIdx = stack.indexOf(target) + val prefix = stack.take(targetIdx) + val suffix = stack.takeRight(stack.size - targetIdx - 1) + stack = prefix ++ List(newTarget) ++ suffix + prefix.lastOption.map(_.scopeNode).getOrElse(newTarget.scopeNode) + case None => super.addToScope(identifier, variable) + } + } + } + def addRequire( projectRoot: String, currentFilePath: String, @@ -96,7 +139,7 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) val resolvedPath = if (isRelative) { Try((File(currentFilePath).parent / path).pathAsString).toOption - .map(_.stripPrefix(s"$projectRoot/")) + .map(_.stripPrefix(s"$projectRoot${JFile.separator}")) .getOrElse(path) } else { path @@ -107,7 +150,9 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) val dir = File(projectRoot) / resolvedPath if (dir.isDirectory) dir.list - .map(_.pathAsString.stripPrefix(s"$projectRoot/").stripSuffix(".rb")) + .map( + _.pathAsString.stripPrefix(s"$projectRoot${JFile.separator}").stripSuffix(".rb").replaceAll("\\\\", "/") + ) .toList else Nil } else { @@ -127,9 +172,10 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) } def addImportedFunctions(importName: String): Unit = { - val matchingTypes = summary.namespaceToType.values.flatten.filter(x => - x.name.startsWith(importName) && x.name.endsWith(RDefines.Program) - ) + val matchingTypes = summary.namespaceToType.values.flatten.filter { x => + x.name.startsWith(importName) + } + typesInScope.addAll(matchingTypes) } @@ -180,21 +226,43 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) (ScopeElement(MethodScope(fullName, param, true), variables), param.fold(x => x, x => x)) } - /** Get the name of the implicit or explict proc param */ + /** Get the name of the implicit or explicit proc param */ def anonProcParam: Option[String] = stack.collectFirst { case ScopeElement(MethodScope(_, Left(param), true), _) => param } - /** Set the name of explict proc param */ - def setProcParam(param: String): Unit = updateSurrounding { + /** Set the name of explicit proc param */ + def setProcParam(param: String, paramNode: NewMethodParameterIn): Unit = updateSurrounding { case ScopeElement(MethodScope(fullName, _, _), variables) => - (ScopeElement(MethodScope(fullName, Right(param)), variables), ()) + (ScopeElement(MethodScope(fullName, Right(param), true), variables ++ Map(paramNode.name -> paramNode)), ()) + } + + /** If a proc param is used, provides the node to add to the AST. + */ + def procParamName: Option[NewMethodParameterIn] = { + stack + .collectFirst { + case ScopeElement(MethodScope(_, Left(param), true), _) => param + case ScopeElement(MethodScope(_, Right(param), true), _) => param + } + .flatMap(lookupVariable(_).collect { case p: NewMethodParameterIn => p }) } def surroundingTypeFullName: Option[String] = stack.collectFirst { case ScopeElement(x: TypeLikeScope, _) => x.fullName } + /** Searches the surrounding classes for a class that matches the given value. Returns it if found. + */ + def getSurroundingType(value: String): Option[TypeLikeScope] = { + stack + .collect { case ScopeElement(x: TypeLikeScope, _) => x } + .collectFirst { + case x: TypeLikeScope if x.fullName.split('.').toSeq.endsWith(value.split('.')) => + x + } + } + /** @return * the corresponding node label according to the scope element. */ @@ -274,21 +342,33 @@ class RubyScope(summary: RubyProgramSummary, projectRoot: Option[String]) .orElse(tryResolveStubbedTypeReference(typeName)) .orElse { super.tryResolveTypeReference(normalizedTypeName) match { - case None if GlobalTypes.builtinFunctions.contains(normalizedTypeName) => - // TODO: Create a builtin.json for the program summary to load + case None if GlobalTypes.kernelFunctions.contains(normalizedTypeName) => + Option(RubyType(s"${GlobalTypes.kernelPrefix}.$normalizedTypeName", List.empty, List.empty)) + case None if GlobalTypes.bundledClasses.contains(normalizedTypeName) => Option(RubyType(s"${GlobalTypes.builtinPrefix}.$normalizedTypeName", List.empty, List.empty)) case None => - summary.namespaceToType.flatMap(_._2).collectFirst { - case x if x.name.split("[.]").endsWith(normalizedTypeName.split("[.]")) => - typesInScope.addOne(x) - x - case x if x.name.split("[.]").lastOption.contains(normalizedTypeName) => - typesInScope.addOne(x) - x - } + None case x => x } } } + /** @param identifier + * the name of the variable. + * @return + * the full name of the variable's scope, if available. + */ + def variableScopeFullName(identifier: String): Option[String] = { + stack + .collectFirst { + case scopeElement if scopeElement.variables.contains(identifier) => + scopeElement + } + .map { + case ScopeElement(x: NamespaceLikeScope, _) => x.fullName + case ScopeElement(x: TypeLikeScope, _) => x.fullName + case ScopeElement(x: MethodLikeScope, _) => x.fullName + } + } + } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/ScopeElement.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/ScopeElement.scala index f7661770e69c..3d2e94d7f610 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/ScopeElement.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/datastructures/ScopeElement.scala @@ -35,7 +35,7 @@ trait TypeLikeScope extends TypedScopeElement { * the relative file name. */ case class ProgramScope(fileName: String) extends TypeLikeScope { - override def fullName: String = s"$fileName:${Defines.Program}" + override def fullName: String = s"$fileName${Defines.Main}" } /** A Ruby module/abstract class. diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreator.scala index 347319eca95f..f987a89f3ae9 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreator.scala @@ -14,7 +14,6 @@ import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* import org.antlr.v4.runtime.ParserRuleContext import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate import java.io.File as JFile import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger} @@ -74,7 +73,7 @@ class AstCreator( // Hashmap to store used variable names, to avoid duplicates in case of un-named variables protected val usedVariableNames = mutable.HashMap.empty[String, Int] - override def createAst(): BatchedUpdate.DiffGraphBuilder = createAstForProgramCtx(programCtx) + override def createAst(): DiffGraphBuilder = createAstForProgramCtx(programCtx) private def createAstForProgramCtx(programCtx: DeprecatedRubyParser.ProgramContext) = { val name = ":program" diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreatorHelper.scala index cfb70dfbdd65..d8ad2c3c609f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstCreatorHelper.scala @@ -2,7 +2,6 @@ package io.joern.rubysrc2cpg.deprecated.astcreation import io.joern.rubysrc2cpg.deprecated.parser.DeprecatedRubyParser.* import io.joern.rubysrc2cpg.deprecated.passes.Defines as RubyDefines -import io.joern.rubysrc2cpg.deprecated.utils.MethodTableModel import io.joern.x2cpg.{Ast, ValidationMode} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, nodes} @@ -17,15 +16,17 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As import io.joern.rubysrc2cpg.deprecated.astcreation.GlobalTypes.* - protected def line(ctx: ParserRuleContext): Option[Integer] = Try[Integer](ctx.getStart.getLine).toOption + protected def line(ctx: ParserRuleContext): Option[Int] = + Try(ctx.getStart.getLine).toOption - protected def column(ctx: ParserRuleContext): Option[Integer] = - Try[Integer](ctx.getStart.getCharPositionInLine).toOption + protected def column(ctx: ParserRuleContext): Option[Int] = + Try(ctx.getStart.getCharPositionInLine).toOption - protected def lineEnd(ctx: ParserRuleContext): Option[Integer] = Try[Integer](ctx.getStop.getLine).toOption + protected def lineEnd(ctx: ParserRuleContext): Option[Int] = + Try(ctx.getStop.getLine).toOption - protected def columnEnd(ctx: ParserRuleContext): Option[Integer] = - Try[Integer](ctx.getStop.getCharPositionInLine).toOption + protected def columnEnd(ctx: ParserRuleContext): Option[Int] = + Try(ctx.getStop.getCharPositionInLine).toOption override def code(node: ParserRuleContext): String = shortenCode(text(node)) @@ -91,8 +92,8 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As code: String, typeFullName: String, dynamicTypeHints: Seq[String], - lineNumber: Option[Integer], - columnNumber: Option[Integer], + lineNumber: Option[Int], + columnNumber: Option[Int], definitelyIdentifier: Boolean ): NewNode = { methodsWithName(name) match @@ -145,8 +146,8 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As protected def astForAssignment( lhs: NewNode, rhs: NewNode, - lineNumber: Option[Integer] = None, - colNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + colNumber: Option[Int] = None ): Ast = { val code = Seq(lhs, rhs).collect { case x: AstNodeNew => x.code }.mkString(" = ") val assignment = NewCall() @@ -187,8 +188,8 @@ trait AstCreatorHelper(implicit withSchemaValidation: ValidationMode) { this: As protected def createMethodParameterIn( name: String, - lineNumber: Option[Integer] = None, - colNumber: Option[Integer] = None, + lineNumber: Option[Int] = None, + colNumber: Option[Int] = None, typeFullName: String = RubyDefines.Any, order: Int = -1, index: Int = -1 diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstForControlStructuresCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstForControlStructuresCreator.scala index a118e72dbaeb..89424fad8c9b 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstForControlStructuresCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/AstForControlStructuresCreator.scala @@ -129,7 +129,7 @@ trait AstForControlStructuresCreator(implicit withSchemaValidation: ValidationMo .toSeq val tryNode = controlStructureNode(ctx, ControlStructureTypes.TRY, "try") - tryCatchAst(tryNode, tryBodyAst, catchAsts, finallyAst) + tryCatchAstWithOrder(tryNode, tryBodyAst, catchAsts, finallyAst) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/RubyScope.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/RubyScope.scala index 773c656bb44b..1788679262a1 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/RubyScope.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/astcreation/RubyScope.scala @@ -1,9 +1,8 @@ package io.joern.rubysrc2cpg.deprecated.astcreation import io.joern.x2cpg.datastructures.Scope -import io.shiftleft.codepropertygraph.generated.EdgeTypes +import io.shiftleft.codepropertygraph.generated.{DiffGraphBuilder, EdgeTypes} import io.shiftleft.codepropertygraph.generated.nodes.{DeclarationNew, NewIdentifier, NewLocal, NewNode} -import overflowdb.BatchedUpdate import scala.collection.mutable @@ -39,18 +38,16 @@ class RubyScope extends Scope[String, NewIdentifier, NewNode] { * @param paramNames * the names of parameters. */ - def createAndLinkLocalNodes( - diffGraph: BatchedUpdate.DiffGraphBuilder, - paramNames: Set[String] = Set.empty - ): List[DeclarationNew] = stack.headOption match - case Some(top) => scopeToVarMap.buildVariableGroupings(top.scopeNode, paramNames ++ Set("this"), diffGraph) - case None => List.empty[DeclarationNew] - - /** @param identifier - * the identifier to count - * @return - * the number of times the given identifier occurs in the immediate scope. - */ + def createAndLinkLocalNodes(diffGraph: DiffGraphBuilder, paramNames: Set[String] = Set.empty): List[DeclarationNew] = + stack.headOption match + case Some(top) => scopeToVarMap.buildVariableGroupings(top.scopeNode, paramNames ++ Set("this"), diffGraph) + case None => List.empty[DeclarationNew] + + /** @param identifier + * the identifier to count + * @return + * the number of times the given identifier occurs in the immediate scope. + */ def numVariableReferences(identifier: String): Int = { stack.map(_.scopeNode).flatMap(scopeToVarMap.get).flatMap(_.get(identifier)).map(_.ids.size).headOption.getOrElse(0) } @@ -93,7 +90,7 @@ class RubyScope extends Scope[String, NewIdentifier, NewNode] { def buildVariableGroupings( key: ScopeNodeType, paramNames: Set[String], - diffGraph: BatchedUpdate.DiffGraphBuilder + diffGraph: DiffGraphBuilder ): List[DeclarationNew] = scopeMap.get(key) match case Some(varMap) => diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstCreationPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstCreationPass.scala index 1937d64799ea..23addda53ec8 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstCreationPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstCreationPass.scala @@ -6,11 +6,10 @@ import io.joern.rubysrc2cpg.deprecated.parser.DeprecatedRubyParser import io.joern.rubysrc2cpg.deprecated.utils.{PackageContext, PackageTable} import io.joern.x2cpg.SourceFiles import io.joern.x2cpg.datastructures.Global -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate import scala.jdk.CollectionConverters.EnumerationHasAsScala @@ -19,7 +18,7 @@ class AstCreationPass( parsedFiles: List[(String, DeprecatedRubyParser.ProgramContext)], packageTable: PackageTable, config: Config -) extends ConcurrentWriterCpgPass[(String, DeprecatedRubyParser.ProgramContext)](cpg) { +) extends ForkJoinParallelCpgPass[(String, DeprecatedRubyParser.ProgramContext)](cpg) { private val logger = LoggerFactory.getLogger(this.getClass) diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstPackagePass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstPackagePass.scala index d9eae74899b8..147a7b154daa 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstPackagePass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/AstPackagePass.scala @@ -5,8 +5,8 @@ import io.joern.rubysrc2cpg.deprecated.astcreation.{AstCreator, ResourceManagedP import io.joern.rubysrc2cpg.deprecated.utils.{PackageContext, PackageTable} import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Global -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import org.slf4j.LoggerFactory import scala.util.{Failure, Success, Try} @@ -18,7 +18,7 @@ class AstPackagePass( packageTable: PackageTable, inputPath: String )(implicit withSchemaValidation: ValidationMode) - extends ConcurrentWriterCpgPass[String](cpg) { + extends ForkJoinParallelCpgPass[String](cpg) { private val logger = LoggerFactory.getLogger(getClass) diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyImportResolverPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyImportResolverPass.scala index 788bb5ede7f2..3ca71e605a9f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyImportResolverPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyImportResolverPass.scala @@ -5,7 +5,7 @@ import io.joern.rubysrc2cpg.deprecated.utils.PackageTable import io.joern.x2cpg.Defines as XDefines import io.shiftleft.semanticcpg.language.importresolver.* import io.joern.x2cpg.passes.frontend.XImportResolverPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeHintCallLinker.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeHintCallLinker.scala index 226a65ef3899..7c7229fcb893 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeHintCallLinker.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeHintCallLinker.scala @@ -1,7 +1,7 @@ package io.joern.rubysrc2cpg.deprecated.passes import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryPassGenerator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryPassGenerator.scala index 8e21de3f30be..b3dc97358024 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryPassGenerator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryPassGenerator.scala @@ -1,10 +1,10 @@ package io.joern.rubysrc2cpg.deprecated.passes import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import io.joern.x2cpg.Defines as XDefines class RubyTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AnltrAstPrinter.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AnltrAstPrinter.scala new file mode 100644 index 000000000000..24776624a3f0 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AnltrAstPrinter.scala @@ -0,0 +1,36 @@ +package io.joern.rubysrc2cpg.parser + +import org.antlr.v4.runtime.ParserRuleContext +import org.antlr.v4.runtime.tree.TerminalNode + +/** General purpose ANTLR parse tree printer. + */ +object AnltrAstPrinter { + private val indentationIncrement = 1 + + private def print(level: Int, sb: StringBuilder, context: ParserRuleContext): StringBuilder = { + val indentation = " ".repeat(level) + val contextName = context.getClass.getSimpleName.stripSuffix("Context") + val nextLevel = level + indentationIncrement + sb.append(s"$indentation$contextName\n") + Option(context.children).foreach(_.forEach { + case c: ParserRuleContext => print(nextLevel, sb, c) + case t: TerminalNode => print(nextLevel, sb, t) + }) + sb + } + + private def print(level: Int, sb: StringBuilder, terminal: TerminalNode): StringBuilder = { + val indentation = " ".repeat(level) + sb.append(s"$indentation${terminal.getText}\n") + sb + } + + /** Pretty-prints an entire `ParserRuleContext` together with its descendants. + * @param context + * the context to pretty-print + * @return + * an indented, multiline string representation + */ + def print(context: ParserRuleContext): String = print(0, new StringBuilder, context).toString() +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrContextHelpers.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrContextHelpers.scala index eb2e0d9ecadc..bee3d710e822 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrContextHelpers.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrContextHelpers.scala @@ -1,6 +1,6 @@ package io.joern.rubysrc2cpg.parser -import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.TextSpan +import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.{ProcedureDeclaration, TextSpan, TypeDeclaration} import io.joern.rubysrc2cpg.parser.RubyParser.* import org.antlr.v4.runtime.ParserRuleContext import org.antlr.v4.runtime.misc.Interval @@ -18,14 +18,34 @@ object AntlrContextHelpers { // We need to make sure this doesn't happen when building the `text` field. val startIndex = ctx.getStart.getStartIndex val stopIndex = math.max(startIndex, ctx.getStop.getStopIndex) + + val offset = ctx match { + case x: MethodDefinitionContext => Option(ctx.start.getStartIndex, ctx.stop.getStopIndex + 1) + case x: ClassDefinitionContext => Option(ctx.start.getStartIndex, ctx.stop.getStopIndex + 1) + case x: ModuleDefinitionContext => Option(ctx.start.getStartIndex, ctx.stop.getStopIndex + 1) + case _ => None + } + TextSpan( line = Option(ctx.getStart.getLine), column = Option(ctx.getStart.getCharPositionInLine), lineEnd = Option(ctx.getStop.getLine), columnEnd = Option(ctx.getStop.getCharPositionInLine), + offset = offset, text = ctx.getStart.getInputStream.getText(new Interval(startIndex, stopIndex)) ) } + + /** @return + * true if this token's text is the same as a keyword, false if otherwise. + */ + def isKeyword: Boolean = { + // See RubyParser for why the bounds are used + val minBound = 19 + val maxBound = 56 + val typ = ctx.start.getType + typ >= minBound && typ <= maxBound + } } sealed implicit class CompoundStatementContextHelper(ctx: CompoundStatementContext) { @@ -147,6 +167,21 @@ object AntlrContextHelpers { def isIf: Boolean = Option(ctx.statementModifier().IF()).isDefined } + sealed implicit class QuotedExpandedArrayElementListContextHelper(ctx: QuotedExpandedArrayElementListContext) { + def elements: List[ParserRuleContext] = ctx.quotedExpandedArrayElement.asScala.toList + } + + sealed implicit class QuotedExpandedArrayElementContextHelper(ctx: QuotedExpandedArrayElementContext) { + def interpolations: List[ParserRuleContext] = ctx + .quotedExpandedArrayElementContent() + .asScala + .filter(x => Option(x.compoundStatement()).isDefined) + .map(_.compoundStatement()) + .toList + def hasInterpolation: Boolean = + ctx.interpolations.nonEmpty + } + sealed implicit class QuotedNonExpandedArrayElementListContextHelper(ctx: QuotedNonExpandedArrayElementListContext) { def elements: List[ParserRuleContext] = ctx.quotedNonExpandedArrayElementContent().asScala.toList } @@ -210,7 +245,9 @@ object AntlrContextHelpers { case ctx: AssociationsArgumentListContext => Option(ctx.associationList()).map(_.associations).getOrElse(List.empty) case ctx: SplattingArgumentArgumentListContext => - Option(ctx.splattingArgument()).toList + Option(ctx.splattingArgument()).toList ++ Option(ctx.blockArgument()).toList ++ Option( + ctx.operatorExpressionList() + ).toList case ctx: BlockArgumentArgumentListContext => Option(ctx.blockArgument()).toList case ctx => diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrParser.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrParser.scala index 82a16a960d5d..930c7fad335d 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrParser.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AntlrParser.scala @@ -5,6 +5,7 @@ import org.antlr.v4.runtime.* import org.antlr.v4.runtime.atn.{ATN, ATNConfigSet} import org.antlr.v4.runtime.dfa.DFA import org.slf4j.LoggerFactory + import java.io.File.separator import java.util import scala.collection.mutable.ListBuffer @@ -18,8 +19,9 @@ import scala.util.Try */ class AntlrParser(inputDir: File, filename: String) { - private val charStream = CharStreams.fromFileName(filename) - private val lexer = new RubyLexer(charStream) + private val charStream = CharStreams.fromFileName(filename) + private val lexer = new RubyLexer(charStream) + private val tokenStream = new CommonTokenStream(RubyLexerPostProcessor(lexer)) val parser: RubyParser = new RubyParser(tokenStream) @@ -82,7 +84,7 @@ class AntlrParser(inputDir: File, filename: String) { * @param clearLimit * the percentage of used heap to clear the DFA-cache on. */ -class ResourceManagedParser(clearLimit: Double) extends AutoCloseable { +class ResourceManagedParser(clearLimit: Double, debug: Boolean = false) extends AutoCloseable { private val logger = LoggerFactory.getLogger(getClass) private val runtime = Runtime.getRuntime @@ -92,15 +94,17 @@ class ResourceManagedParser(clearLimit: Double) extends AutoCloseable { def parse(inputFile: File, filename: String): Try[RubyParser.ProgramContext] = { val inputDir = if inputFile.isDirectory then inputFile else inputFile.parent val antlrParser = AntlrParser(inputDir, filename) - val interp = antlrParser.parser.getInterpreter + antlrParser.parser.setTrace(debug) // enables printing of ANTLR parse tree + val interp = antlrParser.parser.getInterpreter // We need to grab a live instance in order to get the static variables as they are protected from static access maybeDecisionToDFA = Option(interp.decisionToDFA) maybeAtn = Option(interp.atn) val usedMemory = runtime.freeMemory.toDouble / runtime.totalMemory.toDouble if (usedMemory >= clearLimit) { - logger.info(s"Runtime memory consumption at $usedMemory, clearing ANTLR DFA cache") + logger.debug(s"Runtime memory consumption at $usedMemory, clearing ANTLR DFA cache") clearDFA() } + val (programCtx, errors) = antlrParser.parse() errors.foreach(logger.warn) programCtx diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AstPrinter.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AstPrinter.scala index 1488305c4269..d3aef495f327 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AstPrinter.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/AstPrinter.scala @@ -1,36 +1,1175 @@ package io.joern.rubysrc2cpg.parser +import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.* +import io.joern.rubysrc2cpg.parser.AntlrContextHelpers.* +import io.joern.rubysrc2cpg.parser.RubyParser.{ + CommandWithDoBlockContext, + ConstantVariableReferenceContext, + MethodCallExpressionContext +} +import io.joern.rubysrc2cpg.passes.Defines +import io.joern.rubysrc2cpg.utils.FreshNameGenerator import org.antlr.v4.runtime.ParserRuleContext -import org.antlr.v4.runtime.tree.TerminalNode - -/** General purpose ANTLR parse tree printer. - */ -object AstPrinter { - private val indentationIncrement = 1 - - private def print(level: Int, sb: StringBuilder, context: ParserRuleContext): StringBuilder = { - val indentation = " ".repeat(level) - val contextName = context.getClass.getSimpleName.stripSuffix("Context") - val nextLevel = level + indentationIncrement - sb.append(s"$indentation$contextName\n") - Option(context.children).foreach(_.forEach { - case c: ParserRuleContext => print(nextLevel, sb, c) - case t: TerminalNode => print(nextLevel, sb, t) - }) - sb - } - - private def print(level: Int, sb: StringBuilder, terminal: TerminalNode): StringBuilder = { - val indentation = " ".repeat(level) - sb.append(s"$indentation${terminal.getText}\n") - sb - } - - /** Pretty-prints an entire `ParserRuleContext` together with its descendants. - * @param context - * the context to pretty-print - * @return - * an indented, multiline string representation - */ - def print(context: ParserRuleContext): String = print(0, new StringBuilder, context).toString() +import org.antlr.v4.runtime.tree.{ParseTree, TerminalNode} + +import scala.jdk.CollectionConverters.* + +class AstPrinter extends RubyParserBaseVisitor[String] { + private val ls = "\n" + private val rubyNodeCreator = new RubyNodeCreator + + private val classNameGen = FreshNameGenerator(id => s"") + + protected def freshClassName(): String = { + classNameGen.fresh + } + + override def defaultResult(): String = "" + + override def visit(tree: ParseTree): String = { + Option(tree).map(super.visit).getOrElse(defaultResult) + } + + override def visitProgram(ctx: RubyParser.ProgramContext): String = { + visit(ctx.compoundStatement()) + } + + override def visitCompoundStatement(ctx: RubyParser.CompoundStatementContext): String = { + ctx.getStatements.map(visit).mkString(ls) + } + + override def visitNextWithoutArguments(ctx: RubyParser.NextWithoutArgumentsContext): String = { + ctx.getText + } + + override def visitGroupingStatement(ctx: RubyParser.GroupingStatementContext): String = { + val stmts = ctx.compoundStatement().getStatements.map(visit) + if (stmts.size == 1) then stmts.head + else stmts.mkString(ls) + } + + override def visitStatements(ctx: RubyParser.StatementsContext): String = { + ctx.statement().asScala.map(visit).toList.mkString(ls) + } + + override def visitWhileExpression(ctx: RubyParser.WhileExpressionContext): String = { + val outputSb = new StringBuilder(ctx.WHILE.getText) + + val condition = visit(ctx.expressionOrCommand) + outputSb.append(s" $condition") + + val body = visit(ctx.doClause()) + + if body != "" then outputSb.append(s"$ls$body") + + outputSb.append(s"$ls${ctx.END.getText}").toString + } + + override def visitUntilExpression(ctx: RubyParser.UntilExpressionContext): String = { + val condition = visit(ctx.expressionOrCommand()) + val body = visit(ctx.doClause()) + + s"${ctx.UNTIL.getText} $condition $body$ls${ctx.END.getText}" + } + + override def visitBeginEndExpression(ctx: RubyParser.BeginEndExpressionContext): String = { + s"${ctx.BEGIN.getText}$ls${visit(ctx.bodyStatement())}$ls${ctx.END.getText}" + } + + override def visitIfExpression(ctx: RubyParser.IfExpressionContext): String = { + val outputSb = new StringBuilder(ctx.IF.getText) + + val condition = visit(ctx.expressionOrCommand()) + outputSb.append(s" $condition") + + val thenBody = visit(ctx.thenClause()) + if thenBody != "" then outputSb.append(s"$ls$thenBody") + + val elsifs = ctx.elsifClause().asScala.map(visit).toList + if elsifs.nonEmpty then outputSb.append(s"$ls${elsifs.mkString(ls)}") + + val elseBody = Option(ctx.elseClause()).map(visit) + if elseBody.isDefined then outputSb.append(s"$ls${elseBody.get}") + + outputSb.append(s"$ls${ctx.END.getText}") + outputSb.toString + } + + override def visitElsifClause(ctx: RubyParser.ElsifClauseContext): String = { + val outputSb = new StringBuilder(ctx.ELSIF.getText) + + val condition = visit(ctx.expressionOrCommand()) + outputSb.append(s" $condition") + + val thenBody = visit(ctx.thenClause()) + if thenBody != "" then outputSb.append(s"$ls$thenBody") + + outputSb.toString + } + + override def visitElseClause(ctx: RubyParser.ElseClauseContext): String = { + val outputSb = new StringBuilder(ctx.ELSE.getText) + + val elseBody = visit(ctx.compoundStatement()) + if elseBody != "" then outputSb.append(s"$ls$elseBody") + + outputSb.toString + } + + override def visitUnlessExpression(ctx: RubyParser.UnlessExpressionContext): String = { + val outputSb = new StringBuilder(ctx.UNLESS.getText) + + val condition = visit(ctx.expressionOrCommand()) + outputSb.append(s" $condition") + + val thenBody = visit(ctx.thenClause()) + if thenBody != "" then outputSb.append(s"$ls$thenBody") + + val elseBody = Option(ctx.elseClause()).map(visit) + if elseBody.isDefined then outputSb.append(s"$ls${elseBody.get}") + + outputSb.append(s"$ls${ctx.END.getText}").toString + } + + override def visitForExpression(ctx: RubyParser.ForExpressionContext): String = { + val forVariable = visit(ctx.forVariable()) + val iterableVariable = visit(ctx.commandOrPrimaryValue()) + val doBlock = visit(ctx.doClause()) + + s"${ctx.FOR.getText} $forVariable ${ctx.IN.getText} $iterableVariable$doBlock$ls${ctx.END.getText}" + } + + override def visitForVariable(ctx: RubyParser.ForVariableContext): String = { + if (ctx.leftHandSide() != null) visit(ctx.leftHandSide()) + else visit(ctx.multipleLeftHandSide()) + } + + override def visitModifierStatement(ctx: RubyParser.ModifierStatementContext): String = { + ctx.statementModifier().getText match + case "if" => + val condition = visit(ctx.expressionOrCommand()) + val thenBody = visit(ctx.statement()) + s"$thenBody if $condition" + case "unless" => + val condition = visit(ctx.expressionOrCommand()) + val thenBody = visit(ctx.statement()) + s"$thenBody unless $condition" + case "while" => + val condition = visit(ctx.expressionOrCommand()) + val body = visit(ctx.statement()) + s"$body while $condition" + case "until" => + val condition = visit(ctx.expressionOrCommand()) + val body = visit(ctx.statement()) + s"$body until $condition" + case "rescue" => + val body = visit(ctx.statement()) + val thenClause = visit(ctx.expressionOrCommand()) + s"$body rescue $thenClause" + case _ => defaultResult() + } + + override def visitTernaryOperatorExpression(ctx: RubyParser.TernaryOperatorExpressionContext): String = { + val condition = visit(ctx.operatorExpression(0)) + val thenBody = visit(ctx.operatorExpression(1)) + val elseBody = visit(ctx.operatorExpression(2)) + + s"$condition ${ctx.QMARK.getText} $thenBody ${ctx.COLON.getText} $elseBody" + } + + override def visitReturnMethodInvocationWithoutParentheses( + ctx: RubyParser.ReturnMethodInvocationWithoutParenthesesContext + ): String = { + s"return ${ctx.primaryValueList().primaryValue().asScala.map(visit).toList.mkString(ls)}" + } + + override def visitReturnWithoutArguments(ctx: RubyParser.ReturnWithoutArgumentsContext): String = { + ctx.getText + } + + override def visitNumericLiteral(ctx: RubyParser.NumericLiteralContext): String = { + if ctx.hasSign then s"${ctx.sign.getText}${visit(ctx.unsignedNumericLiteral())}" + else visit(ctx.unsignedNumericLiteral()) + } + + override def visitUnaryExpression(ctx: RubyParser.UnaryExpressionContext): String = { + s"${ctx.unaryOperator().getText}${visit(ctx.primaryValue())}" + } + + override def visitUnaryMinusExpression(ctx: RubyParser.UnaryMinusExpressionContext): String = { + s"${ctx.MINUS().getText}${visit(ctx.primaryValue())}" + } + + override def visitNotExpressionOrCommand(ctx: RubyParser.NotExpressionOrCommandContext): String = { + s"${ctx.NOT().getText} ${visit(ctx.expressionOrCommand())}" + } + + override def visitCommandExpressionOrCommand(ctx: RubyParser.CommandExpressionOrCommandContext): String = { + val methodInvocation = visit(ctx.methodInvocationWithoutParentheses()) + + if (Option(ctx.EMARK()).isDefined) { + s"${ctx.EMARK().getText}$methodInvocation" + } else { + methodInvocation + } + } + + override def visitCommandWithDoBlock(ctx: RubyParser.CommandWithDoBlockContext): String = { + val name = Option(ctx.methodIdentifier()).orElse(Option(ctx.methodName())).map(visit).getOrElse(defaultResult()) + val arguments = ctx.arguments.map(visit).mkString(" ") + val block = visit(ctx.doBlock()) + + s"$name $arguments $block" + } + + override def visitPrimaryOperatorExpression(ctx: RubyParser.PrimaryOperatorExpressionContext): String = { + rubyNodeCreator.visitPrimaryOperatorExpression(ctx) match { + case x: BinaryExpression if x.lhs.text.endsWith("=") && x.op == "*" => + val newLhs = x.lhs match { + case call: SimpleCall => SimpleIdentifier(None)(call.span.spanStart(call.span.text.stripSuffix("="))) + case y => + y + } + val newRhs = { + val oldRhsSpan = x.rhs.span + SplattingRubyNode(x.rhs)(oldRhsSpan.spanStart(s"*${oldRhsSpan.text}")) + } + s"${newLhs.span.text} = ${newRhs.span.text}" + case x => super.visitPrimaryOperatorExpression(ctx) + } + } + + override def visitPowerExpression(ctx: RubyParser.PowerExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.powerOperator.getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitAdditiveExpression(ctx: RubyParser.AdditiveExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.additiveOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitMultiplicativeExpression(ctx: RubyParser.MultiplicativeExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.multiplicativeOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitLogicalAndExpression(ctx: RubyParser.LogicalAndExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.andOperator.getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitLogicalOrExpression(ctx: RubyParser.LogicalOrExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.orOperator.getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitKeywordAndOrExpressionOrCommand(ctx: RubyParser.KeywordAndOrExpressionOrCommandContext): String = { + val lhs = visit(ctx.lhs) + val op = ctx.binOp.getText + val rhs = visit(ctx.rhs) + + s"$lhs $op $rhs" + } + + override def visitShiftExpression(ctx: RubyParser.ShiftExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.bitwiseShiftOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitBitwiseAndExpression(ctx: RubyParser.BitwiseAndExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.bitwiseAndOperator.getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitBitwiseOrExpression(ctx: RubyParser.BitwiseOrExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.bitwiseOrOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitRelationalExpression(ctx: RubyParser.RelationalExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.relationalOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitEqualityExpression(ctx: RubyParser.EqualityExpressionContext): String = { + val lhs = visit(ctx.primaryValue(0)) + val op = ctx.equalityOperator().getText + val rhs = visit(ctx.primaryValue(1)) + + s"$lhs $op $rhs" + } + + override def visitDecimalUnsignedLiteral(ctx: RubyParser.DecimalUnsignedLiteralContext): String = { + ctx.getText + } + + override def visitBinaryUnsignedLiteral(ctx: RubyParser.BinaryUnsignedLiteralContext): String = { + ctx.getText + } + + override def visitOctalUnsignedLiteral(ctx: RubyParser.OctalUnsignedLiteralContext): String = { + ctx.getText + } + + override def visitHexadecimalUnsignedLiteral(ctx: RubyParser.HexadecimalUnsignedLiteralContext): String = { + ctx.getText + } + + override def visitFloatWithExponentUnsignedLiteral( + ctx: RubyParser.FloatWithExponentUnsignedLiteralContext + ): String = { + ctx.getText + } + + override def visitFloatWithoutExponentUnsignedLiteral( + ctx: RubyParser.FloatWithoutExponentUnsignedLiteralContext + ): String = { + ctx.getText + } + + override def visitPureSymbolLiteral(ctx: RubyParser.PureSymbolLiteralContext): String = { + ctx.getText + } + + override def visitSingleQuotedSymbolLiteral(ctx: RubyParser.SingleQuotedSymbolLiteralContext): String = { + ctx.getText + } + + override def visitNilPseudoVariable(ctx: RubyParser.NilPseudoVariableContext): String = { + ctx.getText + } + + override def visitTruePseudoVariable(ctx: RubyParser.TruePseudoVariableContext): String = { + ctx.getText + } + + override def visitFalsePseudoVariable(ctx: RubyParser.FalsePseudoVariableContext): String = { + ctx.getText + } + + override def visitSingleQuotedStringExpression(ctx: RubyParser.SingleQuotedStringExpressionContext): String = { + if (!ctx.isInterpolated) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString("") + } + } + + override def visitQuotedNonExpandedStringLiteral(ctx: RubyParser.QuotedNonExpandedStringLiteralContext): String = { + ctx.getText + } + + override def visitDoubleQuotedStringExpression(ctx: RubyParser.DoubleQuotedStringExpressionContext): String = { + if (!ctx.isInterpolated) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString + } + } + + override def visitDoubleQuotedSymbolLiteral(ctx: RubyParser.DoubleQuotedSymbolLiteralContext): String = { + if (!ctx.isInterpolated) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString + } + } + + override def visitQuotedExpandedStringLiteral(ctx: RubyParser.QuotedExpandedStringLiteralContext): String = { + if (!ctx.isInterpolated) { + ctx.getText + } else { + val b = ctx.interpolations + ctx.children.asScala.map(visit).mkString + } + } + + override def visitQuotedExpandedStringArrayLiteral( + ctx: RubyParser.QuotedExpandedStringArrayLiteralContext + ): String = { + val elements = + if Option(ctx.quotedExpandedArrayElementList()).isDefined then + ctx.quotedExpandedArrayElementList().elements.map(visit).mkString(" ") + else "" + + s"${ctx.QUOTED_EXPANDED_STRING_ARRAY_LITERAL_START.getText}$elements${ctx.QUOTED_EXPANDED_STRING_ARRAY_LITERAL_END.getText}" + } + + override def visitQuotedExpandedSymbolArrayLiteral( + ctx: RubyParser.QuotedExpandedSymbolArrayLiteralContext + ): String = { + val elements = + if Option(ctx.quotedExpandedArrayElementList()).isDefined then + ctx.quotedExpandedArrayElementList().elements.map(visit).mkString(" ") + else "" + + s"${ctx.QUOTED_EXPANDED_SYMBOL_ARRAY_LITERAL_START.getText}$elements${ctx.QUOTED_EXPANDED_SYMBOL_ARRAY_LITERAL_END.getText}" + } + + override def visitQuotedExpandedArrayElement(ctx: RubyParser.QuotedExpandedArrayElementContext): String = { + ctx.quotedExpandedArrayElementContent().asScala.flatMap(_.children.asScala.map(visit)).mkString + } + + override def visitQuotedExpandedLiteralStringContent( + ctx: RubyParser.QuotedExpandedLiteralStringContentContext + ): String = { + Option(ctx.compoundStatement()) match { + case Some(compoundStatement) => + ctx.children.asScala.map(visit).mkString + case None => ctx.getText + } + } + + override def visitRegularExpressionLiteral(ctx: RubyParser.RegularExpressionLiteralContext): String = { + if (ctx.isStatic) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString(" ") + } + } + + override def visitQuotedExpandedRegularExpressionLiteral( + ctx: RubyParser.QuotedExpandedRegularExpressionLiteralContext + ): String = { + if (ctx.isStatic) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString(" ") + } + } + + override def visitQuotedExpandedExternalCommandLiteral( + ctx: RubyParser.QuotedExpandedExternalCommandLiteralContext + ): String = { + val command = + if ctx.quotedExpandedLiteralStringContent.asScala.nonEmpty then + ctx.quotedExpandedLiteralStringContent.asScala.flatMap(_.children.asScala.map(visit)).mkString("") + else "" + + s"${ctx.QUOTED_EXPANDED_EXTERNAL_COMMAND_LITERAL_START.getText}$command${ctx.QUOTED_EXPANDED_EXTERNAL_COMMAND_LITERAL_END.getText}" + } + + override def visitDoubleQuotedString(ctx: RubyParser.DoubleQuotedStringContext): String = { + if (!ctx.isInterpolated) { + ctx.getText + } else { + ctx.children.asScala.map(visit).mkString + } + } + + override def visitDoubleQuotedStringContent(ctx: RubyParser.DoubleQuotedStringContentContext): String = { + ctx.children.asScala.map(visit).mkString + } + + override def visitTerminal(node: TerminalNode): String = { + node.getText + } + + override def visitCurlyBracesBlock(ctx: RubyParser.CurlyBracesBlockContext): String = { + val outputSb = new StringBuilder(ctx.LCURLY.getText) + + val params = Option(ctx.blockParameter()).fold(List())(_.parameters).map(visit) + if params.nonEmpty then outputSb.append(s"|${params.mkString(",")}|") + + val body = visit(ctx.compoundStatement()) + if body != "" then outputSb.append(s"$ls$body$ls") + + outputSb.append(ctx.RCURLY.getText).toString + } + + override def visitDoBlock(ctx: RubyParser.DoBlockContext): String = { + val outputSb = new StringBuilder(ctx.DO.getText) + + val params = Option(ctx.blockParameter()).fold(List())(_.parameters).map(visit).mkString(",") + if params != "" then outputSb.append(s" |$params|") + + outputSb.append(ls) + + val body = visit(ctx.bodyStatement()) + if body != "" then outputSb.append(s"$body$ls") + + outputSb.append(ctx.END.getText).toString + } + + override def visitLocalVariableAssignmentExpression( + ctx: RubyParser.LocalVariableAssignmentExpressionContext + ): String = { + val lhs = visit(ctx.lhs) + val rhs = visit(ctx.rhs) + val op = ctx.assignmentOperator().getText + + s"$lhs $op $rhs" + } + + override def visitMultipleAssignmentStatement(ctx: RubyParser.MultipleAssignmentStatementContext): String = { + // TODO: fixme - ctx.toTextSpan is being used for individual elements in the building of a MultipleAssignment - needs + // to be fixed so that individual elements span texts can be used to build MultipleAssignment on AstPrinter side. + rubyNodeCreator.visitMultipleAssignmentStatement(ctx).span.text + } + + override def visitMultipleLeftHandSide(ctx: RubyParser.MultipleLeftHandSideContext): String = { + val multiLhs = ctx.multipleLeftHandSideItem.asScala.map(visit).mkString(",") + val packingLhs = Option(ctx.packingLeftHandSide).map(visit).mkString(",") + val procParam = Option(ctx.procParameter).map(visit).mkString(",") + val groupedLhs = Option(ctx.groupedLeftHandSide).map(visit) + + s"$multiLhs $packingLhs $procParam $groupedLhs" + } + + override def visitPackingLeftHandSide(ctx: RubyParser.PackingLeftHandSideContext): String = { + val lhs = visit(ctx.leftHandSide) + val rest = Option(ctx.multipleLeftHandSideItem()).map(_.asScala.map(visit).mkString(",")).getOrElse("") + + s"$lhs $rest" + } + + override def visitMultipleRightHandSide(ctx: RubyParser.MultipleRightHandSideContext): String = { + val rhsSplatting = Option(ctx.splattingRightHandSide()).map(_.splattingArgument()).map(visit).mkString(",") + Option(ctx.operatorExpressionList()) + .map(x => s"${x.operatorExpression().asScala.map(visit).mkString(",")} $rhsSplatting") + .getOrElse(defaultResult()) + } + + override def visitSplattingArgument(ctx: RubyParser.SplattingArgumentContext): String = { + val operator = Option(ctx.STAR) match { + case Some(star) => ctx.STAR.getText + case None => ctx.STAR2.getText + } + + s"$operator${visit(ctx.operatorExpression())}" + } + + override def visitAttributeAssignmentExpression(ctx: RubyParser.AttributeAssignmentExpressionContext): String = { + val lhs = visit(ctx.primaryValue()) + val op = ctx.op.getText + val memberName = ctx.methodName().getText + val rhs = visit(ctx.operatorExpression()) + + s"$lhs$op$memberName = $rhs" + } + + override def visitSimpleCommand(ctx: RubyParser.SimpleCommandContext): String = { + if (Option(ctx.commandArgument()).map(_.getText).exists(_.startsWith("::"))) { + val memberName = ctx.commandArgument().getText.stripPrefix("::") + val methodIdentifier = visit(ctx.methodIdentifier()) + s"$methodIdentifier::$memberName" + } else if (!ctx.methodIdentifier().isAttrDeclaration) { + val identifierCtx = ctx.methodIdentifier() + val arguments = ctx.commandArgument().arguments.map(visit) + (identifierCtx.getText, arguments) match { + case ("require", List(argument)) => + s"require ${arguments.mkString(",")}" + case ("require_relative", List(argument)) => + s"require_relative ${arguments.mkString(",")}" + case ("require_all", List(argument)) => + s"require_all ${arguments.mkString(",")}" + case ("include", List(argument)) => + s"include ${arguments.mkString(",")}" + case (idAssign, arguments) if idAssign.endsWith("=") => + val argNode = arguments match { + case arg :: Nil => arg + case xs => visit(ctx.commandArgument()) + } + s"$idAssign $argNode" + case _ => + s"${visit(identifierCtx)} ${arguments.mkString(",")}" + } + } else { + s"${ctx.commandArgument.arguments.map(visit).mkString(",")}" + } + } + + override def visitSuperWithParentheses(ctx: RubyParser.SuperWithParenthesesContext): String = { + val block = Option(ctx.block()).map(visit) + val arguments = Option(ctx.argumentWithParentheses()).map(_.arguments.map(visit).mkString(",")).getOrElse("") + visitSuperCall(ctx, s"($arguments)", block) + } + + override def visitSuperWithoutParentheses(ctx: RubyParser.SuperWithoutParenthesesContext): String = { + val block = Option(ctx.block()).map(visit) + val arguments = Option(ctx.argumentList()).map(_.elements.map(visit).mkString(",")).getOrElse("") + visitSuperCall(ctx, arguments, block) + } + + private def visitSuperCall(ctx: ParserRuleContext, arguments: String, block: Option[String]): String = { + block match { + case Some(body) => s"super $arguments $body" + case None => s"super $arguments" + } + } + + override def visitIsDefinedExpression(ctx: RubyParser.IsDefinedExpressionContext): String = { + val definedKeyword = visit(ctx.isDefinedKeyword) + val value = visit(ctx.expressionOrCommand()) + s"$definedKeyword $value" + } + + override def visitIsDefinedCommand(ctx: RubyParser.IsDefinedCommandContext): String = { + val definedKeyword = visit(ctx.isDefinedKeyword) + val value = visit(ctx.primaryValue()) + + s"$definedKeyword $value" + } + + override def visitMethodCallExpression(ctx: RubyParser.MethodCallExpressionContext): String = { + val identifier = visit(ctx.methodOnlyIdentifier()) + s"$identifier" + } + + override def visitMethodCallWithBlockExpression(ctx: RubyParser.MethodCallWithBlockExpressionContext): String = { + ctx.methodIdentifier().getText match { + case Defines.Proc | Defines.Lambda => s"${ctx.methodIdentifier().getText} ${visit(ctx.block())}" + case Defines.Loop => + ctx.block() match { + case b: RubyParser.DoBlockBlockContext => + val body = visit(b.doBlock().bodyStatement) + s"${Defines.Loop} do$ls$body${ls}break if false${ls}end" + case y => + val body = visit(ctx.block()) + s"${Defines.Loop}$ls$body${ls}end" + } + case _ => + val methodIdent = visit(ctx.methodIdentifier) + val body = visit(ctx.block) + + ctx.block() match { + case x: RubyParser.DoBlockBlockContext => s"$methodIdent $body" + case y => s"$methodIdent {$ls$body$ls}" + } + } + } + + override def visitLambdaExpression(ctx: RubyParser.LambdaExpressionContext): String = { + val outputSb = new StringBuilder(ctx.MINUSGT.getText) + + val params = Option(ctx.parameterList()).fold(List())(_.parameters).map(visit).mkString(",") + val body = visit(ctx.block()) + + if params != "" then outputSb.append(s"($params)") + if body != "" then outputSb.append(s" $body") + + outputSb.toString + } + + override def visitMethodCallWithParenthesesExpression( + ctx: RubyParser.MethodCallWithParenthesesExpressionContext + ): String = { + val outputSb = new StringBuilder() + + val identifier = visit(ctx.methodIdentifier()) + outputSb.append(identifier) + + val args = ctx.argumentWithParentheses().arguments.map(visit).mkString(",") + outputSb.append(s"($args)") + + if Option(ctx.block).isDefined then outputSb.append(s" ${visit(ctx.block)}") + outputSb.toString + } + + override def visitYieldExpression(ctx: RubyParser.YieldExpressionContext): String = { + val outputSb = new StringBuilder(ctx.YIELD.getText) + val args = Option(ctx.argumentWithParentheses()).iterator.flatMap(_.arguments).map(visit) + if args.nonEmpty then outputSb.append(s"(${args.mkString(",")})") + + outputSb.toString + } + + override def visitYieldMethodInvocationWithoutParentheses( + ctx: RubyParser.YieldMethodInvocationWithoutParenthesesContext + ): String = { + val args = ctx.primaryValueList().primaryValue().asScala.map(visit).mkString(",") + s"${ctx.YIELD.getText} $args" + } + + override def visitMemberAccessCommand(ctx: RubyParser.MemberAccessCommandContext): String = { + val arg = visit(ctx.commandArgument()) + val methodName = visit(ctx.methodName) + val base = visit(ctx.primary()) + + s"$base.$methodName $arg" + } + + override def visitConstantIdentifierVariable(ctx: RubyParser.ConstantIdentifierVariableContext): String = { + ctx.getText + } + + override def visitGlobalIdentifierVariable(ctx: RubyParser.GlobalIdentifierVariableContext): String = { + ctx.getText + } + + override def visitClassIdentifierVariable(ctx: RubyParser.ClassIdentifierVariableContext): String = { + ctx.getText + } + + override def visitInstanceIdentifierVariable(ctx: RubyParser.InstanceIdentifierVariableContext): String = { + ctx.getText + } + + override def visitLocalIdentifierVariable(ctx: RubyParser.LocalIdentifierVariableContext): String = { + ctx.getText + } + + override def visitClassName(ctx: RubyParser.ClassNameContext): String = { + ctx.getText + } + + override def visitMethodIdentifier(ctx: RubyParser.MethodIdentifierContext): String = { + ctx.getText + } + + override def visitMethodOnlyIdentifier(ctx: RubyParser.MethodOnlyIdentifierContext): String = { + ctx.getText + } + + override def visitIsDefinedKeyword(ctx: RubyParser.IsDefinedKeywordContext): String = { + ctx.getText + } + + override def visitLinePseudoVariable(ctx: RubyParser.LinePseudoVariableContext): String = { + ctx.getText + } + + override def visitFilePseudoVariable(ctx: RubyParser.FilePseudoVariableContext): String = { + ctx.getText + } + + override def visitEncodingPseudoVariable(ctx: RubyParser.EncodingPseudoVariableContext): String = { + ctx.getText + } + + override def visitSelfPseudoVariable(ctx: RubyParser.SelfPseudoVariableContext): String = { + ctx.getText + } + + override def visitMemberAccessExpression(ctx: RubyParser.MemberAccessExpressionContext): String = { + val hasArgs = Option(ctx.argumentWithParentheses()).isDefined + val hasBlock = Option(ctx.block()).isDefined + val methodName = ctx.methodName.getText + val isClassDecl = + Option(ctx.primaryValue()).map(_.getText).contains("Class") && Option(ctx.methodName()) + .map(_.getText) + .contains("new") + + if (!hasBlock) { + val target = visit(ctx.primaryValue()) + if (methodName == "new") { + if (!hasArgs) { + return s"$target.$methodName" + } else { + val args = ctx.argumentWithParentheses().arguments.map(visit).mkString(",") + return s"$target.$methodName($args)" + } + } else { + if (!hasArgs) { + return s"$target${ctx.op.getText}$methodName" + } else { + val args = ctx.argumentWithParentheses().arguments.map(visit).mkString(",") + return s"$target${ctx.op.getText}$methodName($args)" + } + } + } + + if (hasBlock && isClassDecl) { + val block = visit(ctx.block()) + } else if (hasBlock) { + val block = visit(ctx.block()) + val target = visit(ctx.primaryValue()) + + if (methodName == "new") { + val callStr = s"$target.$methodName" + + if (!hasArgs) { + return s"$target.$methodName $block" + } else { + val args = ctx.argumentWithParentheses().arguments.map(visit).mkString(",") + return s"$target.$methodName($args) $block" + } + } else { + return s"$target${ctx.op.getText}$methodName $block" + } + } + + defaultResult() + } + + override def visitConstantVariableReference(ctx: RubyParser.ConstantVariableReferenceContext): String = { + s"self::${ctx.CONSTANT_IDENTIFIER().getText}" + } + + override def visitIndexingAccessExpression(ctx: RubyParser.IndexingAccessExpressionContext): String = { + val target = visit(ctx.primaryValue()) + val arg = Option(ctx.indexingArgumentList()).map(_.arguments).getOrElse(List()).map(visit).mkString(",") + + s"$target${ctx.LBRACK.getText}$arg${ctx.RBRACK.getText}" + } + + override def visitBracketAssignmentExpression(ctx: RubyParser.BracketAssignmentExpressionContext): String = { + val op = ctx.assignmentOperator().getText + + if (op != "=") { + defaultResult() + } + + val lhsBase = visit(ctx.primaryValue()) + val lhsArgs = Option(ctx.indexingArgumentList()).map(_.arguments).getOrElse(List()).map(visit) + val rhs = visit(ctx.operatorExpression()) + + s"$lhsBase[${lhsArgs.mkString(",")}] $op ${rhs}" + } + + override def visitBracketedArrayLiteral(ctx: RubyParser.BracketedArrayLiteralContext): String = { + val args = Option(ctx.indexingArgumentList()).map(_.arguments).getOrElse(List()).map(visit).mkString(",") + s"${ctx.LBRACK.getText}$args${ctx.RBRACK.getText}" + } + + override def visitQuotedNonExpandedStringArrayLiteral( + ctx: RubyParser.QuotedNonExpandedStringArrayLiteralContext + ): String = { + val ctxElements = Option(ctx.quotedNonExpandedArrayElementList()) + + val elements = ctxElements + .map(_.elements) + .getOrElse(List()) + .map(_.getText) + + val sep = + if elements.nonEmpty then + ctxElements + .map(_.NON_EXPANDED_ARRAY_ITEM_SEPARATOR().asScala) + .getOrElse(List()) + .map(_.getText) + .headOption + .getOrElse("") + else "" + + val elementsString = elements.mkString(sep) + + s"${ctx.QUOTED_NON_EXPANDED_STRING_ARRAY_LITERAL_START()}$elementsString${ctx.QUOTED_NON_EXPANDED_STRING_ARRAY_LITERAL_END()}" + } + + override def visitQuotedNonExpandedSymbolArrayLiteral( + ctx: RubyParser.QuotedNonExpandedSymbolArrayLiteralContext + ): String = { + val ctxElements = Option(ctx.quotedNonExpandedArrayElementList()) + + val elements = ctxElements + .map(_.elements) + .getOrElse(List()) + .map(_.getText) + + val sep = + if elements.nonEmpty then + ctxElements + .map(_.NON_EXPANDED_ARRAY_ITEM_SEPARATOR().asScala) + .getOrElse(List()) + .map(_.getText) + .headOption + .getOrElse("") + else "" + + val elementsString = elements.mkString(sep) + + s"${ctx.QUOTED_NON_EXPANDED_SYMBOL_ARRAY_LITERAL_START.getText}$elementsString${ctx.QUOTED_NON_EXPANDED_SYMBOL_ARRAY_LITERAL_END.getText}" + } + + override def visitRangeExpression(ctx: RubyParser.RangeExpressionContext): String = { + val lowerBound = visit(ctx.primaryValue(0)) + val upperBound = visit(ctx.primaryValue(1)) + val op = visit(ctx.rangeOperator()) + + s"$lowerBound$op$upperBound" + } + + override def visitRangeOperator(ctx: RubyParser.RangeOperatorContext): String = { + ctx.getText + } + + override def visitHashLiteral(ctx: RubyParser.HashLiteralContext): String = { + val outputSb = new StringBuilder(ctx.LCURLY.getText) + val assocList = Option(ctx.associationList()).map(_.associations).getOrElse(List()).map(visit).mkString(",") + if assocList != "" then outputSb.append(s"$assocList") + outputSb.append(ctx.RCURLY.getText) + outputSb.toString + } + + override def visitAssociationElement(ctx: RubyParser.AssociationElementContext): String = { + val assocOp = Option(ctx.COLON()) match { + case Some(colon) => ":" + case None => "=>" + } + + val opExpression = visit(ctx.operatorExpression()) + + ctx.associationKey().getText match { + case "if" => + s"${ctx.associationKey().getText}$assocOp $opExpression" + case _ => + val assocKey = visit(ctx.associationKey()) + s"$assocKey$assocOp $opExpression" + } + } + + override def visitAssociationHashArgument(ctx: RubyParser.AssociationHashArgumentContext): String = { + val identifierName = Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText) + + val body = identifierName match { + case Some(identifierName) => identifierName + case None => + if ctx.LPAREN() == null then visit(ctx.methodCallsWithParentheses()) + else visit(ctx.methodInvocationWithoutParentheses()) + } + + s"${ctx.STAR2().getText}$body" + } + + override def visitModuleDefinition(ctx: RubyParser.ModuleDefinitionContext): String = { + val outputSb = new StringBuilder(ctx.MODULE.getText) + + val (nonFieldStmts, fields) = rubyNodeCreator.genInitFieldStmts(ctx.bodyStatement()) + + val moduleName = visit(ctx.classPath()) + + outputSb.append(s" $moduleName$ls") + if fields.nonEmpty then outputSb.append(fields.mkString(ls)) + + outputSb.append(nonFieldStmts.span.text).append(s"$ls${ctx.END.getText}").toString + } + + override def visitSingletonClassDefinition(ctx: RubyParser.SingletonClassDefinitionContext): String = { + val outputSb = new StringBuilder() + + val baseClass = Option(ctx.commandOrPrimaryValueClass()).map(visit) + val body = visit(ctx.bodyStatement()) + + baseClass match { + case Some(baseClass) if baseClass == "self" => + outputSb.append(ctx.CLASS.getText).append(s" << $baseClass.${freshClassName()}") + if body != "" then outputSb.append(s"$ls$body") + outputSb.append(s"$ls${ctx.END.getText}") + outputSb.toString + case Some(baseClass) => + outputSb.append(ctx.CLASS.getText).append(s" << $baseClass") + if body != "" then outputSb.append(s"$ls$body") + outputSb.append(s"$ls${ctx.END.getText}").toString + case None => + s"${ctx.CLASS.getText} ${freshClassName()}$ls$body$ls${ctx.END.getText}" + } + } + + override def visitClassDefinition(ctx: RubyParser.ClassDefinitionContext): String = { + val (nonFieldStmts, fields) = rubyNodeCreator.genInitFieldStmts(ctx.bodyStatement()) + + val stmts = rubyNodeCreator.lowerAliasStatementsToMethods(nonFieldStmts) + + val classBody = rubyNodeCreator.filterNonAllowedTypeDeclChildren(stmts) + val className = visit(ctx.classPath()) + + s"class $className$ls${classBody.span.text}${ls}end" + } + + override def visitMethodDefinition(ctx: RubyParser.MethodDefinitionContext): String = { + val outputSb = new StringBuilder(s"${ctx.DEF.getText} ${ctx.definedMethodName.getText}") + + val params = Option(ctx.methodParameterPart().parameterList()).fold(List())(_.parameters).map(visit) + if params.nonEmpty then outputSb.append(s"(${params.mkString(",")})") + + val methodBody = visit(ctx.bodyStatement()) + if methodBody != "" then outputSb.append(s"$ls$methodBody") + + outputSb.append(s"$ls${ctx.END.getText}").toString + } + + override def visitEndlessMethodDefinition(ctx: RubyParser.EndlessMethodDefinitionContext): String = { + val outputSb = new StringBuilder(s"${ctx.DEF.getText} ${ctx.definedMethodName.getText}") + + val params = Option(ctx.parameterList()).fold(List())(_.parameters).map(visit) + if params.nonEmpty then outputSb.append(s"${ctx.LPAREN.getText}${params.mkString(",")}${ctx.RPAREN.getText}") + + outputSb.append(s" ${ctx.EQ.getText}") + val body = visit(ctx.statement()) + if body != "" then outputSb.append(s" $body") + + outputSb.toString + } + + override def visitSingletonMethodDefinition(ctx: RubyParser.SingletonMethodDefinitionContext): String = { + val target = visit(ctx.singletonObject()) + val op = ctx.op.getText + val methodName = ctx.definedMethodName().getText + val params = Option(ctx.methodParameterPart().parameterList()).fold(List())(_.parameters).map(visit).mkString(",") + val body = visit(ctx.bodyStatement()) + + if Option(ctx.methodParameterPart().LPAREN()).isDefined then + s"${ctx.DEF.getText} $target$op$methodName ($params)$ls$body$ls${ctx.END.getText}" + else s"${ctx.DEF.getText} $target$op$methodName $params$ls$body$ls${ctx.END.getText}" + } + + override def visitProcParameter(ctx: RubyParser.ProcParameterContext): String = { + val identName = + Option(ctx.procParameterName()).map(_.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText).getOrElse(ctx.getText) + s"${ctx.AMP().getText}$identName" + } + + override def visitHashParameter(ctx: RubyParser.HashParameterContext): String = { + val identName = Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText).getOrElse(ctx.getText) + s"${ctx.STAR2().getText}$identName" + } + + override def visitArrayParameter(ctx: RubyParser.ArrayParameterContext): String = { + val identName = Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText).getOrElse(ctx.getText) + s"${ctx.STAR.getText}$identName" + } + + override def visitOptionalParameter(ctx: RubyParser.OptionalParameterContext): String = { + val paramName = ctx.optionalParameterName().LOCAL_VARIABLE_IDENTIFIER().getText + val value = visit(ctx.operatorExpression()) + val op = + if Option(ctx.COLON()).isDefined then ctx.COLON().getText + else ctx.EQ().getText + + s"$paramName$op$value" + } + + override def visitMandatoryParameter(ctx: RubyParser.MandatoryParameterContext): String = { + val paramName = ctx.LOCAL_VARIABLE_IDENTIFIER().getText + val op = Option(ctx.COLON) match { + case Some(colon) => ctx.COLON.getText + case None => "" + } + + s"$paramName$op" + } + + override def visitVariableLeftHandSide(ctx: RubyParser.VariableLeftHandSideContext): String = { + s"${ctx.getText}" + } + + override def visitBodyStatement(ctx: RubyParser.BodyStatementContext): String = { + val body = visit(ctx.compoundStatement()) + val rescueClause = Option(ctx.rescueClause.asScala).fold(List())(_.map(visit)) + val elseClause = Option(ctx.elseClause()).map(visit).getOrElse("") + val ensureClause = Option(ctx.ensureClause).map(visit).getOrElse("") + + if (rescueClause.isEmpty && elseClause.isEmpty && ensureClause.isEmpty) { + body + } else { + val outputSb = new StringBuilder(body) + if rescueClause.nonEmpty then outputSb.append(s"$ls${rescueClause.mkString(ls)}") + if elseClause.nonEmpty then outputSb.append(s"$elseClause$ls") + if ensureClause.nonEmpty then outputSb.append(s"$ensureClause") + + outputSb.toString + } + } + + override def visitExceptionClassList(ctx: RubyParser.ExceptionClassListContext): String = { + Option(ctx.multipleRightHandSide()).map(visitMultipleRightHandSide).getOrElse(visit(ctx.operatorExpression())) + } + + override def visitRescueClause(ctx: RubyParser.RescueClauseContext): String = { + val exceptionClassList = Option(ctx.exceptionClassList).map(visit).getOrElse("") + val variables = Option(ctx.exceptionVariableAssignment).map(visit).getOrElse("") + val thenClause = visit(ctx.thenClause) + + val thenKeyword = + if Option(ctx.thenClause().THEN()).isDefined then s" ${ctx.thenClause().THEN().getText}" + else "" + + s"${ctx.RESCUE().getText} $exceptionClassList => $variables $thenKeyword $thenClause".strip() + } + + override def visitEnsureClause(ctx: RubyParser.EnsureClauseContext): String = { + val stmt = visit(ctx.compoundStatement) + s"${ctx.ENSURE().getText}$ls$stmt" + } + + override def visitCaseWithExpression(ctx: RubyParser.CaseWithExpressionContext): String = { + val outputSb = new StringBuilder(ctx.CASE.getText) + + val expression = Option(ctx.expressionOrCommand).map(visit) + if expression.isDefined then outputSb.append(s" ${expression.get}") + + val whenClauses = Option(ctx.whenClause().asScala).fold(List())(_.map(visit)) + if whenClauses.nonEmpty then outputSb.append(s"$ls${whenClauses.mkString}") + + val elseClause = Option(ctx.elseClause()).map(visit) + if elseClause.isDefined then outputSb.append(s"${elseClause.get}$ls") + + outputSb.append(s"${ctx.END.getText}").toString + } + + override def visitCaseWithoutExpression(ctx: RubyParser.CaseWithoutExpressionContext): String = { + val whenClauses = Option(ctx.whenClause().asScala).fold(List())(_.map(visit)).mkString(ls) + val elseClause = Option(ctx.elseClause()).map(visit) + + val op = + if Option(ctx.SEMI()).isDefined then ";" + else ls + s"${ctx.CASE().getText}$op$whenClauses$elseClause" + } + + override def visitWhenClause(ctx: RubyParser.WhenClauseContext): String = { + val outputSb = new StringBuilder(ctx.WHEN.getText) + + val whenArgs = ctx.whenArgument() + val matchArgs = + Option(whenArgs.operatorExpressionList()).iterator.flatMap(_.operatorExpression().asScala).map(visit) + val matchSplatArg = Option(whenArgs.splattingArgument()).map(visit) + val thenClause = visit(ctx.thenClause()) + + if matchArgs.nonEmpty then + val matchArgsStr = matchArgs.mkString(",") + outputSb.append(s" $matchArgsStr") + + val matchSplatArgStr = + if matchSplatArg.isDefined then outputSb.append(s", $matchSplatArg") + + if Option(ctx.thenClause().THEN).isDefined then outputSb.append(s" ${ctx.thenClause.THEN.getText}") + if thenClause != "" then outputSb.append(s"$ls$thenClause") + + outputSb.append(ls).toString + } + + override def visitAssociationKey(ctx: RubyParser.AssociationKeyContext): String = { + Option(ctx.operatorExpression()) match { + case Some(ctx) => visit(ctx) + case None => ctx.getText + } + } + + override def visitAliasStatement(ctx: RubyParser.AliasStatementContext): String = { + s"${ctx.ALIAS.getText} ${ctx.oldName.getText} ${ctx.newName.getText}" + } + + override def visitBreakWithoutArguments(ctx: RubyParser.BreakWithoutArgumentsContext): String = { + ctx.BREAK.getText + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/KeywordHandling.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/KeywordHandling.scala new file mode 100644 index 000000000000..6de85ae30c7c --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/KeywordHandling.scala @@ -0,0 +1,76 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.parser.RubyLexer.* + +trait KeywordHandling { this: RubyLexerBase => + + val keywordMap: Map[String, Int] = Map( + "LINE__" -> LINE__, + "ENCODING__" -> ENCODING__, + "FILE__" -> FILE__, + "BEGIN_" -> BEGIN_, + "END_" -> END_, + "ALIAS" -> ALIAS, + "AND" -> AND, + "BEGIN" -> BEGIN, + "BREAK" -> BREAK, + "CASE" -> CASE, + "CLASS" -> CLASS, + "DEF" -> DEF, + "IS_DEFINED" -> IS_DEFINED, + "DO" -> DO, + "ELSE" -> ELSE, + "ELSIF" -> ELSIF, + "END" -> END, + "ENSURE" -> ENSURE, + "FOR" -> FOR, + "FALSE" -> FALSE, + "IF" -> IF, + "IN" -> IN, + "MODULE" -> MODULE, + "NEXT" -> NEXT, + "NIL" -> NIL, + "NOT" -> NOT, + "OR" -> OR, + "REDO" -> REDO, + "RESCUE" -> RESCUE, + "RETRY" -> RETRY, + "RETURN" -> RETURN, + "SELF" -> SELF, + "SUPER" -> SUPER, + "THEN" -> THEN, + "TRUE" -> TRUE, + "UNDEF" -> UNDEF, + "UNLESS" -> UNLESS, + "UNTIL" -> UNTIL, + "WHEN" -> WHEN, + "WHILE" -> WHILE, + "YIELD" -> YIELD + ) + + private def isPreviousTokenColonOrDot: Boolean = { + val previousToken = previousTokenTypeOrEOF() + previousToken == RubyLexer.DOT || previousToken == RubyLexer.COLON || previousToken == RubyLexer.COLON2 + } + + private def isNextTokenColonOrDot: Boolean = { + _input.LA(1) == '.' || _input.LA(1) == ':' + } + + def setKeywordTokenType(): Unit = { + val tokenText = getText + if (tokenText == null) { + return + } + + if ( + isPreviousTokenColonOrDot || (isNextTokenColonOrDot && tokenText.toUpperCase != "SELF") || !keywordMap.contains( + tokenText.toUpperCase + ) + ) { + setType(RubyLexer.LOCAL_VARIABLE_IDENTIFIER) + } else { + keywordMap.get(tokenText.toUpperCase).foreach(setType) + } + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyLexerBase.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyLexerBase.scala index d3aea681c180..e63249d965ba 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyLexerBase.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyLexerBase.scala @@ -10,6 +10,7 @@ abstract class RubyLexerBase(input: CharStream) with RegexLiteralHandling with InterpolationHandling with QuotedLiteralHandling + with KeywordHandling with HereDocHandling { /** The previously (non-WS) emitted token (in DEFAULT_CHANNEL.) */ diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyNodeCreator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyNodeCreator.scala index eff4cd63e8c8..636680a26624 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyNodeCreator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/parser/RubyNodeCreator.scala @@ -1,15 +1,22 @@ package io.joern.rubysrc2cpg.parser -import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.* +import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.{Block, *} import io.joern.rubysrc2cpg.parser.AntlrContextHelpers.* -import io.joern.rubysrc2cpg.parser.RubyParser.{CommandWithDoBlockContext, ConstantVariableReferenceContext} +import io.joern.rubysrc2cpg.parser.RubyParser.{ + CommandWithDoBlockContext, + ConstantVariableReferenceContext, + QuotedExpandedStringArrayLiteralContext, + QuotedExpandedSymbolArrayLiteralContext +} import io.joern.rubysrc2cpg.passes.Defines import io.joern.rubysrc2cpg.passes.Defines.getBuiltInType import io.joern.rubysrc2cpg.utils.FreshNameGenerator import io.joern.x2cpg.Defines as XDefines +import org.antlr.v4.runtime.ParserRuleContext import org.antlr.v4.runtime.tree.{ParseTree, RuleNode} import org.slf4j.LoggerFactory +import scala.annotation.tailrec import scala.jdk.CollectionConverters.* /** Converts an ANTLR Ruby Parse Tree into the intermediate Ruby AST. @@ -23,7 +30,7 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { SimpleIdentifier(None)(span.spanStart(classNameGen.fresh)) } - private def defaultTextSpan(code: String = ""): TextSpan = TextSpan(None, None, None, None, code) + private def defaultTextSpan(code: String = ""): TextSpan = TextSpan(None, None, None, None, None, code) override def defaultResult(): RubyNode = Unknown()(defaultTextSpan()) @@ -42,6 +49,10 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { StatementList(ctx.getStatements.map(visit))(ctx.toTextSpan) } + override def visitNextWithoutArguments(ctx: RubyParser.NextWithoutArgumentsContext): RubyNode = { + NextExpression()(ctx.toTextSpan) + } + override def visitGroupingStatement(ctx: RubyParser.GroupingStatementContext): RubyNode = { // When there's only 1 statement, we can use it directly, instead of wrapping it in a StatementList. val statements = ctx.compoundStatement().getStatements.map(visit) @@ -160,6 +171,10 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { ReturnExpression(expressions)(ctx.toTextSpan) } + override def visitReturnWithoutArguments(ctx: RubyParser.ReturnWithoutArgumentsContext): RubyNode = { + ReturnExpression(Nil)(ctx.toTextSpan) + } + override def visitNumericLiteral(ctx: RubyParser.NumericLiteralContext): RubyNode = { if (ctx.hasSign) { UnaryExpression(ctx.sign.getText, visit(ctx.unsignedNumericLiteral()))(ctx.toTextSpan) @@ -202,21 +217,13 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { override def visitPrimaryOperatorExpression(ctx: RubyParser.PrimaryOperatorExpressionContext): RubyNode = { super.visitPrimaryOperatorExpression(ctx) match { - case x: BinaryExpression if x.lhs.text.endsWith("=") && x.op == "*" => + case expr @ BinaryExpression(SimpleCall(lhs: SimpleIdentifier, Nil), "*", rhs) if lhs.text.endsWith("=") => // fixme: This workaround handles a parser ambiguity with method identifiers having `=` and assignments with // splatting on the RHS. The Ruby parser gives precedence to assignments over methods called with this suffix - // however - val newLhs = x.lhs match { - case call: SimpleCall => SimpleIdentifier(None)(call.span.spanStart(call.span.text.stripSuffix("="))) - case y => - logger.warn(s"Unhandled class in repacking of primary operator expression ${y.getClass}") - y - } - val newRhs = { - val oldRhsSpan = x.rhs.span - SplattingRubyNode(x.rhs)(oldRhsSpan.spanStart(s"*${oldRhsSpan.text}")) - } - SingleAssignment(newLhs, "=", newRhs)(x.span) + // however. See https://github.com/joernio/joern/issues/4775 + val newLhs = SimpleIdentifier(None)(lhs.span.spanStart(lhs.span.text.stripSuffix("="))) + val newRhs = SplattingRubyNode(rhs)(rhs.span.spanStart(s"*${rhs.span.text}")) + SingleAssignment(newLhs, "=", newRhs)(expr.span) case x => x } } @@ -341,6 +348,17 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { StaticLiteral(getBuiltInType(Defines.String))(ctx.toTextSpan) } + override def visitQuotedExpandedStringArrayLiteral( + ctx: RubyParser.QuotedExpandedStringArrayLiteralContext + ): RubyNode = { + val elements = + if Option(ctx.quotedExpandedArrayElementList()).isDefined then + ctx.quotedExpandedArrayElementList().elements.map(visit) + else List.empty + + ArrayLiteral(elements)(ctx.toTextSpan) + } + override def visitDoubleQuotedStringExpression(ctx: RubyParser.DoubleQuotedStringExpressionContext): RubyNode = { if (!ctx.isInterpolated) { StaticLiteral(getBuiltInType(Defines.String))(ctx.toTextSpan) @@ -383,6 +401,17 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } } + override def visitQuotedExpandedExternalCommandLiteral( + ctx: RubyParser.QuotedExpandedExternalCommandLiteralContext + ): RubyNode = { + val commandLiteral = + if ctx.quotedExpandedLiteralStringContent.asScala.nonEmpty then + StaticLiteral(Defines.String)(ctx.quotedExpandedLiteralStringContent.asScala.toList.map(_.toTextSpan).head) + else StaticLiteral(Defines.String)(ctx.toTextSpan.spanStart()) + + SimpleCall(SimpleIdentifier()(ctx.toTextSpan.spanStart("exec")), List(commandLiteral))(ctx.toTextSpan) + } + override def visitCurlyBracesBlock(ctx: RubyParser.CurlyBracesBlockContext): RubyNode = { val parameters = Option(ctx.blockParameter()).fold(List())(_.parameters).map(visit) val body = visit(ctx.compoundStatement()) @@ -540,7 +569,11 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { override def visitSimpleCommand(ctx: RubyParser.SimpleCommandContext): RubyNode = { if (Option(ctx.commandArgument()).map(_.getText).exists(_.startsWith("::"))) { val memberName = ctx.commandArgument().getText.stripPrefix("::") - MemberAccess(visit(ctx.methodIdentifier()), "::", memberName)(ctx.toTextSpan) + if (memberName.headOption.exists(_.isUpper)) { // Constant accesses are upper-case 1st letter + MemberAccess(visit(ctx.methodIdentifier()), "::", memberName)(ctx.toTextSpan) + } else { + MemberCall(visit(ctx.methodIdentifier()), "::", memberName, Nil)(ctx.toTextSpan) + } } else if (!ctx.methodIdentifier().isAttrDeclaration) { val identifierCtx = ctx.methodIdentifier() val arguments = ctx.commandArgument().arguments.map(visit) @@ -570,6 +603,26 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } } + override def visitSuperWithParentheses(ctx: RubyParser.SuperWithParenthesesContext): RubyNode = { + val block = Option(ctx.block()).map(visit) + val arguments = Option(ctx.argumentWithParentheses()).map(_.arguments.map(visit)).getOrElse(Nil) + visitSuperCall(ctx, arguments, block) + } + + override def visitSuperWithoutParentheses(ctx: RubyParser.SuperWithoutParenthesesContext): RubyNode = { + val block = Option(ctx.block()).map(visit) + val arguments = Option(ctx.argumentList()).map(_.elements.map(visit)).getOrElse(Nil) + visitSuperCall(ctx, arguments, block) + } + + private def visitSuperCall(ctx: ParserRuleContext, arguments: List[RubyNode], block: Option[RubyNode]): RubyNode = { + val callName = SimpleIdentifier()(ctx.toTextSpan.spanStart("super")) + block match { + case Some(body) => SimpleCallWithBlock(callName, arguments, body.asInstanceOf[Block])(ctx.toTextSpan) + case None => SimpleCall(callName, arguments)(ctx.toTextSpan) + } + } + override def visitIsDefinedExpression(ctx: RubyParser.IsDefinedExpressionContext): RubyNode = { SimpleCall(visit(ctx.isDefinedKeyword), visit(ctx.expressionOrCommand()) :: Nil)(ctx.toTextSpan) } @@ -607,7 +660,7 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { override def visitLambdaExpression(ctx: RubyParser.LambdaExpressionContext): RubyNode = { val parameters = Option(ctx.parameterList()).fold(List())(_.parameters).map(visit) - val body = visit(ctx.block()) + val body = visit(ctx.block()).asInstanceOf[Block] ProcOrLambdaExpr(Block(parameters, body)(ctx.toTextSpan))(ctx.toTextSpan) } @@ -637,6 +690,13 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { YieldExpr(arguments)(ctx.toTextSpan) } + override def visitMemberAccessCommand(ctx: RubyParser.MemberAccessCommandContext): RubyNode = { + val arg = visit(ctx.commandArgument()) + val methodName = visit(ctx.methodName()) + val base = visit(ctx.primary()) + MemberCall(base, ".", methodName.text, List(arg))(ctx.toTextSpan) + } + override def visitConstantIdentifierVariable(ctx: RubyParser.ConstantIdentifierVariableContext): RubyNode = { SimpleIdentifier()(ctx.toTextSpan) } @@ -692,9 +752,10 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { override def visitMemberAccessExpression(ctx: RubyParser.MemberAccessExpressionContext): RubyNode = { val hasArguments = Option(ctx.argumentWithParentheses()).isDefined val hasBlock = Option(ctx.block()).isDefined - val isClassDecl = Option(ctx.primaryValue()).map(_.getText).contains("Class") && Option(ctx.methodName()) - .map(_.getText) - .contains("new") + val isClassDecl = + Option(ctx.primaryValue()).map(_.getText).contains("Class") && Option(ctx.methodName()) + .map(_.getText) + .contains("new") val methodName = ctx.methodName().getText if (!hasBlock) { @@ -707,7 +768,13 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } } else { if (!hasArguments) { - return MemberAccess(target, ctx.op.getText, methodName)(ctx.toTextSpan) + if (methodName.headOption.exists(_.isUpper)) { + // This would be a symbol-like member + return MemberAccess(target, ctx.op.getText, methodName)(ctx.toTextSpan) + } else { + // Approximate this as a field-load + return MemberAccess(target, ctx.op.getText, methodName)(ctx.toTextSpan) + } } else { return MemberCall(target, ctx.op.getText, methodName, ctx.argumentWithParentheses().arguments.map(visit))( ctx.toTextSpan @@ -758,6 +825,26 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { )(ctx.toTextSpan) } + override def visitBracketAssignmentExpression(ctx: RubyParser.BracketAssignmentExpressionContext): RubyNode = { + val op = ctx.assignmentOperator().getText + + if (op != "=") { + logger.warn(s"Unsupported assignment operator for bracket assignment expression: $op") + defaultResult() + } + + val lhsBase = visit(ctx.primaryValue()) + val lhsArgs = Option(ctx.indexingArgumentList()).map(_.arguments).getOrElse(List()).map(visit) + + val lhs = IndexAccess(lhsBase, lhsArgs)( + ctx.toTextSpan.spanStart(s"${lhsBase.span.text}[${lhsArgs.map(_.span.text).mkString(", ")}]") + ) + + val rhs = visit(ctx.operatorExpression()) + + SingleAssignment(lhs, op, rhs)(ctx.toTextSpan) + } + override def visitBracketedArrayLiteral(ctx: RubyParser.BracketedArrayLiteralContext): RubyNode = { ArrayLiteral(Option(ctx.indexingArgumentList()).map(_.arguments).getOrElse(List()).map(visit))(ctx.toTextSpan) } @@ -782,6 +869,45 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { ArrayLiteral(elements)(ctx.toTextSpan) } + override def visitQuotedExpandedSymbolArrayLiteral( + ctx: RubyParser.QuotedExpandedSymbolArrayLiteralContext + ): RubyNode = { + if (Option(ctx.quotedExpandedArrayElementList).isDefined) { + ArrayLiteral(ctx.quotedExpandedArrayElementList().elements.map(visit))(ctx.toTextSpan) + } else { + ArrayLiteral(List())(ctx.toTextSpan) + } + } + + override def visitQuotedExpandedArrayElement(ctx: RubyParser.QuotedExpandedArrayElementContext): RubyNode = { + val literalType = findParent(ctx) match { + case Some(parentCtx) => + parentCtx match + case x: QuotedExpandedStringArrayLiteralContext => Defines.String + case x: QuotedExpandedSymbolArrayLiteralContext => Defines.Symbol + case _ => logger.warn("Cannot determine type, defaulting to String"); Defines.String + case _ => logger.warn("Cannot determine type, defaulting to String"); Defines.String + } + + if (ctx.hasInterpolation) { + DynamicLiteral(literalType, ctx.interpolations.map(visit))(ctx.toTextSpan) + } else { + StaticLiteral(literalType)(ctx.toTextSpan) + } + } + + @tailrec + private def findParent(ctx: ParserRuleContext): Option[ParserRuleContext] = { + ctx match { + case x: QuotedExpandedSymbolArrayLiteralContext => Option(ctx) + case x: QuotedExpandedStringArrayLiteralContext => Option(ctx) + case null => Option(ctx) + case _ => + if ctx.parent != null then findParent(ctx.parent.asInstanceOf[ParserRuleContext]) + else None + } + } + override def visitRangeExpression(ctx: RubyParser.RangeExpressionContext): RubyNode = { RangeExpression( visit(ctx.primaryValue(0)), @@ -798,7 +924,7 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { HashLiteral(Option(ctx.associationList()).map(_.associations).getOrElse(List()).map(visit))(ctx.toTextSpan) } - override def visitAssociation(ctx: RubyParser.AssociationContext): RubyNode = { + override def visitAssociationElement(ctx: RubyParser.AssociationElementContext): RubyNode = { ctx.associationKey().getText match { case "if" => Association(SimpleIdentifier()(ctx.toTextSpan.spanStart("if")), visit(ctx.operatorExpression()))(ctx.toTextSpan) @@ -807,16 +933,56 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } } + override def visitAssociationHashArgument(ctx: RubyParser.AssociationHashArgumentContext): RubyNode = { + val identifierName = Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText) + + identifierName match { + case Some(identName) => + SplattingRubyNode(SimpleIdentifier()(ctx.toTextSpan.spanStart(identName)))(ctx.toTextSpan) + case None => + if ctx.LPAREN() == null then SplattingRubyNode(visit(ctx.methodCallsWithParentheses()))(ctx.toTextSpan) + else SplattingRubyNode(visit(ctx.methodInvocationWithoutParentheses()))(ctx.toTextSpan) + } + } + override def visitModuleDefinition(ctx: RubyParser.ModuleDefinitionContext): RubyNode = { - ModuleDeclaration(visit(ctx.classPath()), visit(ctx.bodyStatement()))(ctx.toTextSpan) + val (nonFieldStmts, fields) = genInitFieldStmts(ctx.bodyStatement()) + + val moduleName = visit(ctx.classPath()) + val memberCall = createBodyMemberCall(moduleName.span.text, ctx.toTextSpan) + + ModuleDeclaration(visit(ctx.classPath()), nonFieldStmts, fields, Option(memberCall))(ctx.toTextSpan) } override def visitSingletonClassDefinition(ctx: RubyParser.SingletonClassDefinitionContext): RubyNode = { - SingletonClassDeclaration( - freshClassName(ctx.toTextSpan), - Option(ctx.commandOrPrimaryValueClass()).map(visit), - visit(ctx.bodyStatement()) - )(ctx.toTextSpan) + val baseClass = Option(ctx.commandOrPrimaryValueClass()).map(visit) + val body = visit(ctx.bodyStatement()).asInstanceOf[StatementList] + + baseClass match { + case Some(baseClass) => + baseClass match { + case x: SelfIdentifier => + SingletonClassDeclaration(freshClassName(ctx.toTextSpan), Option(baseClass), body)(ctx.toTextSpan) + case x => + val stmts = body.statements.map { + case x: MethodDeclaration => + val memberAccess = + MemberAccess(baseClass, ".", x.methodName)( + x.span.spanStart(s"${baseClass.span.text}.${x.methodName}") + ) + val singletonBlockMethod = + SingletonObjectMethodDeclaration(x.methodName, x.parameters, x.body, baseClass)(x.span) + SingleAssignment(memberAccess, "=", singletonBlockMethod)( + ctx.toTextSpan.spanStart(s"${memberAccess.span.text} = ${x.span.text}") + ) + case x => x + } + + SingletonStatementList(stmts)(ctx.toTextSpan) + } + case None => + SingletonClassDeclaration(freshClassName(ctx.toTextSpan), baseClass, body)(ctx.toTextSpan) + } } private def findFieldsInMethodDecls(methodDecls: List[MethodDeclaration]): List[RubyNode & RubyFieldIdentifier] = { @@ -836,7 +1002,7 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } } - private def genInitFieldStmts( + def genInitFieldStmts( ctxBodyStatement: RubyParser.BodyStatementContext ): (RubyNode, List[RubyNode & RubyFieldIdentifier]) = { val loweredClassDecls = lowerSingletonClassDeclarations(ctxBodyStatement) @@ -865,10 +1031,23 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { loweredClassDecls match { case stmtList: StatementList => - val (rubyFieldIdentifiers, rest) = stmtList.statements.partition { + val (rubyFieldIdentifiers, otherStructures) = stmtList.statements.partition { case x: (RubyNode & RubyFieldIdentifier) => true case _ => false } + val (fieldAssignments, rest) = otherStructures + .map { + case x @ SingleAssignment(lhs: SimpleIdentifier, op, rhs) => + SingleAssignment(ClassFieldIdentifier()(lhs.span), op, rhs)(x.span) + case x @ SingleAssignment(lhs: RubyFieldIdentifier, op, rhs) => + // Perhaps non-intuitive, but @ fields assigned under a type belong to the singleton class + SingleAssignment(ClassFieldIdentifier()(lhs.span), op, rhs)(x.span) + case x => x + } + .partition { + case x: SingleAssignment => true + case _ => false + } val (instanceFields, classFields) = partitionRubyFields(rubyFieldIdentifiers) @@ -880,42 +1059,28 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { val (instanceFieldsInMethodDecls, classFieldsInMethodDecls) = partitionRubyFields(fieldsInMethodDecls) - val initializeMethod = methodDecls.collectFirst { x => - x.methodName match - case "initialize" => x - } + val initializeMethod = methodDecls.collectFirst { case x if x.methodName == Defines.Initialize => x } val initStmtListStatements = genSingleAssignmentStmtList(instanceFields, instanceFieldsInMethodDecls) - val clinitStmtList = genSingleAssignmentStmtList(classFields, classFieldsInMethodDecls) + val clinitStmtList = genSingleAssignmentStmtList(classFields, classFieldsInMethodDecls) ++ fieldAssignments - val clinitMethod = - MethodDeclaration(XDefines.StaticInitMethodName, List.empty, StatementList(clinitStmtList)(stmtList.span))( + val bodyMethodStmtList = + StatementList(initStmtListStatements ++ clinitStmtList)( stmtList.span + .spanStart(initStmtListStatements.map(_.span.text).concat(clinitStmtList.map(_.span.text)).mkString("\n")) ) - val updatedStmtList = initializeMethod match { - case Some(initMethod) => - initMethod.body match { - // TODO: Filter out instance fields that are assigned an initial value in the constructor method. Current - // implementation leads to "double" assignment happening when the instance field is assigned a value - // where you end up having - // = nil; = ...; - case stmtList: StatementList => - val initializers = initStmtListStatements :+ clinitMethod - StatementList(initializers ++ rest)(stmtList.span) - case x => x - } - case None => - val newInitMethod = - MethodDeclaration("initialize", List.empty, StatementList(initStmtListStatements)(stmtList.span))( - stmtList.span - ) - val initializers = newInitMethod :: clinitMethod :: Nil - StatementList(initializers ++ rest)(stmtList.span) - } - val combinedFields = rubyFieldIdentifiers ++ fieldsInMethodDecls + val bodyMethod = MethodDeclaration(Defines.TypeDeclBody, List.empty, bodyMethodStmtList)( + stmtList.span.spanStart(s"def \n${bodyMethodStmtList.span.text}\nend") + ) - (updatedStmtList, combinedFields.asInstanceOf[List[RubyNode & RubyFieldIdentifier]]) + val combinedFields = rubyFieldIdentifiers ++ fieldsInMethodDecls ++ + fieldAssignments.collect { case SingleAssignment(lhs: RubyFieldIdentifier, _, _) => lhs } + + ( + StatementList(bodyMethod +: rest)(bodyMethod.span), + combinedFields.asInstanceOf[List[RubyNode & RubyFieldIdentifier]] + ) case decls => (decls, List.empty) } } @@ -926,7 +1091,7 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { * @return * the class body as a statement list. */ - private def lowerAliasStatementsToMethods(classBody: RubyNode): StatementList = { + def lowerAliasStatementsToMethods(classBody: RubyNode): StatementList = { val classBodyStmts = classBody match { case StatementList(stmts) => stmts @@ -976,10 +1141,10 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { * - `initialize` MethodDeclaration with all non-allowed children nodes added * - list of all nodes allowed directly under type decl */ - private def filterNonAllowedTypeDeclChildren(stmts: StatementList): (RubyNode, List[RubyNode]) = { + def filterNonAllowedTypeDeclChildren(stmts: StatementList): RubyNode = { val (initMethod, nonInitStmts) = stmts.statements.partition { - case x: MethodDeclaration if x.methodName == "initialize" => true - case _ => false + case x: MethodDeclaration if x.methodName == Defines.Initialize => true + case _ => false } val (allowedTypeDeclChildren, nonAllowedTypeDeclChildren) = nonInitStmts.partition { @@ -987,19 +1152,31 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { case _ => false } - val initMethodDecl = initMethod.headOption match { - case Some(initMethodOpt) => - val castInitMethod = initMethodOpt.asInstanceOf[MethodDeclaration] - val updatedMethodBody = StatementList( - castInitMethod.body.asStatementList.statements ++ nonAllowedTypeDeclChildren - )(castInitMethod.body.span) - MethodDeclaration("initialize", List.empty, updatedMethodBody)(castInitMethod.span) - case None => - logger.warn("Could not find initialize method") - defaultResult() + val (bodyMethod, otherTypeDeclChildren) = allowedTypeDeclChildren.partition { + case x: MethodDeclaration if x.methodName == Defines.TypeDeclBody => true + case _ => false } - (initMethodDecl, allowedTypeDeclChildren) + val updatedBodyMethod = bodyMethod + .asInstanceOf[List[MethodDeclaration]] + .map { x => + val methodDeclStmts = + StatementList(x.body.asInstanceOf[StatementList].statements ++ nonAllowedTypeDeclChildren)( + x.span.spanStart(s"${x.body.span.text}${nonAllowedTypeDeclChildren.map(_.span.text).mkString("\n")}") + ) + + MethodDeclaration(x.methodName, x.parameters, methodDeclStmts)( + x.span.spanStart(s"def \n${methodDeclStmts.span.text}\nend") + ) + } + + val otherTypeDeclChildrenSpan = + if otherTypeDeclChildren.nonEmpty then "\n" + otherTypeDeclChildren.map(_.span.text).mkString("\n") + else "" + + StatementList(initMethod ++ otherTypeDeclChildren ++ updatedBodyMethod)( + stmts.span.spanStart(updatedBodyMethod.headOption.map(x => x.span.text).getOrElse("") + otherTypeDeclChildrenSpan) + ) } override def visitClassDefinition(ctx: RubyParser.ClassDefinitionContext): RubyNode = { @@ -1007,16 +1184,29 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { val stmts = lowerAliasStatementsToMethods(nonFieldStmts) - val (initMethodDecl, allowedTypeDeclChildren) = filterNonAllowedTypeDeclChildren(stmts) + val classBody = filterNonAllowedTypeDeclChildren(stmts) + val className = visit(ctx.classPath()) + + val memberCall = createBodyMemberCall(className.span.text, ctx.toTextSpan) ClassDeclaration( visit(ctx.classPath()), Option(ctx.commandOrPrimaryValueClass()).map(visit), - StatementList(initMethodDecl +: allowedTypeDeclChildren)(stmts.span), - fields + classBody, + fields, + Option(memberCall) )(ctx.toTextSpan) } + private def createBodyMemberCall(name: String, textSpan: TextSpan): TypeDeclBodyCall = { + TypeDeclBodyCall( + MemberAccess(SelfIdentifier()(textSpan.spanStart(Defines.Self)), "::", name)( + textSpan.spanStart(s"${Defines.Self}::$name") + ), + name + )(textSpan.spanStart(s"${Defines.Self}::$name::${Defines.TypeDeclBody}")) + } + /** Lowers all MethodDeclaration found in SingletonClassDeclaration to SingletonMethodDeclaration. * @param ctx * body context from class definitions @@ -1050,11 +1240,13 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } override def visitMethodDefinition(ctx: RubyParser.MethodDefinitionContext): RubyNode = { - MethodDeclaration( - ctx.definedMethodName().getText, - Option(ctx.methodParameterPart().parameterList()).fold(List())(_.parameters).map(visit), - visit(ctx.bodyStatement()) - )(ctx.toTextSpan) + val params = + Option(ctx.methodParameterPart().parameterList()) + .fold(List())(_.parameters) + .map(visit) + .sortBy(x => (x.span.line, x.span.column)) + + MethodDeclaration(ctx.definedMethodName().getText, params, visit(ctx.bodyStatement()))(ctx.toTextSpan) } override def visitEndlessMethodDefinition(ctx: RubyParser.EndlessMethodDefinitionContext): RubyNode = { @@ -1085,7 +1277,8 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } override def visitHashParameter(ctx: RubyParser.HashParameterContext): RubyNode = { - HashParameter(Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText).getOrElse(ctx.getText))(ctx.toTextSpan) + val identifierName = Option(ctx.LOCAL_VARIABLE_IDENTIFIER()).map(_.getText).getOrElse(ctx.getText) + HashParameter(identifierName)(ctx.toTextSpan) } override def visitArrayParameter(ctx: RubyParser.ArrayParameterContext): RubyNode = { @@ -1165,10 +1358,10 @@ class RubyNodeCreator extends RubyParserBaseVisitor[RubyNode] { } override def visitAssociationKey(ctx: RubyParser.AssociationKeyContext): RubyNode = { - if (Option(ctx.operatorExpression()).isDefined) { - visit(ctx.operatorExpression()) - } else { - SimpleIdentifier()(ctx.toTextSpan) + Option(ctx.operatorExpression()) match { + case Some(ctx) if ctx.isKeyword => SimpleIdentifier()(ctx.toTextSpan) + case Some(ctx) => visit(ctx) + case None => SimpleIdentifier()(ctx.toTextSpan) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/AstCreationPass.scala index 2bff6986b47c..8e43529dc25e 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/AstCreationPass.scala @@ -1,15 +1,15 @@ package io.joern.rubysrc2cpg.passes +import flatgraph.DiffGraphApplier import io.joern.rubysrc2cpg.astcreation.AstCreator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate -class AstCreationPass(cpg: Cpg, astCreators: List[AstCreator]) extends ConcurrentWriterCpgPass[AstCreator](cpg) { +class AstCreationPass(cpg: Cpg, astCreators: List[AstCreator]) extends ForkJoinParallelCpgPass[AstCreator](cpg) { private val logger = LoggerFactory.getLogger(getClass) @@ -18,7 +18,7 @@ class AstCreationPass(cpg: Cpg, astCreators: List[AstCreator]) extends Concurren override def init(): Unit = { // The first entry will be the type, which is often found on fieldAccess nodes // (which may be receivers to calls) - val diffGraph = new DiffGraphBuilder + val diffGraph = Cpg.newDiffGraphBuilder val emptyType = NewTypeDecl() .astParentType(NodeTypes.NAMESPACE_BLOCK) @@ -32,7 +32,7 @@ class AstCreationPass(cpg: Cpg, astCreators: List[AstCreator]) extends Concurren .astParentFullName(NamespaceTraversal.globalNamespaceName) .isExternal(true) diffGraph.addNode(emptyType).addNode(anyType) - BatchedUpdate.applyDiff(cpg.graph, diffGraph) + DiffGraphApplier.applyDiff(cpg.graph, diffGraph) } override def runOnPart(diffGraph: DiffGraphBuilder, astCreator: AstCreator): Unit = { diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ConfigFileCreationPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ConfigFileCreationPass.scala index c439883561d5..9a1f5b4987ff 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ConfigFileCreationPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ConfigFileCreationPass.scala @@ -2,7 +2,7 @@ package io.joern.rubysrc2cpg.passes import better.files.File import io.joern.x2cpg.passes.frontend.XConfigFileCreationPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import scala.util.Try diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/Defines.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/Defines.scala index 81dff11e9f82..030c86508d96 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/Defines.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/Defines.scala @@ -1,37 +1,36 @@ package io.joern.rubysrc2cpg.passes -import io.joern.rubysrc2cpg.astcreation.GlobalTypes - object Defines { - val Any: String = "ANY" - val Undefined: String = "Undefined" - val Object: String = "Object" - val NilClass: String = "NilClass" - val TrueClass: String = "TrueClass" - val FalseClass: String = "FalseClass" - val Numeric: String = "Numeric" - val Integer: String = "Integer" - val Float: String = "Float" - val String: String = "String" - val Symbol: String = "Symbol" - val Array: String = "Array" - val Hash: String = "Hash" - val Encoding: String = "Encoding" - val Regexp: String = "Regexp" - val Lambda: String = "lambda" - val Proc: String = "proc" - val This: String = "this" - val Loop: String = "loop" - val Self: String = "self" - - val Program: String = ":program" + val Any: String = "ANY" + val Undefined: String = "Undefined" + val Object: String = "Object" + val NilClass: String = "NilClass" + val TrueClass: String = "TrueClass" + val FalseClass: String = "FalseClass" + val Numeric: String = "Numeric" + val Integer: String = "Integer" + val Float: String = "Float" + val String: String = "String" + val Symbol: String = "Symbol" + val Array: String = "Array" + val Hash: String = "Hash" + val Encoding: String = "Encoding" + val Regexp: String = "Regexp" + val Lambda: String = "lambda" + val Proc: String = "proc" + val Loop: String = "loop" + val Self: String = "self" + val Initialize: String = "initialize" + val TypeDeclBody: String = "" + + val Main: String = "
" val Resolver: String = "" val AnonymousProcParameter = "" - def getBuiltInType(typeInString: String) = s"${GlobalTypes.builtinPrefix}.$typeInString" + def getBuiltInType(typeInString: String) = s"${GlobalTypes.kernelPrefix}.$typeInString" object RubyOperators { val hashInitializer = ".hashInitializer" @@ -41,3 +40,237 @@ object Defines { val regexpNotMatch = "!~" } } + +object GlobalTypes { + val Kernel = "Kernel" + val builtinPrefix = "__core" + val kernelPrefix = s"$builtinPrefix.$Kernel" + + /** Source: https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/function.html + */ + val bundledClasses: Set[String] = Set( + "ARGF", + "ArgumentError", + "Array", + "BasicObject", + "Binding", + "Class", + "ClosedQueueError", + "Comparable", + "Complex", + "ConditionVariable", + "Continuation", + "Dir", + "ENV", + "EOFError", + "Encoding", + "Encoding.CompatibilityError", + "Encoding.Converter", + "Encoding.ConverterNotFoundError", + "Encoding.InvalidByteSequenceError", + "Encoding.UndefinedConversionError", + "EncodingError", + "Enumerable", + "Enumerator", + "Enumerator.ArithmeticSequence", + "Enumerator.Chain", + "Enumerator.Generator", + "Enumerator.Lazy", + "Enumerator.Producer", + "Enumerator.Yielder", + "Errno", + "Exception", + "FalseClass", + "Fiber", + "Fiber.SchedulerInterface", + "FiberError", + "File", + "File.Constants", + "File.Stat", + "FileTest", + "Float", + "FloatDomainError", + "FrozenError", + "GC", + "GC.Profiler", + "Hash", + "IO", + "IO.EAGAINWaitReadable", + "IO.EAGAINWaitWritable", + "IO.EINPROGRESSWaitReadable", + "IO.EINPROGRESSWaitWritable", + "IO.EWOULDBLOCKWaitReadable", + "IO.EWOULDBLOCKWaitWritable", + "IO.WaitReadable", + "IO.WaitWritable", + "IOError", + "IndexError", + "Integer", + "Interrupt", + Kernel, + "KeyError", + "LoadError", + "LocalJumpError", + "Marshal", + "MatchData", + "Math", + "Math.DomainError", + "Method", + "Module", + "Mutex", + "NameError", + "NilClass", + "NoMatchingPatternError", + "NoMemoryError", + "NoMethodError", + "NotImplementedError", + "Numeric", + "Object", + "ObjectSpace", + "ObjectSpace.WeakMap", + "Pool", + "Proc", + "Process", + "Process.GID", + "Process.Status", + "Process.Sys", + "Process.UID", + "Queue", + "Ractor", + "Ractor.ClosedError", + "Ractor.Error", + "Ractor.IsolationError", + "Ractor.MovedError", + "Ractor.MovedObject", + "Ractor.RemoteError", + "Ractor.UnsafeError", + "Random", + "Random.Formatter", + "Range", + "RangeError", + "Rational", + "Regexp", + "RegexpError", + "Ripper", + "RubyVM", + "RubyVM.AbstractSyntaxTree", + "RubyVM.AbstractSyntaxTree.Node", + "RubyVM.InstructionSequence", + "RubyVM.MJIT", + "RuntimeError", + "ScriptError", + "SecurityError", + "Signal", + "SignalException", + "SizedQueue", + "StandardError", + "StopIteration", + "String", + "Struct", + "Symbol", + "SyntaxError", + "SystemCallError", + "SystemExit", + "SystemStackError", + "Thread", + "Thread.Backtrace", + "Thread.Backtrace.Location", + "ThreadError", + "ThreadGroup", + "Time", + "TracePoint", + "TrueClass", + "TypeError", + "UnboundMethod", + "UncaughtThrowError", + "UnicodeNormalize", + "Warning", + "ZeroDivisionError", + "fatal", + "unknown" + ) + + /* Source: https://ruby-doc.org/3.2.2/Kernel.html + * + * We comment-out methods that require an explicit "receiver" (target of member access.) + */ + val kernelFunctions: Set[String] = Set( + "Array", + "Complex", + "Float", + "Hash", + "Integer", + "Rational", + "String", + "__callee__", + "__dir__", + "__method__", + "abort", + "at_exit", + "autoload", + "autoload?", + "binding", + "block_given?", + "callcc", + "caller", + "caller_locations", + "catch", + "chomp", + "chomp!", + "chop", + "chop!", + // "class", + // "clone", + "eval", + "exec", + "exit", + "exit!", + "fail", + "fork", + "format", + // "frozen?", + "gets", + "global_variables", + "gsub", + "gsub!", + "iterator?", + "lambda", + "load", + "local_variables", + "loop", + "open", + "p", + "print", + "printf", + "proc", + "putc", + "puts", + "raise", + "rand", + "readline", + "readlines", + "require", + "require_all", + "require_relative", + "select", + "set_trace_func", + "sleep", + "spawn", + "sprintf", + "srand", + "sub", + "sub!", + "syscall", + "system", + "tap", + "test", + // "then", + "throw", + "trace_var", + // "trap", + "untrace_var", + "warn" + // "yield_self", + ) + +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencyPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencyPass.scala index 8ea80e56c39a..9413191ec7c6 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencyPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencyPass.scala @@ -1,6 +1,6 @@ package io.joern.rubysrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{ConfigFile, NewDependency} import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencySummarySolverPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencySummarySolverPass.scala new file mode 100644 index 000000000000..f5bb6e11e890 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/DependencySummarySolverPass.scala @@ -0,0 +1,41 @@ +package io.joern.rubysrc2cpg.passes; + +import io.joern.rubysrc2cpg.datastructures.RubyProgramSummary +import io.joern.x2cpg.passes.base.{MethodStubCreator, TypeDeclStubCreator} +import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.Dependency +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* +import io.joern.x2cpg.Defines +import io.joern.rubysrc2cpg.passes.Defines as RDefines +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, NodeTypes} + +class DependencySummarySolverPass(cpg: Cpg, dependencySummary: RubyProgramSummary) + extends ForkJoinParallelCpgPass[Dependency](cpg) { + override def generateParts(): Array[Dependency] = cpg.dependency.toArray + override def runOnPart(diffGraph: DiffGraphBuilder, dependency: Dependency): Unit = { + dependencySummary.namespaceToType.filter(_._1.startsWith(dependency.name)).flatMap(_._2).foreach { x => + val typeDeclName = + if x.name.endsWith(RDefines.Main) then RDefines.Main + else x.name.split("[.]").lastOption.getOrElse(Defines.Unknown) + + val dependencyTypeDecl = TypeDeclStubCreator + .createTypeDeclStub(name = typeDeclName, fullName = x.name, fileName = s"${dependency.name}.rb") + + diffGraph.addNode(dependencyTypeDecl) + + x.methods.foreach { x => + MethodStubCreator.createMethodStub( + name = x.name.split("[:]").lastOption.getOrElse(Defines.Unknown), + fullName = x.name, + signature = "", + dispatchType = DispatchTypes.DYNAMIC_DISPATCH, + parameterCount = 1, + dstGraph = diffGraph, + astParentType = NodeTypes.TYPE_DECL, + astParentFullName = dependencyTypeDecl.fullName + ) + } + } + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImplicitRequirePass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImplicitRequirePass.scala index cb78620ebe4e..a4de875aa2b5 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImplicitRequirePass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImplicitRequirePass.scala @@ -5,8 +5,10 @@ import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{Cpg, DispatchTypes, EdgeTypes, Operators} import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import org.apache.commons.text.CaseUtils +import java.util.regex.Pattern import scala.collection.mutable /** In some Ruby frameworks, it is common to have an autoloader library that implicitly loads requirements onto the @@ -40,34 +42,51 @@ class ImplicitRequirePass(cpg: Cpg, programSummary: RubyProgramSummary) extends /** Collects methods within a module. */ private def findMethodsViaAstChildren(module: Method): Iterator[Method] = { - Iterator(module) ++ module.astChildren.flatMap { - case x: TypeDecl => x.method.flatMap(findMethodsViaAstChildren) - case x: Method => Iterator(x) ++ x.astChildren.collectAll[Method].flatMap(findMethodsViaAstChildren) - case _ => Iterator.empty - } + // TODO For now we have to go via the full name regex because the AST is not yet linked + // at the execution time of this pass. + // Iterator(module) ++ module.astChildren.flatMap { + // case x: TypeDecl => x.method.flatMap(findMethodsViaAstChildren) + // case x: Method => Iterator(x) ++ x.astChildren.collectAll[Method].flatMap(findMethodsViaAstChildren) + // case _ => Iterator.empty + // } + cpg.method.fullName(Pattern.quote(module.fullName) + ".*") } override def runOnPart(builder: DiffGraphBuilder, part: Method): Unit = { - findMethodsViaAstChildren(part).ast.isCall - .flatMap { - case x if x.name == Operators.alloc => - x.argument.isIdentifier - case x => - x.receiver.isIdentifier - } - .map(i => i -> programSummary.matchingTypes(i.name)) - .distinct - .foreach { case (identifier, rubyTypes) => + val identifiersToMatch = mutable.ArrayBuffer.empty[String] + + val typeDecl = cpg.typeDecl.fullName(Pattern.quote(part.fullName) + ".*").l + typeDecl.inheritsFromTypeFullName.foreach(identifiersToMatch.append) + + val methods = findMethodsViaAstChildren(part).toList + val calls = methods.ast.isCall.toList + val identifiers = calls.flatMap { + case x if x.name == Operators.alloc => + // TODO Once constructor invocations are lowered correctly, this case is not needed anymore. + x.argument.isIdentifier.name + case x if x.methodFullName == Operators.fieldAccess && x.argument(1).code == "self" => + x.asInstanceOf[OpNodes.FieldAccess].fieldIdentifier.canonicalName + case x => + Iterator.empty + } + + identifiers.foreach(identifiersToMatch.append) + + identifiers.distinct + .foreach { identifierName => + val rubyTypes = programSummary.matchingTypes(identifierName) val requireCalls = rubyTypes.flatMap { rubyType => typeToPath.get(rubyType.name) match { case Some(path) - if identifier.file.name + if part.file.name .map(_.replace("\\", "/")) .headOption .exists(x => rubyType.name.startsWith(x)) => None // do not add an import to a file that defines the type - case Some(path) => Option(createRequireCall(builder, rubyType, path)) - case None => None + case Some(path) => + Option(createRequireCall(builder, rubyType, path)) + case None => + None } } val startIndex = part.block.astChildren.size @@ -82,7 +101,7 @@ class ImplicitRequirePass(cpg: Cpg, programSummary: RubyProgramSummary) extends val requireCallNode = NewCall() .name(importCallName) .code(s"$importCallName '$path'") - .methodFullName(s"__builtin:$importCallName") + .methodFullName(s"__builtin.$importCallName") .dispatchType(DispatchTypes.DYNAMIC_DISPATCH) .typeFullName(Defines.Any) val receiverIdentifier = diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImportsPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImportsPass.scala index 1722f663146a..8467d44ee88f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImportsPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/ImportsPass.scala @@ -2,7 +2,7 @@ package io.joern.rubysrc2cpg.passes import io.joern.x2cpg.Imports.createImportNodeAndLink import io.joern.x2cpg.X2Cpg.stripQuotes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyImportResolverPass.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyImportResolverPass.scala index e9e2010ba110..25c891175b3e 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyImportResolverPass.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyImportResolverPass.scala @@ -5,7 +5,7 @@ import io.joern.rubysrc2cpg.deprecated.utils.PackageTable import io.joern.x2cpg.Defines as XDefines import io.shiftleft.semanticcpg.language.importresolver.* import io.joern.x2cpg.passes.frontend.XImportResolverPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* import io.joern.rubysrc2cpg.passes.Defines as RDefines @@ -29,7 +29,6 @@ class RubyImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) { } private def resolveEntities(expEntity: String, importCall: Call, fileName: String): Set[EvaluatedImport] = { - // TODO: Currently only working on internal dependencies, will be fixed for external dependencies once the dependency linking is done val expResolvedPath = if (expEntity.contains(".")) getResolvedPath(expEntity, fileName) @@ -43,11 +42,12 @@ class RubyImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) { val filePattern = s"${Pattern.quote(expResolvedPath)}\\.?.*" val resolvedTypeDecls = cpg.typeDecl .where(_.file.name(filePattern)) + .whereNot(_.isModule) .fullName .flatMap(fullName => Seq( ResolvedTypeDecl(fullName), - ResolvedMethod(s"$fullName.${XDefines.ConstructorMethodName}", "new", fullName.split("[.]").lastOption) + ResolvedMethod(s"$fullName.${Defines.Initialize}", "new", fullName.split("[.]").lastOption) ) ) .toSet @@ -61,7 +61,7 @@ class RubyImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) { // Expose methods which are directly present in a file, without any module, TypeDecl val resolvedMethods = cpg.method .where(_.file.name(filePattern)) - .where(_.nameExact(RDefines.Program)) + .where(_.nameExact(RDefines.Main)) .astChildren .astChildren .isMethod diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeHintCallLinker.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeHintCallLinker.scala index 41c941c89d3c..cb48259d2fd8 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeHintCallLinker.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeHintCallLinker.scala @@ -1,12 +1,35 @@ package io.joern.rubysrc2cpg.passes import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes.Call +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.{Call, NewMethod} import io.shiftleft.semanticcpg.language.* +import java.util.regex.Pattern + class RubyTypeHintCallLinker(cpg: Cpg) extends XTypeHintCallLinker(cpg) { override def calls: Iterator[Call] = super.calls.nameNot("^(require).*") + private val fileNamePattern = Pattern.compile("^(.*(.rb)).*$") + + override def createMethodStub(methodName: String, call: Call, builder: DiffGraphBuilder): NewMethod = { + // In the case of Python/JS we can use name info to check if, despite the method name might be incorrect, that we + // label the method correctly as internal by finding that the method should belong to an internal file + val matcher = fileNamePattern.matcher(methodName) + val basePath = cpg.metaData.root.head + val isExternal = if (matcher.matches()) { + val fileName = matcher.group(1) + cpg.file.nameExact(s"$basePath$fileName").isEmpty + } else { + true + } + val name = + if (methodName.contains(pathSep) && methodName.length > methodName.lastIndexOf(pathSep) + 1) + val strippedMethod = methodName.stripPrefix(s"${GlobalTypes.kernelPrefix}.") + if GlobalTypes.kernelFunctions.contains(strippedMethod) then strippedMethod + else methodName.substring(methodName.lastIndexOf(pathSep) + pathSep.length) + else methodName + createMethodStub(name, methodName, call.argumentOut.size, isExternal, builder) + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryPassGenerator.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryPassGenerator.scala index ef422d7c545d..8a49c70bdc97 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryPassGenerator.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryPassGenerator.scala @@ -2,10 +2,12 @@ package io.joern.rubysrc2cpg.passes import io.joern.x2cpg.Defines as XDefines import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.passes.frontend.XTypeRecovery.AllNodeTypesFromNodeExt +import io.shiftleft.codepropertygraph.generated.{Cpg, Operators, PropertyNames} import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.FieldAccess import io.shiftleft.semanticcpg.language.* -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class RubyTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) extends XTypeRecoveryPassGenerator[File](cpg, config) { @@ -38,14 +40,27 @@ private class RecoverForRubyFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder, /** A heuristic method to determine if a call name is a constructor or not. */ override protected def isConstructor(name: String): Boolean = - !name.isBlank && (name == "new" || name == XDefines.ConstructorMethodName) + !name.isBlank && (name == "new" || name == Defines.Initialize) override protected def hasTypes(node: AstNode): Boolean = node match { case x: Call if !x.methodFullName.startsWith("") => - !x.methodFullName.toLowerCase().matches("(|any)") + x.getKnownTypes.nonEmpty case x: Call if x.methodFullName.startsWith("") => x.typeFullName != "" && super.hasTypes(node) - case x => super.hasTypes(node) + case x => + x.getKnownTypes.nonEmpty + } + + override def prepopulateSymbolTableEntry(x: AstNode): Unit = x match { + case x @ (_: Identifier | _: Local | _: MethodParameterIn) => symbolTable.append(x, x.getKnownTypes) + case call: Call => + val tnfs = + if call.methodFullName == XDefines.DynamicCallUnknownFullName || call.methodFullName.startsWith("") + then (call.dynamicTypeHintFullName ++ call.possibleTypes).distinct + else (call.methodFullName +: (call.dynamicTypeHintFullName ++ call.possibleTypes)).distinct + + symbolTable.append(call, tnfs.toSet) + case _ => } override def visitImport(i: Import): Unit = for { @@ -63,4 +78,39 @@ private class RecoverForRubyFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder, override def visitIdentifierAssignedToConstructor(i: Identifier, c: Call): Set[String] = { associateTypes(i, Set(i.typeFullName)) } + + override def storeCallTypeInfo(c: Call, types: Seq[String]): Unit = + if (types.nonEmpty) { + + // Only necessary if we have more than 1 type and want to try and resolve to a single type + val finalTypes = if (types.size > 1 && c.receiver.nonEmpty) { + c.receiver.l.isCall.headOption match { + case Some(recCall) => + if (recCall.methodFullName == Operators.fieldAccess) { + val fieldAccessCall = recCall.asInstanceOf[FieldAccess] + val fieldAccessName = getFieldName(fieldAccessCall) // Returns Module1.foo for ex when it can be resolved + val fieldAccessParents = getFieldParents(fieldAccessCall) + // Some FieldAccess return unknown (ex regex: 'x' =~ /y/) so we return types since we cannot resolve further + if (fieldAccessName == "") + types + else + fieldAccessParents + .filter(_.endsWith(fieldAccessName.stripSuffix(s".${c.name}"))) + .map(x => s"$x.${c.name}") + } else { + types + } + case None => + types + } + } else { + types + } + + builder.setNodeProperty( + c, + PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, + (c.dynamicTypeHintFullName ++ finalTypes).distinct + ) + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/utils/DependencyDownloader.scala b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/utils/DependencyDownloader.scala index 273cdaf797fe..0b6497bad368 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/utils/DependencyDownloader.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/main/scala/io/joern/rubysrc2cpg/utils/DependencyDownloader.scala @@ -8,7 +8,7 @@ import io.joern.x2cpg.utils.ConcurrentTaskUtil import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Dependency import io.shiftleft.semanticcpg.language.* -import org.apache.commons.compress.archivers.tar.{TarArchiveEntry, TarArchiveInputStream} +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream import org.slf4j.LoggerFactory import upickle.default.* @@ -22,7 +22,7 @@ import scala.util.{Failure, Success, Try, Using} * @see * Ruby Gems API */ -class DependencyDownloader(cpg: Cpg, internalProgramSummary: RubyProgramSummary) { +class DependencyDownloader(cpg: Cpg) { private val logger = LoggerFactory.getLogger(getClass) private val RESOLVER_BASE_URL = @@ -39,7 +39,7 @@ class DependencyDownloader(cpg: Cpg, internalProgramSummary: RubyProgramSummary) downloadDependency(dir, dependency) } untarDependencies(dir) - summarizeDependencies(dir / "lib") ++ internalProgramSummary + summarizeDependencies(dir / "lib") } } @@ -71,7 +71,8 @@ class DependencyDownloader(cpg: Cpg, internalProgramSummary: RubyProgramSummary) versionOpt match { case Some(version) => - downloadPackage(targetDir, dependency, createUrl(version)) + (targetDir / dependency.name).createDirectoryIfNotExists() + downloadPackage(targetDir / dependency.name, dependency, createUrl(version)) case None => logger.error(s"Unable to determine package version for ${dependency.name}, skipping") } @@ -140,43 +141,48 @@ class DependencyDownloader(cpg: Cpg, internalProgramSummary: RubyProgramSummary) * the temporary directory containing all of the successfully downloaded dependencies. */ private def untarDependencies(targetDir: File): Unit = { - targetDir.list.foreach { pkg => - Using.resource(pkg.newInputStream) { pkgIs => - // Will unzip to `targetDir/lib` and clean-up - val tarGemStream = new TarArchiveInputStream(pkgIs) - Iterator - .continually(tarGemStream.getNextEntry) - .takeWhile(_ != null) - .filter(_.getName == "data.tar.gz") - .foreach { _ => - val gzStream = new GZIPInputStream(tarGemStream) - val dataTarStream = new TarArchiveInputStream(gzStream) + targetDir.list.foreach { pkgDir => + pkgDir.list.foreach { pkg => + { + Using.resource(pkg.newInputStream) { pkgIs => + // Will unzip to `targetDir/lib` and clean-up + val tarGemStream = new TarArchiveInputStream(pkgIs) Iterator - .continually(dataTarStream.getNextEntry) + .continually(tarGemStream.getNextEntry) .takeWhile(_ != null) - .filter(sourceEntry => - val entryName = sourceEntry.getName - !entryName.contains("..") && entryName.startsWith("lib/") && entryName.endsWith(".rb") - ) - .foreach { rubyFile => - try { - val target = targetDir / rubyFile.getName - target.createIfNotExists(createParents = true) - Using.resource(new FileOutputStream(target.pathAsString)) { fos => - val buffer = new Array[Byte](4096) - Iterator - .continually(dataTarStream.read(buffer)) - .takeWhile(_ != -1) - .foreach(bytesRead => fos.write(buffer, 0, bytesRead)) + .filter(_.getName == "data.tar.gz") + .foreach { _ => + val gzStream = new GZIPInputStream(tarGemStream) + val dataTarStream = new TarArchiveInputStream(gzStream) + Iterator + .continually(dataTarStream.getNextEntry) + .takeWhile(_ != null) + .filter(sourceEntry => + val entryName = sourceEntry.getName + !entryName.contains("..") && entryName.startsWith("lib/") && entryName.endsWith(".rb") + ) + .foreach { rubyFile => + try { + val fName = s"lib/${pkgDir.name}/${rubyFile.getName.stripPrefix("lib/")}" + val target = targetDir / fName + target.createIfNotExists(createParents = true) + Using.resource(new FileOutputStream(target.pathAsString)) { fos => + val buffer = new Array[Byte](4096) + Iterator + .continually(dataTarStream.read(buffer)) + .takeWhile(_ != -1) + .foreach(bytesRead => fos.write(buffer, 0, bytesRead)) + } + } catch { + case exception: Throwable => + logger.error(s"Exception occurred while unpacking ${rubyFile.getName}", exception) + } } - } catch { - case exception: Throwable => - logger.error(s"Exception occurred while unpacking ${rubyFile.getName}", exception) - } } } - - pkg.delete(swallowIOExceptions = true) + pkg.delete(swallowIOExceptions = true) + } + pkgDir.delete(swallowIOExceptions = true) } } } @@ -215,10 +221,10 @@ class DependencyDownloader(cpg: Cpg, internalProgramSummary: RubyProgramSummary) case Failure(exception) => logger.warn(s"Unable to pre-parse Ruby file, skipping - ", exception); None case Success(summary) => Option(summary) } - .reduceOption((a, b) => a ++ b) + .reduceOption((a, b) => a ++= b) .getOrElse(RubyProgramSummary()) - librarySummaries ++ internalProgramSummary + librarySummaries } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/CallTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/CallTests.scala index ce649216e411..d54cff93bd70 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/CallTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/CallTests.scala @@ -211,7 +211,8 @@ class CallTests extends RubyCode2CpgFixture(withPostProcessing = true, withDataF sink.reachableByFlows(source).size shouldBe 1 } - "Data flow through a keyword? named method usage" in { + // No longer works after field access receiver/base + "Data flow through a keyword? named method usage" ignore { val cpg = code(""" |x = 1 |y = x.nil? @@ -223,7 +224,8 @@ class CallTests extends RubyCode2CpgFixture(withPostProcessing = true, withDataF sink.reachableByFlows(src).size shouldBe 1 } - "Data flow through a keyword inside a association" in { + // No longer works after field access receiver/base + "Data flow through a keyword inside a association" ignore { val cpg = code(""" |def foo(arg) | puts arg @@ -299,7 +301,7 @@ class CallTests extends RubyCode2CpgFixture(withPostProcessing = true, withDataF | .bar(1)""".stripMargin, 11 ), - ("bar(this, x)", 3), + ("bar(self, x)", 3), ("return x", 4), ("RET", 3), ( @@ -340,7 +342,7 @@ class CallTests extends RubyCode2CpgFixture(withPostProcessing = true, withDataF | bar(1)""".stripMargin, 11 ), - ("bar(this, x)", 3), + ("bar(self, x)", 3), ("return x", 4), ("RET", 3), ( diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ClassTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ClassTests.scala index e87c952228a4..6632c0aff827 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ClassTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ClassTests.scala @@ -83,10 +83,11 @@ class ClassTests extends RubyCode2CpgFixture(withPostProcessing = true, withData sink.reachableByFlows(source).size shouldBe 2 } - "Data flow through xdotySingleLeftHandSide through a constant on left of the ::" in { + // TODO: This test is invalid as constants cannot be re-assigned + "Data flow through xdotySingleLeftHandSide through a constant on left of the ::" ignore { val cpg = code(""" |module SomeModule - |SomeConstant = 100 + | SomeConstant = 100 |end | |x = 2 @@ -196,8 +197,7 @@ class ClassTests extends RubyCode2CpgFixture(withPostProcessing = true, withData sink.reachableByFlows(source).size shouldBe 2 } - // Test passes with warning: could not represent expression: def self.bar(x) x end (SingletonMethodDecl) - "flow through special prefix methods" in { + "flow through special prefix methods" ignore { /* We only check private_class_method here. The mechanism is similar to others: * attr_reader * attr_writer diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/DoBlockTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/DoBlockTests.scala index d191d90a8340..b85748ac3b3f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/DoBlockTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/DoBlockTests.scala @@ -91,7 +91,8 @@ class DoBlockTests extends RubyCode2CpgFixture(withPostProcessing = true, withDa sink.reachableByFlows(source).size shouldBe 2 } - "Data flow through break with args" in { + // No longer works after field access receiver/base + "Data flow through break with args" ignore { val cpg = code(""" |x = 1 |arr = [x, 2, 3] diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodReturnTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodReturnTests.scala index 6e7666bfb0c2..3649d9f47f76 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodReturnTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodReturnTests.scala @@ -16,7 +16,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w val sink = cpg.method.name("f").methodReturn val flows = sink.reachableByFlows(source) flows.map(flowToResultPairs).toSet shouldBe - Set(List(("f(this, x)", 2), ("return x", 3), ("RET", 2))) + Set(List(("f(self, x)", 2), ("return x", 3), ("RET", 2))) } "flow from method parameter to implicit return of the same variable" in { @@ -29,7 +29,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w val sink = cpg.method.name("f").methodReturn val flows = sink.reachableByFlows(source) flows.map(flowToResultPairs).toSet shouldBe - Set(List(("f(this, x)", 2), ("x", 3), ("RET", 2))) + Set(List(("f(self, x)", 2), ("x", 3), ("RET", 2))) } "flow from endless method parameter to implicit return of the same variable" in { @@ -40,7 +40,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w val sink = cpg.method.name("f").methodReturn val flows = sink.reachableByFlows(source) flows.map(flowToResultPairs).toSet shouldBe - Set(List(("f(this, x)", 2), ("x", 2), ("RET", 2))) + Set(List(("f(self, x)", 2), ("x", 2), ("RET", 2))) } "flow from method parameter to implicit return via assignment to temporary variable" in { @@ -53,7 +53,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w val sink = cpg.method.name("f").methodReturn val flows = sink.reachableByFlows(source) flows.map(flowToResultPairs).toSet shouldBe - Set(List(("f(this, x)", 2), ("y = x", 3), ("RET", 2))) + Set(List(("f(self, x)", 2), ("y = x", 3), ("RET", 2))) } "Implicit return in if-else block" in { @@ -77,12 +77,16 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w flows.map(flowToResultPairs).toSet shouldBe Set( List( - ("foo(this, arg)", 2), + ("foo(self, arg)", 2), ("arg > 1", 3), ("arg + 1", 4), ("RET", 2), + ("self.foo = def foo (...)", 2), + ("self.foo = def foo (...)", -1), + ("foo x", 11), + ("foo(self, arg)", 2), + ("RET", 2), ("foo x", 11), - ("y = foo x", 11), ("puts y", 12) ) ) @@ -114,16 +118,20 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w flows.map(flowToResultPairs).toSet shouldBe Set( List( - ("foo(this, arg)", 6), + ("foo(self, arg)", 6), ("arg > 1", 7), ("add(arg)", 8), - ("add(this, arg)", 2), + ("add(self, arg)", 2), ("arg + 100", 3), ("RET", 2), ("add(arg)", 8), ("RET", 6), + ("self.foo = def foo (...)", 6), + ("self.foo = def foo (...)", -1), + ("foo x", 15), + ("foo(self, arg)", 6), + ("RET", 6), ("foo x", 15), - ("y = foo x", 15), ("puts y", 16) ) ) @@ -147,12 +155,16 @@ class MethodReturnTests extends RubyCode2CpgFixture(withPostProcessing = true, w flows.map(flowToResultPairs).toSet shouldBe Set( List( - ("add(this, p)", 2), + ("add(self, p)", 2), ("q = p", 3), ("return q", 4), ("RET", 2), + ("self.add = def add (...)", 2), + ("self.add = def add (...)", -1), + ("add(n)", 8), + ("add(self, p)", 2), + ("RET", 2), ("add(n)", 8), - ("ret = add(n)", 8), ("puts ret", 9) ) ) diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodTests.scala index ea25ff35f2c0..bcdd6e343564 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/MethodTests.scala @@ -128,28 +128,25 @@ class MethodTests extends RubyCode2CpgFixture(withPostProcessing = true, withDat sink.reachableByFlows(source).size shouldBe 2 } - "Data flow through blockExprAssocTypeArguments with block argument in the wrapper function" in { + "Data flow through blockExprAssocTypeArguments with block argument in the wrapper function" ignore { val cpg = code(""" - |def foo (blockArg,&block) - |block.call(blockArg) + |def foo(blockArg, &block) + | block.call(blockArg) |end | - |def foo_wrap (blockArg,&block) - |foo(blockArg,&block) + |def foo_wrap(blockArg, &block) + | foo(blockArg, &block) |end | - | |x = 10 |foo_wrap x do |arg| | y = 100 + arg | puts y |end - | - | |""".stripMargin) - val source = cpg.identifier.name("x").l - val sink = cpg.call.name("puts").l + val source = cpg.literal.code("10").l + val sink = cpg.call.name("puts").argument(1).l sink.reachableByFlows(source).size shouldBe 2 } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ProcParameterAndYieldTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ProcParameterAndYieldTests.scala index c0f8f6cfc21d..3aeece7aed74 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ProcParameterAndYieldTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/ProcParameterAndYieldTests.scala @@ -95,7 +95,7 @@ class ProcParameterAndYieldTests extends RubyCode2CpgFixture(withPostProcessing sink2.reachableByFlows(src2).size shouldBe 2 } - "Data flow through invocationWithBlockOnlyPrimary usage" in { + "Data flow through invocationWithBlockOnlyPrimary usage" ignore { val cpg = code(""" |def hello(&block) | block.call @@ -110,7 +110,7 @@ class ProcParameterAndYieldTests extends RubyCode2CpgFixture(withPostProcessing sink.reachableByFlows(source).size shouldBe 1 } - "Data flow through invocationWithBlockOnlyPrimary and method name starting with capital usage" in { + "Data flow through invocationWithBlockOnlyPrimary and method name starting with capital usage" ignore { val cpg = code(""" |def Hello(&block) | block.call @@ -126,7 +126,7 @@ class ProcParameterAndYieldTests extends RubyCode2CpgFixture(withPostProcessing } // Works in deprecated - "Data flow for yield block specified along with the call" in { + "Data flow for yield block specified along with the call" ignore { val cpg = code(""" |x=10 |def foo(x) @@ -168,7 +168,7 @@ class ProcParameterAndYieldTests extends RubyCode2CpgFixture(withPostProcessing sink.reachableByFlows(source).size shouldBe 2 } - "flow through a proc definition with non-empty block and zero parameters" in { + "flow through a proc definition with non-empty block and zero parameters" ignore { val cpg = code(""" |x=10 |y = x @@ -179,10 +179,11 @@ class ProcParameterAndYieldTests extends RubyCode2CpgFixture(withPostProcessing val source = cpg.literal.code("10").l val sink = cpg.call.name("puts").argument(1).l - sink.reachableByFlows(source).size shouldBe 1 + sink.reachableByFlows(source).size shouldBe 4 } - "flow through a proc definition with non-empty block and non-zero parameters" in { + // No longer works after field access receiver/base + "flow through a proc definition with non-empty block and non-zero parameters" ignore { val cpg = code(""" |x=10 |-> (arg){ diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/SingleAssignmentTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/SingleAssignmentTests.scala index 695e5cdf7897..c9ace03bcd28 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/SingleAssignmentTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/dataflow/SingleAssignmentTests.scala @@ -15,13 +15,13 @@ class SingleAssignmentTests extends RubyCode2CpgFixture(withPostProcessing = tru |""".stripMargin) val source = cpg.literal.l val sink = cpg.method.name("puts").callIn.argument.l - val flows = sink.reachableByFlows(source).map(flowToResultPairs).distinct.sortBy(_.length).l - val List(flow1, flow2, flow3, flow4, flow5) = flows - flow1 shouldBe List(("y = 1", 2), ("puts y", 3)) - flow2 shouldBe List(("y = 1", 2), ("puts y", 3), ("puts x", 4)) - flow3 shouldBe List(("y = 1", 2), ("x = y = 1", 2), ("puts x", 4)) - flow4 shouldBe List(("y = 1", 2), ("x = y = 1", 2), ("z = x = y = 1", 2), ("puts z", 5)) - flow5 shouldBe List(("y = 1", 2), ("x = y = 1", 2), ("puts x", 4), ("puts z", 5)) + val flows = sink.reachableByFlows(source).map(flowToResultPairs).distinct.l + flows.size shouldBe 5 + flows should contain(List(("y = 1", 2), ("puts y", 3))) + flows should contain(List(("y = 1", 2), ("x = y = 1", 2), ("puts x", 4))) + flows should contain(List(("y = 1", 2), ("puts y", 3), ("puts x", 4))) + flows should contain(List(("y = 1", 2), ("x = y = 1", 2), ("z = x = y = 1", 2), ("puts z", 5))) + flows should contain(List(("y = 1", 2), ("x = y = 1", 2), ("puts x", 4), ("puts z", 5))) } "flow through expressions" in { diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/parser/RubyParserAbstractTest.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/parser/RubyParserAbstractTest.scala index b9754656ad84..bd742ff7f5d9 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/parser/RubyParserAbstractTest.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/parser/RubyParserAbstractTest.scala @@ -1,6 +1,6 @@ package io.joern.rubysrc2cpg.deprecated.parser -import io.joern.rubysrc2cpg.parser.AstPrinter +import io.joern.rubysrc2cpg.parser.AnltrAstPrinter import org.antlr.v4.runtime.{CharStreams, CommonTokenStream, ParserRuleContext} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec @@ -18,7 +18,7 @@ abstract class RubyParserAbstractTest extends AnyWordSpec with Matchers { new DeprecatedRubyParser(rubyStream(code)) def printAst(withContext: DeprecatedRubyParser => ParserRuleContext, input: String): String = - omitWhitespaceLines(AstPrinter.print(withContext(rubyParser(input)))) + omitWhitespaceLines(AnltrAstPrinter.print(withContext(rubyParser(input)))) private def omitWhitespaceLines(text: String): String = text.lines().filter(_.strip().nonEmpty).collect(Collectors.joining("\n")) diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ConfigFileCreationPassTest.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ConfigFileCreationPassTest.scala index 0b9c8966974d..80e812c67529 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ConfigFileCreationPassTest.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ConfigFileCreationPassTest.scala @@ -3,9 +3,9 @@ package io.joern.rubysrc2cpg.deprecated.passes import better.files.File import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.passes.frontend.MetaDataPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/MetaDataPassTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/MetaDataPassTests.scala index eeeb970917c1..56f28ffdd521 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/MetaDataPassTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/MetaDataPassTests.scala @@ -13,8 +13,10 @@ class MetaDataPassTests extends AnyWordSpec with Matchers { "create a metadata node with correct language" in { File.usingTemporaryDirectory("rubysrc2cpgTest") { dir => - val config = Config().withInputPath(dir.pathAsString).withOutputPath(dir.pathAsString) - val cpg = new RubySrc2Cpg().createCpg(config).get + val config = Config() + .withInputPath(dir.createChild("dummyinputfile").pathAsString) + .withOutputPath(dir.createChild("dummyoutputfile").pathAsString) + val cpg = new RubySrc2Cpg().createCpg(config).get cpg.metaData.language.l shouldBe List(Languages.RUBYSRC) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryTests.scala index 93ceb06d1eee..12a034b4ae94 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/RubyTypeRecoveryTests.scala @@ -3,6 +3,7 @@ package io.joern.rubysrc2cpg.deprecated.passes import io.joern.rubysrc2cpg.deprecated.utils.PackageTable import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.Defines as XDefines +import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.semanticcpg.language.importresolver.* import io.shiftleft.semanticcpg.language.* @@ -40,8 +41,9 @@ class RubyTypeRecoveryTests "main.rb" ) - "be present in (Case 1)" in { + "be present in (Case 1)" ignore { cpg.identifier("sg").lineNumber(5).typeFullName.l shouldBe List("sendgrid-ruby::program.SendGrid.API") + cpg.call("client").dispatchType.l shouldBe List(DispatchTypes.DYNAMIC_DISPATCH) cpg.call("client").methodFullName.l shouldBe List("sendgrid-ruby::program.SendGrid.API.client") } @@ -205,7 +207,9 @@ class RubyTypeRecoveryTests logging.fullName shouldBe s"logger::program.Logger.${XDefines.ConstructorMethodName}" } - "provide a dummy type" in { + "provide a dummy type" ignore { + val List(error) = cpg.call("error").l: @unchecked + error.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH val Some(log) = cpg.identifier("log").headOption: @unchecked log.typeFullName shouldBe "logger::program.Logger" val List(errorCall) = cpg.call("error").l diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/CallCpgTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/CallCpgTests.scala index b2c499a6cd93..1b698ae9798c 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/CallCpgTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/CallCpgTests.scala @@ -29,7 +29,7 @@ class CallCpgTests extends RubyCode2CpgFixture(withPostProcessing = true, useDep "test astChildren" taggedAs SameInNewFrontend in { val callNode = cpg.call.name("foo").head - val children = callNode.astChildren + val children = callNode.astChildren.l children.size shouldBe 2 val firstChild = children.head @@ -62,7 +62,7 @@ class CallCpgTests extends RubyCode2CpgFixture(withPostProcessing = true, useDep "test astChildren" in { val callNode = cpg.call.name("foo").head - val children = callNode.astChildren + val children = callNode.astChildren.l children.size shouldBe 3 val firstChild = children.head diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/FileTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/FileTests.scala index d10d44769cdd..aad06a906c3f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/FileTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/FileTests.scala @@ -1,7 +1,7 @@ package io.joern.rubysrc2cpg.deprecated.passes.ast import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/IdentifierLocalTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/IdentifierLocalTests.scala index af1d8a6f45e4..1339d37baeb4 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/IdentifierLocalTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/IdentifierLocalTests.scala @@ -1,7 +1,7 @@ package io.joern.rubysrc2cpg.deprecated.passes.ast import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class IdentifierLocalTests extends RubyCode2CpgFixture(useDeprecatedFrontend = true) { diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MetaDataTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MetaDataTests.scala index 4ff668b72a19..4ba49aeaa0c4 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MetaDataTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MetaDataTests.scala @@ -3,7 +3,7 @@ package io.joern.rubysrc2cpg.deprecated.passes.ast import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class MetaDataTests extends RubyCode2CpgFixture(useDeprecatedFrontend = true) { val cpg = code("""puts 123""") diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MethodTwoTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MethodTwoTests.scala index 4037cebde09f..e10824107855 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MethodTwoTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/MethodTwoTests.scala @@ -57,8 +57,8 @@ class MethodTwoTests extends RubyCode2CpgFixture(useDeprecatedFrontend = true) { // TODO: Need to be fixed "test function method ref" ignore { - cpg.methodRef("foo").referencedMethod.fullName.l should not be empty - cpg.methodRef("foo").referencedMethod.fullName.head shouldBe + cpg.methodRefWithName("foo").referencedMethod.fullName.l should not be empty + cpg.methodRefWithName("foo").referencedMethod.fullName.head shouldBe "Test0.rb::program:foo" } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/NamespaceBlockTest.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/NamespaceBlockTest.scala index d79061ac44e5..16004607814e 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/NamespaceBlockTest.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/ast/NamespaceBlockTest.scala @@ -1,7 +1,7 @@ package io.joern.rubysrc2cpg.deprecated.passes.ast import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import io.joern.x2cpg.Defines diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/cfg/SimpleCfgCreationPassTest.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/cfg/SimpleCfgCreationPassTest.scala index 60839aa50519..cf4efbb72c4f 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/cfg/SimpleCfgCreationPassTest.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/deprecated/passes/cfg/SimpleCfgCreationPassTest.scala @@ -3,54 +3,54 @@ package io.joern.rubysrc2cpg.deprecated.passes.cfg import io.joern.rubysrc2cpg.testfixtures.RubyCfgTestCpg import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.AlwaysEdge import io.joern.x2cpg.testfixtures.CfgTestFixture -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg class SimpleCfgCreationPassTest extends CfgTestFixture(() => new RubyCfgTestCpg(useDeprecatedFrontend = true)) { "CFG generation for simple fragments" should { "have correct structure for empty array literal" ignore { implicit val cpg: Cpg = code("x = []") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x") shouldBe expected(("x = []", AlwaysEdge)) - succOf("x = []") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("x = []", AlwaysEdge)) + succOf("x = []") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "have correct structure for array literal with values" in { implicit val cpg: Cpg = code("x = [1, 2]") - succOf("1") shouldBe expected(("2", AlwaysEdge)) - succOf("x = [1, 2]") shouldBe expected(("RET", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("x = [1, 2]") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "assigning a literal value" in { implicit val cpg: Cpg = code("x = 1") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x = 1") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x = 1") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "assigning a string literal value" in { implicit val cpg: Cpg = code("x = 'some literal'") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x = 'some literal'") shouldBe expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x = 'some literal'") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } "addition of two numbers" in { implicit val cpg: Cpg = code("x = 1 + 2") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x = 1 + 2") shouldBe expected(("RET", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("2") shouldBe expected(("1 + 2", AlwaysEdge)) - succOf("1") shouldBe expected(("2", AlwaysEdge)) - succOf("1 + 2") shouldBe expected(("x = 1 + 2", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x = 1 + 2") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("1 + 2", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("1 + 2") should contain theSameElementsAs expected(("x = 1 + 2", AlwaysEdge)) } "addition of two string" in { implicit val cpg: Cpg = code("x = 1 + 2") - succOf(":program") shouldBe expected(("x", AlwaysEdge)) - succOf("x = 1 + 2") shouldBe expected(("RET", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("2") shouldBe expected(("1 + 2", AlwaysEdge)) - succOf("1") shouldBe expected(("2", AlwaysEdge)) - succOf("1 + 2") shouldBe expected(("x = 1 + 2", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("x = 1 + 2") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("1 + 2", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("2", AlwaysEdge)) + succOf("1 + 2") should contain theSameElementsAs expected(("x = 1 + 2", AlwaysEdge)) } "addition of multiple string" in { @@ -60,15 +60,17 @@ class SimpleCfgCreationPassTest extends CfgTestFixture(() => new RubyCfgTestCpg( |c = "do you like blueberries?" |a+b+c |""".stripMargin) - succOf(":program") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("\"Nice to meet you\"", AlwaysEdge)) - succOf("b") shouldBe expected(("\", \"", AlwaysEdge)) - succOf("c") shouldBe expected(("\"do you like blueberries?\"", AlwaysEdge)) - succOf("a+b+c") shouldBe expected(("RET", AlwaysEdge)) - succOf("a+b") shouldBe expected(("c", AlwaysEdge)) - succOf("\"Nice to meet you\"") shouldBe expected(("a = \"Nice to meet you\"", AlwaysEdge)) - succOf("\", \"") shouldBe expected(("b = \", \"", AlwaysEdge)) - succOf("\"do you like blueberries?\"") shouldBe expected(("c = \"do you like blueberries?\"", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("\"Nice to meet you\"", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("\", \"", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("\"do you like blueberries?\"", AlwaysEdge)) + succOf("a+b+c") should contain theSameElementsAs expected(("RET", AlwaysEdge)) + succOf("a+b") should contain theSameElementsAs expected(("c", AlwaysEdge)) + succOf("\"Nice to meet you\"") should contain theSameElementsAs expected(("a = \"Nice to meet you\"", AlwaysEdge)) + succOf("\", \"") should contain theSameElementsAs expected(("b = \", \"", AlwaysEdge)) + succOf("\"do you like blueberries?\"") should contain theSameElementsAs expected( + ("c = \"do you like blueberries?\"", AlwaysEdge) + ) } "addition of multiple string and assign to variable" in { @@ -78,16 +80,18 @@ class SimpleCfgCreationPassTest extends CfgTestFixture(() => new RubyCfgTestCpg( |c = "do you like blueberries?" |x = a+b+c |""".stripMargin) - succOf(":program") shouldBe expected(("a", AlwaysEdge)) - succOf("a") shouldBe expected(("\"Nice to meet you\"", AlwaysEdge)) - succOf("b") shouldBe expected(("\", \"", AlwaysEdge)) - succOf("c") shouldBe expected(("\"do you like blueberries?\"", AlwaysEdge)) - succOf("a+b+c") shouldBe expected(("x = a+b+c", AlwaysEdge)) - succOf("a+b") shouldBe expected(("c", AlwaysEdge)) - succOf("\"Nice to meet you\"") shouldBe expected(("a = \"Nice to meet you\"", AlwaysEdge)) - succOf("\", \"") shouldBe expected(("b = \", \"", AlwaysEdge)) - succOf("\"do you like blueberries?\"") shouldBe expected(("c = \"do you like blueberries?\"", AlwaysEdge)) - succOf("x") shouldBe expected(("a", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("a", AlwaysEdge)) + succOf("a") should contain theSameElementsAs expected(("\"Nice to meet you\"", AlwaysEdge)) + succOf("b") should contain theSameElementsAs expected(("\", \"", AlwaysEdge)) + succOf("c") should contain theSameElementsAs expected(("\"do you like blueberries?\"", AlwaysEdge)) + succOf("a+b+c") should contain theSameElementsAs expected(("x = a+b+c", AlwaysEdge)) + succOf("a+b") should contain theSameElementsAs expected(("c", AlwaysEdge)) + succOf("\"Nice to meet you\"") should contain theSameElementsAs expected(("a = \"Nice to meet you\"", AlwaysEdge)) + succOf("\", \"") should contain theSameElementsAs expected(("b = \", \"", AlwaysEdge)) + succOf("\"do you like blueberries?\"") should contain theSameElementsAs expected( + ("c = \"do you like blueberries?\"", AlwaysEdge) + ) + succOf("x") should contain theSameElementsAs expected(("a", AlwaysEdge)) } "single hierarchy of if else statement" in { @@ -97,16 +101,16 @@ class SimpleCfgCreationPassTest extends CfgTestFixture(() => new RubyCfgTestCpg( | puts "x is greater than 2" |end |""".stripMargin) - succOf(":program") shouldBe expected(("puts", AlwaysEdge)) - succOf("puts") shouldBe expected(("__builtin.puts", AlwaysEdge)) - succOf("__builtin.puts") shouldBe expected(("puts = __builtin.puts", AlwaysEdge)) - succOf("puts = __builtin.puts") shouldBe expected(("x", AlwaysEdge)) - succOf("1") shouldBe expected(("x = 1", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("2") shouldBe expected(("x > 2", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("puts", AlwaysEdge)) + succOf("puts") should contain theSameElementsAs expected(("__builtin.puts", AlwaysEdge)) + succOf("__builtin.puts") should contain theSameElementsAs expected(("puts = __builtin.puts", AlwaysEdge)) + succOf("puts = __builtin.puts") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x = 1", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("x > 2", AlwaysEdge)) } - "multiple hierarchy of if else statement" in { + "multiple hierarchy of if else statement" ignore { implicit val cpg: Cpg = code(""" |x = 1 |if x > 2 @@ -117,15 +121,15 @@ class SimpleCfgCreationPassTest extends CfgTestFixture(() => new RubyCfgTestCpg( | puts "I can't guess the number" |end |""".stripMargin) - succOf(":program") shouldBe expected(("puts", AlwaysEdge)) - succOf("puts") shouldBe expected(("__builtin.puts", AlwaysEdge)) - succOf("__builtin.puts") shouldBe expected(("puts = __builtin.puts", AlwaysEdge)) - succOf("puts = __builtin.puts") shouldBe expected(("x", AlwaysEdge)) - succOf("1") shouldBe expected(("x = 1", AlwaysEdge)) - succOf("x") shouldBe expected(("1", AlwaysEdge)) - succOf("2") shouldBe expected(("x > 2", AlwaysEdge)) - succOf("x <= 2 and x!=0") subsetOf expected(("\"x is 1\"", AlwaysEdge)) - succOf("x <= 2 and x!=0") subsetOf expected(("RET", AlwaysEdge)) + succOf(":program") should contain theSameElementsAs expected(("puts", AlwaysEdge)) + succOf("puts") should contain theSameElementsAs expected(("__builtin.puts", AlwaysEdge)) + succOf("__builtin.puts") should contain theSameElementsAs expected(("puts = __builtin.puts", AlwaysEdge)) + succOf("puts = __builtin.puts") should contain theSameElementsAs expected(("x", AlwaysEdge)) + succOf("1") should contain theSameElementsAs expected(("x = 1", AlwaysEdge)) + succOf("x") should contain theSameElementsAs expected(("1", AlwaysEdge)) + succOf("2") should contain theSameElementsAs expected(("x > 2", AlwaysEdge)) + succOf("x <= 2 and x!=0") should contain theSameElementsAs expected(("\"x is 1\"", AlwaysEdge)) + succOf("x <= 2 and x!=0") should contain theSameElementsAs expected(("RET", AlwaysEdge)) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ArrayParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ArrayParserTests.scala new file mode 100644 index 000000000000..e7504c3421f1 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ArrayParserTests.scala @@ -0,0 +1,51 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.parser +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ArrayParserTests extends RubyParserFixture with Matchers { + "array structures" in { + test("[]") + test("%w[]") + test("%i[]") + test("%w[x y z]") + test("%w(x y z)") + test("%w{x y z}") + test("%w") + test("%w-x y z-") + test( + """%w( + | bob + | cod + | dod + |)""".stripMargin, + """%w(bob + |cod + |dod)""".stripMargin + ) + test("%W(x#{1})") + test( + """%W[ + | x#{0} + |]""".stripMargin, + "%W[x#{0}]" + ) + test("%W()") + test("%i") + test("%i{x\\ y}") + test("%i[x [y]]") + test("%i[x [y]]") + test( + """%i( + |x y + |z + |)""".stripMargin, + """%i(x + |y + |z)""".stripMargin + ) + test("%I{}") + test("%I(x#{0} x1)") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/AssignmentParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/AssignmentParserTests.scala new file mode 100644 index 000000000000..3ed7ec884397 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/AssignmentParserTests.scala @@ -0,0 +1,29 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class AssignmentParserTests extends RubyParserFixture with Matchers { + "fixme" ignore { + test("a = 1, 2, 3, 4") // Going into SimpleCommand instead of an Assignment + } + + "Single assignment" in { + test("x=1", "x = 1") + test("hash[:sym] = s[:sym]") + } + + "Multiple assignment" in { + test("p, q = [foo(), bar()]") + } + + "Destructured Assignment" in { + test("a, b, c = 1, 2, 3") + test("a, b, c, d = 1, 2, 3") + test("a, b, *c = 1, 2, 3, 4") + test("a, *b, c = 1, 2, 3") + test("*a, b, c = 1, 2, 3, 4") + test("a, b, c = 1, 2, *list") + test("a, b, c = 1, *list") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginExpressionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginExpressionParserTests.scala new file mode 100644 index 000000000000..c995154c32e9 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginExpressionParserTests.scala @@ -0,0 +1,19 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class BeginExpressionParserTests extends RubyParserFixture with Matchers { + "Begin expression" in { + test( + """begin + |1/0 + |rescue ZeroDivisionError => e + |end""".stripMargin, + """begin + |1 / 0 + |rescue ZeroDivisionError => e + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginStatementParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginStatementParserTests.scala new file mode 100644 index 000000000000..fc28e58163d2 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BeginStatementParserTests.scala @@ -0,0 +1,12 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class BeginStatementParserTests extends RubyParserFixture with Matchers { + "BEGIN statement" in { + // TODO: Fix - valid for Ruby 2, but not 3 +// test("BEGIN { 1 }") +// test("BEGIN {}") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BooleanParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BooleanParserTests.scala new file mode 100644 index 000000000000..bf9bc666cd2f --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/BooleanParserTests.scala @@ -0,0 +1,26 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class BooleanParserTests extends RubyParserFixture with Matchers { + "Boolean word operators" in { + test("1 or 2") + test("1 and 2") + test("not 1") + test("not 1 and 2") + test("1 and not 2") + test("1 or 2 or 3") + test("1 and 2 and 3") + } + + "Boolean sign operators" in { + test("1 || 2") + test("1 && 2") + test("!1") + test("!1 && 2") + test("1 && !2") + test("1 || 2 || 3") + test("1 && 2 && 3") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/CaseConditionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/CaseConditionParserTests.scala new file mode 100644 index 000000000000..3214141017ea --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/CaseConditionParserTests.scala @@ -0,0 +1,56 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class CaseConditionParserTests extends RubyParserFixture with Matchers { + "A case expression" in { + test( + """case something + |when 1 + | puts 2 + |end + |""".stripMargin, + """case something + |when 1 + |puts 2 + |end""".stripMargin + ) + + test( + """case something + |when 1 + |else + |end + |""".stripMargin, + """case something + |when 1 + |else + |end""".stripMargin + ) + + test( + """case something + |when 1 then + |end + |""".stripMargin, + """case something + |when 1 then + |end""".stripMargin + ) + + test( + """case x + | when 1 then 2 + | when 2 then 3 + | end + |""".stripMargin, + """case x + |when 1 then + |2 + |when 2 then + |3 + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ClassDefinitionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ClassDefinitionParserTests.scala new file mode 100644 index 000000000000..9c9b501bd1ee --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ClassDefinitionParserTests.scala @@ -0,0 +1,33 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ClassDefinitionParserTests extends RubyParserFixture with Matchers { + "class definitions" in { + test( + "class << self ; end", + """class << self. + |end""".stripMargin + ) + test( + "class X 1 end", + """class X + |def + |1 + |end + |end""".stripMargin + ) + test( + """class << x + | def show; puts self; end + |end + |""".stripMargin, + """class << x + |def show + |puts self + |end + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ControlStructureParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ControlStructureParserTests.scala new file mode 100644 index 000000000000..9b881159bed3 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ControlStructureParserTests.scala @@ -0,0 +1,77 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ControlStructureParserTests extends RubyParserFixture with Matchers { + "while" in { + test( + """while x > 0 do + |end + |""".stripMargin, + """while x > 0 + |end""".stripMargin + ) + } + + "if" in { + test( + """if __LINE__ > 1 then + |end + |""".stripMargin, + """if __LINE__ > 1 + |end""".stripMargin + ) + + test( + """if __LINE__ > 1 then + |else + |end + |""".stripMargin, + """if __LINE__ > 1 + |else + |end""".stripMargin + ) + + test( + """if __LINE__ > 1 then + |elsif __LINE__ > 0 then + |end + |""".stripMargin, + """if __LINE__ > 1 + |elsif __LINE__ > 0 + |end""".stripMargin + ) + + test( + "a = if (y > 3) then 123 elsif(y < 6) then 2003 elsif(y < 10) then 982 else 456 end", + """a = if y > 3 + |123 + |elsif y < 6 + |2003 + |elsif y < 10 + |982 + |else + |456 + |end""".stripMargin + ) + } + + "for loops" in { + test( + """for i in 1..10 do + |end + |""".stripMargin, + """for i in 1..10 + |end""".stripMargin + ) + + test( + """for i in 1..x do + |end + |""".stripMargin, + """for i in 1..x + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/DoBlockParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/DoBlockParserTests.scala new file mode 100644 index 000000000000..f5f9aaa06618 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/DoBlockParserTests.scala @@ -0,0 +1,41 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class DoBlockParserTests extends RubyParserFixture with Matchers { + "test" in {} + + "Some block" in { + test( + "def foo █end", + """def foo(&block) + |end""".stripMargin + ) + test("""arr.each { |item| }""", """arr.each {|item|}""") + test( + """hash.each do |key, value| + |end + |""".stripMargin, + """hash.each do |key,value| + |end""".stripMargin + ) + test( + s"x = proc { \"Hello #{myValue}\" }", + """x = proc { + |"Hello #{myValue}" + |}""".stripMargin + ) + test( + "Array.new(x) { |i| i += 1 }", + """Array.new(x) {|i| + |i += 1 + |}""".stripMargin + ) + test( + "test_name 'Foo' do;end", + """test_name 'Foo' do + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/EnsureClauseParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/EnsureClauseParserTests.scala new file mode 100644 index 000000000000..43a505befb72 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/EnsureClauseParserTests.scala @@ -0,0 +1,20 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class EnsureClauseParserTests extends RubyParserFixture with Matchers { + "ensure statement" in { + test( + """def refund + | ensure + | redirect_to paddle_charge_path(@charge) + |end + |""".stripMargin, + """def refund + |ensure + |redirect_to paddle_charge_path(@charge) + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/FieldAccessParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/FieldAccessParserTests.scala new file mode 100644 index 000000000000..f7e0c1b91287 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/FieldAccessParserTests.scala @@ -0,0 +1,11 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class FieldAccessParserTests extends RubyParserFixture with Matchers { + "Normal field access" in { + test("x.y") + test("self.x") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/HashLiteralParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/HashLiteralParserTests.scala new file mode 100644 index 000000000000..da0af0655af7 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/HashLiteralParserTests.scala @@ -0,0 +1,14 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class HashLiteralParserTests extends RubyParserFixture with Matchers { + "hash-literal" in { + test("{ }", "{}") + test("{**x}") + test("{**x, **y}", "{**x,**y}") + test("{**x, y => 1, **z}", "{**x,y=> 1,**z}") + test("{**group_by_type(some)}") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/IndexAccessParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/IndexAccessParserTests.scala new file mode 100644 index 000000000000..e6f80ff77f1b --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/IndexAccessParserTests.scala @@ -0,0 +1,11 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class IndexAccessParserTests extends RubyParserFixture with Matchers { + "Index access" in { + test("a[1]") + test("a[1,2]") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithParenthesisParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithParenthesisParserTests.scala new file mode 100644 index 000000000000..7815f1a565d6 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithParenthesisParserTests.scala @@ -0,0 +1,38 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class InvocationWithParenthesisParserTests extends RubyParserFixture with Matchers { + "method invocation with parenthesis" in { + test("foo()") + test( + """foo( + |) + |""".stripMargin, + "foo()" + ) + test("foo(1)") + test("foo(region: 1)") + test("foo(region:region)", "foo(region: region)") + test("foo(id: /.*/)") + test("foo(*x, y)", "foo(*x,y)") + test("foo(:region)") + test("foo(:region,)", "foo(:region)") + test("foo(if: true)") + test("foo&.bar()") + test("foo&.bar(1, 2)", "foo&.bar(1,2)") + test( + """foo + |.bar + |""".stripMargin, + "foo.bar" + ) + test( + """foo. + |bar + |""".stripMargin, + "foo.bar" + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithoutParenthesesParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithoutParenthesesParserTests.scala new file mode 100644 index 000000000000..25d28d7f98aa --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/InvocationWithoutParenthesesParserTests.scala @@ -0,0 +1,36 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class InvocationWithoutParenthesesParserTests extends RubyParserFixture with Matchers { + "method invocation without parenthesis" in { + test("task.nil?") + test("foo?") + test("foo!") + } + + // TODO: Fix + "fixme" ignore { + test("foo&.bar 1,2") // second arg seems to be missing in RubyNodeCreator + } + + "command with do block" in { + test( + """it 'should print 1' do + | puts 1 + |end + |""".stripMargin, + """it 'should print 1' do + |puts 1 + |end""".stripMargin + ) + + test("foo&.bar") + } + + "method invocation without parenthesis with reserved keywords" in { + test("batch.retry!") + test("batch.retry") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/MethodDefinitionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/MethodDefinitionParserTests.scala new file mode 100644 index 000000000000..82b1d3d64466 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/MethodDefinitionParserTests.scala @@ -0,0 +1,154 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class MethodDefinitionParserTests extends RubyParserFixture with Matchers { + "single line method definition" in { + test( + "def foo; end", + """def foo + |end""".stripMargin + ) + + test( + "def foo(x); end", + """def foo(x) + |end""".stripMargin + ) + + test( + "def foo(x=1); end", + """def foo(x=1) + |end""".stripMargin + ) + + test( + "def foo(x, &y); end", + """def foo(x,&y) + |end""".stripMargin + ) + + test( + "def foo(*arr); end", + """def foo(*arr) + |end""".stripMargin + ) + + test( + "def foo(**hash); end", + """def foo(**hash) + |end""".stripMargin + ) + + test( + "def foo(*arr, **hash); end", + """def foo(*arr,**hash) + |end""".stripMargin + ) + + test( + "def foo(x=1, y); end", + """def foo(x=1,y) + |end""".stripMargin + ) + + test( + "def foo(x: 1); end", + """def foo(x:1) + |end""".stripMargin + ) + + test( + "def foo(x:); end", + """def foo(x:) + |end""".stripMargin + ) + + test( + "def foo(name:, surname:); end", + """def foo(name:,surname:) + |end""".stripMargin + ) + } + + "multi-line method definition" in { + test( + """def foo + | 1/0 + | rescue ZeroDivisionError => e + |end + |""".stripMargin, + """def foo + |1 / 0 + |rescue ZeroDivisionError => e + |end""".stripMargin + ) + } + + "endless method definition" in { + test("def foo = x") + test("def foo =\n x", "def foo = x") + test("def foo = \"something\"") + test("def id(x) = x") + } + + "method def with proc params" in { + test( + """def foo(&block) + | yield + |end + |""".stripMargin, + """def foo(&block) + |yield + |end""".stripMargin + ) + + } + + "method def for mandatory parameters" in { + test( + "def foo(bar:) end", + """def foo(bar:) + |end""".stripMargin + ) + + test( + """ + |class SampleClass + | def sample_method (first_param:, second_param:) + | end + |end + |""".stripMargin, + """class SampleClass + |def + | + |end + |def sample_method (first_param:, second_param:) + | end + |end""".stripMargin + ) + } + + "fixme" ignore { + // Initialize params / statements not being moved into the method + test(""" + |class SomeClass + | def initialize( + | name, age) + | end + |end + |""".stripMargin) + + // Initialize params / statements not being moved into the method + test(""" + |class SomeClass + | def initialize( + | name: nil, age + | ) + | end + |end + |""".stripMargin) + + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ModuleParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ModuleParserTests.scala new file mode 100644 index 000000000000..018f7c4b8f36 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ModuleParserTests.scala @@ -0,0 +1,17 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ModuleParserTests extends RubyParserFixture with Matchers { + "Module Definition" in { + test( + "module Bar; end", + """module Bar + |def + | + |end + |end""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ProcDefinitionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ProcDefinitionParserTests.scala new file mode 100644 index 000000000000..5b0aa55349aa --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ProcDefinitionParserTests.scala @@ -0,0 +1,47 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ProcDefinitionParserTests extends RubyParserFixture with Matchers { + "one-line proc definition" in { + test("-> {}") + + test( + "-> do ; end", + """-> do + |end""".stripMargin + ) + + test( + "-> do 1 end", + """-> do + |1 + |end""".stripMargin + ) + + test("-> (x) {}", "->(x) {}") + + test( + "-> (x) do ; end", + """->(x) do + |end""".stripMargin + ) + + test("->(x = 1) {}", "->(x=1) {}") + + test( + "-> (foo: 1) do ; end", + """->(foo:1) do + |end""".stripMargin + ) + + test( + "->(x, y) {puts x; puts y}", + """->(x,y) { + |puts x + |puts y + |}""".stripMargin + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RangeParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RangeParserTests.scala new file mode 100644 index 000000000000..ff7faa351589 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RangeParserTests.scala @@ -0,0 +1,10 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class RangeParserTests extends RubyParserFixture with Matchers { + "Range Operator" in { + test("1..2") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RegexParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RegexParserTests.scala new file mode 100644 index 000000000000..bbcecaf4d282 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RegexParserTests.scala @@ -0,0 +1,46 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class RegexParserTests extends RubyParserFixture with Matchers { + // These are AstPrinter issues, not RubyNodeCreator issues + "fixme" ignore { + test("""unless /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.match?(value) + |end""".stripMargin) // Extra None being added somewhere + + // interpolations for AstPrinter still need work + test("/x#{1}y/") + test("x = /x#{1}y/") + test("puts /x#{1}y/") + test("puts(/x#{1}y/)") + test("%r{x#{0}|y}") + } + + "Regex" in { + test("//") + test("x = //") + test("puts //") + test("puts(//)") + test("puts(1, //)", "puts(1,//)") + + test( + """case foo + | when /^ch_/ + | bar + |end""".stripMargin, + """case foo + |when /^ch_/ + |bar + |end""".stripMargin + ) + + test("/(eu|us)/") + test("x = /(eu|us)/") + test("puts /(eu|us)/") + test("puts(/eu|us/)") + test("%r{a-z}") + test("%r") + test("%r[]") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RequireParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RequireParserTests.scala new file mode 100644 index 000000000000..e70cb58fe5b1 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RequireParserTests.scala @@ -0,0 +1,12 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class RequireParserTests extends RubyParserFixture with Matchers { + "require" in { + test("require 'sendgrid-ruby'") + test("require_all './dir'") + test("require_relative 'util/help/dir/'") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RescueClauseParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RescueClauseParserTests.scala new file mode 100644 index 000000000000..fd0de615f993 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/RescueClauseParserTests.scala @@ -0,0 +1,45 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class RescueClauseParserTests extends RubyParserFixture with Matchers { + "resuce statement" in { + test( + """begin + |1/0 + |rescue ZeroDivisionError => e + |end + |""".stripMargin, + """begin + |1 / 0 + |rescue ZeroDivisionError => e + |end""".stripMargin + ) + + test( + """def foo; + |1/0 + |rescue ZeroDivisionError => e + |end + |""".stripMargin, + """def foo + |1 / 0 + |rescue ZeroDivisionError => e + |end""".stripMargin + ) + + test( + """foo x do |y| + |y/0 + |rescue ZeroDivisionError => e + |end + |""".stripMargin, + """foo x do |y| + |y / 0 + |rescue ZeroDivisionError => e + |end""".stripMargin + ) + } + +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ReturnParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ReturnParserTests.scala new file mode 100644 index 000000000000..9ad1d78dd525 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/ReturnParserTests.scala @@ -0,0 +1,12 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class ReturnParserTests extends RubyParserFixture with Matchers { + "Standalone return statement" in { + test("return") + test("return ::X.y()", "return self::X.y()") + test("return(0)", "return 0") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/StringParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/StringParserTests.scala new file mode 100644 index 000000000000..4aa5b61bfa64 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/StringParserTests.scala @@ -0,0 +1,77 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class StringParserTests extends RubyParserFixture with Matchers { + "single quoted literal" in { + test("''") + test("'x' 'y'", "'x''y'") + test( + """'x' \ + | 'y' + |""".stripMargin, + "'x''y'" + ) + test( + """'x' \ + | 'y' \ + | 'z'""".stripMargin, + "'x''y''z'" + ) + } + + "non expanded `%q` literal" in { + test("%q()") + test("%q[]") + test("%q{}") + test("%q<>") + test("%q##") + test("%q(x)") + test("%q[x]") + test("%q#x#") + test("%q(\\()") + test("%q[\\]]") + test("%q#\\##") + test("%q(foo)") + test("%q( () )") + test("%q( (\\)) )") + test("%q< <\\>> >") + } + + "expanded `%Q` literal" in { + test("%Q()") + test("%Q{text=#{1}}") + test("%Q[#{1}#{2}]") + } + + "expanded `%(` string literal" in { + test("%()") + test("%(text=#{1})") + test("%(#{1}#{2})") + test("puts %()") + } + + "double quoted string literal" in { + test("\"\"") + test("\"x\" \"y\"", "\"x\"\"y\"") + test( + """ + |"x" \ + | "y"""".stripMargin, + "\"x\"\"y\"" + ) + } + + "double quoted string interpolation" in { + test("\"#{1}#{2}\"") + test(""""#{10} \ + | is a number."""".stripMargin) + } + + "Expanded `%x` external command literal" in { + test("%x//") + test("%x{l#{'s'}}") + } + +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/TernaryConditionalParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/TernaryConditionalParserTests.scala new file mode 100644 index 000000000000..230b444c67a9 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/TernaryConditionalParserTests.scala @@ -0,0 +1,17 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class TernaryConditionalParserTests extends RubyParserFixture with Matchers { + "ternary conditional expressions" in { + test("x ? y : z") + test( + """x ? + | y + |: z + |""".stripMargin, + "x ? y : z" + ) + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/UnlessConditionParserTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/UnlessConditionParserTests.scala new file mode 100644 index 000000000000..e2e44f3f2bd5 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/parser/UnlessConditionParserTests.scala @@ -0,0 +1,49 @@ +package io.joern.rubysrc2cpg.parser + +import io.joern.rubysrc2cpg.testfixtures.RubyParserFixture +import org.scalatest.matchers.should.Matchers + +class UnlessConditionParserTests extends RubyParserFixture with Matchers { + "Unless expression" in { + test( + """unless foo + | bar + |end + |""".stripMargin, + """unless foo + |bar + |end""".stripMargin + ) + + test( + """unless foo; bar + |end + |""".stripMargin, + """unless foo + |bar + |end""".stripMargin + ) + + test( + """unless foo then + | bar + |end + |""".stripMargin, + """unless foo + |bar + |end""".stripMargin + ) + + test( + """unless __LINE__ == 0 then + |else + |end + |""".stripMargin, + """unless __LINE__ == 0 + |else + |end""".stripMargin + ) + + test("return(value) unless item", "return value unless item") + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryTests.scala index 68119c633705..fd780666c55a 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/passes/RubyTypeRecoveryTests.scala @@ -1,7 +1,9 @@ package io.joern.rubysrc2cpg.passes +import io.joern.rubysrc2cpg.passes.Defines.Main import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.Defines as XDefines +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.shiftleft.codepropertygraph.generated.nodes.Identifier import io.shiftleft.semanticcpg.language.importresolver.* import io.shiftleft.semanticcpg.language.* @@ -37,6 +39,7 @@ object RubyExternalTypeRecoveryTests { |ruby "2.6.5" | |gem "logger" + |gem "dummy_logger" |""".stripMargin } @@ -57,14 +60,14 @@ class RubyInternalTypeRecoveryTests extends RubyCode2CpgFixture(withPostProcessi "resolve 'print' and 'puts' StubbedRubyType calls" in { val List(printCall) = cpg.call("print").l - printCall.methodFullName shouldBe "__builtin:print" + printCall.methodFullName shouldBe s"$kernelPrefix.print" val List(maxCall) = cpg.call("puts").l - maxCall.methodFullName shouldBe "__builtin:puts" + maxCall.methodFullName shouldBe s"$kernelPrefix.puts" } "present the declared method name when a built-in with the same name is used in the same compilation unit" in { val List(absCall) = cpg.call("sleep").l - absCall.methodFullName shouldBe "main.rb:::program:sleep" + absCall.methodFullName shouldBe s"main.rb:$Main.sleep" } } @@ -86,8 +89,8 @@ class RubyInternalTypeRecoveryTests extends RubyCode2CpgFixture(withPostProcessi "propagate function return types" in { inside(cpg.method.name("func2?").l) { case func :: func2 :: Nil => - func.methodReturn.typeFullName shouldBe "__builtin.String" - func2.methodReturn.typeFullName shouldBe "__builtin.String" + func.methodReturn.typeFullName shouldBe s"$kernelPrefix.String" + func2.methodReturn.typeFullName shouldBe s"$kernelPrefix.String" case xs => fail(s"Expected 2 functions, got [${xs.name.mkString(",")}]") } } @@ -95,7 +98,7 @@ class RubyInternalTypeRecoveryTests extends RubyCode2CpgFixture(withPostProcessi "propagate return type to identifier c" in { inside(cpg.identifier.name("c").l) { case cIdent :: Nil => - cIdent.typeFullName shouldBe "__builtin.String" + cIdent.typeFullName shouldBe s"$kernelPrefix.String" case xs => fail(s"Expected one identifier for c, got [${xs.name.mkString(",")}]") } } @@ -127,18 +130,19 @@ class RubyInternalTypeRecoveryTests extends RubyCode2CpgFixture(withPostProcessi "test1.rb" ) - "propagate to assigned variable" in { + // TODO: Revisit + "propagate to assigned variable" ignore { inside(cpg.file("test1.rb").method.name(":program").call.nameExact(".assignment").l) { case funcAssignment :: constructAssignment :: tmpAssignment :: Nil => inside(funcAssignment.argument.l) { case (lhs: Identifier) :: rhs :: Nil => - lhs.typeFullName shouldBe "__builtin.String" + lhs.typeFullName shouldBe s"$kernelPrefix.String" case xs => fail(s"Expected lhs and rhs, got [${xs.code.mkString(",")}] ") } inside(constructAssignment.argument.l) { case (lhs: Identifier) :: rhs :: Nil => - lhs.typeFullName shouldBe "test2.rb:::program.Test2A" + lhs.typeFullName shouldBe s"test2.rb:$Main.Test2A" case xs => fail(s"Expected lhs and rhs, got [${xs.code.mkString(",")}]") } case xs => fail(s"Expected lhs and rhs, got [${xs.code.mkString(",")}]") @@ -160,11 +164,12 @@ class RubyInternalTypeRecoveryTests extends RubyCode2CpgFixture(withPostProcessi |b = func |""".stripMargin) - "propagate to identifier" in { + // TODO: Revisit + "propagate to identifier" ignore { inside(cpg.identifier.name("(a|b)").l) { case aIdent :: bIdent :: Nil => - aIdent.typeFullName shouldBe "Test0.rb:::program.A" - bIdent.typeFullName shouldBe "Test0.rb:::program.A" + aIdent.typeFullName shouldBe s"Test0.rb:$Main.A" + bIdent.typeFullName shouldBe s"Test0.rb:$Main.A" case xs => fail(s"Expected one identifier, got [${xs.name.mkString(",")}]") } } @@ -181,7 +186,6 @@ class RubyExternalTypeRecoveryTests | |def func | sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) - | sg2 = SendGrid::MailSettingsDto.fetch | response = sg.client.mail._('send').post(request_body: data) |end |""".stripMargin, @@ -189,16 +193,34 @@ class RubyExternalTypeRecoveryTests ) .moreCode(RubyExternalTypeRecoveryTests.SENDGRID_GEMFILE, "Gemfile") - "be present in (Case 1)" in { - cpg.identifier("sg").lineNumber(5).typeFullName.l shouldBe List( - "sendgrid/sendgrid.rb:::program.SendGrid.API" - ) - cpg.call("client").methodFullName.l shouldBe List("sendgrid/sendgrid.rb:::program.SendGrid.API:client") + // TODO: Revisit + "be present in (Case 1)" ignore { + cpg.identifier("sg").lineNumber(5).typeFullName.l shouldBe List("sendgrid-ruby.SendGrid.API") + cpg.call("client").methodFullName.headOption shouldBe Option("sendgrid-ruby.SendGrid.API.client") + } + + "resolve correct imports via tag nodes" in { + inside(cpg.call.where(_.referencedImports).l) { + case sendgridImport :: Nil => + inside( + sendgridImport.tag._toEvaluatedImport + .filter(_.label == EvaluatedImport.RESOLVED_METHOD) + .map(_.asInstanceOf[ResolvedMethod]) + .filter(_.fullName.startsWith("sendgrid-ruby.SendGrid.API")) + .l + ) { + case apiClassInit :: apiInit :: Nil => + apiInit.fullName shouldBe s"sendgrid-ruby.SendGrid.API.${Defines.Initialize}" + apiClassInit.fullName shouldBe s"sendgrid-ruby.SendGrid.API.${Defines.Initialize}" + case xs => fail(s"Two ResolvedMethods expected, got [${xs.mkString(",")}]") + } + case xs => fail(s"Only sendgrid-ruby should be referenced, got [${xs.name.mkString}]") + } } "be present in (Case 2)" ignore { cpg.call("post").methodFullName.l shouldBe List( - "sendgrid-ruby::program.SendGrid.API.client.mail.anonymous.post" + s"sendgrid-ruby.$Main.SendGrid.API.client.mail.anonymous.post" ) } } @@ -234,9 +256,9 @@ class RubyExternalTypeRecoveryTests "resolve 'x' and 'y' locally under foo.rb" in { val Some(x) = cpg.identifier("x").where(_.file.name(".*foo.*")).headOption: @unchecked - x.typeFullName shouldBe "__builtin.Integer" + x.typeFullName shouldBe s"$kernelPrefix.Integer" val Some(y) = cpg.identifier("y").where(_.file.name(".*foo.*")).headOption: @unchecked - y.typeFullName shouldBe "__builtin.String" + y.typeFullName shouldBe s"$kernelPrefix.String" } "resolve 'FooModule.x' and 'FooModule.y' field access primitive types correctly" in { @@ -247,9 +269,9 @@ class RubyExternalTypeRecoveryTests .name("z") .l z1.typeFullName shouldBe "ANY" - z1.dynamicTypeHintFullName shouldBe Seq("__builtin.Integer", "__builtin.String") + z1.dynamicTypeHintFullName shouldBe Seq(s"$kernelPrefix.Integer", s"$kernelPrefix.String") z2.typeFullName shouldBe "ANY" - z2.dynamicTypeHintFullName shouldBe Seq("__builtin.Integer", "__builtin.String") + z2.dynamicTypeHintFullName shouldBe Seq(s"$kernelPrefix.Integer", s"$kernelPrefix.String") } "resolve 'FooModule.d' field access object types correctly" ignore { @@ -259,7 +281,7 @@ class RubyExternalTypeRecoveryTests .isIdentifier .name("d") .headOption: @unchecked - d.typeFullName shouldBe "dbi::program.DBI.connect." + d.typeFullName shouldBe "dbi.$Main.DBI.connect." d.dynamicTypeHintFullName shouldBe Seq() } @@ -270,7 +292,7 @@ class RubyExternalTypeRecoveryTests .isCall .name("select_one") .l - d.methodFullName shouldBe "dbi::program.DBI.connect..select_one" + d.methodFullName shouldBe "dbi.$Main.DBI.connect..select_one" d.dynamicTypeHintFullName shouldBe Seq() d.callee(NoResolve).isExternal.headOption shouldBe Some(true) } @@ -279,10 +301,10 @@ class RubyExternalTypeRecoveryTests "resolve correct imports via tag nodes" ignore { val List(foo: ResolvedTypeDecl) = cpg.file(".*foo.rb").ast.isCall.where(_.referencedImports).tag._toEvaluatedImport.toList: @unchecked - foo.fullName shouldBe "dbi::program.DBI" + foo.fullName shouldBe s"dbi.$Main.DBI" val List(bar: ResolvedTypeDecl) = cpg.file(".*bar.rb").ast.isCall.where(_.referencedImports).tag._toEvaluatedImport.toList: @unchecked - bar.fullName shouldBe "foo.rb::program.FooModule" + bar.fullName shouldBe s"foo.rb.$Main.FooModule" } } @@ -297,22 +319,35 @@ class RubyExternalTypeRecoveryTests |""".stripMargin) .moreCode(RubyExternalTypeRecoveryTests.LOGGER_GEMFILE, "Gemfile") - // TODO: Fix when external dependency resolving is complete - "resolve correct imports via tag nodes" ignore { - val List(logging: ResolvedMethod, _) = - cpg.call.where(_.referencedImports).tag._toEvaluatedImport.toList: @unchecked - logging.fullName shouldBe s"logger::program.Logger.${XDefines.ConstructorMethodName}" + "resolve correct imports via tag nodes" in { + inside(cpg.call.where(_.referencedImports).l) { + case loggerImport :: Nil => + inside( + loggerImport.tag._toEvaluatedImport + .filter(_.label == EvaluatedImport.RESOLVED_METHOD) + .map(_.asInstanceOf[ResolvedMethod]) + .filter(_.fullName == s"logger.Logger.${Defines.Initialize}") + .l + ) { + case loggerInit :: Nil => + loggerInit.fullName shouldBe s"logger.Logger.${Defines.Initialize}" + case xs => fail(s"Two ResolvedMethods expected, got [${xs.mkString(",")}]") + } + case xs => fail(s"Only logger library should be referenced, got [${xs.name.mkString}]") + } } - "provide a dummy type" in { + // TODO: Revisit + "provide a dummy type" ignore { val Some(log) = cpg.identifier("log").headOption: @unchecked - log.typeFullName shouldBe "logger.rb:::program.Logger" + log.typeFullName shouldBe "logger.Logger" val List(errorCall) = cpg.call("error").l - errorCall.methodFullName shouldBe "logger.rb:::program.Logger:error" + errorCall.methodFullName shouldBe "logger.Logger.error" } } - "assignment from a call to a identifier inside an imported module using methodCall" should { + // TODO: Fix parsing errors on Stripe library + "assignment from a call to a identifier inside an imported module using methodCall" ignore { lazy val cpg = code( """ |require 'stripe' @@ -324,18 +359,19 @@ class RubyExternalTypeRecoveryTests ) .moreCode(RubyExternalTypeRecoveryTests.STRIPE_GEMFILE, "Gemfile") - "resolved the type of call" ignore { + "resolved the type of call" in { val Some(create) = cpg.call("create").headOption: @unchecked - create.methodFullName shouldBe "stripe.rb:::program.Stripe.Customer:create" + create.methodFullName shouldBe s"stripe.rb:$Main.Stripe.Customer.create" } - "resolved the type of identifier" ignore { + "resolved the type of identifier" in { val Some(customer) = cpg.identifier("customer").headOption: @unchecked - customer.typeFullName shouldBe "stripe::program.Stripe.Customer.create." + customer.typeFullName shouldBe s"stripe.$Main.Stripe.Customer.create." } } - "recovery of type for call having a method with same name" should { + // TODO: revisit + "recovery of type for call having a method with same name" ignore { lazy val cpg = code(""" |require "logger" | @@ -349,11 +385,11 @@ class RubyExternalTypeRecoveryTests .moreCode(RubyExternalTypeRecoveryTests.LOGGER_GEMFILE, "Gemfile") "have a correct type for call `connect`" in { - cpg.call("error").methodFullName.l shouldBe List("logger.rb:::program.Logger:error") + cpg.call("error").methodFullName.l shouldBe List("logger.Logger.error") } "have a correct type for identifier `d`" in { - cpg.identifier("e").typeFullName.l shouldBe List("logger.rb:::program.Logger:error.") + cpg.identifier("e").typeFullName.l shouldBe List("logger.Logger.error.") } } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ArrayTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ArrayTests.scala index da05ac069b9d..914d4fcfc58c 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ArrayTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ArrayTests.scala @@ -1,8 +1,12 @@ package io.joern.rubysrc2cpg.querying +import io.joern.rubysrc2cpg.passes.GlobalTypes.{builtinPrefix, kernelPrefix} import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators +import io.shiftleft.codepropertygraph.generated.nodes.{Call, Literal} import io.shiftleft.semanticcpg.language.* +import io.joern.rubysrc2cpg.passes.Defines +import io.shiftleft.codepropertygraph.generated.nodes.Literal class ArrayTests extends RubyCode2CpgFixture { @@ -76,7 +80,7 @@ class ArrayTests extends RubyCode2CpgFixture { val List(foo) = arrayCall.argument.isLiteral.l foo.code shouldBe "foo" - foo.typeFullName shouldBe "__builtin.String" + foo.typeFullName shouldBe s"$kernelPrefix.String" } "`%i(x y)` is represented by an `arrayInitializer` operator call with arguments `:x`, `:y`" in { @@ -94,7 +98,44 @@ class ArrayTests extends RubyCode2CpgFixture { x.typeFullName shouldBe y.typeFullName y.code shouldBe "y" - y.typeFullName shouldBe "__builtin.Symbol" + y.typeFullName shouldBe s"$kernelPrefix.Symbol" + } + + "%W is represented an `arrayInitializer` operator call" in { + val cpg = code("""%W(x#{1 + 3} y#{23} z) + |""".stripMargin) + + val List(arrayCall) = cpg.call.name(Operators.arrayInitializer).l + + arrayCall.code shouldBe "%W(x#{1 + 3} y#{23} z)" + arrayCall.lineNumber shouldBe Some(1) + + val List(xFmt, yFmt) = arrayCall.argument.isCall.l + xFmt.name shouldBe Operators.formatString + xFmt.typeFullName shouldBe Defines.getBuiltInType(Defines.String) + + yFmt.name shouldBe Operators.formatString + yFmt.typeFullName shouldBe Defines.getBuiltInType(Defines.String) + + val List(xFmtStr) = xFmt.astChildren.isCall.l + xFmtStr.name shouldBe Operators.formattedValue + + val List(xFmtStrAdd) = xFmtStr.astChildren.isCall.l + xFmtStrAdd.name shouldBe Operators.addition + + val List(lhs, rhs) = xFmtStrAdd.argument.l + lhs.code shouldBe "1" + rhs.code shouldBe "3" + + val List(yFmtStr) = yFmt.astChildren.isCall.l + yFmtStr.name shouldBe Operators.formattedValue + + val List(yFmtStrLit: Literal) = yFmtStr.argument.l: @unchecked + yFmtStrLit.code shouldBe "23" + + val List(zLit) = arrayCall.argument.isLiteral.l + zLit.code shouldBe "z" + zLit.typeFullName shouldBe s"$kernelPrefix.String" } "an implicit array constructor (Array::[]) should be lowered to an array initializer" in { @@ -105,8 +146,8 @@ class ArrayTests extends RubyCode2CpgFixture { inside(cpg.call.nameExact("[]").l) { case bracketCall :: Nil => bracketCall.name shouldBe "[]" - bracketCall.methodFullName shouldBe "__builtin.Array:[]" - bracketCall.typeFullName shouldBe "__builtin.Array" + bracketCall.methodFullName shouldBe s"$builtinPrefix.Array.[]" + bracketCall.typeFullName shouldBe s"$builtinPrefix.Array" inside(bracketCall.argument.l) { case _ :: one :: two :: three :: Nil => @@ -120,4 +161,27 @@ class ArrayTests extends RubyCode2CpgFixture { } + "%I array" in { + val cpg = code("%I(test_#{1} test_2)") + + val List(arrayCall) = cpg.call.name(Operators.arrayInitializer).l + arrayCall.lineNumber shouldBe Some(1) + arrayCall.code shouldBe "%I(test_#{1} test_2)" + + val List(test1Fmt) = arrayCall.argument.isCall.l + test1Fmt.name shouldBe Operators.formatString + test1Fmt.typeFullName shouldBe Defines.getBuiltInType(Defines.Symbol) + test1Fmt.code shouldBe "test_#{1}" + + val List(test1FmtSymbol) = test1Fmt.astChildren.isCall.l + test1FmtSymbol.name shouldBe Operators.formattedValue + test1FmtSymbol.typeFullName shouldBe Defines.getBuiltInType(Defines.Symbol) + + val List(test1FmtFinal: Literal) = test1FmtSymbol.argument.l: @unchecked + test1FmtFinal.code shouldBe "1" + + val List(test2) = arrayCall.argument.isLiteral.l + test2.code shouldBe "test_2" + test2.typeFullName shouldBe Defines.getBuiltInType(Defines.Symbol) + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/AttributeAccessorTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/AttributeAccessorTests.scala new file mode 100644 index 000000000000..873ca54aa735 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/AttributeAccessorTests.scala @@ -0,0 +1,62 @@ +package io.joern.rubysrc2cpg.querying + +import io.joern.x2cpg.Defines +import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture +import io.shiftleft.codepropertygraph.generated.{Operators, DispatchTypes} +import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier} +import io.shiftleft.semanticcpg.language.* + +class AttributeAccessorTests extends RubyCode2CpgFixture { + + "`x.y=1` is approximated by a `x.y =` assignment with argument `1`" in { + val cpg = code("""x = Foo.new + |x.y = 1 + |""".stripMargin) + inside(cpg.assignment.where(_.source.isLiteral.codeExact("1")).l) { + case xyAssign :: Nil => + xyAssign.lineNumber shouldBe Some(2) + xyAssign.code shouldBe "x.y = 1" + + val fieldTarget = xyAssign.target.asInstanceOf[Call] + fieldTarget.code shouldBe "x.y" + fieldTarget.name shouldBe Operators.fieldAccess + fieldTarget.methodFullName shouldBe Operators.fieldAccess + fieldTarget.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + + inside(fieldTarget.argument.l) { + case (base: Identifier) :: (field: FieldIdentifier) :: Nil => + base.name shouldBe "x" + field.canonicalName shouldBe "@y" + field.code shouldBe "y" + case xs => fail("Expected field access to have two targets") + } + case xs => fail("Expected a single assignment to the literal `1`") + } + } + + "`x.y` is represented by a field access `x.y`" in { + val cpg = code("""x = Foo.new + |a = x.y + |b = x.z() + |""".stripMargin) + // Test the field access + inside(cpg.fieldAccess.lineNumber(2).codeExact("x.y").l) { + case xyCall :: Nil => + xyCall.lineNumber shouldBe Some(2) + xyCall.code shouldBe "x.y" + xyCall.methodFullName shouldBe Operators.fieldAccess + xyCall.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + case xs => fail("Expected a single field access for `x.y`") + } + // Test an explicit call with parenthesis + inside(cpg.call("z").lineNumber(3).l) { + case xzCall :: Nil => + xzCall.lineNumber shouldBe Some(3) + xzCall.code shouldBe "x.z()" + xzCall.methodFullName shouldBe Defines.DynamicCallUnknownFullName + xzCall.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + case xs => fail("Expected a single call for `x.z()`") + } + } + +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CallTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CallTests.scala index f7a81941d959..728a0ae461d1 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CallTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CallTests.scala @@ -1,13 +1,15 @@ package io.joern.rubysrc2cpg.querying -import io.joern.rubysrc2cpg.passes.Defines.RubyOperators +import io.joern.rubysrc2cpg.passes.{GlobalTypes, Defines as RubyDefines} +import io.joern.rubysrc2cpg.passes.Defines.{Main, RubyOperators} +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.Defines -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, NodeTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.semanticcpg.language.* -class CallTests extends RubyCode2CpgFixture { +class CallTests extends RubyCode2CpgFixture(withPostProcessing = true) { "`puts 'hello'` is represented by a CALL node" in { val cpg = code(""" @@ -17,14 +19,68 @@ class CallTests extends RubyCode2CpgFixture { val List(puts) = cpg.call.name("puts").l puts.lineNumber shouldBe Some(2) puts.code shouldBe "puts 'hello'" + puts.methodFullName shouldBe s"$kernelPrefix.puts" + puts.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH - val List(rec: Identifier, hello: Literal) = puts.argument.l: @unchecked - rec.argumentIndex shouldBe 0 - rec.name shouldBe "puts" + val List(selfReceiver: Identifier, hello: Literal) = puts.argument.l: @unchecked + selfReceiver.argumentIndex shouldBe 0 + selfReceiver.name shouldBe RubyDefines.Self + selfReceiver.code shouldBe RubyDefines.Self hello.argumentIndex shouldBe 1 hello.code shouldBe "'hello'" hello.lineNumber shouldBe Some(2) + + val List(callBase: Call) = puts.receiver.l: @unchecked + callBase.argumentIndex shouldBe -1 + callBase.methodFullName shouldBe Operators.fieldAccess + callBase.name shouldBe Operators.fieldAccess + callBase.code shouldBe "self.puts" + + val List(baseSelf: Identifier, baseProperty: FieldIdentifier) = callBase.argument.l: @unchecked + baseSelf.argumentIndex shouldBe 1 + baseSelf.name shouldBe RubyDefines.Self + baseProperty.argumentIndex shouldBe 2 + baseProperty.canonicalName shouldBe "puts" + } + + "a `Kernel` or bundled class function call in a fully qualified way should have a type ref receiver" in { + val cpg = code(""" + |Kernel.puts 'hello' + |Math.atan2(1, 1) + |""".stripMargin) + + val List(puts) = cpg.call.name("puts").l + puts.lineNumber shouldBe Some(2) + puts.code shouldBe "Kernel.puts 'hello'" + puts.methodFullName shouldBe s"$kernelPrefix.puts" + puts.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + + val List(kernelRec: Call) = puts.receiver.l: @unchecked + kernelRec.argumentIndex shouldBe -1 + kernelRec.typeFullName shouldBe Defines.Any + kernelRec.code shouldBe "Kernel.puts" + + kernelRec.argument(1).asInstanceOf[TypeRef].typeFullName shouldBe kernelPrefix + kernelRec.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "puts" + + val kernelBase = puts.argument(0).asInstanceOf[TypeRef] + kernelBase.typeFullName shouldBe kernelPrefix + kernelBase.code shouldBe "Kernel" + + val List(atan2) = cpg.call.name("atan2").l + atan2.lineNumber shouldBe Some(3) + atan2.code shouldBe "Math.atan2(1, 1)" + atan2.methodFullName shouldBe s"${GlobalTypes.builtinPrefix}.Math.atan2" + atan2.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + + val List(mathRec: Call) = atan2.receiver.l: @unchecked + mathRec.argumentIndex shouldBe -1 + mathRec.typeFullName shouldBe Defines.Any + mathRec.code shouldBe s"Math.atan2" + + mathRec.argument(1).asInstanceOf[TypeRef].typeFullName shouldBe s"${GlobalTypes.builtinPrefix}.Math" + mathRec.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "atan2" } "`foo(1,2)` is represented by a CALL node" in { @@ -80,9 +136,9 @@ class CallTests extends RubyCode2CpgFixture { "contain they keyword in the argumentName property" in { inside(cpg.call.nameExact("foo").argument.l) { - case (foo: Identifier) :: (hello: Literal) :: (baz: Literal) :: Nil => - foo.name shouldBe "foo" - foo.argumentIndex shouldBe 0 + case (self: Identifier) :: (hello: Literal) :: (baz: Literal) :: Nil => + self.name shouldBe RubyDefines.Self + self.argumentIndex shouldBe 0 hello.code shouldBe "\"hello\"" hello.argumentIndex shouldBe 1 @@ -105,13 +161,13 @@ class CallTests extends RubyCode2CpgFixture { |""".stripMargin) "create an assignment from `a` to an invocation block" in { - inside(cpg.method(":program").assignment.where(_.target.isIdentifier.name("a")).l) { + inside(cpg.method.isModule.assignment.where(_.target.isIdentifier.name("a")).l) { case assignment :: Nil => assignment.code shouldBe "a = A.new" inside(assignment.argument.l) { case (a: Identifier) :: (_: Block) :: Nil => a.name shouldBe "a" - a.dynamicTypeHintFullName should contain("Test0.rb:::program.A") + a.dynamicTypeHintFullName should contain(s"Test0.rb:$Main.A") case xs => fail(s"Expected one identifier and one call argument, got [${xs.code.mkString(",")}]") } case xs => fail(s"Expected a single assignment, got [${xs.code.mkString(",")}]") @@ -119,7 +175,7 @@ class CallTests extends RubyCode2CpgFixture { } "create an assignment from a temp variable to the call" in { - inside(cpg.method(":program").assignment.where(_.target.isIdentifier.name("")).l) { + inside(cpg.method.isModule.assignment.where(_.target.isIdentifier.name("")).l) { case assignment :: Nil => inside(assignment.argument.l) { case (a: Identifier) :: (alloc: Call) :: Nil => @@ -135,12 +191,12 @@ class CallTests extends RubyCode2CpgFixture { } "create a call to the object's constructor, with the temp variable receiver" in { - inside(cpg.call.nameExact(Defines.ConstructorMethodName).l) { + inside(cpg.call.nameExact("new").l) { case constructor :: Nil => inside(constructor.argument.l) { case (a: Identifier) :: Nil => a.name shouldBe "" - a.typeFullName shouldBe "Test0.rb:::program.A" + a.typeFullName shouldBe s"Test0.rb:$Main.A" a.argumentIndex shouldBe 0 case xs => fail(s"Expected one identifier and one call argument, got [${xs.code.mkString(",")}]") } @@ -162,7 +218,7 @@ class CallTests extends RubyCode2CpgFixture { inside(cpg.call("src").l) { case src :: Nil => src.name shouldBe "src" - src.methodFullName shouldBe "Test0.rb:::program:src" + src.methodFullName shouldBe s"Test0.rb:$Main.src" case xs => fail(s"Expected exactly one `src` call, instead got [${xs.code.mkString(",")}]") } } @@ -199,24 +255,39 @@ class CallTests extends RubyCode2CpgFixture { "named parameters in parenthesis-less call to a symbol value should create a correctly named argument" in { val cpg = code("on in: :sequence") - val List(_, inArg) = cpg.call.argument.l: @unchecked + val List(_, inArg) = cpg.call.nameExact("on").argument.l: @unchecked inArg.code shouldBe ":sequence" inArg.argumentName shouldBe Option("in") } + "named parameters in parenthesis-less call with a known keyword as the association key should shadow the keyword" in { + val cpg = code(""" + |foo retry: 3 + |""".stripMargin) + val List(_, retry) = cpg.call.nameExact("foo").argument.l: @unchecked + retry.code shouldBe "3" + retry.argumentName shouldBe Some("retry") + } + "a call with a quoted regex literal should have a literal receiver" in { - val cpg = code("%r{^/}.freeze") - val List(regexLiteral: Literal) = cpg.call.nameExact("freeze").receiver.l: @unchecked - regexLiteral.typeFullName shouldBe "__builtin.Regexp" + val cpg = code("%r{^/}.freeze()") + val regexLiteral = cpg.call.nameExact("freeze").receiver.fieldAccess.argument(1).head.asInstanceOf[Literal] + regexLiteral.typeFullName shouldBe s"$kernelPrefix.Regexp" regexLiteral.code shouldBe "%r{^/}" } "a call with a double colon receiver" in { - val cpg = code("::Augeas.open { |aug| aug.get('/augeas/version') }") - val List(augeas: Call) = cpg.call.nameExact("open").receiver.l: @unchecked - // TODO: Right now this is seen as a "getter" but should _probably_ be a field access, e.g. self.Augeas - augeas.methodFullName shouldBe "Test0.rb:::program:Augeas" - augeas.code shouldBe "::Augeas" + val cpg = code("::Augeas.open { |aug| aug.get('/augeas/version') }") + val augeasReceiv = cpg.call.nameExact("open").receiver.head.asInstanceOf[Call] + augeasReceiv.methodFullName shouldBe Operators.fieldAccess + augeasReceiv.code shouldBe "::Augeas.open" + + val selfAugeas = augeasReceiv.argument(1).asInstanceOf[Call] + + selfAugeas.argument(1).asInstanceOf[Identifier].name shouldBe RubyDefines.Self + selfAugeas.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "Augeas" + + augeasReceiv.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "open" } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CaseTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CaseTests.scala index fff1e06d8a20..f46d99664045 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CaseTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/CaseTests.scala @@ -1,10 +1,9 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.semanticcpg.language.* -import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.Operators - +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class CaseTests extends RubyCode2CpgFixture { "`case x ... end` should be represented with if-else chain and multiple match expressions should be or-ed together" in { @@ -20,7 +19,7 @@ class CaseTests extends RubyCode2CpgFixture { |""".stripMargin val cpg = code(caseCode) - val block @ List(_) = cpg.method(":program").block.astChildren.isBlock.l + val block @ List(_) = cpg.method.isModule.block.astChildren.isBlock.l val List(assign) = block.astChildren.assignment.l; val List(lhs, rhs) = assign.argument.l @@ -38,7 +37,7 @@ class CaseTests extends RubyCode2CpgFixture { .l orConds.map { case mExpr: Call if mExpr.name == "include?" => - val List(lhs, rhs) = mExpr.astChildren.l + val List(_, lhs, rhs) = mExpr.astChildren.l rhs.code shouldBe "" s"splat:${lhs.code}" case mExpr: Call if mExpr.name == Operators.equals => @@ -68,7 +67,7 @@ class CaseTests extends RubyCode2CpgFixture { |end |""".stripMargin) - val block @ List(_) = cpg.method(":program").block.astChildren.isBlock.l + val block @ List(_) = cpg.method.isModule.block.astChildren.isBlock.l val headIf @ List(_) = block.astChildren.isControlStructure.l val ifStmts @ List(_, _, _, _) = headIf.repeat(_.astChildren.order(3).astChildren.isControlStructure)(_.emit).l; @@ -80,7 +79,7 @@ class CaseTests extends RubyCode2CpgFixture { .l orConds.map { case c: Call if c.name == "any?" => - val List(lhs) = c.astChildren.l + val List(_, lhs) = c.astChildren.l s"splat:${lhs.code}" case e: Expression => s"expr:${e.code}" diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ClassTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ClassTests.scala index 4f358d0eba49..758676333e53 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ClassTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ClassTests.scala @@ -1,20 +1,13 @@ package io.joern.rubysrc2cpg.querying +import io.joern.rubysrc2cpg.passes.{GlobalTypes, Defines as RubyDefines} import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.Defines -import io.shiftleft.codepropertygraph.generated.{ModifierTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes.{ - Block, - Call, - FieldIdentifier, - Identifier, - Literal, - MethodRef, - Modifier, - Return -} +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import io.joern.rubysrc2cpg.passes.Defines as RubyDefines +import io.joern.rubysrc2cpg.passes.Defines.{Main, TypeDeclBody, Initialize} +import io.joern.rubysrc2cpg.passes.GlobalTypes class ClassTests extends RubyCode2CpgFixture { @@ -26,11 +19,19 @@ class ClassTests extends RubyCode2CpgFixture { val List(classC) = cpg.typeDecl.name("C").l classC.inheritsFromTypeFullName shouldBe List() - classC.fullName shouldBe "Test0.rb:::program.C" + classC.fullName shouldBe s"Test0.rb:$Main.C" classC.lineNumber shouldBe Some(2) classC.baseType.l shouldBe List() - classC.member.l shouldBe List() - classC.method.name.l shouldBe List("", "") + classC.member.name.l shouldBe List(RubyDefines.TypeDeclBody, RubyDefines.Initialize) + classC.method.name.l shouldBe List(RubyDefines.TypeDeclBody, RubyDefines.Initialize) + + val List(singletonC) = cpg.typeDecl.nameExact("C").l + singletonC.inheritsFromTypeFullName shouldBe List() + singletonC.fullName shouldBe s"Test0.rb:$Main.C" + singletonC.lineNumber shouldBe Some(2) + singletonC.baseType.l shouldBe List() + singletonC.member.name.l shouldBe List() + singletonC.method.name.l shouldBe List() } "`class C < D` is represented by a TYPE_DECL node inheriting from `D`" in { @@ -43,13 +44,21 @@ class ClassTests extends RubyCode2CpgFixture { val List(classC) = cpg.typeDecl.name("C").l classC.inheritsFromTypeFullName shouldBe List("D") - classC.fullName shouldBe "Test0.rb:::program.C" + classC.fullName shouldBe s"Test0.rb:$Main.C" classC.lineNumber shouldBe Some(2) - classC.member.l shouldBe List() - classC.method.name.l shouldBe List("", "") + classC.member.name.l shouldBe List(RubyDefines.TypeDeclBody, RubyDefines.Initialize) + classC.method.name.l shouldBe List(RubyDefines.TypeDeclBody, RubyDefines.Initialize) val List(typeD) = classC.baseType.l typeD.name shouldBe "D" + + val List(singletonC) = cpg.typeDecl.nameExact("C").l + + singletonC.inheritsFromTypeFullName shouldBe List("D") + singletonC.fullName shouldBe s"Test0.rb:$Main.C" + singletonC.lineNumber shouldBe Some(2) + singletonC.member.name.l shouldBe List() + singletonC.method.name.l shouldBe List() } "`attr_reader :a` is represented by a `@a` MEMBER node" in { @@ -60,11 +69,16 @@ class ClassTests extends RubyCode2CpgFixture { |""".stripMargin) val List(classC) = cpg.typeDecl.name("C").l - val List(aMember) = classC.member.l + val List(aMember) = classC.member.nameExact("@a").l - aMember.name shouldBe "@a" aMember.code shouldBe "attr_reader :a" aMember.lineNumber shouldBe Some(3) + + val List(singletonC) = cpg.typeDecl.name("C").l + singletonC.member.nameExact("@a").isEmpty shouldBe true + + val List(aGetterMember) = classC.member.nameExact("a").l + aGetterMember.dynamicTypeHintFullName should contain("Test0.rb:
.C.a") } "`attr_reader :'abc'` is represented by a `@abc` MEMBER node" in { @@ -79,6 +93,9 @@ class ClassTests extends RubyCode2CpgFixture { abcMember.code shouldBe "attr_reader :'abc'" abcMember.lineNumber shouldBe Some(3) + + val List(aMember) = classC.member.nameExact("abc").l + aMember.dynamicTypeHintFullName should contain("Test0.rb:
.C.abc") } "`attr_reader :'abc' creates an `abc` METHOD node" in { @@ -93,14 +110,17 @@ class ClassTests extends RubyCode2CpgFixture { methodAbc.code shouldBe "def abc (...)" methodAbc.lineNumber shouldBe Some(3) - methodAbc.parameter.isEmpty shouldBe true - methodAbc.fullName shouldBe "Test0.rb:::program.C:abc" + methodAbc.parameter.indexGt(0).isEmpty shouldBe true + methodAbc.fullName shouldBe s"Test0.rb:$Main.C.abc" - // TODO: Make sure that @abc in this return is the actual field val List(ret: Return) = methodAbc.methodReturn.cfgIn.l: @unchecked - val List(abcField: Identifier) = ret.astChildren.l: @unchecked - ret.code shouldBe "return @abc" - abcField.name shouldBe "@abc" + val List(abcFieldAccess: Call) = ret.astChildren.l: @unchecked + ret.code shouldBe "@abc" + abcFieldAccess.name shouldBe Operators.fieldAccess + abcFieldAccess.code shouldBe "self.@abc" + + val List(aMember) = classC.member.nameExact("abc").l + aMember.dynamicTypeHintFullName should contain("Test0.rb:
.C.abc") } "`attr_reader :a, :b` is represented by `@a`, `@b` MEMBER nodes" in { @@ -143,15 +163,19 @@ class ClassTests extends RubyCode2CpgFixture { methodA.code shouldBe "def a= (...)" methodA.lineNumber shouldBe Some(3) - methodA.fullName shouldBe "Test0.rb:::program.C:a=" + methodA.fullName shouldBe s"Test0.rb:$Main.C.a=" // TODO: there's probably a better way for testing this - val List(param) = methodA.parameter.l - val List(assignment) = methodA.assignment.l - val List(lhs: Identifier, rhs: Identifier) = assignment.argument.l: @unchecked + val List(_, param) = methodA.parameter.l + val List(assignment) = methodA.assignment.l + val List(lhs: Call, rhs: Identifier) = assignment.argument.l: @unchecked param.name shouldBe rhs.name - lhs.name shouldBe "@a" + lhs.name shouldBe Operators.fieldAccess + lhs.code shouldBe "self.@a" + + val List(aMember) = classC.member.nameExact("a=").l + aMember.dynamicTypeHintFullName should contain("Test0.rb:
.C.a=") } "`attr_accessor :a` is represented by a `@a` MEMBER node" in { @@ -180,10 +204,68 @@ class ClassTests extends RubyCode2CpgFixture { val List(classC) = cpg.typeDecl.name("C").l val List(methodF) = classC.method.name("f").l - methodF.fullName shouldBe "Test0.rb:::program.C:f" + methodF.fullName shouldBe s"Test0.rb:$Main.C.f" + + val List(memberF) = classC.member.nameExact("f").l + memberF.dynamicTypeHintFullName.toSet should contain(methodF.fullName) + } + + "`M.method` in a module `M` should have a method bound to a member under the module's singleton type declaration" in { + val cpg = code(""" + |module M + | def M.method(x) + | x + | end + |end + |def main(p) + | M::method(p) + |end + |""".stripMargin) + + // Obtain the nodes first + val regularTypeDecl = cpg.typeDecl.nameExact("M").head + val singletonTypeDecl = cpg.typeDecl.nameExact("M").head + val method = regularTypeDecl.method.nameExact("method").head + val methodTypeDecl = cpg.typeDecl.fullNameExact(method.fullName).head + val methodMember = singletonTypeDecl.member.nameExact("method").head + // Now determine the properties and potential edges + methodMember.dynamicTypeHintFullName.toSet should contain(method.fullName) + methodTypeDecl.methodBinding.flatMap(_.boundMethod).head shouldBe method + } + + "a method in a nested module should have the nested module's member-type and nested types' method" in { + val cpg = code(""" + |module MMM + | module Nested + | def self.method(x) + | x + | end + | end + |end + |def outer(aaa) + | MMM::Nested::method(aaa) + |end + |""".stripMargin) + + val nestedTypeDecl = cpg.typeDecl("Nested").head + val nestedSingleton = cpg.typeDecl("Nested").head + val nestedTypeDeclMember = cpg.member("Nested").head + val singletonTypeDecl = cpg.typeDecl.nameExact("Nested").head + + val method = nestedTypeDecl.method.nameExact("method").head + val methodTypeDecl = cpg.typeDecl.fullNameExact(method.fullName).head + val methodMember = singletonTypeDecl.member.nameExact("method").head + + nestedTypeDeclMember.typeDecl.name shouldBe "MMM" + nestedTypeDeclMember.dynamicTypeHintFullName.toSet should contain(nestedSingleton.fullName) + + singletonTypeDecl.astParent.asInstanceOf[TypeDecl].name shouldBe "MMM" + + methodMember.dynamicTypeHintFullName.toSet should contain(method.fullName) + methodTypeDecl.methodBinding.flatMap(_.boundMethod).head shouldBe method } - "`def initialize() ... end` directly inside a class has method name ``" in { + "`def initialize() ... end` directly inside a class has the constructor modifier" in { val cpg = code(""" |class C | def initialize() @@ -192,9 +274,10 @@ class ClassTests extends RubyCode2CpgFixture { |""".stripMargin) val List(classC) = cpg.typeDecl.name("C").l - val List(methodInit) = classC.method.name("").l + val List(methodInit) = classC.method.name(RubyDefines.Initialize).l - methodInit.fullName shouldBe "Test0.rb:::program.C:" + methodInit.fullName shouldBe s"Test0.rb:$Main.C.${RubyDefines.Initialize}" + methodInit.isConstructor.isEmpty shouldBe false } "`class C end` has default constructor" in { @@ -204,12 +287,12 @@ class ClassTests extends RubyCode2CpgFixture { |""".stripMargin) val List(classC) = cpg.typeDecl.name("C").l - val List(methodInit) = classC.method.name("").l + val List(methodInit) = classC.method.name(RubyDefines.Initialize).l - methodInit.fullName shouldBe "Test0.rb:::program.C:" + methodInit.fullName shouldBe s"Test0.rb:$Main.C.${RubyDefines.Initialize}" } - "`def initialize() ... end` not directly under class has method name `initialize`" in { + "only `def initialize() ... end` directly under class has the constructor modifier" in { val cpg = code(""" |def initialize() | 1 @@ -230,7 +313,22 @@ class ClassTests extends RubyCode2CpgFixture { |end |""".stripMargin) - cpg.method.name("").literal.code.l should be(empty) + cpg.method.nameExact(RubyDefines.Initialize).where(_.isConstructor).literal.code.l should be(empty) + } + + "Constants should be defined under the respective singleton" in { + val cpg = code(""" + |module MMM + | MConst = 2 + | module Nested + | NConst = 4 + | end + |end + | + |""".stripMargin) + + cpg.member("MConst").typeDecl.fullName.head shouldBe s"Test0.rb:$Main.MMM" + cpg.member("NConst").typeDecl.fullName.head shouldBe s"Test0.rb:$Main.MMM.Nested" } "a basic anonymous class" should { @@ -246,14 +344,14 @@ class ClassTests extends RubyCode2CpgFixture { inside(cpg.typeDecl.nameExact("").l) { case anonClass :: Nil => anonClass.name shouldBe "" - anonClass.fullName shouldBe "Test0.rb:::program." + anonClass.fullName shouldBe s"Test0.rb:$Main." inside(anonClass.method.l) { - case defaultConstructor :: hello :: Nil => - defaultConstructor.name shouldBe Defines.ConstructorMethodName - defaultConstructor.fullName shouldBe s"Test0.rb:::program.:${Defines.ConstructorMethodName}" + case hello :: defaultConstructor :: Nil => + defaultConstructor.name shouldBe RubyDefines.Initialize + defaultConstructor.fullName shouldBe s"Test0.rb:$Main..${RubyDefines.Initialize}" hello.name shouldBe "hello" - hello.fullName shouldBe "Test0.rb:::program.:hello" + hello.fullName shouldBe s"Test0.rb:$Main..hello" case xs => fail(s"Expected a single method, but got [${xs.map(x => x.label -> x.code).mkString(",")}]") } case xs => fail(s"Expected a single anonymous class, but got [${xs.map(x => x.label -> x.code).mkString(",")}]") @@ -261,18 +359,17 @@ class ClassTests extends RubyCode2CpgFixture { } "generate an assignment to the variable `a` with the source being a constructor invocation of the class" in { - inside(cpg.method(":program").assignment.l) { + inside(cpg.method.isModule.assignment.l) { case aAssignment :: Nil => aAssignment.target.code shouldBe "a" - // TODO: Constructors are not supported, we simply check the `code` property - aAssignment.source.code shouldBe "Class.new" + aAssignment.source.code shouldBe "Class.new (...)" case xs => fail(s"Expected a single assignment, but got [${xs.map(x => x.label -> x.code).mkString(",")}]") } } } - "a basic singleton class" should { + "a basic singleton class extending an object instance" should { val cpg = code("""class Animal; end |animal = Animal.new | @@ -280,35 +377,49 @@ class ClassTests extends RubyCode2CpgFixture { | def bark | 'Woof' | end + | + | def legs + | 4 + | end |end | |animal.bark # => 'Woof' |""".stripMargin) - "generate a type decl with the associated members" in { - inside(cpg.typeDecl.nameExact("").l) { - case anonClass :: Nil => - anonClass.name shouldBe "" - anonClass.fullName shouldBe "Test0.rb:::program." - // TODO: Attempt to resolve the below with the `scope` class once we're handling constructors - anonClass.inheritsFromTypeFullName shouldBe Seq("animal") - inside(anonClass.method.l) { - case defaultConstructor :: bark :: Nil => - defaultConstructor.name shouldBe Defines.ConstructorMethodName - defaultConstructor.fullName shouldBe s"Test0.rb:::program.:${Defines.ConstructorMethodName}" + "Create assignments to method refs for methods on singleton object" in { + inside(cpg.method.isModule.block.assignment.l) { + case _ :: _ :: _ :: barkAssignment :: legsAssignment :: Nil => + inside(barkAssignment.argument.l) { + case (lhs: Call) :: (rhs: TypeRef) :: Nil => + val List(identifier, fieldIdentifier) = lhs.argument.l: @unchecked + identifier.code shouldBe "animal" + fieldIdentifier.code shouldBe "bark" + + rhs.typeFullName shouldBe s"Test0.rb:$Main.class< fail(s"Expected two arguments for assignment, got [${xs.code.mkString(",")}]") + } - bark.name shouldBe "bark" - bark.fullName shouldBe "Test0.rb:::program.:bark" - case xs => fail(s"Expected a single method, but got [${xs.map(x => x.label -> x.code).mkString(",")}]") + inside(legsAssignment.argument.l) { + case (lhs: Call) :: (rhs: TypeRef) :: Nil => + val List(identifier, fieldIdentifier) = lhs.argument.l: @unchecked + identifier.code shouldBe "animal" + fieldIdentifier.code shouldBe "legs" + + rhs.typeFullName shouldBe s"Test0.rb:$Main.class< fail(s"Expected two arguments for assignment, got [${xs.code.mkString(",")}]") } - case xs => fail(s"Expected a single anonymous class, but got [${xs.map(x => x.label -> x.code).mkString(",")}]") + case xs => fail(s"Expected five assignments, got [${xs.code.mkString(",")}]") } } - "register that `animal` may possibly be an instantiation of the singleton type" in { - cpg.local("animal").possibleTypes.l should contain("Test0.rb:::program.") + "Create TYPE_DECL nodes for two singleton methods" in { + inside(cpg.typeDecl.name("(bark|legs)").l) { + case barkTypeDecl :: legsTypeDecl :: Nil => + barkTypeDecl.fullName shouldBe s"Test0.rb:$Main.class< fail(s"Expected two type_decls, got [${xs.code.mkString(",")}]") + } } - } "if: as function param" should { @@ -324,7 +435,7 @@ class ClassTests extends RubyCode2CpgFixture { |""".stripMargin) inside(cpg.typeDecl.name("User").l) { case userType :: Nil => - inside(userType.method.name(Defines.ConstructorMethodName).l) { + inside(userType.method.name(RubyDefines.TypeDeclBody).l) { case constructor :: Nil => inside(constructor.astChildren.isBlock.l) { case methodBlock :: Nil => @@ -358,7 +469,7 @@ class ClassTests extends RubyCode2CpgFixture { inside(cpg.typeDecl.name("AdminController").l) { case adminTypeDecl :: Nil => - inside(adminTypeDecl.method.name(Defines.ConstructorMethodName).l) { + inside(adminTypeDecl.method.name(RubyDefines.TypeDeclBody).l) { case constructor :: Nil => inside(constructor.astChildren.isBlock.l) { case methodBlock :: Nil => @@ -383,12 +494,14 @@ class ClassTests extends RubyCode2CpgFixture { } } - "fully qualified base types" should { + "base types names extending a class in the definition" should { val cpg = code("""require "rails/all" | |module Bar - | class Baz + | module Baz + | class Boz + | end | end |end | @@ -396,12 +509,12 @@ class ClassTests extends RubyCode2CpgFixture { | class Application < Rails::Application | end | - | class Foo < Bar::Baz + | class Foo < Bar::Baz::Boz | end |end |""".stripMargin) - "not confuse the internal `Application` with `Rails::Application` and leave the type unresolved" in { + "handle a qualified base type from an external type correctly" in { inside(cpg.typeDecl("Application").headOption) { case Some(app) => app.inheritsFromTypeFullName.head shouldBe "Rails.Application" @@ -409,10 +522,10 @@ class ClassTests extends RubyCode2CpgFixture { } } - "resolve the internal type being referenced" in { + "handle a deeply qualified internal base type correctly" in { inside(cpg.typeDecl("Foo").headOption) { case Some(app) => - app.inheritsFromTypeFullName.head shouldBe "Test0.rb:::program.Bar.Baz" + app.inheritsFromTypeFullName.head shouldBe "Bar.Baz.Boz" case None => fail("Expected a type decl for 'Foo', instead got nothing") } } @@ -443,7 +556,7 @@ class ClassTests extends RubyCode2CpgFixture { "create respective member nodes" in { inside(cpg.typeDecl.name("Foo").l) { case fooType :: Nil => - inside(fooType.member.l) { + inside(fooType.member.name("@.*").l) { case aMember :: bMember :: cMember :: dMember :: oMember :: Nil => // Test that all members in class are present aMember.code shouldBe "@a" @@ -460,7 +573,7 @@ class ClassTests extends RubyCode2CpgFixture { "create nil assignments under the class initializer" in { inside(cpg.typeDecl.name("Foo").l) { case fooType :: Nil => - inside(fooType.method.name(Defines.ConstructorMethodName).l) { + inside(fooType.method.name(RubyDefines.TypeDeclBody).l) { case initMethod :: Nil => inside(initMethod.block.astChildren.isCall.name(Operators.assignment).l) { case aAssignment :: bAssignment :: cAssignment :: dAssignment :: oAssignment :: Nil => @@ -473,12 +586,12 @@ class ClassTests extends RubyCode2CpgFixture { inside(aAssignment.argument.l) { case (lhs: Call) :: (rhs: Literal) :: Nil => - lhs.code shouldBe "this.@a" + lhs.code shouldBe s"${RubyDefines.Self}.@a" lhs.methodFullName shouldBe Operators.fieldAccess inside(lhs.argument.l) { case (identifier: Identifier) :: (fieldIdentifier: FieldIdentifier) :: Nil => - identifier.code shouldBe RubyDefines.This + identifier.code shouldBe RubyDefines.Self fieldIdentifier.code shouldBe "@a" case _ => fail("Expected identifier and fieldIdentifier for fieldAccess") } @@ -486,13 +599,30 @@ class ClassTests extends RubyCode2CpgFixture { rhs.code shouldBe "nil" case _ => fail("Expected only LHS and RHS for assignment call") } - case _ => fail("") + case xs => fail(s"Expected assignments, got [${xs.code.mkString}]") } case xs => fail(s"Expected one method for init, instead got ${xs.name.mkString(", ")}") } case xs => fail(s"Expected TypeDecl for Foo, instead got ${xs.name.mkString(", ")}") } } + + "call the body method" in { + inside(cpg.call.nameExact(RubyDefines.TypeDeclBody).headOption) { + case Some(bodyCall) => + bodyCall.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + bodyCall.methodFullName shouldBe s"Test0.rb:$Main.Foo.${RubyDefines.TypeDeclBody}" + + bodyCall.receiver.isEmpty shouldBe true + inside(bodyCall.argumentOption(0)) { + case Some(selfArg: Call) => + selfArg.name shouldBe Operators.fieldAccess + selfArg.code shouldBe "self::Foo" + case None => fail("Expected `self` argument") + } + case None => fail("Expected call") + } + } } "Class Variables in Class and Methods" should { @@ -518,9 +648,9 @@ class ClassTests extends RubyCode2CpgFixture { |""".stripMargin) "create respective member nodes" in { - inside(cpg.typeDecl.name("Foo").l) { + inside(cpg.typeDecl.nameExact("Foo").l) { case fooType :: Nil => - inside(fooType.member.l) { + inside(fooType.member.name("@.*").l) { case aMember :: bMember :: cMember :: dMember :: oMember :: Nil => // Test that all members in class are present aMember.code shouldBe "@@a" @@ -537,7 +667,7 @@ class ClassTests extends RubyCode2CpgFixture { "create nil assignments under the class initializer" in { inside(cpg.typeDecl.name("Foo").l) { case fooType :: Nil => - inside(fooType.method.name(Defines.StaticInitMethodName).l) { + inside(fooType.method.name(RubyDefines.TypeDeclBody).l) { case clinitMethod :: Nil => inside(clinitMethod.block.astChildren.isCall.name(Operators.assignment).l) { case aAssignment :: bAssignment :: cAssignment :: dAssignment :: oAssignment :: Nil => @@ -550,12 +680,12 @@ class ClassTests extends RubyCode2CpgFixture { inside(aAssignment.argument.l) { case (lhs: Call) :: (rhs: Literal) :: Nil => - lhs.code shouldBe "Foo.@@a" + lhs.code shouldBe s"${RubyDefines.Self}.@@a" lhs.methodFullName shouldBe Operators.fieldAccess inside(lhs.argument.l) { case (identifier: Identifier) :: (fieldIdentifier: FieldIdentifier) :: Nil => - identifier.code shouldBe "Foo" + identifier.code shouldBe RubyDefines.Self fieldIdentifier.code shouldBe "@@a" case _ => fail("Expected identifier and fieldIdentifier for fieldAccess") } @@ -596,7 +726,9 @@ class ClassTests extends RubyCode2CpgFixture { } "create the `StandardError` local variable" in { - cpg.local.nameExact("some_variable").dynamicTypeHintFullName.toList shouldBe List("__builtin.StandardError") + cpg.local.nameExact("some_variable").dynamicTypeHintFullName.toList shouldBe List( + s"${GlobalTypes.builtinPrefix}.StandardError" + ) } "create the splatted error local variable" in { @@ -617,15 +749,15 @@ class ClassTests extends RubyCode2CpgFixture { "be moved to constructor method" in { inside(cpg.typeDecl.name("Foo").l) { case fooClass :: Nil => - inside(fooClass.method.name(Defines.ConstructorMethodName).l) { + inside(fooClass.method.name(RubyDefines.TypeDeclBody).l) { case initMethod :: Nil => inside(initMethod.astChildren.isBlock.astChildren.isCall.l) { case scopeCall :: Nil => scopeCall.code shouldBe "scope :published, -> { where(status: \"Published\") }" inside(scopeCall.argument.l) { - case (scopeIdent: Identifier) :: (literalArg: Literal) :: unknownArg :: Nil => - scopeIdent.code shouldBe "scope" + case (self: Identifier) :: (literalArg: Literal) :: unknownArg :: Nil => + self.code shouldBe "self" literalArg.code shouldBe ":published" case xs => fail(s"Expected three arguments, got ${xs.code.mkString(", ")} instead") } @@ -640,29 +772,38 @@ class ClassTests extends RubyCode2CpgFixture { "Scope call with Lambda Expression" should { val cpg = code(""" - |class Foo - | scope :hits_by_ip, ->(ip, col = "*") { select("#{col}").where(ip_address: ip).order("id DESC") } - | def bar - | puts 1 - | end - |end - |""".stripMargin) + |class Foo + | scope :hits_by_ip, ->(ip, col = "*") { select("#{col}").where(ip_address: ip).order("id DESC") } + | def bar + | puts 1 + | end + |end + |""".stripMargin) "correct method full name for method ref under call" in { inside(cpg.typeDecl.name("Foo").l) { case fooClass :: Nil => - inside(fooClass.method.name(Defines.ConstructorMethodName).l) { + inside(fooClass.method.name(RubyDefines.TypeDeclBody).l) { case initMethod :: Nil => + initMethod.code shouldBe "def \nscope :hits_by_ip, ->(ip, col = \"*\") { select(\"#{col}\").where(ip_address: ip).order(\"id DESC\") }\nend" inside(initMethod.astChildren.isBlock.l) { case methodBlock :: Nil => inside(methodBlock.astChildren.l) { case methodCall :: Nil => inside(methodCall.astChildren.l) { - case (identifier: Identifier) :: (literal: Literal) :: (methodRef: MethodRef) :: Nil => - identifier.code shouldBe "scope" + case (base: Call) :: (self: Identifier) :: (literal: Literal) :: (typeRef: TypeRef) :: Nil => + base.code shouldBe "self.scope" + self.name shouldBe "self" literal.code shouldBe ":hits_by_ip" - methodRef.methodFullName shouldBe "Test0.rb:::program.Foo::0" - methodRef.referencedMethod.parameter.indexGt(0).name.l shouldBe List("ip", "col") + typeRef.typeFullName shouldBe s"Test0.rb:$Main.Foo.${RubyDefines.TypeDeclBody}.0&Proc" + cpg.method + .fullNameExact( + typeRef.typ.referencedTypeDecl.member.name("call").dynamicTypeHintFullName.toSeq* + ) + .parameter + .indexGt(0) + .name + .l shouldBe List("ip", "col") case xs => fail(s"Expected three children, got ${xs.code.mkString(", ")} instead") } case xs => fail(s"Expected one call, got ${xs.code.mkString(", ")} instead") @@ -674,20 +815,138 @@ class ClassTests extends RubyCode2CpgFixture { case xs => fail(s"Expected one class, got ${xs.code.mkString(", ")} instead") } } + } - "correct method def under block" in { - inside(cpg.typeDecl.name("Foo").l) { - case fooClass :: Nil => - inside(fooClass.method.name(Defines.ConstructorMethodName).l) { - case initMethod :: Nil => - inside(initMethod.astChildren.isMethod.l) { - case lambdaMethod :: Nil => - lambdaMethod.fullName shouldBe "Test0.rb:::program.Foo::0" - case xs => fail(s"Expected method decl for lambda, got ${xs.code.mkString(", ")} instead") + // TODO: Fix when implementing calls vs field accesses, currently handled as a MemberAccess where the target becomes "Encoding" + // which is resolved as `<__builtin.Encoding>`, and then adds the `Converter` as a function call, so type ends up being + // `<__builtin.Encoding>:Converter` + "GlobalTypes::BundledClasses" ignore { + val cpg = code(""" + |a = Encoding::Converter.asciicompat_encoding("abc") + |""".stripMargin) + + "resolve call type" in { + inside(cpg.call.nameExact(Operators.assignment).l) { + case assignCall :: Nil => + inside(assignCall.argument.l) { + case lhs :: (rhs: Call) :: Nil => + rhs.typeFullName shouldBe "__builtin.Encoding.Converter.asciicompat_encoding" + case xs => fail(s"Expected lhs and rhs for assignment call, got [${xs.code.mkString(",")}]") + } + case xs => fail(s"Expected one call for assignment, got [${xs.code.mkString(",")}]") + } + } + } + + "Class definition on one line" should { + val cpg = code(""" + |class X 1 end + |""".stripMargin) + + "create TYPE_DECL" in { + inside(cpg.typeDecl.name("X").l) { + case xClass :: Nil => + inside(xClass.astChildren.isMethod.l) { + case bodyMethod :: initMethod :: Nil => + inside(bodyMethod.block.astChildren.l) { + case (literal: Literal) :: Nil => + literal.code shouldBe "1" + case xs => fail(s"Expected literal for body method, got [${xs.code.mkString(",")}]") } - case xs => fail(s"Expected one init method, got ${xs.code.mkString(", ")} instead") + case xs => fail(s"Expected body and init method, got [${xs.code.mkString(",")}]") } - case xs => fail(s"Expected one class, got ${xs.code.mkString(", ")} instead") + case xs => fail(s"Expected one class, got [${xs.code.mkString(",")}]") + } + } + } + + "A call to super" should { + val cpg = code(""" + |class A + | def foo(a) + | end + |end + |class B < A + | def foo(a) + | super(a) + | end + |end + |""".stripMargin) + + "create a simple call" in { + val superCall = cpg.call.nameExact("super").head + superCall.code shouldBe "super(a)" + superCall.name shouldBe "super" + superCall.methodFullName shouldBe Defines.DynamicCallUnknownFullName + } + } + + "a class that is redefined should have a counter suffixed to ensure uniqueness" in { + val cpg = code(""" + |class Foo + | def foo;end + |end + |class Bar;end + |class Foo + | def foo;end + |end + |class Foo;end + |""".stripMargin) + + cpg.typeDecl.name("(Foo|Bar).*").filterNot(_.name.endsWith("")).name.l shouldBe List( + "Foo", + "Bar", + "Foo", + "Foo" + ) + cpg.typeDecl.name("(Foo|Bar).*").filterNot(_.name.endsWith("")).fullName.l shouldBe List( + s"Test0.rb:$Main.Foo", + s"Test0.rb:$Main.Bar", + s"Test0.rb:$Main.Foo0", + s"Test0.rb:$Main.Foo1" + ) + + cpg.method.nameExact("foo").fullName.l shouldBe List(s"Test0.rb:$Main.Foo.foo", s"Test0.rb:$Main.Foo0.foo") + + } + + "Class with nonAllowedTypeDeclChildren and explicit init" should { + val cpg = code(""" + |class Foo + | 1 + | def initialize(bar) + | puts bar + | end + |end + |""".stripMargin) + + "have an explicit init method" in { + inside(cpg.typeDecl.nameExact("Foo").method.l) { + case initMethod :: bodyMethod :: Nil => + bodyMethod.name shouldBe TypeDeclBody + + initMethod.name shouldBe Initialize + inside(initMethod.parameter.l) { + case selfParam :: barParam :: Nil => + selfParam.name shouldBe "self" + barParam.name shouldBe "bar" + case xs => fail(s"Expected two params, got [${xs.code.mkString(",")}]") + } + + inside(initMethod.block.astChildren.l) { + case (putsCall: Call) :: Nil => + putsCall.name shouldBe "puts" + case xs => fail(s"Expected one call, got [${xs.code.mkString(",")}]") + } + + inside(bodyMethod.block.astChildren.l) { + case (one: Literal) :: Nil => + one.code shouldBe "1" + one.typeFullName shouldBe s"${GlobalTypes.kernelPrefix}.Integer" + case xs => fail(s"Expected one literal, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected body method and init method, got [${xs.code.mkString(",")}]") } } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ConditionalTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ConditionalTests.scala index 3a5c1619a2b9..3ed14c936954 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ConditionalTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ConditionalTests.scala @@ -9,7 +9,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.Call class ConditionalTests extends RubyCode2CpgFixture { "`x ? y : z` is lowered into an if-else expression" in { - val cpg = code(""" + val cpg = code("""x, y, z = false, true, false |x ? y : z |""".stripMargin) @@ -27,11 +27,11 @@ class ConditionalTests extends RubyCode2CpgFixture { inside(ifStmt.astChildren.isBlock.l) { case ifBlock :: elseBlock :: Nil => - val (_: Local) :: (y: Identifier) :: Nil = ifBlock.astChildren.l: @unchecked + val (y: Identifier) :: Nil = ifBlock.astChildren.l: @unchecked y.name shouldBe "y" y.lineNumber shouldBe Some(2) - val (_: Local) :: (z: Identifier) :: Nil = elseBlock.astChildren.l: @unchecked + val (z: Identifier) :: Nil = elseBlock.astChildren.l: @unchecked z.name shouldBe "z" z.lineNumber shouldBe Some(2) case xs => fail(s"Expected exactly two blocks under the if-structure, got [${xs.code.mkString(",")}]") @@ -41,7 +41,7 @@ class ConditionalTests extends RubyCode2CpgFixture { } "`f(x ? y : z)` is lowered into conditional operator" in { - val cpg = code(""" + val cpg = code("""x, y, z = false, true, false |f(x ? y : z) |""".stripMargin) inside(cpg.call(Operators.conditional).l) { @@ -58,7 +58,7 @@ class ConditionalTests extends RubyCode2CpgFixture { } "`f(unless x then y else z end)` is lowered into conditional operator" in { - val cpg = code(""" + val cpg = code("""x, y, z = false, true, false |f(unless x then y else z end) |""".stripMargin) inside(cpg.call(Operators.conditional).l) { diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ContentTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ContentTests.scala new file mode 100644 index 000000000000..85a8db6c92a9 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ContentTests.scala @@ -0,0 +1,77 @@ +package io.joern.rubysrc2cpg.querying + +import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture +import io.shiftleft.semanticcpg.language.* + +class ContentTests extends RubyCode2CpgFixture(disableFileContent = false) { + "Content of file" in { + val fileContent = + """ + |class Animal + |end + | + |def foo + | puts "a" + |end + |""".stripMargin + + val cpg = code(fileContent, "Test0.rb") + + cpg.file.name("Test0.rb").content.head shouldBe fileContent + } + + "Content of method" in { + + val fooFunc = + """def foo + | puts "a" + |end""".stripMargin + + val cpg = code(s"""$fooFunc""".stripMargin) + + val method = cpg.method.name("foo").head + + method.content.head shouldBe fooFunc + } + + "Content of Class" in { + val cls = + """class Animal + |end""".stripMargin + + val cpg = code(s"""$cls""".stripMargin) + val animal = cpg.typeDecl.name("Animal").head + + animal.content.head shouldBe cls + } + + "Content of Module" in { + val mod = """module Foo + |end""".stripMargin + + val cpg = code(mod) + val module = cpg.typeDecl.name("Foo").head + + module.content.head shouldBe mod + } + + "Method and Class content" in { + val cls = + """class Animal + |end""".stripMargin + + val fooFunc = + """def foo + | puts "a" + |end""".stripMargin + + val cpg = code(s"""$cls + |$fooFunc""".stripMargin) + + val method = cpg.method.name("foo").head + val animal = cpg.typeDecl.name("Animal").head + + method.content.head shouldBe fooFunc + animal.content.head shouldBe cls + } +} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ControlStructureTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ControlStructureTests.scala index 1bf780877fd2..2007e59ea37d 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ControlStructureTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ControlStructureTests.scala @@ -1,6 +1,6 @@ package io.joern.rubysrc2cpg.querying -import io.joern.rubysrc2cpg.astcreation.RubyIntermediateAst.SimpleIdentifier +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Operators} import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal} @@ -293,7 +293,7 @@ class ControlStructureTests extends RubyCode2CpgFixture { whileCond.code shouldBe "true" whileCond.lineNumber shouldBe Some(2) - putsHi.methodFullName shouldBe "__builtin:puts" + putsHi.methodFullName shouldBe s"$kernelPrefix.puts" putsHi.code shouldBe "puts 'hi'" putsHi.lineNumber shouldBe Some(2) } @@ -518,4 +518,18 @@ class ControlStructureTests extends RubyCode2CpgFixture { } } } + + "Generate continue node for next" in { + val cpg = code(""" + |for i in arr do + | next if i % 2 == 0 + |end + |""".stripMargin) + + inside(cpg.controlStructure.controlStructureType(ControlStructureTypes.CONTINUE).l) { + case nextControl :: Nil => + nextControl.code shouldBe "next" + case xs => fail(s"Expected next to be continue, got [${xs.code.mkString(",")}]") + } + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DependencyTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DependencyTests.scala index 31e86cd313b8..8b0148d6ae5c 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DependencyTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DependencyTests.scala @@ -5,6 +5,7 @@ import io.joern.x2cpg.Defines import io.joern.rubysrc2cpg.passes.Defines as RubyDefines import io.shiftleft.codepropertygraph.generated.nodes.{Block, Identifier} import io.shiftleft.semanticcpg.language.* +import io.joern.rubysrc2cpg.passes.Defines.Main class DependencyTests extends RubyCode2CpgFixture { @@ -92,11 +93,11 @@ class DownloadDependencyTest extends RubyCode2CpgFixture(downloadDependencies = "recognize the full method name of the imported Main_outer_class's constructor" in { inside(cpg.assignment.where(_.target.isIdentifier.name("v")).argument.l) { case (v: Identifier) :: (block: Block) :: Nil => - v.dynamicTypeHintFullName should contain("dummy_logger.rb:::program.Main_module.Main_outer_class") + v.dynamicTypeHintFullName should contain("dummy_logger.Main_module.Main_outer_class") - inside(block.astChildren.isCall.name(Defines.ConstructorMethodName).headOption) { + inside(block.astChildren.isCall.nameExact("new").headOption) { case Some(constructorCall) => - constructorCall.methodFullName shouldBe "dummy_logger.rb:::program.Main_module.Main_outer_class:" + constructorCall.methodFullName shouldBe s"dummy_logger.Main_module.Main_outer_class.${RubyDefines.Initialize}" case None => fail(s"Expected constructor call, did not find one") } case xs => fail(s"Expected two arguments under the constructor assignment, got [${xs.code.mkString(", ")}]") @@ -106,11 +107,11 @@ class DownloadDependencyTest extends RubyCode2CpgFixture(downloadDependencies = "recognize the full method name of the imported Help's constructor" in { inside(cpg.assignment.where(_.target.isIdentifier.name("g")).argument.l) { case (g: Identifier) :: (block: Block) :: Nil => - g.dynamicTypeHintFullName should contain("utils/help.rb:::program.Help") + g.dynamicTypeHintFullName should contain("dummy_logger.Help") - inside(block.astChildren.isCall.name(Defines.ConstructorMethodName).headOption) { + inside(block.astChildren.isCall.name("new").headOption) { case Some(constructorCall) => - constructorCall.methodFullName shouldBe "utils/help.rb:::program.Help:" + constructorCall.methodFullName shouldBe s"dummy_logger.Help.${RubyDefines.Initialize}" case None => fail(s"Expected constructor call, did not find one") } case xs => fail(s"Expected two arguments under the constructor assignment, got [${xs.code.mkString(", ")}]") @@ -120,12 +121,12 @@ class DownloadDependencyTest extends RubyCode2CpgFixture(downloadDependencies = // TODO: This requires type propagation "recognise methodFullName for `first_fun`" ignore { cpg.call.name("first_fun").head.methodFullName should equal( - "dummy_logger::program:Main_module:Main_outer_class:first_fun" + s"dummy_logger.$Main.Main_module.Main_outer_class.first_fun" ) cpg.call .name("help_print") .head - .methodFullName shouldBe "dummy_logger::program:Help:help_print" + .methodFullName shouldBe s"dummy_logger.$Main:Help:help_print" } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DoBlockTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DoBlockTests.scala index 9f7564ecbe1f..65e9a7cc7f5c 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DoBlockTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/DoBlockTests.scala @@ -1,5 +1,7 @@ package io.joern.rubysrc2cpg.querying +import io.joern.rubysrc2cpg.passes.GlobalTypes.builtinPrefix +import io.joern.rubysrc2cpg.passes.Defines.Main import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.joern.x2cpg.Defines import io.shiftleft.codepropertygraph.generated.nodes.* @@ -20,28 +22,42 @@ class DoBlockTests extends RubyCode2CpgFixture { | |""".stripMargin) - "create an anonymous method with associated type declaration" in { - inside(cpg.method.nameExact(":program").l) { + "create an anonymous method with associated type declaration and wrapper type" in { + inside(cpg.method.isModule.l) { case program :: Nil => - inside(program.block.astChildren.collectAll[Method].l) { + inside(program.astChildren.collectAll[Method].l) { case foo :: closureMethod :: Nil => foo.name shouldBe "foo" closureMethod.name shouldBe "0" - closureMethod.fullName shouldBe "Test0.rb:::program:0" + closureMethod.fullName shouldBe s"Test0.rb:$Main.0" case xs => fail(s"Expected a two method nodes, instead got [${xs.code.mkString(", ")}]") } - inside(program.block.astChildren.collectAll[TypeDecl].isLambda.l) { + inside(program.astChildren.collectAll[TypeDecl].isLambda.l) { case closureType :: Nil => closureType.name shouldBe "0" - closureType.fullName shouldBe "Test0.rb:::program:0" + closureType.fullName shouldBe s"Test0.rb:$Main.0" + case xs => fail(s"Expected a one closure type node, instead got [${xs.code.mkString(", ")}]") + } + + inside(program.astChildren.collectAll[TypeDecl].name(".*Proc").l) { + case closureType :: Nil => + val callMember = closureType.member.nameExact("call").head + callMember.typeFullName shouldBe Defines.Any + callMember.dynamicTypeHintFullName shouldBe Seq(s"Test0.rb:$Main.0") case xs => fail(s"Expected a one closure type node, instead got [${xs.code.mkString(", ")}]") } case xs => fail(s"Expected a single program module, instead got [${xs.code.mkString(", ")}]") } } + "create a method ref argument with populated type full name, which corresponds to the method type" in { + val typeRefArg = cpg.call("foo").argument(1).head.asInstanceOf[TypeRef] + val lambdaTypeDecl = cpg.typeDecl("0").head + typeRefArg.typeFullName shouldBe s"${lambdaTypeDecl.fullName}&Proc" + } + "have no parameters in the closure declaration" in { inside(cpg.method("0").parameter.indexGt(0).l) { case Nil => // pass @@ -68,19 +84,19 @@ class DoBlockTests extends RubyCode2CpgFixture { |""".stripMargin) "create an anonymous method with associated type declaration" in { - inside(cpg.method.nameExact(":program").l) { + inside(cpg.method.isModule.l) { case program :: Nil => - inside(program.block.astChildren.collectAll[Method].l) { + inside(program.astChildren.collectAll[Method].l) { case closureMethod :: Nil => closureMethod.name shouldBe "0" - closureMethod.fullName shouldBe "Test0.rb:::program:0" + closureMethod.fullName shouldBe s"Test0.rb:$Main.0" case xs => fail(s"Expected a one method nodes, instead got [${xs.code.mkString(", ")}]") } - inside(program.block.astChildren.collectAll[TypeDecl].l) { + inside(program.astChildren.collectAll[TypeDecl].isLambda.l) { case closureType :: Nil => closureType.name shouldBe "0" - closureType.fullName shouldBe "Test0.rb:::program:0" + closureType.fullName shouldBe s"Test0.rb:$Main.0" case xs => fail(s"Expected a one closure type node, instead got [${xs.code.mkString(", ")}]") } case xs => fail(s"Expected a single program module, instead got [${xs.code.mkString(", ")}]") @@ -97,19 +113,20 @@ class DoBlockTests extends RubyCode2CpgFixture { "specify the closure reference as an argument to the member call with block" in { inside(cpg.call("each").argument.l) { - case (myArray: Identifier) :: (lambdaRef: MethodRef) :: Nil => + case (myArray: Identifier) :: (lambdaRef: TypeRef) :: Nil => myArray.argumentIndex shouldBe 0 myArray.name shouldBe "my_array" + myArray.code shouldBe "my_array" lambdaRef.argumentIndex shouldBe 1 - lambdaRef.methodFullName shouldBe "Test0.rb:::program:0" + lambdaRef.typeFullName shouldBe s"Test0.rb:$Main.0&Proc" case xs => fail(s"Expected `each` call to have call and method ref arguments, instead got [${xs.code.mkString(", ")}]") } } "have the call under the closure" in { - inside(cpg.method("0").call.l) { + inside(cpg.method("0").call.nameExact("puts").l) { case puts :: Nil => puts.name shouldBe "puts" puts.code shouldBe "puts item" @@ -129,20 +146,20 @@ class DoBlockTests extends RubyCode2CpgFixture { |""".stripMargin) "create an anonymous method with associated type declaration" in { - inside(cpg.method.nameExact(":program").l) { + inside(cpg.method.isModule.l) { case program :: Nil => - inside(program.block.astChildren.collectAll[Method].l) { + inside(program.astChildren.collectAll[Method].l) { case closureMethod :: Nil => closureMethod.name shouldBe "0" - closureMethod.fullName shouldBe "Test0.rb:::program:0" + closureMethod.fullName shouldBe s"Test0.rb:$Main.0" closureMethod.isLambda.nonEmpty shouldBe true case xs => fail(s"Expected a one method nodes, instead got [${xs.code.mkString(", ")}]") } - inside(program.block.astChildren.collectAll[TypeDecl].l) { + inside(program.astChildren.collectAll[TypeDecl].isLambda.l) { case closureType :: Nil => closureType.name shouldBe "0" - closureType.fullName shouldBe "Test0.rb:::program:0" + closureType.fullName shouldBe s"Test0.rb:$Main.0" closureType.isLambda.nonEmpty shouldBe true case xs => fail(s"Expected a one closure type node, instead got [${xs.code.mkString(", ")}]") } @@ -161,19 +178,20 @@ class DoBlockTests extends RubyCode2CpgFixture { "specify the closure reference as an argument to the member call with block" in { inside(cpg.call("each").argument.l) { - case (hash: Identifier) :: (lambdaRef: MethodRef) :: Nil => + case (hash: Identifier) :: (lambdaRef: TypeRef) :: Nil => hash.argumentIndex shouldBe 0 hash.name shouldBe "hash" + hash.code shouldBe "hash" lambdaRef.argumentIndex shouldBe 1 - lambdaRef.methodFullName shouldBe "Test0.rb:::program:0" + lambdaRef.typeFullName shouldBe s"Test0.rb:$Main.0&Proc" case xs => fail(s"Expected `each` call to have call and method ref arguments, instead got [${xs.code.mkString(", ")}]") } } "have the calls under the closure" in { - inside(cpg.method("0").call.l) { + inside(cpg.method("0").call.nameExact("puts").l) { case puts1 :: puts2 :: Nil => puts1.name shouldBe "puts" puts1.code shouldBe "puts key" @@ -194,14 +212,16 @@ class DoBlockTests extends RubyCode2CpgFixture { |""".stripMargin) // Basic assertions for expected behaviour - "create the declarations for the closure" in { - inside(cpg.method(".*").l) { + "create the declarations for the closure with captured local" in { + inside(cpg.method.isLambda.l) { case m :: Nil => m.name should startWith("") + val myValue = m.local.nameExact("myValue").head + myValue.closureBindingId shouldBe Option(s"Test0.rb:$Main.myValue") case xs => fail(s"Expected exactly one closure method decl, instead got [${xs.code.mkString(",")}]") } - inside(cpg.typeDecl(".*").l) { + inside(cpg.typeDecl.isLambda.l) { case m :: Nil => m.name should startWith("") case xs => fail(s"Expected exactly one closure type decl, instead got [${xs.code.mkString(",")}]") @@ -211,17 +231,17 @@ class DoBlockTests extends RubyCode2CpgFixture { "annotate the nodes via CAPTURE bindings" in { cpg.all.collectAll[ClosureBinding].l match { case myValue :: Nil => - myValue.closureOriginalName.head shouldBe "myValue" + myValue.closureOriginalName shouldBe Option("myValue") inside(myValue._localViaRefOut) { case Some(local) => local.name shouldBe "myValue" - local.method.fullName.headOption shouldBe Option("Test0.rb:::program") + local.method.fullName.headOption shouldBe Option(s"Test0.rb:$Main") case None => fail("Expected closure binding refer to the captured local") } inside(myValue._captureIn.l) { - case (x: MethodRef) :: Nil => x.methodFullName shouldBe "Test0.rb:::program:0" - case xs => fail(s"Expected single method ref binding but got [${xs.mkString(",")}]") + case (x: TypeRef) :: Nil => x.typeFullName shouldBe s"Test0.rb:$Main.0&Proc" + case xs => fail(s"Expected single method ref binding but got [${xs.mkString(",")}]") } case xs => @@ -249,13 +269,13 @@ class DoBlockTests extends RubyCode2CpgFixture { tmpLocal.name shouldBe "" tmpAssign.code shouldBe " = Array.new(x) { |i| i += 1 }" - newCall.name shouldBe Defines.ConstructorMethodName - newCall.methodFullName shouldBe "__builtin.Array:" + newCall.name shouldBe "new" + newCall.methodFullName shouldBe s"$builtinPrefix.Array.initialize" inside(newCall.argument.l) { - case (_: Identifier) :: (x: Identifier) :: (closure: MethodRef) :: Nil => + case (_: Identifier) :: (x: Identifier) :: (closure: TypeRef) :: Nil => x.name shouldBe "x" - closure.methodFullName should endWith("0") + closure.typeFullName should endWith("0&Proc") case xs => fail(s"Expected a base, `x`, and closure ref, instead got [${xs.code.mkString(",")}]") } case xs => @@ -295,13 +315,69 @@ class DoBlockTests extends RubyCode2CpgFixture { "create a call `test_name` with a test name and lambda argument" in { inside(cpg.call.nameExact("test_name").argument.l) { - case (_: Identifier) :: (testName: Literal) :: (testMethod: MethodRef) :: Nil => + case (_: Identifier) :: (testName: Literal) :: (testMethod: TypeRef) :: Nil => testName.code shouldBe "'Foo'" - testMethod.referencedMethod.call.nameExact("puts").nonEmpty shouldBe true + cpg.method + .fullNameExact(testMethod.typ.referencedTypeDecl.member.name("call").dynamicTypeHintFullName.toSeq*) + .call + .nameExact("puts") + .nonEmpty shouldBe true case xs => fail(s"Expected a literal and method ref argument, instead got $xs") } } } + "A lambda with arrow syntax" should { + + val cpg = code(""" + |arrow_lambda = ->(y) { y } + |""".stripMargin) + + "create a lambda method with a `y` parameter" in { + inside(cpg.method.isLambda.headOption) { + case Some(lambda) => + lambda.code shouldBe "{ y }" + lambda.parameter.name.l shouldBe List("self", "y") + case xs => fail(s"Expected a lambda method") + } + } + + "create a method ref assigned to `arrow_lambda`" in { + inside(cpg.method.isModule.assignment.code("arrow_lambda.*").headOption) { + case Some(lambdaAssign) => + lambdaAssign.target.asInstanceOf[Identifier].name shouldBe "arrow_lambda" + lambdaAssign.source.asInstanceOf[TypeRef].typeFullName shouldBe s"Test0.rb:$Main.0&Proc" + case xs => fail(s"Expected an assignment to a lambda") + } + } + + } + + "A lambda with lambda keyword syntax" should { + + val cpg = code(""" + |a_lambda = lambda { |y| y } + |""".stripMargin) + + "create a lambda method with a `y` parameter" in { + inside(cpg.method.isLambda.headOption) { + case Some(lambda) => + lambda.code shouldBe "{ |y| y }" + lambda.parameter.name.l shouldBe List("self", "y") + case xs => fail(s"Expected a lambda method") + } + } + + "create a method ref assigned to `arrow_lambda`" in { + inside(cpg.method.isModule.assignment.code("a_lambda.*").headOption) { + case Some(lambdaAssign) => + lambdaAssign.target.asInstanceOf[Identifier].name shouldBe "a_lambda" + lambdaAssign.source.asInstanceOf[TypeRef].typeFullName shouldBe s"Test0.rb:$Main.0&Proc" + case xs => fail(s"Expected an assignment to a lambda") + } + } + + } + } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/FieldAccessTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/FieldAccessTests.scala index 630687742d7f..4ab8d56af91c 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/FieldAccessTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/FieldAccessTests.scala @@ -1,33 +1,31 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.codepropertygraph.generated.DispatchTypes -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier} +import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, TypeRef} +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.semanticcpg.language.* +import io.joern.rubysrc2cpg.passes.Defines.Main class FieldAccessTests extends RubyCode2CpgFixture { - "`x.y` is represented by an `x.y` CALL without arguments" in { + "`x.y` is represented by a `x.y` field access" in { val cpg = code(""" - |x.y - |""".stripMargin) + |x = Foo.new + |x.y + |""".stripMargin) - inside(cpg.call("y").headOption) { + inside(cpg.fieldAccess.code("x.y").headOption) { case Some(xyCall) => - xyCall.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH - xyCall.lineNumber shouldBe Some(2) + xyCall.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH + xyCall.name shouldBe Operators.fieldAccess + xyCall.methodFullName shouldBe Operators.fieldAccess + xyCall.lineNumber shouldBe Some(3) xyCall.code shouldBe "x.y" - - inside(xyCall.receiver.headOption) { - case Some(x: Identifier) => - x.name shouldBe "x" - case _ => fail("Expected an identifier receiver") - } - case None => fail("Expected a call with the name `y`") + case None => fail("Expected a field access with the code `x.y`") } } - "`self.x` should correctly create a `this` node field base" in { + "`self.x` should correctly create a `self` node field base" in { // Example from railsgoat val cpg = code(""" @@ -41,21 +39,199 @@ class FieldAccessTests extends RubyCode2CpgFixture { |end |""".stripMargin) - inside(cpg.call.name("sick_days_earned").l) { + inside(cpg.fieldAccess.code("self.sick_days_earned").l) { case sickDays :: _ => sickDays.code shouldBe "self.sick_days_earned" - sickDays.name shouldBe "sick_days_earned" - sickDays.dispatchType shouldBe DispatchTypes.DYNAMIC_DISPATCH + sickDays.name shouldBe Operators.fieldAccess + sickDays.methodFullName shouldBe Operators.fieldAccess + sickDays.dispatchType shouldBe DispatchTypes.STATIC_DISPATCH inside(sickDays.argument.l) { - case (self: Identifier) :: Nil => - self.name shouldBe "this" + case (self: Identifier) :: (sickDaysId: FieldIdentifier) :: Nil => + self.name shouldBe "self" self.code shouldBe "self" self.typeFullName should endWith("PaidTimeOff") + + sickDaysId.canonicalName shouldBe "@sick_days_earned" + sickDaysId.code shouldBe "sick_days_earned" case xs => fail(s"Expected exactly two field access arguments, instead got [${xs.code.mkString(", ")}]") } case Nil => fail("Expected at least one call with `self` base, but got none.") } } + "script-level type properties accessed at various lexical scopes" should { + + val cpg = code(""" + |require 'base64' + | + |# self.Baz = TYPE_REF Baz + |module Baz + | def self.func1() + | end + |end + | + |Base64::decode64() # self.Base64.decode64() + |Baz::func1() # self.Baz.func1() + | + |# self.Foo = TYPE_REF Foo + |class Foo + | def func() + | Baz.func1() # self.Baz.func1 + | end + |end + | + |f = Foo.new + |f.func() # self.f.func + |""".stripMargin) + + "assign an alias for type declarations to the singleton" in { + inside(cpg.method.isModule.assignment.where(_.source.isTypeRef).l) { + case baz :: foo :: Nil => + val bazAssign = baz.argument(1).asInstanceOf[Call] + bazAssign.name shouldBe Operators.fieldAccess + bazAssign.code shouldBe "self.Baz" + + val bazTypeRef = baz.argument(2).asInstanceOf[TypeRef] + bazTypeRef.typeFullName shouldBe s"Test0.rb:$Main.Baz" + bazTypeRef.code shouldBe "module Baz (...)" + + val fooAssign = foo.argument(1).asInstanceOf[Call] + fooAssign.name shouldBe Operators.fieldAccess + fooAssign.code shouldBe "self.Foo" + + val fooTypeRef = foo.argument(2).asInstanceOf[TypeRef] + fooTypeRef.typeFullName shouldBe s"Test0.rb:$Main.Foo" + fooTypeRef.code shouldBe "class Foo (...)" + case _ => fail(s"Expected two type ref assignments on the module level") + } + } + + "give external type accesses on script-level the `self.` base" in { + val call = cpg.method.isModule.call.codeExact("Base64::decode64()").head + call.name shouldBe "decode64" + + val base = call.argument(0).asInstanceOf[Call] + base.name shouldBe Operators.fieldAccess + base.code shouldBe "self.Base64" + + val receiver = call.receiver.isCall.head + receiver.name shouldBe Operators.fieldAccess + receiver.code shouldBe "Base64.decode64" + + val selfArg1 = receiver.argument(1).asInstanceOf[Call] + selfArg1.name shouldBe Operators.fieldAccess + selfArg1.code shouldBe "self.Base64" + + val selfArg2 = receiver.argument(2).asInstanceOf[FieldIdentifier] + selfArg2.canonicalName shouldBe "decode64" + selfArg2.code shouldBe "decode64" + } + + "give internal type accesses on script-level the `self.` base" in { + val call = cpg.method.isModule.call.codeExact("Baz::func1()").head + call.name shouldBe "func1" + + val base = call.argument(0).asInstanceOf[Call] + base.name shouldBe Operators.fieldAccess + base.code shouldBe "self.Baz" + + val receiver = call.receiver.isCall.head + receiver.name shouldBe Operators.fieldAccess + receiver.code shouldBe "Baz.func1" + + val selfArg1 = receiver.argument(1).asInstanceOf[Call] + selfArg1.name shouldBe Operators.fieldAccess + selfArg1.code shouldBe "self.Baz" + + val selfArg2 = receiver.argument(2).asInstanceOf[FieldIdentifier] + selfArg2.canonicalName shouldBe "func1" + selfArg2.code shouldBe "func1" + } + + "give method call accesses on script-level the `self.` base" in { + val call = cpg.method.isModule.call.nameExact("func").head + call.name shouldBe "func" + + val base = call.argument(0).asInstanceOf[Identifier] + base.name shouldBe "f" + base.code shouldBe "f" + + val receiver = call.receiver.isCall.head + receiver.name shouldBe Operators.fieldAccess + receiver.code shouldBe "f.func" + + val selfArg1 = receiver.argument(1).asInstanceOf[Identifier] + selfArg1.name shouldBe "f" + selfArg1.code shouldBe "f" + + val selfArg2 = receiver.argument(2).asInstanceOf[FieldIdentifier] + selfArg2.canonicalName shouldBe "func" + selfArg2.code shouldBe "func" + } + + "give method call accesses inside of a class method the `self.` base if the type referred to is from `self`" in { + val call = cpg.method.nameExact("func").call.nameExact("func1").head + call.name shouldBe "func1" + + val base = call.argument(0).asInstanceOf[Call] + base.name shouldBe Operators.fieldAccess + base.code shouldBe "self.Baz" + + val receiver = call.receiver.isCall.head + receiver.name shouldBe Operators.fieldAccess + receiver.code shouldBe "Baz.func1" + + val selfArg1 = receiver.argument(1).asInstanceOf[Call] + selfArg1.name shouldBe Operators.fieldAccess + selfArg1.code shouldBe "self.Baz" + + val selfArg2 = receiver.argument(2).asInstanceOf[FieldIdentifier] + selfArg2.canonicalName shouldBe "func1" + selfArg2.code shouldBe "func1" + } + + } + + "a member access call referring to a parent class in the lexical scope" should { + val cpg = code(""" + |module A + | module B + | def func() + | end + | module C + | # TYPE_REF A B func + | A::B::func() + | end + | end + |end + | + |""".stripMargin) + + "create `TYPE_REF` targets for the field accesses" in { + val call = cpg.call.nameExact("func").head + val base = call.argument(0).asInstanceOf[Call] + base.name shouldBe Operators.fieldAccess + base.code shouldBe "A::B" + + base.argument(1).asInstanceOf[TypeRef].typeFullName shouldBe s"Test0.rb:$Main.A" + base.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "B" + + val receiver = call.receiver.isCall.head + receiver.name shouldBe Operators.fieldAccess + receiver.code shouldBe "A::B.func" + + val selfArg1 = receiver.argument(1).asInstanceOf[Call] + selfArg1.name shouldBe Operators.fieldAccess + selfArg1.code shouldBe "A::B" + + selfArg1.argument(1).asInstanceOf[TypeRef].typeFullName shouldBe s"Test0.rb:$Main.A" + selfArg1.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "B" + + val selfArg2 = receiver.argument(2).asInstanceOf[FieldIdentifier] + selfArg2.canonicalName shouldBe "func" + selfArg2.code shouldBe "func" + } + } + } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HashTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HashTests.scala index 1b5a70c649a0..051c2b574cec 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HashTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HashTests.scala @@ -1,13 +1,13 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.passes.Defines.RubyOperators +import io.joern.rubysrc2cpg.passes.GlobalTypes.{builtinPrefix, kernelPrefix} import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal} +import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal, TypeRef} import io.shiftleft.semanticcpg.language.* class HashTests extends RubyCode2CpgFixture { - "`{}` is represented by a `hashInitializer` operator call" in { val cpg = code(""" |{} @@ -101,7 +101,7 @@ class HashTests extends RubyCode2CpgFixture { lhs.name shouldBe Operators.indexAccess rhs.code shouldBe "\"abc\"" - rhs.typeFullName shouldBe "__builtin.String" + rhs.typeFullName shouldBe s"$kernelPrefix.String" case _ => fail("Expected LHS and RHS after lowering") } @@ -110,7 +110,7 @@ class HashTests extends RubyCode2CpgFixture { lhs.name shouldBe Operators.indexAccess rhs.code shouldBe "\"ade\"" - rhs.typeFullName shouldBe "__builtin.String" + rhs.typeFullName shouldBe s"$kernelPrefix.String" } case _ => fail("Expected 5 calls (one per item in range)") } @@ -127,7 +127,7 @@ class HashTests extends RubyCode2CpgFixture { lhs.name shouldBe Operators.indexAccess rhs.code shouldBe "\"abc\"" - rhs.typeFullName shouldBe "__builtin.String" + rhs.typeFullName shouldBe s"$kernelPrefix.String" case _ => fail("Expected LHS and RHS after lowering") } case _ => fail("Expected 3 calls (one per item in range)") @@ -145,7 +145,7 @@ class HashTests extends RubyCode2CpgFixture { inside(cpg.call.name(RubyOperators.hashInitializer).l) { case hashInitializer :: Nil => inside(hashInitializer.inCall.astSiblings.l) { - case _ :: (firstCall: Call) :: (secondCall: Call) :: (tmp: Identifier) :: Nil => + case (firstCall: Call) :: (secondCall: Call) :: (tmp: Identifier) :: Nil => firstCall.code shouldBe "[1] = \"abc\"" secondCall.code shouldBe "[2] = \"abc\"" tmp.name shouldBe "" @@ -175,7 +175,7 @@ class HashTests extends RubyCode2CpgFixture { case _ => fail("Expected range operator for non-primitive range key") } - rhs.typeFullName shouldBe "__builtin.String" + rhs.typeFullName shouldBe s"$kernelPrefix.String" rhs.code shouldBe "\"a\"" case _ => fail("Expected LHS and RHS for association") } @@ -195,11 +195,11 @@ class HashTests extends RubyCode2CpgFixture { case hashCall :: Nil => hashCall.code shouldBe "Hash [1 => \"a\", 2 => \"b\", 3 => \"c\"]" hashCall.lineNumber shouldBe Some(2) - hashCall.methodFullName shouldBe "__builtin.Hash:[]" - hashCall.typeFullName shouldBe "__builtin.Hash" + hashCall.methodFullName shouldBe s"$builtinPrefix.Hash.[]" + hashCall.typeFullName shouldBe s"$builtinPrefix.Hash" inside(hashCall.astChildren.l) { - case _ :: (one: Call) :: (two: Call) :: (three: Call) :: Nil => + case (_: Call) :: (_: TypeRef) :: (one: Call) :: (two: Call) :: (three: Call) :: Nil => one.code shouldBe "1 => \"a\"" two.code shouldBe "2 => \"b\"" three.code shouldBe "3 => \"c\"" @@ -209,4 +209,62 @@ class HashTests extends RubyCode2CpgFixture { } } + "Splatting argument in hash" in { + val cpg = code(""" + |a = {**x, **y} + |""".stripMargin) + + inside(cpg.call.name(RubyOperators.hashInitializer).l) { + case hashCall :: Nil => + val List(xSplatCall, ySplatCall) = hashCall.inCall.astSiblings.isCall.l + xSplatCall.code shouldBe "**x" + xSplatCall.methodFullName shouldBe RubyOperators.splat + + ySplatCall.code shouldBe "**y" + ySplatCall.methodFullName shouldBe RubyOperators.splat + case xs => fail(s"Expected call to hashInitializer, [${xs.code.mkString(",")}]") + } + } + + "Function call in hash" in { + val cpg = code(""" + |a = {**foo(bar)} + |""".stripMargin) + + inside(cpg.call.name(RubyOperators.hashInitializer).l) { + case hashInitializer :: Nil => + val List(splatCall) = hashInitializer.inCall.astSiblings.isCall.l + splatCall.code shouldBe "**foo(bar)" + splatCall.name shouldBe RubyOperators.splat + + val List(splatCallArg: Call) = splatCall.argument.l: @unchecked + + splatCallArg.code shouldBe "foo(bar)" + + val List(selfCallArg, barCallArg) = splatCallArg.argument.l + barCallArg.code shouldBe "self.bar" + case xs => fail(s"Expected one call for init, got [${xs.code.mkString(",")}]") + } + } + + "Function call without parentheses" in { + val cpg = code(""" + |a = {**(foo 13)} + |""".stripMargin) + + inside(cpg.call.name(RubyOperators.hashInitializer).l) { + case hashInitializer :: Nil => + val List(splatCall) = hashInitializer.inCall.astSiblings.isCall.l + splatCall.code shouldBe "**(foo 13)" + splatCall.name shouldBe RubyOperators.splat + + val List(splatCallArg: Call) = splatCall.argument.l: @unchecked + + splatCallArg.code shouldBe "foo 13" + + val List(selfCallArg, literalCallArg) = splatCallArg.argument.l + literalCallArg.code shouldBe "13" + case xs => fail(s"Expected one call for init, got [${xs.code.mkString(",")}]") + } + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HereDocTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HereDocTests.scala index 974aaabe5eb6..748335043856 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HereDocTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/HereDocTests.scala @@ -1,6 +1,7 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.shiftleft.codepropertygraph.generated.nodes.{Call, Literal, Local, Method, Return} import io.shiftleft.semanticcpg.language.* @@ -25,7 +26,7 @@ class HereDocTests extends RubyCode2CpgFixture { localAst.code shouldBe "a" callAst.code shouldBe "a = 10" - literalAst.typeFullName shouldBe "__builtin.String" + literalAst.typeFullName shouldBe s"$kernelPrefix.String" returnAst.code shouldBe "a" case _ => @@ -54,7 +55,7 @@ class HereDocTests extends RubyCode2CpgFixture { inside(assignmentCall.argument.l) { case lhsArg :: (rhsArg: Literal) :: Nil => lhsArg.code shouldBe "a" - rhsArg.typeFullName shouldBe "__builtin.String" + rhsArg.typeFullName shouldBe s"$kernelPrefix.String" case _ => fail("Expected LHS and RHS for assignment") } case _ => fail("Expected call for assignment") diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ImportTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ImportTests.scala index 806d7232c704..ae9db429fdd9 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ImportTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ImportTests.scala @@ -1,13 +1,11 @@ package io.joern.rubysrc2cpg.querying +import io.joern.rubysrc2cpg.passes.Defines.Main import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.semanticcpg.language.* -import io.joern.rubysrc2cpg.RubySrc2Cpg -import io.joern.rubysrc2cpg.Config -import scala.util.{Success, Failure} import org.scalatest.Inspectors -class ImportTests extends RubyCode2CpgFixture with Inspectors { +class ImportTests extends RubyCode2CpgFixture(withPostProcessing = true) with Inspectors { "`require 'test'` is a CALL node with an IMPORT node pointing to it" in { val cpg = code(""" @@ -59,12 +57,12 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { ) val List(newCall) = - cpg.method.name(":program").filename("t1.rb").ast.isCall.methodFullName(".*:").methodFullName.l - newCall should startWith(s"${path}.rb:") + cpg.method.isModule.filename("t1.rb").ast.isCall.methodFullName(".*\\.initialize").methodFullName.l + newCall should startWith(s"$path.rb:") } } - "Ambiguous methods resolves to included method" in { + "Ambiguous methods resolves to included method" ignore { forAll(List("A", "B")) { moduleName => val cpg = code(s""" | module A @@ -86,7 +84,7 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { |""".stripMargin) val List(methodName) = - cpg.method.name("bar").ast.isCall.methodFullName(".*::program\\.(A|B):foo").methodFullName.l + cpg.method.name("bar").ast.isCall.methodFullName(s".*\\.$Main\\.(A|B).foo").methodFullName.l methodName should endWith(s"${moduleName}:foo") } } @@ -107,7 +105,7 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { | end |end | - |B::bar + |B::bar() |""".stripMargin, "bar/B.rb" ) @@ -119,7 +117,9 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { ) .moreCode( """ - |B.bar + |def func() + | B.bar() + |end |""".stripMargin, "Bar.rb" ) @@ -171,9 +171,9 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { "resolve calls to builtin functions" in { inside(cpg.call.methodFullName("(pp|csv).*").l) { case csvParseCall :: csvTableInitCall :: ppCall :: Nil => - csvParseCall.methodFullName shouldBe "csv.CSV:parse" - ppCall.methodFullName shouldBe "pp.PP:pp" - csvTableInitCall.methodFullName shouldBe "csv.CSV.Table:" + csvParseCall.methodFullName shouldBe "csv.CSV.parse" + ppCall.methodFullName shouldBe "pp.PP.pp" + csvTableInitCall.methodFullName shouldBe "csv.CSV.Table.initialize" case xs => fail(s"Expected three calls, got [${xs.code.mkString(",")}] instead") } } @@ -182,8 +182,8 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { "`require_all` on a directory" should { val cpg = code(""" |require_all './dir' - |Module1.foo - |Module2.foo + |Module1.foo() + |Module2.foo() |""".stripMargin) .moreCode( """ @@ -206,8 +206,8 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { "allow the resolution for all modules in that directory" in { cpg.call("foo").methodFullName.l shouldBe List( - "dir/module1.rb:::program.Module1:foo", - "dir/module2.rb:::program.Module2:foo" + s"dir/module1.rb:$Main.Module1.foo", + s"dir/module2.rb:$Main.Module2.foo" ) } } @@ -231,7 +231,8 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { } } - "Modifying `$LOADER` with an additional entry" should { + // TODO: This will need to be fixed with the Import resolver + "Modifying `$LOADER` with an additional entry" ignore { val cpg = code( """ |lib_dir = File.expand_path('lib', __dir__) @@ -244,9 +245,9 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { |require 'file2' |require 'file3' | - |File1::foo # lib/file1.rb::program:foo - |File2::foo # lib/file2.rb::program:foo - |File3::foo # src/file3.rb::program:foo + |File1::foo # lib/file1.rb.
.foo + |File2::foo # lib/file2.rb.
.foo + |File3::foo # src/file3.rb.
.foo |""".stripMargin, "main.rb" ).moreCode( @@ -275,14 +276,12 @@ class ImportTests extends RubyCode2CpgFixture with Inspectors { "src/file3.rb" ) - // TODO: This works because of an over-approximation of the type resolver assuming that classes may have been - // implicitly loaded elsewhere "resolve the calls directly" in { inside(cpg.call.name("foo.*").l) { case foo1 :: foo2 :: foo3 :: Nil => - foo1.methodFullName shouldBe "lib/file1.rb:::program.File1:foo" - foo2.methodFullName shouldBe "lib/file2.rb:::program.File2:foo" - foo3.methodFullName shouldBe "src/file3.rb:::program.File3:foo" + foo1.methodFullName shouldBe s"lib/file1.rb:$Main.File1.foo" + foo2.methodFullName shouldBe s"lib/file2.rb:$Main.File2.foo" + foo3.methodFullName shouldBe s"src/file3.rb:$Main.File3.foo" case xs => fail(s"Expected 3 calls, got [${xs.code.mkString(",")}] instead") } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/IndexAccessTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/IndexAccessTests.scala index 795e9cf9aa09..3a420aa3265e 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/IndexAccessTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/IndexAccessTests.scala @@ -7,7 +7,7 @@ import io.shiftleft.semanticcpg.language.* class IndexAccessTests extends RubyCode2CpgFixture { "`x[1]` is represented by an `indexAccess` operator call" in { - val cpg = code(""" + val cpg = code("""x = Array() |x[1] |""".stripMargin) @@ -29,7 +29,7 @@ class IndexAccessTests extends RubyCode2CpgFixture { } "`x[1,2]` is represented by an `indexAccess` operator call" in { - val cpg = code(""" + val cpg = code("""x = Array() |x[1,2] |""".stripMargin) diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/LiteralTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/LiteralTests.scala index 8245c2fc84f5..9b579319aaa4 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/LiteralTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/LiteralTests.scala @@ -2,6 +2,7 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.shiftleft.semanticcpg.language.* class LiteralTests extends RubyCode2CpgFixture { @@ -14,7 +15,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "123" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Integer" + literal.typeFullName shouldBe s"$kernelPrefix.Integer" } "`3.14` is represented by a LITERAL node" in { @@ -25,7 +26,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "3.14" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Float" + literal.typeFullName shouldBe s"$kernelPrefix.Float" } "`3e10` is represented by a LITERAL node" in { @@ -36,7 +37,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "3e10" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Float" + literal.typeFullName shouldBe s"$kernelPrefix.Float" } "`12e-10` is represented by a LITERAL node" in { @@ -47,7 +48,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "12e-10" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Float" + literal.typeFullName shouldBe s"$kernelPrefix.Float" } "`0b01` is represented by a LITERAL node" in { @@ -58,7 +59,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "0b01" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Integer" + literal.typeFullName shouldBe s"$kernelPrefix.Integer" } "`0xabc` is represented by a LITERAL node" in { @@ -69,7 +70,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "0xabc" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Integer" + literal.typeFullName shouldBe s"$kernelPrefix.Integer" } "`true` is represented by a LITERAL node" in { @@ -80,7 +81,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "true" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.TrueClass" + literal.typeFullName shouldBe s"$kernelPrefix.TrueClass" } "`false` is represented by a LITERAL node" in { @@ -91,7 +92,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "false" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.FalseClass" + literal.typeFullName shouldBe s"$kernelPrefix.FalseClass" } "`nil` is represented by a LITERAL node" in { @@ -102,7 +103,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "nil" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.NilClass" + literal.typeFullName shouldBe s"$kernelPrefix.NilClass" } "`'hello'` is represented by a LITERAL node" in { @@ -113,7 +114,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "'hello'" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } "`'x' 'y' 'z'` is represented by a LITERAL node" in { @@ -124,7 +125,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "'x' 'y' 'z'" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } "`\"hello\"` is represented by a LITERAL node" in { @@ -135,7 +136,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "\"hello\"" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } "`%q(hello)` is represented by a LITERAL node" in { @@ -146,7 +147,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "%q(hello)" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } "`%Q(hello world)` is represented by a LITERAL node" in { @@ -157,7 +158,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "%Q(hello world)" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } "`%(foo \"bar\" baz)` is represented by a LITERAL node" in { @@ -168,7 +169,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "%(foo \"bar\" baz)" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } """`%q<\n...\n>` is represented by a LITERAL node""" in { @@ -186,7 +187,7 @@ class LiteralTests extends RubyCode2CpgFixture { |123 |>""".stripMargin literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.String" + literal.typeFullName shouldBe s"$kernelPrefix.String" } @@ -198,7 +199,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe ":symbol" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Symbol" + literal.typeFullName shouldBe s"$kernelPrefix.Symbol" } "`:'symbol'` is represented by a LITERAL node" in { @@ -209,7 +210,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe ":'symbol'" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Symbol" + literal.typeFullName shouldBe s"$kernelPrefix.Symbol" } "`/(eu|us)/` is represented by a LITERAL node" in { @@ -220,7 +221,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "/(eu|us)/" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Regexp" + literal.typeFullName shouldBe s"$kernelPrefix.Regexp" } "`/fedora|el-|centos/` is represented by a LITERAL node" in { @@ -231,7 +232,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(literal) = cpg.literal.l literal.code shouldBe "/fedora|el-|centos/" literal.lineNumber shouldBe Some(2) - literal.typeFullName shouldBe "__builtin.Regexp" + literal.typeFullName shouldBe s"$kernelPrefix.Regexp" } "`/#{os_version_regex}/` is represented by a CALL node with a string format method full name" in { @@ -243,7 +244,7 @@ class LiteralTests extends RubyCode2CpgFixture { val List(formatValueCall) = cpg.call.code("/#.*").l formatValueCall.code shouldBe "/#{os_version_regex}/" formatValueCall.lineNumber shouldBe Some(3) - formatValueCall.typeFullName shouldBe "__builtin.Regexp" + formatValueCall.typeFullName shouldBe s"$kernelPrefix.Regexp" formatValueCall.methodFullName shouldBe Operators.formatString } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodReturnTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodReturnTests.scala index 44a2e625ec3e..b63fced8d728 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodReturnTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodReturnTests.scala @@ -1,9 +1,10 @@ package io.joern.rubysrc2cpg.querying -import io.joern.rubysrc2cpg.passes.Defines.RubyOperators +import io.joern.rubysrc2cpg.passes.Defines.{Main, RubyOperators} +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Literal, Method, MethodRef, Return} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { @@ -71,7 +72,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { r.lineNumber shouldBe Some(3) val List(c: Call) = r.astChildren.isCall.l - c.methodFullName shouldBe "__builtin:puts" + c.methodFullName shouldBe s"$kernelPrefix.puts" c.lineNumber shouldBe Some(3) c.code shouldBe "puts x" } @@ -155,7 +156,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { val List(s: Literal) = r.astChildren.isLiteral.l s.code shouldBe ":g" - s.typeFullName shouldBe "__builtin.Symbol" + s.typeFullName shouldBe s"$kernelPrefix.Symbol" } "explicit RETURN node for `\"\"` exists" in { @@ -191,14 +192,14 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { val List(twenty: Literal) = return20.astChildren.l: @unchecked twenty.code shouldBe "20" twenty.lineNumber shouldBe Some(4) - twenty.typeFullName shouldBe "__builtin.Integer" + twenty.typeFullName shouldBe s"$kernelPrefix.Integer" returnNil.code shouldBe "return nil" returnNil.lineNumber shouldBe Some(3) val List(nil: Literal) = returnNil.astChildren.l: @unchecked nil.code shouldBe "nil" nil.lineNumber shouldBe Some(3) - nil.typeFullName shouldBe "__builtin.NilClass" + nil.typeFullName shouldBe s"$kernelPrefix.NilClass" case xs => fail(s"Expected exactly two return nodes, instead got [${xs.code.mkString(",")}]") } case xs => fail(s"Expected exactly one method with the name `f`, instead got [${xs.code.mkString(",")}]") @@ -226,14 +227,14 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { val List(twenty: Literal) = return20.astChildren.l: @unchecked twenty.code shouldBe "20" twenty.lineNumber shouldBe Some(4) - twenty.typeFullName shouldBe "__builtin.Integer" + twenty.typeFullName shouldBe s"$kernelPrefix.Integer" return40.code shouldBe "40" return40.lineNumber shouldBe Some(6) val List(forty: Literal) = return40.astChildren.l: @unchecked forty.code shouldBe "40" forty.lineNumber shouldBe Some(6) - forty.typeFullName shouldBe "__builtin.Integer" + forty.typeFullName shouldBe s"$kernelPrefix.Integer" case xs => fail(s"Expected exactly two return nodes, instead got [${xs.code.mkString(",")}]") } case xs => fail(s"Expected exactly one method with the name `f`, instead got [${xs.code.mkString(",")}]") @@ -296,14 +297,14 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { val List(twenty: Literal) = return20.astChildren.l: @unchecked twenty.code shouldBe "20" twenty.lineNumber shouldBe Some(2) - twenty.typeFullName shouldBe "__builtin.Integer" + twenty.typeFullName shouldBe s"$kernelPrefix.Integer" return40.code shouldBe "40" return40.lineNumber shouldBe Some(2) val List(forty: Literal) = return40.astChildren.l: @unchecked forty.code shouldBe "40" forty.lineNumber shouldBe Some(2) - forty.typeFullName shouldBe "__builtin.Integer" + forty.typeFullName shouldBe s"$kernelPrefix.Integer" case xs => fail(s"Expected exactly two return nodes, instead got [${xs.code.mkString(",")}]") } case xs => fail(s"Expected exactly one method with the name `f`, instead got [${xs.code.mkString(",")}]") @@ -338,7 +339,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { } } - "implicit RETURN node for ASSOCIATION" in { + "implicit RETURN node for super call" in { val cpg = code(""" |def j | super(only: ["a"]) @@ -349,11 +350,11 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { case jMethod :: Nil => inside(jMethod.methodReturn.toReturn.l) { case retAssoc :: Nil => - retAssoc.code shouldBe "only: [\"a\"]" + retAssoc.code shouldBe "super(only: [\"a\"])" val List(call: Call) = retAssoc.astChildren.l: @unchecked - call.name shouldBe RubyOperators.association - call.code shouldBe "only: [\"a\"]" + call.name shouldBe "super" + call.code shouldBe "super(only: [\"a\"])" case xs => fail(s"Expected exactly one return nodes, instead got [${xs.code.mkString(",")}]") } case _ => fail("Only one method expected") @@ -379,7 +380,7 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { inside(bar.astChildren.collectAll[Method].l) { case closureMethod :: Nil => closureMethod.name shouldBe "0" - closureMethod.fullName shouldBe "Test0.rb:::program:bar:0" + closureMethod.fullName shouldBe s"Test0.rb:$Main.bar.0" case xs => fail(s"Expected closure method, but found ${xs.code.mkString(", ")} instead") } @@ -391,8 +392,8 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { returnCall.name shouldBe "foo" - val List(_, arg: MethodRef) = returnCall.argument.l: @unchecked - arg.methodFullName shouldBe "Test0.rb:::program:bar:0" + val List(_, arg: TypeRef) = returnCall.argument.l: @unchecked + arg.typeFullName shouldBe s"Test0.rb:$Main.bar.0&Proc" case xs => fail(s"Expected one call for return, but found ${xs.code.mkString(", ")} instead") } @@ -432,10 +433,27 @@ class MethodReturnTests extends RubyCode2CpgFixture(withDataFlow = true) { inside(cpg.method.nameExact("custom_fact_content").methodReturn.toReturn.astChildren.l) { case (heredoc: Literal) :: Nil => - heredoc.typeFullName shouldBe "__builtin.String" + heredoc.typeFullName shouldBe s"$kernelPrefix.String" heredoc.code should startWith("<<-EOM") case xs => fail(s"Expected a single literal node, instead got [${xs.code.mkString(", ")}]") } } + "a return in an expression position without arguments should generate a return node with no children" in { + val cpg = code(""" + |def foo + | return unless baz() + | bar() + |end + |""".stripMargin) + + inside(cpg.method.nameExact("foo").ast.isReturn.headOption) { + case Some(ret) => + ret.code shouldBe "return" + ret.astChildren.size shouldBe 0 + ret.astParent.astParent.code shouldBe "return unless baz()" + case None => fail(s"Expected at least one return node") + } + } + } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodTests.scala index bb5bb7b93f12..40fc02072a43 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/MethodTests.scala @@ -1,10 +1,11 @@ package io.joern.rubysrc2cpg.querying -import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.joern.x2cpg.Defines import io.joern.rubysrc2cpg.passes.Defines as RDefines +import io.joern.rubysrc2cpg.passes.Defines.Main +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix +import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, NodeTypes, Operators} -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Literal, MethodRef, Return, TypeRef} import io.shiftleft.semanticcpg.language.* class MethodTests extends RubyCode2CpgFixture { @@ -17,7 +18,7 @@ class MethodTests extends RubyCode2CpgFixture { "be represented by a METHOD node" in { val List(f) = cpg.method.name("f").l - f.fullName shouldBe "Test0.rb:::program:f" + f.fullName shouldBe s"Test0.rb:$Main.f" f.isExternal shouldBe false f.lineNumber shouldBe Some(2) f.numberOfLines shouldBe 1 @@ -30,12 +31,18 @@ class MethodTests extends RubyCode2CpgFixture { "have a corresponding bound type" in { val List(fType) = cpg.typeDecl("f").l - fType.fullName shouldBe "Test0.rb:::program:f" + fType.fullName shouldBe s"Test0.rb:$Main.f" fType.code shouldBe "def f(x) = 1" - fType.astParentFullName shouldBe "Test0.rb:::program:f" + fType.astParentFullName shouldBe s"Test0.rb:$Main" fType.astParentType shouldBe NodeTypes.METHOD val List(fMethod) = fType.iterator.boundMethod.l - fType.fullName shouldBe "Test0.rb:::program:f" + fType.fullName shouldBe s"Test0.rb:$Main.f" + } + + "create a 'fake' method for the file" in { + val List(m) = cpg.method.nameExact(RDefines.Main).l + m.fullName shouldBe s"Test0.rb:$Main" + m.isModule.nonEmpty shouldBe true } } @@ -48,7 +55,7 @@ class MethodTests extends RubyCode2CpgFixture { val List(f) = cpg.method.name("f").l - f.fullName shouldBe "Test0.rb:::program:f" + f.fullName shouldBe s"Test0.rb:$Main.f" f.isExternal shouldBe false f.lineNumber shouldBe Some(2) f.numberOfLines shouldBe 3 @@ -62,7 +69,7 @@ class MethodTests extends RubyCode2CpgFixture { val List(f) = cpg.method.name("f").l - f.fullName shouldBe "Test0.rb:::program:f" + f.fullName shouldBe s"Test0.rb:$Main.f" f.isExternal shouldBe false f.lineNumber shouldBe Some(2) f.numberOfLines shouldBe 1 @@ -80,7 +87,7 @@ class MethodTests extends RubyCode2CpgFixture { val List(f) = cpg.method.name("f").l - f.fullName shouldBe "Test0.rb:::program:f" + f.fullName shouldBe s"Test0.rb:$Main.f" f.isExternal shouldBe false f.lineNumber shouldBe Some(2) f.numberOfLines shouldBe 1 @@ -186,8 +193,8 @@ class MethodTests extends RubyCode2CpgFixture { case funcF :: Nil => inside(funcF.parameter.l) { case thisParam :: xParam :: Nil => - thisParam.code shouldBe "this" - thisParam.typeFullName shouldBe "Test0.rb:::program.C" + thisParam.code shouldBe RDefines.Self + thisParam.typeFullName shouldBe s"Test0.rb:$Main.C" thisParam.index shouldBe 0 thisParam.isVariadic shouldBe false @@ -220,8 +227,8 @@ class MethodTests extends RubyCode2CpgFixture { case funcF :: Nil => inside(funcF.parameter.l) { case thisParam :: xParam :: Nil => - thisParam.code shouldBe "this" - thisParam.typeFullName shouldBe "Test0.rb:::program.C" + thisParam.code shouldBe RDefines.Self + thisParam.typeFullName shouldBe s"Test0.rb:$Main.C" thisParam.index shouldBe 0 thisParam.isVariadic shouldBe false @@ -252,7 +259,7 @@ class MethodTests extends RubyCode2CpgFixture { xs.name shouldBe "xs" xs.code shouldBe "*xs" xs.isVariadic shouldBe true - xs.typeFullName shouldBe "__builtin.Array" + xs.typeFullName shouldBe s"$kernelPrefix.Array" case xs => fail(s"Expected `foo` to have one parameter, got [${xs.code.mkString(", ")}]") } } @@ -263,7 +270,7 @@ class MethodTests extends RubyCode2CpgFixture { ys.name shouldBe "ys" ys.code shouldBe "**ys" ys.isVariadic shouldBe true - ys.typeFullName shouldBe "__builtin.Hash" + ys.typeFullName shouldBe s"$kernelPrefix.Hash" case xs => fail(s"Expected `foo` to have one parameter, got [${xs.code.mkString(", ")}]") } } @@ -296,7 +303,7 @@ class MethodTests extends RubyCode2CpgFixture { "create a method under `Foo` for both `x=`, `x`, and `bar=`, where `bar=` forwards parameters to a call to `x=`" in { inside(cpg.typeDecl("Foo").l) { case foo :: Nil => - inside(foo.method.nameNot(Defines.ConstructorMethodName, Defines.StaticInitMethodName).l) { + inside(foo.method.nameNot(RDefines.Initialize, RDefines.TypeDeclBody).l) { case xeq :: x :: bar :: Nil => xeq.name shouldBe "x=" x.name shouldBe "x" @@ -339,13 +346,13 @@ class MethodTests extends RubyCode2CpgFixture { |""".stripMargin) "exist under the module TYPE_DECL" in { - inside(cpg.typeDecl.name("F").method.l) { + inside(cpg.typeDecl.name("F").method.nameExact("bar", "baz").l) { case bar :: baz :: Nil => inside(bar.parameter.l) { case thisParam :: xParam :: Nil => - thisParam.name shouldBe "this" + thisParam.name shouldBe RDefines.Self thisParam.code shouldBe "F" - thisParam.typeFullName shouldBe "Test0.rb:::program.F" + thisParam.typeFullName shouldBe s"Test0.rb:$Main.F" xParam.name shouldBe "x" case xs => fail(s"Expected two parameters, got ${xs.name.mkString(", ")}") @@ -353,9 +360,9 @@ class MethodTests extends RubyCode2CpgFixture { inside(baz.parameter.l) { case thisParam :: xParam :: Nil => - thisParam.name shouldBe "this" + thisParam.name shouldBe RDefines.Self thisParam.code shouldBe "F" - thisParam.typeFullName shouldBe "Test0.rb:::program.F" + thisParam.typeFullName shouldBe s"Test0.rb:$Main.F" xParam.name shouldBe "x" xParam.code shouldBe "x" @@ -365,14 +372,20 @@ class MethodTests extends RubyCode2CpgFixture { } } - "baz should not exist in the :program block" in { - inside(cpg.method.name(":program").l) { + // TODO: we cannot bind baz as this is a dynamic assignment to `F` which is trickier to determine + // Also, double check bindings + "have bindings to the singleton module TYPE_DECL" ignore { + cpg.typeDecl.name("F").methodBinding.methodFullName.l shouldBe List(s"Test0.rb:$Main.F.bar") + } + + "baz should not exist in the
block" in { + inside(cpg.method.isModule.l) { case prog :: Nil => inside(prog.block.astChildren.isMethod.name("baz").l) { case Nil => // passing case case _ => fail("Baz should not exist under program method block") } - case _ => fail("Expected one Method for :program") + case _ => fail("Expected one Method for ") } } } @@ -387,7 +400,7 @@ class MethodTests extends RubyCode2CpgFixture { "be represented by a METHOD node" in { inside(cpg.method.name("exists\\?").l) { case existsMethod :: Nil => - existsMethod.fullName shouldBe "Test0.rb:::program:exists?" + existsMethod.fullName shouldBe s"Test0.rb:$Main.exists?" existsMethod.isExternal shouldBe false inside(existsMethod.methodReturn.cfgIn.l) { @@ -520,6 +533,7 @@ class MethodTests extends RubyCode2CpgFixture { |class Foo | def authenticate(email, password) | auth = nil + | a = getPass() | if a == Digest::MD5.hexdigest(password) | auth = a | end @@ -532,20 +546,27 @@ class MethodTests extends RubyCode2CpgFixture { case Some(ifCond: Call) => inside(ifCond.argument.l) { case (leftArg: Identifier) :: (rightArg: Call) :: Nil => + leftArg.name shouldBe "a" + rightArg.name shouldBe "hexdigest" rightArg.code shouldBe "Digest::MD5.hexdigest(password)" inside(rightArg.argument.l) { case (md5: Call) :: (passwordArg: Identifier) :: Nil => - md5.name shouldBe "MD5" - inside(md5.argument.l) { - case (digest: Identifier) :: Nil => - digest.name shouldBe "Digest" - case xs => fail(s"Expected 1 argument, got ${xs.code.mkString(", ")} instead") - } + md5.name shouldBe Operators.fieldAccess + md5.code shouldBe "Digest::MD5" + + val md5Base = md5.argument(1).asInstanceOf[Call] + md5.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "MD5" + + md5Base.name shouldBe Operators.fieldAccess + md5Base.code shouldBe "self.Digest" + + md5Base.argument(1).asInstanceOf[Identifier].name shouldBe RDefines.Self + md5Base.argument(2).asInstanceOf[FieldIdentifier].canonicalName shouldBe "Digest" case xs => fail(s"Expected identifier and call, got ${xs.code.mkString(", ")} instead") } - case xs => fail(s"Expected 3 arguments, got ${xs.code.mkString(", ")} instead") + case xs => fail(s"Expected 2 arguments, got ${xs.code.mkString(", ")} instead") } case None => fail("Expected if-condition") } @@ -581,31 +602,34 @@ class MethodTests extends RubyCode2CpgFixture { ) "be directly under :program" in { - inside(cpg.method.name(RDefines.Program).filename("t1.rb").assignment.l) { + inside(cpg.method.name(RDefines.Main).filename("t1.rb").assignment.l) { case moduleAssignment :: classAssignment :: methodAssignment :: Nil => - moduleAssignment.code shouldBe "A = class t1.rb:::program.A (...)" - classAssignment.code shouldBe "B = class t1.rb:::program.B (...)" - methodAssignment.code shouldBe "c = def c (...)" + moduleAssignment.code shouldBe "self.A = module A (...)" + classAssignment.code shouldBe "self.B = class B (...)" + methodAssignment.code shouldBe "self.c = def c (...)" inside(moduleAssignment.argument.l) { - case (lhs: Identifier) :: (rhs: TypeRef) :: Nil => - lhs.name shouldBe "A" - rhs.typeFullName shouldBe "t1.rb:::program.A" + case (lhs: Call) :: (rhs: TypeRef) :: Nil => + lhs.code shouldBe "self.A" + lhs.name shouldBe Operators.fieldAccess + rhs.typeFullName shouldBe s"t1.rb:$Main.A" case xs => fail(s"Expected lhs and rhs, instead got ${xs.code.mkString(",")}") } inside(classAssignment.argument.l) { - case (lhs: Identifier) :: (rhs: TypeRef) :: Nil => - lhs.name shouldBe "B" - rhs.typeFullName shouldBe "t1.rb:::program.B" + case (lhs: Call) :: (rhs: TypeRef) :: Nil => + lhs.code shouldBe "self.B" + lhs.name shouldBe Operators.fieldAccess + rhs.typeFullName shouldBe s"t1.rb:$Main.B" case xs => fail(s"Expected lhs and rhs, instead got ${xs.code.mkString(",")}") } inside(methodAssignment.argument.l) { - case (lhs: Identifier) :: (rhs: MethodRef) :: Nil => - lhs.name shouldBe "c" - rhs.methodFullName shouldBe "t1.rb:::program:c" - rhs.typeFullName shouldBe RDefines.Any + case (lhs: Call) :: (rhs: MethodRef) :: Nil => + lhs.code shouldBe "self.c" + lhs.name shouldBe Operators.fieldAccess + rhs.methodFullName shouldBe s"t1.rb:$Main.c" + rhs.typeFullName shouldBe s"t1.rb:$Main.c" case xs => fail(s"Expected lhs and rhs, instead got ${xs.code.mkString(",")}") } @@ -614,28 +638,244 @@ class MethodTests extends RubyCode2CpgFixture { } "not be present in other files" in { - inside(cpg.method.name(RDefines.Program).filename("t2.rb").assignment.l) { + inside(cpg.method.name(RDefines.Main).filename("t2.rb").assignment.l) { case classAssignment :: methodAssignment :: Nil => - classAssignment.code shouldBe "D = class t2.rb:::program.D (...)" - methodAssignment.code shouldBe "e = def e (...)" + classAssignment.code shouldBe "self.D = class D (...)" + methodAssignment.code shouldBe "self.e = def e (...)" inside(classAssignment.argument.l) { - case (lhs: Identifier) :: (rhs: TypeRef) :: Nil => - lhs.name shouldBe "D" - rhs.typeFullName shouldBe "t2.rb:::program.D" + case (lhs: Call) :: (rhs: TypeRef) :: Nil => + lhs.code shouldBe "self.D" + lhs.name shouldBe Operators.fieldAccess + rhs.typeFullName shouldBe s"t2.rb:$Main.D" case xs => fail(s"Expected lhs and rhs, instead got ${xs.code.mkString(",")}") } inside(methodAssignment.argument.l) { - case (lhs: Identifier) :: (rhs: MethodRef) :: Nil => - lhs.name shouldBe "e" - rhs.methodFullName shouldBe "t2.rb:::program:e" - rhs.typeFullName shouldBe RDefines.Any + case (lhs: Call) :: (rhs: MethodRef) :: Nil => + lhs.code shouldBe "self.e" + lhs.name shouldBe Operators.fieldAccess + rhs.methodFullName shouldBe s"t2.rb:$Main.e" + rhs.typeFullName shouldBe s"t2.rb:$Main.e" case xs => fail(s"Expected lhs and rhs, instead got ${xs.code.mkString(",")}") } case xs => fail(s"Expected two assignments, got [${xs.code.mkString(",")}]") } } + + "be placed in order of definition" in { + inside(cpg.method.name(RDefines.Main).filename("t1.rb").block.astChildren.l) { + case (a1: Call) :: (a2: Call) :: (a3: Call) :: (a4: Call) :: (a5: Call) :: Nil => + a1.code shouldBe "self.A = module A (...)" + a2.code shouldBe "self::A::" + a3.code shouldBe "self.B = class B (...)" + a4.code shouldBe "self::B::" + a5.code shouldBe "self.c = def c (...)" + case xs => fail(s"Expected assignments to appear before definitions, instead got [${xs.mkString("\n")}]") + } + } + } + + "Splatting and normal argument" in { + val cpg = code(""" + |def foo(*x, y) + |end + |""".stripMargin) + + inside(cpg.method.name("foo").l) { + case fooMethod :: Nil => + inside(fooMethod.method.parameter.l) { + case selfArg :: splatArg :: normalArg :: Nil => + splatArg.code shouldBe "*x" + splatArg.index shouldBe 1 + + normalArg.code shouldBe "y" + normalArg.index shouldBe 2 + case xs => fail(s"Expected two parameters, got [${xs.code.mkString(",")}]") + } + case xs => fail(s"Expected one method, got [${xs.code.mkString(",")}]") + } + } + + "Splatting argument in call" in { + val cpg = code(""" + |def foo(a, b) + |end + | + |x = 1,2 + |foo(*x, y) + |""".stripMargin) + + inside(cpg.call.name("foo").l) { + case fooCall :: Nil => + inside(fooCall.argument.l) { + case selfArg :: xArg :: yArg :: Nil => + xArg.code shouldBe "*x" + yArg.code shouldBe "self.y" + case xs => fail(s"Expected two args, got [${xs.code.mkString(",")}]") + } + case xs => fail(s"Expected one call to foo, got [${xs.code.mkString(",")}]") + } + } + + "a nested method declaration inside of a do-block should connect the member node to the bound type decl" in { + val cpg = code(""" + |foo do + | def bar + | end + |end + |""".stripMargin) + + val parentType = cpg.member("bar").typeDecl.head + parentType.isLambda should not be empty + parentType.methodBinding.methodFullName.head should endWith("0") + } + + "a method that is redefined should have a counter suffixed to ensure uniqueness" in { + val cpg = code(""" + |def foo;end + |def bar;end + |def foo;end + |def foo;end + |""".stripMargin) + + cpg.method.name("(foo|bar).*").name.l shouldBe List("foo", "bar", "foo", "foo") + cpg.method.name("(foo|bar).*").fullName.l shouldBe List( + s"Test0.rb:$Main.foo", + s"Test0.rb:$Main.bar", + s"Test0.rb:$Main.foo0", + s"Test0.rb:$Main.foo1" + ) + } + + "MemberCall with a function name the same as a reserved keyword" in { + val cpg = code(""" + |batch.retry!() + |""".stripMargin) + + inside(cpg.call.name(".*retry!").l) { + case batchCall :: Nil => + batchCall.name shouldBe "retry!" + batchCall.code shouldBe "batch.retry!()" + + inside(batchCall.receiver.l) { + case (receiverCall: Call) :: Nil => + receiverCall.name shouldBe Operators.fieldAccess + receiverCall.code shouldBe "batch.retry!" + + val selfBatch = receiverCall.argument(1).asInstanceOf[Call] + selfBatch.code shouldBe "self.batch" + + val retry = receiverCall.argument(2).asInstanceOf[FieldIdentifier] + retry.code shouldBe "retry!" + + case xs => fail(s"Expected one receiver for call, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected one method for batch.retry, got [${xs.code.mkString(",")}]") + } + } + + "Call with :: syntax and reserved keyword" in { + val cpg = code(""" + |batch::retry!() + |""".stripMargin) + + inside(cpg.call.name(".*retry!").l) { + case batchCall :: Nil => + batchCall.name shouldBe "retry!" + batchCall.code shouldBe "batch::retry!()" + + inside(batchCall.receiver.l) { + case (receiverCall: Call) :: Nil => + receiverCall.name shouldBe Operators.fieldAccess + receiverCall.code shouldBe "batch.retry!" + + val selfBatch = receiverCall.argument(1).asInstanceOf[Call] + selfBatch.code shouldBe "self.batch" + + val retry = receiverCall.argument(2).asInstanceOf[FieldIdentifier] + retry.code shouldBe "retry!" + + case xs => fail(s"Expected one receiver for call, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected one method for batch.retry, got [${xs.code.mkString(",")}]") + } + } + + "Call with reserved keyword as base and call name using . notation" in { + val cpg = code(""" + |retry.retry!() + |""".stripMargin) + + inside(cpg.call.name(".*retry!").l) { + case batchCall :: Nil => + batchCall.name shouldBe "retry!" + batchCall.code shouldBe "retry.retry!()" + + inside(batchCall.receiver.l) { + case (receiverCall: Call) :: Nil => + receiverCall.name shouldBe Operators.fieldAccess + receiverCall.code shouldBe "retry.retry!" + + val selfBatch = receiverCall.argument(1).asInstanceOf[Call] + selfBatch.code shouldBe "self.retry" + + val retry = receiverCall.argument(2).asInstanceOf[FieldIdentifier] + retry.code shouldBe "retry!" + + case xs => fail(s"Expected one receiver for call, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected one method for batch.retry, got [${xs.code.mkString(",")}]") + } + } + + "Call with reserved keyword as base and call name" in { + val cpg = code(""" + |retry::retry!() + |""".stripMargin) + + inside(cpg.call.name(".*retry!").l) { + case batchCall :: Nil => + batchCall.name shouldBe "retry!" + batchCall.code shouldBe "retry::retry!()" + + inside(batchCall.receiver.l) { + case (receiverCall: Call) :: Nil => + receiverCall.name shouldBe Operators.fieldAccess + receiverCall.code shouldBe "retry.retry!" + + val selfBatch = receiverCall.argument(1).asInstanceOf[Call] + selfBatch.code shouldBe "self.retry" + + val retry = receiverCall.argument(2).asInstanceOf[FieldIdentifier] + retry.code shouldBe "retry!" + + case xs => fail(s"Expected one receiver for call, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected one method for batch.retry, got [${xs.code.mkString(",")}]") + } + } + + "%x should be represented as a call to EXEC" in { + val cpg = code(""" + |%x(ls -l) + |""".stripMargin) + + inside(cpg.call.name("exec").l) { + case execCall :: Nil => + execCall.name shouldBe "exec" + inside(execCall.argument.l) { + case selfArg :: lsArg :: Nil => + selfArg.code shouldBe "self" + lsArg.code shouldBe "ls -l" + case xs => fail(s"expected 2 arguments, got [${xs.code.mkString(",")}]") + } + case xs => fail(s"Expected one call to exec, got [${xs.code.mkString(",")}]") + } } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ModuleTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ModuleTests.scala index 273bc58d8740..9e3801817b58 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ModuleTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ModuleTests.scala @@ -1,5 +1,7 @@ package io.joern.rubysrc2cpg.querying +import io.joern.rubysrc2cpg.passes.Defines +import io.joern.rubysrc2cpg.passes.Defines.Main import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.semanticcpg.language.* @@ -13,10 +15,28 @@ class ModuleTests extends RubyCode2CpgFixture { val List(m) = cpg.typeDecl.name("M").l - m.fullName shouldBe "Test0.rb:::program.M" + m.fullName shouldBe s"Test0.rb:$Main.M" m.lineNumber shouldBe Some(2) m.baseType.l shouldBe List() - m.member.l shouldBe List() - m.method.l shouldBe List() + m.member.name.l shouldBe List(Defines.TypeDeclBody) + m.method.name.l shouldBe List(Defines.TypeDeclBody) } + + "nested modules are represented by nested TYPE_DECL nodes" in { + val cpg = code(""" + |module M1 + | module M2 + | end + |end + |""".stripMargin) + + val List(m) = cpg.typeDecl.name("M1").l + + m.fullName shouldBe s"Test0.rb:$Main.M1" + m.lineNumber shouldBe Some(2) + m.baseType.l shouldBe List() + m.member.name.l shouldBe List(Defines.TypeDeclBody) + m.method.name.l shouldBe List(Defines.TypeDeclBody) + } + } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ProcParameterAndYieldTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ProcParameterAndYieldTests.scala index a5ed7e6119c3..605880a70a29 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ProcParameterAndYieldTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/ProcParameterAndYieldTests.scala @@ -1,77 +1,96 @@ package io.joern.rubysrc2cpg.querying import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import org.scalatest.Inspectors -import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* +import org.scalatest.Inspectors class ProcParameterAndYieldTests extends RubyCode2CpgFixture with Inspectors { - "Methods" should { - "with a yield expression" should { - "with a proc parameter" should { - val cpg1 = code("def foo(&b) yield end") - val cpg2 = code("def self.foo(&b) yield end") - val cpgs = List(cpg1, cpg2) - - "have a single block argument" in { - forAll(cpgs)(_.method("foo").parameter.code("&.*").name.l shouldBe List("b")) - } - - "represent the yield as a conditional with a call and return node as children" in { - forAll(cpgs) { cpg => - inside(cpg.method("foo").call(".conditional").code("yield").astChildren.l) { - case List(cond: Expression, call: Call, ret: Return) => { - cond.code shouldBe "" - call.name shouldBe "b" - call.code shouldBe "yield" - ret.code shouldBe "yield" - } - } - } - } - } - - "without a proc parameter" should { - val cpg1 = code("def foo() yield end") - val cpg2 = code("def self.foo() yield end") - val cpgs = List(cpg1, cpg2) - - "have a call to a block parameter" in { - forAll(cpgs)(_.call.code("yield").astChildren.isCall.code("yield").name.l shouldBe List("")) - } - - "add a block argument" in { - val List(param1) = cpg1.method("foo").parameter.code("&.*").l - param1.name shouldBe "" - param1.index shouldBe 1 - - val List(param2) = cpg2.method("foo").parameter.code("&.*").l - param2.name shouldBe "" - param2.index shouldBe 1 - } - } - - "with yield arguments" should { - val cpg = code("def foo(x) yield(x) end") - "replace the yield with a call to the block parameter with arguments" in { - val List(call) = cpg.call.codeExact("yield(x)").astChildren.isCall.codeExact("yield(x)").l - call.name shouldBe "" - call.argument.code.l shouldBe List("", "x") - } - - } + + "a method with an explicit proc parameter should create an invocation of it's `call` member" in { + val cpg = code("def foo(&b) yield end") + + val foo = cpg.method("foo").head + + val bParam = foo.parameter.last + bParam.name shouldBe "b" + bParam.code shouldBe "&b" + bParam.index shouldBe 1 + + inside(foo.call.nameExact("call").argument.l) { case selfBase :: Nil => + selfBase.code shouldBe "b" } + } + + "a singleton method with an explicit proc parameter should create an invocation of it's `call` member" in { + val cpg = code("def self.foo(&b) yield end") + + val foo = cpg.method("foo").head - "that don't have a yield nor a proc parameter" should { - val cpg1 = code("def foo() end") - val cpg2 = code("def self.foo() end") - val cpgs = List(cpg1, cpg2) + val bParam = foo.parameter.last + bParam.name shouldBe "b" + bParam.code shouldBe "&b" + bParam.index shouldBe 1 - "not add a block argument" in { - forAll(cpgs)(_.method("foo").parameter.code("&.*").name.l should be(empty)) - } + inside(foo.call.nameExact("call").argument.l) { case selfBase :: Nil => + selfBase.code shouldBe "b" } + } + + "a method with an implicit proc parameter should create an invocation using a unique parameter name" in { + val cpg = code(""" + |def foo() yield end + |def self.bar() yield end + |""".stripMargin) + + val foo = cpg.method("foo").head + val bar = cpg.method("bar").head + + val fooParam = foo.parameter.last + fooParam.name shouldBe "" + fooParam.code shouldBe "&" + fooParam.index shouldBe 1 + + val barParam = bar.parameter.last + barParam.name shouldBe "" + barParam.code shouldBe "&" + barParam.index shouldBe 1 + + foo.call.nameExact("call").argument.isIdentifier.name.l shouldBe List("") + bar.call.nameExact("call").argument.isIdentifier.name.l shouldBe List("") + } + + "a method with an implicit proc parameter should create an invocation of it's `call` member with given arguments" in { + val cpg = code("def foo(x) yield(x) end") + + val foo = cpg.method("foo").head + + val List(xParam, procParam) = foo.parameter.l.takeRight(2) + + xParam.name shouldBe "x" + xParam.index shouldBe 1 + + procParam.name shouldBe "" + procParam.code shouldBe "&" + procParam.index shouldBe 2 + + inside(foo.call.nameExact("call").argument.l) { case selfBase :: x :: Nil => + selfBase.code shouldBe "" + selfBase.argumentIndex shouldBe 0 + x.code shouldBe "x" + x.argumentIndex shouldBe 1 + } + } + + "a method without a yield nor proc parameter should not have either modelled" in { + val cpg1 = code("def foo() end") + val cpg2 = code("def self.foo() end") + val cpgs = List(cpg1, cpg2) + forAll(cpgs)(cpg => { + cpg.method("foo").parameter.code("&.*").name.l should be(empty) + cpg.method("foo").call.nameExact("call").name.l should be(empty) + }) } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/RegexTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/RegexTests.scala index d48f9bb337de..d5d892cb1e8d 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/RegexTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/RegexTests.scala @@ -1,25 +1,27 @@ package io.joern.rubysrc2cpg.querying -import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language.* -import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture - -import scala.reflect.ClassTag import io.joern.rubysrc2cpg.passes.Defines.RubyOperators +import io.joern.rubysrc2cpg.passes.GlobalTypes.kernelPrefix +import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.Literal +import io.shiftleft.semanticcpg.language.* -class RegexTests extends RubyCode2CpgFixture { +class RegexTests extends RubyCode2CpgFixture(withPostProcessing = true) { "`'x' =~ y` is a member call `'x'.=~ /y/" in { val cpg = code("""|'x' =~ /y/ |0 |""".stripMargin) - cpg.call(RubyOperators.regexpMatch).methodFullName.l shouldBe List(s"__builtin.String:${RubyOperators.regexpMatch}") + cpg.call(RubyOperators.regexpMatch).methodFullName.l shouldBe List( + s"$kernelPrefix.String.${RubyOperators.regexpMatch}" + ) } "`/x/ =~ 'y'` is a member call `/x/.=~ 'y'" in { val cpg = code("""|/x/ =~ 'y' |0 |""".stripMargin) - cpg.call(RubyOperators.regexpMatch).methodFullName.l shouldBe List(s"__builtin.Regexp:${RubyOperators.regexpMatch}") + cpg.call(RubyOperators.regexpMatch).methodFullName.l shouldBe List( + s"$kernelPrefix.Regexp.${RubyOperators.regexpMatch}" + ) } "Regex expression in if statements" in { @@ -31,15 +33,15 @@ class RegexTests extends RubyCode2CpgFixture { inside(cpg.controlStructure.isIf.l) { case regexIf :: Nil => - regexIf.condition.isCall.methodFullName.l shouldBe List(s"__builtin.Regexp:${RubyOperators.regexpMatch}") + regexIf.condition.isCall.methodFullName.l shouldBe List(s"$kernelPrefix.Regexp.${RubyOperators.regexpMatch}") inside(regexIf.condition.isCall.argument.l) { case (lhs: Literal) :: (rhs: Literal) :: Nil => lhs.code shouldBe "/mswin|mingw|cygwin/" - lhs.typeFullName shouldBe "__builtin.Regexp" + lhs.typeFullName shouldBe s"$kernelPrefix.Regexp" rhs.code shouldBe "\"mswin\"" - rhs.typeFullName shouldBe "__builtin.String" + rhs.typeFullName shouldBe s"$kernelPrefix.String" case xs => fail(s"Expected two arguments, got [${xs.code.mkString(",")}]") } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SetterTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SetterTests.scala deleted file mode 100644 index 0f963c277d44..000000000000 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SetterTests.scala +++ /dev/null @@ -1,29 +0,0 @@ -package io.joern.rubysrc2cpg.querying - -import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture -import io.shiftleft.semanticcpg.language.* - -class SetterTests extends RubyCode2CpgFixture { - - "`x.y=1` is represented by a `x.y=` CALL with argument `1`" in { - val cpg = code(""" - |x.y = 1 - |""".stripMargin) - - val List(setter) = cpg.call("y=").l - val List(fieldAccess) = cpg.fieldAccess.l - - setter.code shouldBe "x.y = 1" - setter.lineNumber shouldBe Some(2) - setter.receiver.l shouldBe List(fieldAccess) - - fieldAccess.code shouldBe "x.y=" - fieldAccess.lineNumber shouldBe Some(2) - fieldAccess.fieldIdentifier.code.l shouldBe List("y=") - - val List(_, one) = setter.argument.l - one.code shouldBe "1" - one.lineNumber shouldBe Some(2) - } - -} diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SingleAssignmentTests.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SingleAssignmentTests.scala index 8b0bae392100..3a9f74df5fc2 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SingleAssignmentTests.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/querying/SingleAssignmentTests.scala @@ -4,6 +4,7 @@ import io.joern.rubysrc2cpg.testfixtures.RubyCode2CpgFixture import io.shiftleft.codepropertygraph.generated.nodes.{Block, Call, Identifier, Literal} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators} import io.shiftleft.semanticcpg.language.* +import io.joern.rubysrc2cpg.passes.Defines as RubyDefines class SingleAssignmentTests extends RubyCode2CpgFixture { @@ -213,4 +214,79 @@ class SingleAssignmentTests extends RubyCode2CpgFixture { } } + "in a method body" in { + val cpg = code(""" + |def f(p) + | y = p + | y + |end + |""".stripMargin) + + inside(cpg.assignment.code("y = p").l) { + case assign :: Nil => + inside(assign.argument.l) { + case (y: Identifier) :: (p: Identifier) :: Nil => + y.name shouldBe "y" + p.name shouldBe "p" + case _ => fail(s"Expected two assigment identifiers arguments") + } + case _ => fail("Unable to find assignment `y = p`") + } + } + + "Bracket Assignments" in { + val cpg = code(""" + | def get_pto_schedule + | begin + | schedules = current_user.paid_time_off.schedule + | jfs = [] + | schedules.each do |s| + | hash = Hash.new + | hash[:id] = s[:id] + | hash[:title] = s[:event_name] + | hash[:start] = s[:date_begin] + | hash[:end] = s[:date_end] + | jfs << hash + | end + | rescue + | end + | respond_to do |format| + | format.json { render json: jfs.to_json } + | end + | end + |""".stripMargin) + + inside(cpg.method.isLambda.l) { + case scheduleLambda :: _ :: _ :: Nil => + inside(scheduleLambda.call.name(Operators.assignment).l) { + case _ :: id :: title :: start :: end :: _ :: Nil => + id.code shouldBe "hash[:id] = s[:id]" + + inside(id.argument.l) { + case (lhs: Call) :: (rhs: Call) :: Nil => + lhs.methodFullName shouldBe Operators.indexAccess + lhs.code shouldBe "hash[:id]" + + rhs.methodFullName shouldBe Operators.indexAccess + rhs.code shouldBe "s[:id]" + + inside(lhs.argument.l) { + case base :: (index: Literal) :: Nil => + index.typeFullName shouldBe RubyDefines.getBuiltInType(RubyDefines.Symbol) + case xs => fail(s"Expected base and index, got [${xs.code.mkString(",")}]") + } + + inside(rhs.argument.l) { + case base :: (index: Literal) :: Nil => + index.typeFullName shouldBe RubyDefines.getBuiltInType(RubyDefines.Symbol) + case xs => fail(s"Expected base and index, got [${xs.code.mkString(",")}]") + } + + case xs => fail(s"Expected lhs and rhs, got ${xs.code.mkString(";")}]") + } + case xs => fail(s"Expected six assignemnts, got [${xs.code.mkString(";")}]") + } + case xs => fail(s"Expected three lambdas, got ${xs.size} lambdas instead") + } + } } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyCode2CpgFixture.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyCode2CpgFixture.scala index 4675ad8584c0..015ceb9b7dbb 100644 --- a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyCode2CpgFixture.scala +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyCode2CpgFixture.scala @@ -1,21 +1,21 @@ package io.joern.rubysrc2cpg.testfixtures import io.joern.dataflowengineoss.language.Path -import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.FlowSemantic import io.joern.dataflowengineoss.testfixtures.{SemanticCpgTestFixture, SemanticTestCpg} import io.joern.rubysrc2cpg.deprecated.utils.PackageTable import io.joern.rubysrc2cpg.{Config, RubySrc2Cpg} import io.joern.x2cpg.testfixtures.* -import io.joern.x2cpg.{ValidationMode, X2Cpg} -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.ValidationMode +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} import org.scalatest.Tag import java.io.File import org.scalatest.Inside -trait RubyFrontend(useDeprecatedFrontend: Boolean, withDownloadDependencies: Boolean) extends LanguageFrontend { +trait RubyFrontend(useDeprecatedFrontend: Boolean, withDownloadDependencies: Boolean, disableFileContent: Boolean) + extends LanguageFrontend { override val fileSuffix: String = ".rb" implicit val config: Config = @@ -24,6 +24,7 @@ trait RubyFrontend(useDeprecatedFrontend: Boolean, withDownloadDependencies: Boo .getOrElse(Config().withSchemaValidation(ValidationMode.Enabled)) .withUseDeprecatedFrontend(useDeprecatedFrontend) .withDownloadDependencies(withDownloadDependencies) + .withDisableFileContent(disableFileContent) override def execute(sourceCodeFile: File): Cpg = { new RubySrc2Cpg().createCpg(sourceCodeFile.getAbsolutePath).get @@ -34,9 +35,10 @@ trait RubyFrontend(useDeprecatedFrontend: Boolean, withDownloadDependencies: Boo class DefaultTestCpgWithRuby( packageTable: Option[PackageTable], useDeprecatedFrontend: Boolean, - downloadDependencies: Boolean = false + downloadDependencies: Boolean = false, + disableFileContent: Boolean = true ) extends DefaultTestCpg - with RubyFrontend(useDeprecatedFrontend, downloadDependencies) + with RubyFrontend(useDeprecatedFrontend, downloadDependencies, disableFileContent) with SemanticTestCpg { override protected def applyPasses(): Unit = { @@ -52,18 +54,18 @@ class DefaultTestCpgWithRuby( } RubySrc2Cpg.postProcessingPasses(this, config).foreach(_.createAndApply()) } - } class RubyCode2CpgFixture( withPostProcessing: Boolean = false, withDataFlow: Boolean = false, downloadDependencies: Boolean = false, + disableFileContent: Boolean = true, extraFlows: List[FlowSemantic] = List.empty, packageTable: Option[PackageTable] = None, useDeprecatedFrontend: Boolean = false ) extends Code2CpgFixture(() => - new DefaultTestCpgWithRuby(packageTable, useDeprecatedFrontend, downloadDependencies) + new DefaultTestCpgWithRuby(packageTable, useDeprecatedFrontend, downloadDependencies, disableFileContent) .withOssDataflow(withDataFlow) .withExtraFlows(extraFlows) .withPostProcessingPasses(withPostProcessing) @@ -73,15 +75,18 @@ class RubyCode2CpgFixture( implicit val resolver: ICallResolver = NoResolve - protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + protected def flowToResultPairs(path: Path): List[(String, Int)] = + path.resultPairs().collect { case (firstElement, secondElement) => (firstElement, secondElement.getOrElse(-1)) } } -class RubyCfgTestCpg(useDeprecatedFrontend: Boolean = true, downloadDependencies: Boolean = false) - extends CfgTestCpg - with RubyFrontend(useDeprecatedFrontend, downloadDependencies) { +class RubyCfgTestCpg( + useDeprecatedFrontend: Boolean = true, + downloadDependencies: Boolean = false, + disableFileContent: Boolean = true +) extends CfgTestCpg + with RubyFrontend(useDeprecatedFrontend, downloadDependencies, disableFileContent) { override val fileSuffix: String = ".rb" } diff --git a/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyParserFixture.scala b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyParserFixture.scala new file mode 100644 index 000000000000..539e39e9a8c7 --- /dev/null +++ b/joern-cli/frontends/rubysrc2cpg/src/test/scala/io/joern/rubysrc2cpg/testfixtures/RubyParserFixture.scala @@ -0,0 +1,96 @@ +package io.joern.rubysrc2cpg.testfixtures + +import io.joern.rubysrc2cpg.Config +import io.joern.rubysrc2cpg.parser.{AstPrinter, ResourceManagedParser, RubyNodeCreator, RubyParser} +import io.joern.x2cpg.SourceFiles +import io.joern.x2cpg.utils.{ConcurrentTaskUtil, TestCodeWriter} +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike +import org.slf4j.LoggerFactory +import better.files.File as BFile + +import java.nio.charset.StandardCharsets +import java.nio.file.{Files, Path} +import scala.util.{Failure, Success, Using} + +class RubyParserFixture + extends RubyFrontend(useDeprecatedFrontend = false, withDownloadDependencies = false, disableFileContent = true) + with TestCodeWriter + with AnyWordSpecLike + with Matchers { + private val RubySourceFileExtensions: Set[String] = Set(".rb") + private val logger = LoggerFactory.getLogger(this.getClass) + private var fileNameCounter = 0 + + def generateParserTasks( + resourceManagedParser: ResourceManagedParser, + config: Config, + inputPath: String + ): Iterator[() => RubyParser.ProgramContext] = { + SourceFiles + .determine( + inputPath, + RubySourceFileExtensions, + ignoredDefaultRegex = Option(config.defaultIgnoredFilesRegex), + ignoredFilesRegex = Option(config.ignoredFilesRegex), + ignoredFilesPath = Option(config.ignoredFiles) + ) + .map(fileName => + () => + resourceManagedParser.parse(BFile(config.inputPath), fileName) match { + case Failure(exception) => throw exception + case Success(ctx) => ctx + } + ) + .iterator + } + + def writeCode(code: String, extension: String): Path = { + val tmpDir = BFile.newTemporaryDirectory("x2cpgTestTmpDir").deleteOnExit() + val tmpPath = tmpDir.path + val codeFiles = { + val fileName = { + val filename = s"Test$fileNameCounter$extension" + fileNameCounter += 1 + filename + } + + val filePath = Path.of(fileName) + if (filePath.getParent != null) { + Files.createDirectories(tmpPath.resolve(filePath.getParent)) + } + val codeAsBytes = code.getBytes(StandardCharsets.UTF_8) + val codeFile = tmpPath.resolve(filePath) + Files.write(codeFile, codeAsBytes) + codeFilePreProcessing(codeFile) + codeFile + } + + tmpPath + } + + def parseCode(code: String): List[RubyParser.ProgramContext] = { + val tempPath = writeCode(code, ".rb") + + Using.resource(new ResourceManagedParser(config.antlrCacheMemLimit)) { parser => + ConcurrentTaskUtil.runUsingThreadPool(generateParserTasks(parser, config, tempPath.toString)).flatMap { + case Failure(exception) => logger.warn(s"Could not parse file, skipping - ", exception); None + case Success(ctx) => Option(ctx) + } + } + } + + def test(code: String, expected: String = null): Unit = { + val astPrinter = parseCode(code).headOption match { + case Some(head) => Option(AstPrinter().visit(head)) + case None => None + } + + astPrinter match { + case Some(ast) => + val compareTo = if (expected != null) expected else code + ast shouldBe compareTo + case None => fail("AST Printer failed") + } + } +} diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/Main.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/Main.scala index 800d7a8a3dc7..b9d071df2273 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/Main.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/Main.scala @@ -1,7 +1,7 @@ package io.joern.swiftsrc2cpg import io.joern.swiftsrc2cpg.Frontend.* -import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery} +import io.joern.x2cpg.passes.frontend.{TypeRecoveryParserConfig, XTypeRecovery, XTypeRecoveryConfig} import io.joern.x2cpg.utils.Environment import io.joern.x2cpg.{X2CpgConfig, X2CpgMain} import scopt.OParser @@ -24,7 +24,7 @@ object Frontend { import builder.* OParser.sequence( programName("swiftsrc2cpg"), - XTypeRecovery.parserOptions, + XTypeRecoveryConfig.parserOptionsForParserConfig, opt[String]("define") .unbounded() .text("define a name") diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/SwiftSrc2Cpg.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/SwiftSrc2Cpg.scala index b7bd96d5dfe7..4c48432b6fcf 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/SwiftSrc2Cpg.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/SwiftSrc2Cpg.scala @@ -6,11 +6,10 @@ import io.joern.swiftsrc2cpg.passes.* import io.joern.swiftsrc2cpg.utils.AstGenRunner import io.joern.x2cpg.X2Cpg.withNewEmptyCpg import io.joern.x2cpg.X2CpgFrontend -import io.joern.x2cpg.passes.callgraph.NaiveCallLinker +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.utils.{HashUtil, Report} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.CpgPassBase +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.layers.LayerCreatorContext import scala.util.Try @@ -46,23 +45,10 @@ class SwiftSrc2Cpg extends X2CpgFrontend[Config] { val maybeCpg = createCpgWithOverlays(config) maybeCpg.map { cpg => new OssDataFlow(new OssDataFlowOptions()).run(new LayerCreatorContext(cpg)) - SwiftSrc2Cpg.postProcessingPasses(cpg, Option(config)).foreach(_.createAndApply()) + val typeRecoveryConfig = XTypeRecoveryConfig(config.typePropagationIterations, !config.disableDummyTypes) + swiftsrc2cpg.postProcessingPasses(cpg, typeRecoveryConfig).foreach(_.createAndApply()) cpg } } } - -object SwiftSrc2Cpg { - - def postProcessingPasses(cpg: Cpg, config: Option[Config] = None): List[CpgPassBase] = { - val typeRecoveryConfig = - config.fold(XTypeRecoveryConfig())(c => XTypeRecoveryConfig(c.typePropagationIterations, !c.disableDummyTypes)) - List(new SwiftInheritanceNamePass(cpg), new ConstClosurePass(cpg)) ++ - new SwiftTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() ++ List( - new SwiftTypeHintCallLinker(cpg), - new NaiveCallLinker(cpg) - ) - } - -} diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreator.scala index eae7d2bc78d7..af843e9d2568 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreator.scala @@ -4,11 +4,11 @@ import io.joern.swiftsrc2cpg.Config import io.joern.swiftsrc2cpg.datastructures.Scope import io.joern.swiftsrc2cpg.parser.SwiftJsonParser.ParseResult import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.datastructures.Stack.* import io.joern.x2cpg.utils.NodeBuilders.newMethodReturnNode import io.joern.x2cpg.{Ast, AstCreatorBase, ValidationMode, AstNodeBuilder as X2CpgAstNodeBuilder} import io.joern.x2cpg.datastructures.Global +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.joern.x2cpg.utils.NodeBuilders.newModifierNode import io.joern.x2cpg.utils.OffsetUtils import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal @@ -21,7 +21,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.NewTypeRef import io.shiftleft.codepropertygraph.generated.ModifierTypes import io.shiftleft.codepropertygraph.generated.nodes.File.PropertyDefaults import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import scala.collection.mutable @@ -121,10 +121,10 @@ class AstCreator(val config: Config, val global: Global, val parserResult: Parse case null => notHandledYet(node) } - override protected def line(node: SwiftNode): Option[Integer] = node.startLine.map(Integer.valueOf) - override protected def column(node: SwiftNode): Option[Integer] = node.startColumn.map(Integer.valueOf) - override protected def lineEnd(node: SwiftNode): Option[Integer] = node.endLine.map(Integer.valueOf) - override protected def columnEnd(node: SwiftNode): Option[Integer] = node.endColumn.map(Integer.valueOf) + override protected def line(node: SwiftNode): Option[Int] = node.startLine + override protected def column(node: SwiftNode): Option[Int] = node.startColumn + override protected def lineEnd(node: SwiftNode): Option[Int] = node.endLine + override protected def columnEnd(node: SwiftNode): Option[Int] = node.endColumn private val lineOffsetTable = OffsetUtils.getLineOffsetTable(Option(parserResult.fileContent)) diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreatorHelper.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreatorHelper.scala index b98bc2523d0c..7a60e48fe4d2 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreatorHelper.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstCreatorHelper.scala @@ -9,7 +9,8 @@ import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.FunctionDeclSyntax import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.GuardStmtSyntax import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.InitializerDeclSyntax import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.SwiftNode -import io.joern.swiftsrc2cpg.passes.Defines +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.{Ast, ValidationMode} import io.joern.x2cpg.utils.NodeBuilders.{newClosureBindingNode, newLocalNode} import io.shiftleft.codepropertygraph.generated.nodes.NewNode @@ -18,7 +19,6 @@ import io.shiftleft.codepropertygraph.generated.nodes.NewNamespaceBlock import io.shiftleft.codepropertygraph.generated.nodes.NewTypeDecl import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.shiftleft.codepropertygraph.generated.PropertyNames -import io.shiftleft.passes.IntervalKeyPool import scala.collection.mutable diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForDeclSyntaxCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForDeclSyntaxCreator.scala index 303d753b38a1..f131b8691a98 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForDeclSyntaxCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForDeclSyntaxCreator.scala @@ -3,11 +3,11 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.datastructures.BlockScope import io.joern.swiftsrc2cpg.datastructures.MethodScope import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.utils.NodeBuilders.* import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.nodes.NewModifier import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.ModifierTypes diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForExprSyntaxCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForExprSyntaxCreator.scala index e3ebefe4b845..ad6a90ce65bc 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForExprSyntaxCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForExprSyntaxCreator.scala @@ -1,11 +1,11 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.swiftsrc2cpg.passes.GlobalBuiltins import io.joern.x2cpg.Ast import io.joern.x2cpg.datastructures.Stack.* import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.Operators @@ -494,11 +494,7 @@ trait AstForExprSyntaxCreator(implicit withSchemaValidation: ValidationMode) { private def astForTryExprSyntax(node: TryExprSyntax): Ast = { val tryNode = controlStructureNode(node, ControlStructureTypes.TRY, code(node)) val bodyAst = astForNode(node.expression) - // The semantics of try statement children is defined by their order value. - // Thus we set the here explicitly and do not rely on the usual consecutive - // ordering. - setOrderExplicitly(bodyAst, 1) - Ast(tryNode).withChild(bodyAst) + tryCatchAst(tryNode, bodyAst, Seq.empty, None) } private def astForTupleExprSyntax(node: TupleExprSyntax): Ast = { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForPatternSyntaxCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForPatternSyntaxCreator.scala index c143f51e5f1d..72afc93c5f0f 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForPatternSyntaxCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForPatternSyntaxCreator.scala @@ -3,9 +3,9 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.datastructures.BlockScope import io.joern.swiftsrc2cpg.datastructures.MethodScope import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.Operators diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForStmtSyntaxCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForStmtSyntaxCreator.scala index 85883687dbf1..df0b6da1b806 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForStmtSyntaxCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForStmtSyntaxCreator.scala @@ -54,22 +54,17 @@ trait AstForStmtSyntaxCreator(implicit withSchemaValidation: ValidationMode) { private def astForDiscardStmtSyntax(node: DiscardStmtSyntax): Ast = notHandledYet(node) private def astForDoStmtSyntax(node: DoStmtSyntax): Ast = { - val tryNode = controlStructureNode(node, ControlStructureTypes.TRY, code(node)) - val bodyAst = astForNode(node.body) - setOrderExplicitly(bodyAst, 1) - val catchAsts = node.catchClauses.children.zipWithIndex.map { case (h, index) => - astForCatchHandler(h, index + 2) - }.toIndexedSeq - Ast(tryNode).withChild(bodyAst).withChildren(catchAsts) + val tryNode = controlStructureNode(node, ControlStructureTypes.TRY, code(node)) + val bodyAst = astForNode(node.body) + val catchAsts = node.catchClauses.children.map(astForCatchHandler) + tryCatchAst(tryNode, bodyAst, catchAsts, None) } - private def astForCatchHandler(catchClause: CatchClauseSyntax, argIndex: Int): Ast = { - val catchNode = - controlStructureNode(catchClause, ControlStructureTypes.CATCH, code(catchClause)) - .order(argIndex) - .argumentIndex(argIndex) - val declAst = astForNode(catchClause.catchItems) - val bodyAst = astForNode(catchClause.body) + private def astForCatchHandler(catchClause: CatchClauseSyntax): Ast = { + val catchNode = controlStructureNode(catchClause, ControlStructureTypes.CATCH, code(catchClause)) + val declAst = astForNode(catchClause.catchItems) + val bodyAst = astForNode(catchClause.body) + setArgumentIndices(List(declAst, bodyAst)) Ast(catchNode).withChild(declAst).withChild(bodyAst) } diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSwiftTokenCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSwiftTokenCreator.scala index 58835fcdd967..2ef71aeeec96 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSwiftTokenCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSwiftTokenCreator.scala @@ -1,9 +1,9 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import scala.annotation.unused diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCollectionCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCollectionCreator.scala index 95b9770842db..dfa383826e6f 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCollectionCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCollectionCreator.scala @@ -1,10 +1,10 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Stack.* +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.nodes.File.PropertyDefaults import io.shiftleft.codepropertygraph.generated.DispatchTypes import io.shiftleft.codepropertygraph.generated.Operators diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCreator.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCreator.scala index 97dbf8491419..9365c71b916b 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCreator.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstForSyntaxCreator.scala @@ -3,10 +3,10 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.datastructures.BlockScope import io.joern.swiftsrc2cpg.datastructures.MethodScope import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg.Ast import io.joern.x2cpg.datastructures.Stack.* import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.EvaluationStrategies import io.shiftleft.codepropertygraph.generated.nodes.NewModifier import io.shiftleft.codepropertygraph.generated.ModifierTypes diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstNodeBuilder.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstNodeBuilder.scala index 46d5bc71e759..6d1d6f337db5 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstNodeBuilder.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/astcreation/AstNodeBuilder.scala @@ -1,10 +1,10 @@ package io.joern.swiftsrc2cpg.astcreation import io.joern.swiftsrc2cpg.parser.SwiftNodeSyntax.* -import io.joern.swiftsrc2cpg.passes.Defines import io.joern.x2cpg import io.joern.x2cpg.Ast import io.joern.x2cpg.ValidationMode +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.joern.x2cpg.utils.NodeBuilders.newMethodReturnNode import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.DispatchTypes @@ -92,8 +92,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createIndexAccessCallAst( baseNode: NewNode, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseNode)}[${codeOf(partNode)}]", @@ -109,8 +109,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createIndexAccessCallAst( baseAst: Ast, partAst: Ast, - line: Option[Integer], - column: Option[Integer], + line: Option[Int], + column: Option[Int], additionalArgsAst: Seq[Ast] = Seq.empty ): Ast = { val callNode = createCallNode( @@ -127,8 +127,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createFieldAccessCallAst( baseNode: NewNode, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseNode)}.${codeOf(partNode)}", @@ -144,8 +144,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC protected def createFieldAccessCallAst( baseAst: Ast, partNode: NewNode, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode( s"${codeOf(baseAst.nodes.head)}.${codeOf(partNode)}", @@ -169,8 +169,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC code: String, callName: String, dispatchType: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewCall = NewCall() .code(code) .name(callName) @@ -182,11 +182,7 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC .columnNumber(column) .typeFullName(Defines.Any) - protected def createFieldIdentifierNode( - name: String, - line: Option[Integer], - column: Option[Integer] - ): NewFieldIdentifier = { + protected def createFieldIdentifierNode(name: String, line: Option[Int], column: Option[Int]): NewFieldIdentifier = { NewFieldIdentifier() .code(name) .canonicalName(name) @@ -206,8 +202,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC destId: NewNode, sourceId: NewNode, code: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode(code, Operators.assignment, DispatchTypes.STATIC_DISPATCH, line, column) val arguments = List(Ast(destId), Ast(sourceId)) @@ -218,8 +214,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC dest: Ast, source: Ast, code: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): Ast = { val callNode = createCallNode(code, Operators.assignment, DispatchTypes.STATIC_DISPATCH, line, column) val arguments = List(dest, source) @@ -251,8 +247,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC signature: Option[String], returnType: String, fileName: Option[String] = None, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): AstAndMethod = { val methodNode = NewMethod() .name(io.joern.x2cpg.Defines.StaticInitMethodName) @@ -275,8 +271,8 @@ trait AstNodeBuilder(implicit withSchemaValidation: ValidationMode) { this: AstC code: String, callName: String, fullName: String, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewCall = NewCall() .code(code) .name(callName) diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/AstCreationPass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/AstCreationPass.scala index c70cd4a4db1b..e23e779fc240 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/AstCreationPass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/AstCreationPass.scala @@ -6,9 +6,10 @@ import io.joern.swiftsrc2cpg.parser.SwiftJsonParser import io.joern.swiftsrc2cpg.utils.AstGenRunner.AstGenRunnerResult import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.datastructures.Global +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.joern.x2cpg.utils.{Report, TimeUtils} -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.utils.IOUtils import org.slf4j.{Logger, LoggerFactory} @@ -18,7 +19,7 @@ import scala.jdk.CollectionConverters.* class AstCreationPass(cpg: Cpg, astGenRunnerResult: AstGenRunnerResult, config: Config, report: Report = new Report())( implicit withSchemaValidation: ValidationMode -) extends ConcurrentWriterCpgPass[String](cpg) { +) extends ForkJoinParallelCpgPass[String](cpg) { private val logger: Logger = LoggerFactory.getLogger(classOf[AstCreationPass]) diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/BuiltinTypesPass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/BuiltinTypesPass.scala index 0dcf14c8c3a0..c4114c3cfb07 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/BuiltinTypesPass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/BuiltinTypesPass.scala @@ -1,6 +1,7 @@ package io.joern.swiftsrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{NewNamespaceBlock, NewType, NewTypeDecl} import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/DependenciesPass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/DependenciesPass.scala index 8fcbbc599118..bcd21e04e516 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/DependenciesPass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/DependenciesPass.scala @@ -1,7 +1,7 @@ package io.joern.swiftsrc2cpg.passes import io.joern.x2cpg.X2Cpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.codepropertygraph.generated.nodes.NewDependency import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ExtensionInheritancePass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ExtensionInheritancePass.scala index cb74d50525f5..a307d2c612f9 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ExtensionInheritancePass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ExtensionInheritancePass.scala @@ -1,15 +1,15 @@ package io.joern.swiftsrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.TypeDecl import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.PropertyNames -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* import java.io.File -class ExtensionInheritancePass(cpg: Cpg) extends ConcurrentWriterCpgPass[TypeDecl](cpg) { +class ExtensionInheritancePass(cpg: Cpg) extends ForkJoinParallelCpgPass[TypeDecl](cpg) { private val SourceFolder: String = "/Source/" diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ImportsPass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ImportsPass.scala index b3ced26cd68c..d89d9b8f5dbe 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ImportsPass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ImportsPass.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes import io.joern.x2cpg.X2Cpg import io.joern.x2cpg.passes.frontend.XImportsPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment /** This pass creates `IMPORT` nodes by looking for calls to `require`. `IMPORT` nodes are linked to existing dependency diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftMetaDataPass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftMetaDataPass.scala index 2f62ceb5de6e..d114e3d3a4cd 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftMetaDataPass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftMetaDataPass.scala @@ -1,7 +1,7 @@ package io.joern.swiftsrc2cpg.passes import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewMetaData import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeNodePass.scala b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeNodePass.scala index c4676bfda819..1e78013d2b25 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeNodePass.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeNodePass.scala @@ -1,17 +1,16 @@ package io.joern.swiftsrc2cpg.passes -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.joern.x2cpg.passes.frontend.TypeNodePass import io.shiftleft.semanticcpg.language.* -import io.shiftleft.passes.KeyPool import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import scala.collection.mutable object SwiftTypeNodePass { - def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg, keyPool: Option[KeyPool] = None): TypeNodePass = { - new TypeNodePass(registeredTypes, cpg, keyPool, getTypesFromCpg = false) { + def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg): TypeNodePass = { + new TypeNodePass(registeredTypes, cpg, getTypesFromCpg = false) { override def fullToShortName(typeName: String): String = { typeName match { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/dataflow/DataFlowTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/dataflow/DataFlowTests.scala index e7de93beec41..15ac7441b461 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/dataflow/DataFlowTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/dataflow/DataFlowTests.scala @@ -8,7 +8,6 @@ import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.Identifier import io.shiftleft.codepropertygraph.generated.nodes.Literal import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.toNodeTraversal class DataFlowTests extends DataFlowCodeToCpgSuite { @@ -871,7 +870,7 @@ class DataFlowTests extends DataFlowCodeToCpgSuite { cpg .call("bar") .outE(EdgeTypes.REACHING_DEF) - .count(_.inNode() == cpg.ret.head) shouldBe 1 + .count(_.dst == cpg.ret.head) shouldBe 1 } } diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/io/CodeDumperFromFileTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/io/CodeDumperFromFileTests.scala index 401379610cca..74070859371c 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/io/CodeDumperFromFileTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/io/CodeDumperFromFileTests.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.io import better.files.File import io.joern.swiftsrc2cpg.testfixtures.SwiftSrc2CpgSuite import io.shiftleft.semanticcpg.codedumper.CodeDumper -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import java.util.regex.Pattern diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ActorTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ActorTests.scala index 9f35b700b653..ac7a7b581e3a 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ActorTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ActorTests.scala @@ -3,9 +3,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class ActorTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/AvailabilityQueryTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/AvailabilityQueryTests.scala index bc5471c202f6..f49f1b07708d 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/AvailabilityQueryTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/AvailabilityQueryTests.scala @@ -3,9 +3,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class AvailabilityQueryTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BorrowExprTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BorrowExprTests.scala index 346292310e0b..41d5bfb74245 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BorrowExprTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BorrowExprTests.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class BorrowExprTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BuiltinWordTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BuiltinWordTests.scala index 1619e9046cf2..01e2535d6108 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BuiltinWordTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/BuiltinWordTests.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class BuiltinWordTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ConflictMarkersTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ConflictMarkersTests.scala index 83c8113a0304..1c102a80e460 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ConflictMarkersTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ConflictMarkersTests.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class ConflictMarkersTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/CopyExprTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/CopyExprTests.scala index a37615b6b7c0..74cdd5dd2ad3 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/CopyExprTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/CopyExprTests.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CopyExprTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/DeclarationTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/DeclarationTests.scala index d296aa4a8c6e..07ba4e56a134 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/DeclarationTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/DeclarationTests.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class DeclarationTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/EnumTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/EnumTests.scala index 4c06817fe338..eb1f77e8ac99 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/EnumTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/EnumTests.scala @@ -4,9 +4,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class EnumTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ExpressionTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ExpressionTests.scala index a34be3b027d8..fe36cd54b82f 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ExpressionTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ExpressionTests.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class ExpressionTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ForeachTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ForeachTests.scala index 034f2cd05a6b..82baf8f5365f 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ForeachTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ForeachTests.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class ForeachTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SimpleAstCreationPassTest.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SimpleAstCreationPassTest.scala index c5b6ff659ce6..cb09bdbb24ed 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SimpleAstCreationPassTest.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SimpleAstCreationPassTest.scala @@ -1,8 +1,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite - -import io.joern.swiftsrc2cpg.passes.Defines +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg.Defines import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/StatementTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/StatementTests.scala index 071f028346f7..99102b6f6b62 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/StatementTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/StatementTests.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class StatementTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SuperTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SuperTests.scala index 3991c1d143f5..c3e538e433a3 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SuperTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SuperTests.scala @@ -4,7 +4,7 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class SuperTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SwitchTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SwitchTests.scala index a49ca2a5a8b5..1532d02ad0da 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SwitchTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/SwitchTests.scala @@ -4,9 +4,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class SwitchTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ToplevelLibraryTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ToplevelLibraryTests.scala index eda0969c3d9c..a70e3645c9ba 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ToplevelLibraryTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/ToplevelLibraryTests.scala @@ -4,9 +4,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class ToplevelLibraryTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TryTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TryTests.scala index cc04f6a56439..92f9e092680e 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TryTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TryTests.scala @@ -4,9 +4,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class TryTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TypealiasTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TypealiasTests.scala index 97ecb3006bdc..9a974501a878 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TypealiasTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/TypealiasTests.scala @@ -4,9 +4,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class TypealiasTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/WhileTests.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/WhileTests.scala index df30834877dd..6138b719d8e1 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/WhileTests.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/passes/ast/WhileTests.scala @@ -2,9 +2,9 @@ package io.joern.swiftsrc2cpg.passes.ast import io.joern.swiftsrc2cpg.testfixtures.AstSwiftSrc2CpgSuite -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* class WhileTests extends AstSwiftSrc2CpgSuite { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/AstSwiftSrc2CpgFrontend.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/AstSwiftSrc2CpgFrontend.scala index 239d210ebd8e..51cb41b43bfa 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/AstSwiftSrc2CpgFrontend.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/AstSwiftSrc2CpgFrontend.scala @@ -8,7 +8,7 @@ import io.joern.swiftsrc2cpg.utils.AstGenRunner import io.joern.x2cpg.testfixtures.LanguageFrontend import io.joern.x2cpg.ValidationMode import io.joern.x2cpg.X2Cpg.newEmptyCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait AstSwiftSrc2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala index d265e0f5d7a7..af0875c95404 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/DataFlowCodeToCpgSuite.scala @@ -3,8 +3,9 @@ package io.joern.swiftsrc2cpg.testfixtures import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext -import io.joern.swiftsrc2cpg.SwiftSrc2Cpg import io.joern.x2cpg.X2Cpg +import io.joern.x2cpg.frontendspecific.swiftsrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig import io.joern.x2cpg.testfixtures.{Code2CpgFixture, TestCpg} import io.shiftleft.semanticcpg.layers.LayerCreatorContext @@ -16,7 +17,7 @@ class DataFlowTestCpg extends TestCpg with SwiftSrc2CpgFrontend { val context = new LayerCreatorContext(this) val options = new OssDataFlowOptions() new OssDataFlow(options).run(context) - SwiftSrc2Cpg.postProcessingPasses(this).foreach(_.createAndApply()) + swiftsrc2cpg.postProcessingPasses(this, XTypeRecoveryConfig()).foreach(_.createAndApply()) } } @@ -26,7 +27,7 @@ class DataFlowCodeToCpgSuite extends Code2CpgFixture(() => new DataFlowTestCpg() protected implicit val context: EngineContext = EngineContext() protected def flowToResultPairs(path: Path): List[(String, Integer)] = - path.resultPairs().collect { case (firstElement: String, secondElement: Option[Integer]) => + path.resultPairs().collect { case (firstElement: String, secondElement) => (firstElement, secondElement.getOrElse(-1)) } } diff --git a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/SwiftSrc2CpgFrontend.scala b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/SwiftSrc2CpgFrontend.scala index 7d5d6a149e9f..22b00ca25507 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/SwiftSrc2CpgFrontend.scala +++ b/joern-cli/frontends/swiftsrc2cpg/src/test/scala/io/joern/swiftsrc2cpg/testfixtures/SwiftSrc2CpgFrontend.scala @@ -3,7 +3,7 @@ package io.joern.swiftsrc2cpg.testfixtures import better.files.File import io.joern.swiftsrc2cpg.{Config, SwiftSrc2Cpg} import io.joern.x2cpg.testfixtures.LanguageFrontend -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg trait SwiftSrc2CpgFrontend extends LanguageFrontend { def execute(sourceCodePath: java.io.File): Cpg = { diff --git a/joern-cli/frontends/swiftsrc2cpg/swiftsrc2cpg.sh b/joern-cli/frontends/swiftsrc2cpg/swiftsrc2cpg.sh index e3ab2a9c7c44..ce725e61d0ff 100755 --- a/joern-cli/frontends/swiftsrc2cpg/swiftsrc2cpg.sh +++ b/joern-cli/frontends/swiftsrc2cpg/swiftsrc2cpg.sh @@ -2,5 +2,6 @@ SCRIPT_ABS_PATH=$(readlink -f "$0") SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH) +LOG4J2_CONFIG="${SCRIPT_ABS_DIR}/src/main/resources/log4j2.xml" -$SCRIPT_ABS_DIR/target/universal/stage/bin/swiftsrc2cpg $@ +"${SCRIPT_ABS_DIR}/target/universal/stage/bin/swiftsrc2cpg" -Dlog4j2.formatMsgNoLookups=true -Dlog4j.configurationFile="${LOG4J2_CONFIG}" "$@" diff --git a/joern-cli/frontends/php2cpg/src/main/resources/known_function_signatures.txt b/joern-cli/frontends/x2cpg/src/main/resources/php_known_function_signatures.txt similarity index 100% rename from joern-cli/frontends/php2cpg/src/main/resources/known_function_signatures.txt rename to joern-cli/frontends/x2cpg/src/main/resources/php_known_function_signatures.txt diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Ast.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Ast.scala index ea5f9f8bd5f4..0788a8734691 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Ast.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Ast.scala @@ -1,11 +1,11 @@ package io.joern.x2cpg -import io.shiftleft.codepropertygraph.generated.EdgeTypes +import io.shiftleft.codepropertygraph.generated.{DiffGraphBuilder, EdgeTypes} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.nodes.AstNode.PropertyDefaults import org.slf4j.LoggerFactory -import overflowdb.BatchedUpdate.DiffGraphBuilder -import overflowdb.SchemaViolationException +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder +import flatgraph.SchemaViolationException case class AstEdge(src: NewNode, dst: NewNode) @@ -58,7 +58,7 @@ object Ast { !(src.isValidOutNeighbor(edge, dst) && dst.isValidInNeighbor(edge, src)) ) { throw new SchemaViolationException( - s"Malformed AST detected: (${src.label()}) -[$edge]-> (${dst.label()}) violates the schema." + s"Malformed AST detected: (${src.label}) -[$edge]-> (${dst.label}) violates the schema." ) } @@ -222,9 +222,10 @@ case class Ast( * copy. */ def subTreeCopy(node: AstNodeNew, argIndex: Int = -1, replacementNode: Option[AstNodeNew] = None): Ast = { - val newNode = replacementNode match + val newNode = replacementNode match { case Some(n) => n case None => node.copy + } if (argIndex != -1) { // newNode.order = argIndex newNode match { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstCreatorBase.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstCreatorBase.scala index d9bcab90807f..01da69c6e419 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstCreatorBase.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstCreatorBase.scala @@ -1,15 +1,16 @@ package io.joern.x2cpg import io.joern.x2cpg.passes.frontend.MetaDataPass +import io.joern.x2cpg.utils.IntervalKeyPool import io.joern.x2cpg.utils.NodeBuilders.newMethodReturnNode +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, ModifierTypes} -import io.shiftleft.passes.IntervalKeyPool import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: ValidationMode) { - val diffGraph: DiffGraphBuilder = new DiffGraphBuilder + val diffGraph: DiffGraphBuilder = Cpg.newDiffGraphBuilder private val closureKeyPool = new IntervalKeyPool(first = 0, last = Long.MaxValue) @@ -87,7 +88,7 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V ): Ast = Ast(method) .withChildren(parameters) - .withChild(Ast(NewBlock())) + .withChild(Ast(NewBlock().typeFullName(Defines.Any))) .withChildren(modifiers.map(Ast(_))) .withChild(Ast(methodReturn)) @@ -97,8 +98,8 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V signature: Option[String], returnType: String, fileName: Option[String] = None, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): Ast = { val methodNode = NewMethod() .name(Defines.StaticInitMethodName) @@ -112,7 +113,7 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V methodNode.filename(fileName.get) } val staticModifier = NewModifier().modifierType(ModifierTypes.STATIC) - val body = blockAst(NewBlock(), initAsts) + val body = blockAst(NewBlock().typeFullName(Defines.Any), initAsts) val methodReturn = newMethodReturnNode(returnType, None, None, None) methodAst(methodNode, Nil, body, methodReturn, List(staticModifier)) } @@ -147,11 +148,11 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V } } - def wrapMultipleInBlock(asts: Seq[Ast], lineNumber: Option[Integer]): Ast = { + def wrapMultipleInBlock(asts: Seq[Ast], lineNumber: Option[Int]): Ast = { asts.toList match { - case Nil => blockAst(NewBlock().lineNumber(lineNumber)) + case Nil => blockAst(NewBlock().typeFullName(Defines.Any).lineNumber(lineNumber)) case ast :: Nil => ast - case astList => blockAst(NewBlock().lineNumber(lineNumber), astList) + case astList => blockAst(NewBlock().typeFullName(Defines.Any).lineNumber(lineNumber), astList) } } @@ -159,8 +160,8 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V condition: Option[Ast], body: Seq[Ast], code: Option[String] = None, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): Ast = { var whileNode = NewControlStructure() .controlStructureType(ControlStructureTypes.WHILE) @@ -176,8 +177,8 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V condition: Option[Ast], body: Seq[Ast], code: Option[String] = None, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): Ast = { var doWhileNode = NewControlStructure() .controlStructureType(ControlStructureTypes.DO) @@ -220,7 +221,15 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V /** For the given try body, catch ASTs and finally AST, create a try-catch-finally AST with orders set correctly for * the ossdataflow engine. */ - def tryCatchAst(tryNode: NewControlStructure, tryBodyAst: Ast, catchAsts: Seq[Ast], finallyAst: Option[Ast]): Ast = { + @deprecated( + "This will be removed once all frontends switched to `tryCatchAst` using ControlStructure nodes for catches/finally. Use `tryCatchAst` instead." + ) + def tryCatchAstWithOrder( + tryNode: NewControlStructure, + tryBodyAst: Ast, + catchAsts: Seq[Ast], + finallyAst: Option[Ast] + ): Ast = { tryBodyAst.root.collect { case x: ExpressionNew => x }.foreach(_.order = 1) catchAsts.flatMap(_.root).collect { case x: ExpressionNew => x }.foreach(_.order = 2) finallyAst.flatMap(_.root).collect { case x: ExpressionNew => x }.foreach(_.order = 3) @@ -230,6 +239,16 @@ abstract class AstCreatorBase(filename: String)(implicit withSchemaValidation: V .withChildren(finallyAst.toList) } + /** For the given try body, catch ASTs, and finally AST, create a try-catch-finally AST. + */ + def tryCatchAst(tryNode: NewControlStructure, tryBodyAst: Ast, catchAsts: Seq[Ast], finallyAst: Option[Ast]): Ast = { + setArgumentIndices(tryBodyAst +: (catchAsts ++ finallyAst.toSeq)) + Ast(tryNode) + .withChild(tryBodyAst) + .withChildren(catchAsts) + .withChildren(finallyAst.toSeq) + } + /** For a given block node and statement ASTs, create an AST that represents the block. The main purpose of this * method is to increase the readability of the code which creates block asts. */ diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstNodeBuilder.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstNodeBuilder.scala index 06eff6f6724f..217814f6d4d0 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstNodeBuilder.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/AstNodeBuilder.scala @@ -27,10 +27,10 @@ import org.apache.commons.lang3.StringUtils import scala.util.Try trait AstNodeBuilder[Node, NodeProcessor] { this: NodeProcessor => - protected def line(node: Node): Option[Integer] - protected def column(node: Node): Option[Integer] - protected def lineEnd(node: Node): Option[Integer] - protected def columnEnd(element: Node): Option[Integer] + protected def line(node: Node): Option[Int] + protected def column(node: Node): Option[Int] + protected def lineEnd(node: Node): Option[Int] + protected def columnEnd(element: Node): Option[Int] private val MinCodeLength: Int = 50 private val DefaultMaxCodeLength: Int = 1000 @@ -234,7 +234,7 @@ trait AstNodeBuilder[Node, NodeProcessor] { this: NodeProcessor => } protected def blockNode(node: Node): NewBlock = { - blockNode(node, BlockDefaults.Code, BlockDefaults.TypeFullName) + blockNode(node, BlockDefaults.Code, Defines.Any) } protected def blockNode(node: Node, code: String, typeFullName: String): NewBlock = { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Imports.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Imports.scala index a46e41fdabaf..7d523c6aba44 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Imports.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/Imports.scala @@ -2,7 +2,7 @@ package io.joern.x2cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{CallBase, NewImport} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder object Imports { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/SourceFiles.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/SourceFiles.scala index 24b224a15fab..9fac9de33edc 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/SourceFiles.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/SourceFiles.scala @@ -5,17 +5,59 @@ import better.files.* import org.slf4j.LoggerFactory import java.io.FileNotFoundException +import java.nio.file.FileVisitor +import java.nio.file.FileVisitResult +import java.nio.file.Path import java.nio.file.Paths +import java.nio.file.attribute.BasicFileAttributes +import java.nio.file.Files import scala.util.matching.Regex +import scala.jdk.CollectionConverters.SetHasAsJava + object SourceFiles { private val logger = LoggerFactory.getLogger(getClass) + /** Hack to have a FileVisitor in place that will continue iterating files even if an IOException happened during + * traversal. + */ + private final class FailsafeFileVisitor extends FileVisitor[Path] { + + private val seenFiles = scala.collection.mutable.Set.empty[Path] + + def files(): Set[File] = seenFiles.map(File(_)).toSet + + override def preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult = { + FileVisitResult.CONTINUE + } + + override def visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult = { + seenFiles.addOne(file) + FileVisitResult.CONTINUE + } + + override def visitFileFailed(file: Path, exc: java.io.IOException): FileVisitResult = { + exc match { + case e: java.nio.file.FileSystemLoopException => logger.warn(s"Ignoring '$file' (cyclic symlink)") + case other => logger.warn(s"Ignoring '$file'", other) + } + FileVisitResult.CONTINUE + } + + override def postVisitDirectory(dir: Path, exc: java.io.IOException): FileVisitResult = FileVisitResult.CONTINUE + } + private def isIgnoredByFileList(filePath: String, ignoredFiles: Seq[String]): Boolean = { - val isInIgnoredFiles = ignoredFiles.exists { - case ignorePath if File(ignorePath).isDirectory => filePath.startsWith(ignorePath) - case ignorePath => filePath == ignorePath + val filePathFile = File(filePath) + if (!filePathFile.exists || !filePathFile.isReadable) { + logger.debug(s"'$filePath' ignored (not readable or broken symlink)") + return true + } + val isInIgnoredFiles = ignoredFiles.exists { ignorePath => + val ignorePathFile = File(ignorePath) + ignorePathFile.exists && + (ignorePathFile.contains(filePathFile, strict = false) || ignorePathFile.isSameFileAs(filePathFile)) } if (isInIgnoredFiles) { logger.debug(s"'$filePath' ignored (--exclude)") @@ -106,7 +148,11 @@ object SourceFiles { val matchingFiles = files.filter(hasSourceFileExtension).map(_.toString) val matchingFilesFromDirs = dirs - .flatMap(_.listRecursively) + .flatMap { dir => + val visitor = new FailsafeFileVisitor + Files.walkFileTree(dir.path, visitOptions.toSet.asJava, Int.MaxValue, visitor) + visitor.files() + } .filter(hasSourceFileExtension) .map(_.pathAsString) @@ -117,21 +163,17 @@ object SourceFiles { * unexpected and hard-to-debug issues in the results. */ private def assertAllExist(files: Set[File]): Unit = { - val (existant, nonExistant) = files.partition(_.isReadable) - val nonReadable = existant.filterNot(_.isReadable) - - if (nonExistant.nonEmpty || nonReadable.nonEmpty) { - logErrorWithPaths("Source input paths do not exist", nonExistant.map(_.canonicalPath)) - + val (existent, nonExistent) = files.partition(_.exists) + val nonReadable = existent.filterNot(_.isReadable) + if (nonExistent.nonEmpty || nonReadable.nonEmpty) { + logErrorWithPaths("Source input paths do not exist", nonExistent.map(_.canonicalPath)) logErrorWithPaths("Source input paths exist, but are not readable", nonReadable.map(_.canonicalPath)) - throw FileNotFoundException("Invalid source paths provided") } } private def logErrorWithPaths(message: String, paths: Iterable[String]): Unit = { val pathsArray = paths.toArray.sorted - pathsArray.lengthCompare(1) match { case cmp if cmp < 0 => // pathsArray is empty, so don't log anything case cmp if cmp == 0 => logger.error(s"$message: ${paths.head}") diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/X2Cpg.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/X2Cpg.scala index 0bd7c702fa3e..73ec53c17190 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/X2Cpg.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/X2Cpg.scala @@ -3,10 +3,9 @@ package io.joern.x2cpg import better.files.File import io.joern.x2cpg.X2Cpg.{applyDefaultOverlays, withErrorsToConsole} import io.joern.x2cpg.layers.{Base, CallGraph, ControlFlow, TypeRelations} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext} import org.slf4j.LoggerFactory -import overflowdb.Config import scopt.OParser import java.io.PrintWriter @@ -117,14 +116,35 @@ abstract class X2CpgMain[T <: X2CpgConfig[T], X <: X2CpgFrontend[?]](val cmdLine implicit defaultConfig: T ) { + private val logger = LoggerFactory.getLogger(classOf[X2CpgMain[T, X]]) + + private def logVersionAndArgs(args: Array[String]): Unit = { + val frontendName = frontend.getClass.getSimpleName.stripSuffix("$") + val joernVersion = + // We only have a proper version there if joern was build using sbt assembly. Otherwise, it might be null. + Option(frontend.getClass.getPackage.getImplementationVersion).map(v => s"v$v").getOrElse("local build") + val logText = s"Executing $frontendName ($joernVersion) with arguments: ${args.mkString(" ")}" + logger.debug(logText) + } + + private def logOutputPath(outputPath: String): Unit = { + if (X2CpgConfig.defaultOutputPath == outputPath) { + // We only log the output path of no explicit path was given by the user. + // Otherwise, the user obviously knows the path. + logger.info(s"The resulting CPG will be stored at ${File(outputPath)}") + } + } + /** method that evaluates frontend with configuration */ def run(config: T, frontend: X): Unit def main(args: Array[String]): Unit = { + logVersionAndArgs(args) X2Cpg.parseCommandLine(args, cmdLineParser, defaultConfig) match { case Some(config) => try { + logOutputPath(config.outputPath) run(config, frontend) } catch { case ex: Throwable => @@ -152,15 +172,22 @@ trait X2CpgFrontend[T <: X2CpgConfig[?]] { /** Create CPG according to given configuration, printing errors to the console if they occur. The CPG is closed and * not returned. */ + @throws[Throwable]("if createCpg throws any Throwable") def run(config: T): Unit = { withErrorsToConsole(config) { _ => createCpg(config) match { case Success(cpg) => - cpg.close() + cpg.close() // persists to disk Success(cpg) case Failure(exception) => Failure(exception) } + }.recover { exception => + // We explicitly rethrow the exception so that every frontend will + // terminate with exit code 1 if there was an exception during createCpg. + // Frontend maintainer may want to catch that RuntimeException on their end + // to add custom error handling. + throw exception } } @@ -272,19 +299,16 @@ object X2Cpg { /** Create an empty CPG, backed by the file at `optionalOutputPath` or in-memory if `optionalOutputPath` is empty. */ def newEmptyCpg(optionalOutputPath: Option[String] = None): Cpg = { - val odbConfig = optionalOutputPath - .map { outputPath => - val outFile = File(outputPath) + optionalOutputPath match { + case Some(outputPath) => + lazy val outFile = File(outputPath) if (outputPath != "" && outFile.exists) { logger.info("Output file exists, removing: " + outputPath) outFile.delete() } - Config.withDefaults.withStorageLocation(outputPath) - } - .getOrElse { - Config.withDefaults() - } - Cpg.withConfig(odbConfig) + Cpg.withStorage(outFile.path) + case None => Cpg.empty + } } /** Apply function `applyPasses` to a newly created CPG. The CPG is wrapped in a `Try` and returned. On failure, the diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenNodeBuilder.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenNodeBuilder.scala index e8773ce02a53..d940fc10d4ae 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenNodeBuilder.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenNodeBuilder.scala @@ -10,12 +10,12 @@ trait AstGenNodeBuilder[NodeProcessor] extends AstNodeBuilder[BaseNodeInfo[?], N override def code(node: BaseNodeInfo[?]): String = Option(node).map(_.code).getOrElse(PropertyDefaults.Code) - override def line(node: BaseNodeInfo[?]): Option[Integer] = Option(node).flatMap(_.lineNumber) + override def line(node: BaseNodeInfo[?]): Option[Int] = Option(node).flatMap(_.lineNumber) - override def lineEnd(node: BaseNodeInfo[?]): Option[Integer] = Option(node).flatMap(_.lineNumberEnd) + override def lineEnd(node: BaseNodeInfo[?]): Option[Int] = Option(node).flatMap(_.lineNumberEnd) - override def column(node: BaseNodeInfo[?]): Option[Integer] = Option(node).flatMap(_.columnNumber) + override def column(node: BaseNodeInfo[?]): Option[Int] = Option(node).flatMap(_.columnNumber) - override def columnEnd(node: BaseNodeInfo[?]): Option[Integer] = Option(node).flatMap(_.columnNumberEnd) + override def columnEnd(node: BaseNodeInfo[?]): Option[Int] = Option(node).flatMap(_.columnNumberEnd) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenRunner.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenRunner.scala index 25c173dbdc95..c9a9a514efab 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenRunner.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/AstGenRunner.scala @@ -98,11 +98,11 @@ trait AstGenRunnerBase(config: X2CpgConfig[?] & AstGenConfig[?]) { */ protected val SupportedBinaries: Set[(OperatingSystemType, ArchitectureType)] = Set( Environment.OperatingSystemType.Windows -> Environment.ArchitectureType.X86, - Environment.OperatingSystemType.Windows -> Environment.ArchitectureType.ARM, + Environment.OperatingSystemType.Windows -> Environment.ArchitectureType.ARMv8, Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.X86, - Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.ARM, + Environment.OperatingSystemType.Linux -> Environment.ArchitectureType.ARMv8, Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.X86, - Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.ARM + Environment.OperatingSystemType.Mac -> Environment.ArchitectureType.ARMv8 ) /** Determines the name of the executable to run, based on the host system. Usually, AST GEN binaries support three @@ -129,8 +129,8 @@ trait AstGenRunnerBase(config: X2CpgConfig[?] & AstGenConfig[?]) { s"${metaData.name}-$x86Suffix" } else { Environment.architecture match { - case Environment.ArchitectureType.X86 => s"${metaData.name}-$x86Suffix" - case Environment.ArchitectureType.ARM => s"${metaData.name}-$armSuffix" + case Environment.ArchitectureType.X86 => s"${metaData.name}-$x86Suffix" + case Environment.ArchitectureType.ARMv8 => s"${metaData.name}-$armSuffix" } } } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/package.scala index da3ec7d28dce..96c2a25b13b5 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/package.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/astgen/package.scala @@ -12,10 +12,10 @@ package object astgen { def node: T def json: Value def code: String - def lineNumber: Option[Integer] - def columnNumber: Option[Integer] - def lineNumberEnd: Option[Integer] - def columnNumberEnd: Option[Integer] + def lineNumber: Option[Int] + def columnNumber: Option[Int] + def lineNumberEnd: Option[Int] + def columnNumberEnd: Option[Int] } /** The basic components of the results from parsing the JSON AST. diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/datastructures/ProgramSummary.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/datastructures/ProgramSummary.scala index da3ccbe1a4a5..13e381ee5415 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/datastructures/ProgramSummary.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/datastructures/ProgramSummary.scala @@ -3,7 +3,6 @@ package io.joern.x2cpg.datastructures import io.shiftleft.codepropertygraph.generated.nodes.DeclarationNew import scala.annotation.targetName -import scala.collection.immutable.Map import scala.collection.mutable import scala.reflect.ClassTag @@ -14,16 +13,20 @@ import scala.reflect.ClassTag * * @tparam T * the type/class meta data class. + * @tparam M + * the function/method meta data class. + * @tparam F + * the field/property/member meta data class. */ -trait ProgramSummary[T <: TypeLike[?, ?]] { +trait ProgramSummary[T <: TypeLike[M, F], M <: MethodLike, F <: FieldLike] { /** A mapping between a namespace/directory and the containing types. */ - protected val namespaceToType: Map[String, Set[T]] + protected val namespaceToType: mutable.Map[String, mutable.Set[T]] /** For the given namespace, returns the declared types. */ - def typesUnderNamespace(namespace: String): Set[T] = namespaceToType.getOrElse(namespace, Set.empty) + def typesUnderNamespace(namespace: String): Set[T] = namespaceToType.getOrElse(namespace, Set.empty).toSet /** For a type, will search for the associated namespace. */ @@ -35,33 +38,71 @@ trait ProgramSummary[T <: TypeLike[?, ?]] { * the set of matching types' meta data. */ def matchingTypes(typeName: String): List[T] = { - namespaceToType.values.flatten.filter(_.name.endsWith(typeName)).toList + namespaceToType.values.flatten.filter(t => t.name.split('.').endsWith(typeName.split('.'))).toList + } + + /** Absorbs the given program summary information into this program summary. + * @param o + * the program summary to absorb. + * @return + * this program summary. + */ + def absorb(o: ProgramSummary[T, M, F]): ProgramSummary[T, M, F] = { + ProgramSummary.merge(this.namespaceToType, o.namespaceToType) + this } } object ProgramSummary { - /** Combines two namespace-to-type maps. - */ - def combine[T <: TypeLike[M, F], M <: MethodLike, F <: FieldLike]( - a: Map[String, Set[T]], - b: Map[String, Set[T]] - ): Map[String, Set[T]] = { - val accumulator = mutable.HashMap.from(a) - - b.keySet.foreach(namespace => - accumulator.updateWith(namespace) { - case Some(existing) => - val types = (existing.toList ++ b(namespace).toList) - .groupBy(_.name) - .map { case (_, ts) => ts.reduce((a, b) => (a + b).asInstanceOf[T]) } - .toSet - Option(types) + def merge[T <: TypeLike[M, F], M <: MethodLike, F <: FieldLike]( + a: mutable.Map[String, mutable.Set[T]], + b: mutable.Map[String, mutable.Set[T]] + ): mutable.Map[String, mutable.Set[T]] = { + + def dedupTypesInPlace(m: mutable.Map[String, mutable.Set[T]]): Unit = { + val newMap = m + .map { case (namespace, ts) => namespace -> ts.groupBy(_.name) } + .map { case (namespace, typMap) => + val dedupedTypes = mutable.Set.from( + typMap + .map { case (name, ts) => name -> ts.reduce((u, v) => (u + v).asInstanceOf[T]) } + .values + .toSet + ) + m.put(namespace, dedupedTypes) + namespace -> dedupedTypes + } + .toMap + assert(m.flatMap { case (name, ts) => ts.groupBy(_.name).map(_._2.size) }.forall(_ == 1)) + } + + // Handle duplicate types sharing the same namespace. This can be introduced from serialized type stubs. + dedupTypesInPlace(a) + dedupTypesInPlace(b) + + b.foreach { case (namespace, bts) => + a.updateWith(namespace) { + case Some(ats: mutable.Set[T]) => + // Assert that we can simply reduce the grouped values to a simple key-value mapping for fast look-ups + assert(ats.groupBy(_.name).values.forall(_.sizeIs == 1)) + val atsMap = ats.groupBy(_.name).map { case (name, ts) => name -> ts.head } + + bts.foreach { bt => + atsMap.get(bt.name) match { + case Some(at) => + ats.remove(at) + ats.add((at + bt).asInstanceOf[T]) + case None => + ats.add(bt) + } + } + Option(ats) case None => b.get(namespace) } - ) - accumulator.toMap + } + a } } @@ -75,7 +116,7 @@ object ProgramSummary { * @tparam T * the type/class meta data class. */ -trait TypedScope[M <: MethodLike, F <: FieldLike, T <: TypeLike[M, F]](summary: ProgramSummary[T]) { +trait TypedScope[M <: MethodLike, F <: FieldLike, T <: TypeLike[M, F]](summary: ProgramSummary[T, M, F]) { this: Scope[?, ?, TypedScopeElement] => /** Tracks the types that are visible to this scope. @@ -136,20 +177,6 @@ trait TypedScope[M <: MethodLike, F <: FieldLike, T <: TypeLike[M, F]](summary: } } - /** Determines if, by observing the given argument types, that the method's signature is a plausible match to the - * observed arguments. - * - * The default implementation only considers that the same number of arguments are added and does not account for - * variadic arguments nor polymorphism. - * - * @param method - * the method meta data. - * @param argTypes - * the observed arguments from the call-site. - * @return - * true if the method could be overloaded by a call with these argument types. - */ - /** Given the type full name and field name, will attempt to find the matching entry. * @param typeFullName * the base type full name. If none, will refer to loosely imported member or functions. @@ -271,7 +298,7 @@ trait OverloadableScope[M <: OverloadableMethod] { * @param summary * the program summary. */ -class DefaultTypedScope[M <: MethodLike, F <: FieldLike, T <: TypeLike[M, F]](summary: ProgramSummary[T]) +class DefaultTypedScope[M <: MethodLike, F <: FieldLike, T <: TypeLike[M, F]](summary: ProgramSummary[T, M, F]) extends Scope[String, DeclarationNew, TypedScopeElement] with TypedScope[M, F, T](summary) { diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeHintCallLinker.scala similarity index 74% rename from joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeHintCallLinker.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeHintCallLinker.scala index 81c1d37c9986..38639c165a80 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeHintCallLinker.scala @@ -1,12 +1,10 @@ -package io.joern.javasrc2cpg.passes +package io.joern.x2cpg.frontendspecific.javasrc2cpg import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ - -import java.util.regex.Pattern +import io.shiftleft.semanticcpg.language.* class JavaTypeHintCallLinker(cpg: Cpg) extends XTypeHintCallLinker(cpg) { diff --git a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeRecoveryPassGenerator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeRecoveryPassGenerator.scala similarity index 87% rename from joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeRecoveryPassGenerator.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeRecoveryPassGenerator.scala index de72cac64304..936595fc045b 100644 --- a/joern-cli/frontends/javasrc2cpg/src/main/scala/io/joern/javasrc2cpg/passes/JavaTypeRecoveryPassGenerator.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/JavaTypeRecoveryPassGenerator.scala @@ -1,12 +1,11 @@ -package io.joern.javasrc2cpg.passes +package io.joern.x2cpg.frontendspecific.javasrc2cpg import io.joern.x2cpg.Defines -import io.joern.x2cpg.passes.frontend._ -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.PropertyNames -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.joern.x2cpg.passes.frontend.* +import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class JavaTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) extends XTypeRecoveryPassGenerator[Method](cpg, config) { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/package.scala new file mode 100644 index 000000000000..56d0cfe158db --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/javasrc2cpg/package.scala @@ -0,0 +1,18 @@ +package io.joern.x2cpg.frontendspecific + +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.CpgPassBase + +package object javasrc2cpg { + + object ParameterNames { + val EnableTypeRecovery = "enable-type-recovery" + } + + def typeRecoveryPasses(cpg: Cpg, xtypeRecoveryConfig: XTypeRecoveryConfig): List[CpgPassBase] = { + new JavaTypeRecoveryPassGenerator(cpg, xtypeRecoveryConfig).generate() :+ + new JavaTypeHintCallLinker(cpg) + } + +} diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConstClosurePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ConstClosurePass.scala similarity index 96% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConstClosurePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ConstClosurePass.scala index ca9b5b6d5033..f9b4b0f339c9 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/ConstClosurePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ConstClosurePass.scala @@ -1,10 +1,10 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Method, MethodRef} import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* /** A pass that identifies assignments of closures to constants and updates `METHOD` nodes accordingly. */ diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/Defines.scala similarity index 86% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/Defines.scala index d7fdc61164db..6445c205d144 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/Defines.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/Defines.scala @@ -1,4 +1,4 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal @@ -19,7 +19,9 @@ object Defines { val Never: String = Any val Undefined: String = Any val NodeModulesFolder: String = "node_modules" + val Program: String = ":program" val GlobalNamespace: String = NamespaceTraversal.globalNamespaceName + val OperatorsNew: String = ".new" // TODO: place ".new" into the schema val JsTypes: List[String] = List( diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/GlobalBuiltins.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/GlobalBuiltins.scala similarity index 99% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/GlobalBuiltins.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/GlobalBuiltins.scala index 1fe6bafa4089..ca1d6596a6bb 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/GlobalBuiltins.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/GlobalBuiltins.scala @@ -1,4 +1,4 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg object GlobalBuiltins { diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptImportResolverPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptImportResolverPass.scala similarity index 96% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptImportResolverPass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptImportResolverPass.scala index 59ed5d0e9e49..c9d577869b0f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptImportResolverPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptImportResolverPass.scala @@ -1,8 +1,8 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg import io.joern.x2cpg.Defines as XDefines import io.joern.x2cpg.passes.frontend.XImportResolverPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, Identifier, Method, MethodRef} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.* @@ -49,7 +49,7 @@ class JavaScriptImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) { cpg .file(s"${Pattern.quote(resolvedPath)}\\.?.*") .method - .nameExact(":program") + .nameExact(Defines.Program) else Iterator.empty ) match { @@ -60,7 +60,7 @@ class JavaScriptImportResolverPass(cpg: Cpg) extends XImportResolverPass(cpg) { } def targetAssignments = targetModule - .nameExact(":program") + .nameExact(Defines.Program) .flatMap(_._callViaContainsOut) .assignment diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptInheritanceNamePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptInheritanceNamePass.scala similarity index 71% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptInheritanceNamePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptInheritanceNamePass.scala index 46c5ed4a979e..8db53edda5e8 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptInheritanceNamePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptInheritanceNamePass.scala @@ -1,7 +1,7 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg import io.joern.x2cpg.passes.frontend.XInheritanceFullNamePass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg /** Using some basic heuristics, will try to resolve type full names from types found within the CPG. Requires * ImportPass as a pre-requisite. @@ -9,7 +9,7 @@ import io.shiftleft.codepropertygraph.Cpg class JavaScriptInheritanceNamePass(cpg: Cpg) extends XInheritanceFullNamePass(cpg) { override val pathSep: Char = ':' - override val moduleName: String = ":program" + override val moduleName: String = Defines.Program override val fileExt: String = ".js" } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeHintCallLinker.scala similarity index 68% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeHintCallLinker.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeHintCallLinker.scala index 2bfbfad0027b..2d3478ca4d8f 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeHintCallLinker.scala @@ -1,7 +1,7 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* @@ -10,7 +10,7 @@ class JavaScriptTypeHintCallLinker(cpg: Cpg) extends XTypeHintCallLinker(cpg) { override protected val pathSep = ":" override protected def calls: Iterator[Call] = cpg.call - .or(_.nameNot(".*", ".*"), _.name(".new")) + .or(_.nameNot(".*", ".*"), _.name(Defines.OperatorsNew)) .filter(c => calleeNames(c).nonEmpty && c.callee.isEmpty) } diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeRecovery.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeRecovery.scala similarity index 87% rename from joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeRecovery.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeRecovery.scala index ec93ca447a4c..2d9c8072f1f2 100644 --- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/passes/JavaScriptTypeRecovery.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/JavaScriptTypeRecovery.scala @@ -1,14 +1,14 @@ -package io.joern.jssrc2cpg.passes +package io.joern.x2cpg.frontendspecific.jssrc2cpg import io.joern.x2cpg.Defines as XDefines import io.joern.x2cpg.Defines.ConstructorMethodName import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Operators, Properties, PropertyNames} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.FieldAccess -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class JavaScriptTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) extends XTypeRecoveryPassGenerator[File](cpg, config) { @@ -48,9 +48,9 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui override protected def prepopulateSymbolTableEntry(x: AstNode): Unit = x match { case x @ (_: Identifier | _: Local | _: MethodParameterIn) - if x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any) != Defines.Any => - val typeFullName = x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any) - val typeHints = symbolTable.get(LocalVar(x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any))) - typeFullName + if x.propertyOption(Properties.TypeFullName).getOrElse(Defines.Any) != Defines.Any => + val typeFullName = x.propertyOption(Properties.TypeFullName).getOrElse(Defines.Any) + val typeHints = symbolTable.get(LocalVar(typeFullName)) - typeFullName lazy val cpgTypeFullName = cpg.typeDecl.nameExact(typeFullName).fullName.toSet val resolvedTypeHints = if (typeHints.nonEmpty) symbolTable.put(x, typeHints) @@ -59,9 +59,8 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui if (!resolvedTypeHints.contains(typeFullName) && resolvedTypeHints.sizeIs == 1) builder.setNodeProperty(x, PropertyNames.TYPE_FULL_NAME, resolvedTypeHints.head) - case x @ (_: Identifier | _: Local | _: MethodParameterIn) - if x.property(PropertyNames.POSSIBLE_TYPES, Seq.empty[String]).nonEmpty => - val possibleTypes = x.property(PropertyNames.POSSIBLE_TYPES, Seq.empty[String]) + case x @ (_: Identifier | _: Local | _: MethodParameterIn) if x.property(Properties.PossibleTypes).nonEmpty => + val possibleTypes = x.property(Properties.PossibleTypes) if (possibleTypes.sizeIs == 1 && !possibleTypes.contains("ANY")) { val typeFullName = possibleTypes.head val typeHints = symbolTable.get(LocalVar(typeFullName)) - typeFullName @@ -94,7 +93,7 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui } .flatMap { case (t, ts) if Set(t) == ts => Set(t) - case (_, ts) => ts.map(_.replaceAll("\\.(?!js::program)", pathSep)) + case (_, ts) => ts.map(_.replaceAll(s"\\.(?!js:${Defines.Program})", pathSep)) } p match { case _: MethodParameterIn => symbolTable.put(p, resolvedHints) @@ -109,7 +108,7 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui } private lazy val exportedIdentifiers = cu.method - .nameExact(":program") + .nameExact(Defines.Program) .flatMap(_._callViaContainsOut) .nameExact(Operators.assignment) .filter(_.code.startsWith("exports.*")) @@ -123,11 +122,16 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui override protected def visitIdentifierAssignedToConstructor(i: Identifier, c: Call): Set[String] = { val constructorPaths = if (c.methodFullName.endsWith(".alloc")) { - def newChildren = c.inAssignment.astSiblings.isCall.nameExact(".new").astChildren + val newOp = c.inAssignment.astSiblings.isCall.nameExact(Defines.OperatorsNew).headOption + val newChildren = newOp.astChildren.l + val possibleImportIdentifier = newChildren.isIdentifier.headOption match { case Some(id) if GlobalBuiltins.builtins.contains(id.name) => Set(s"__ecma.${id.name}") - case Some(id) => symbolTable.get(id) - case None => Set.empty[String] + case Some(id) => + val typs = symbolTable.get(CallAlias(id.name, Option("this"))) + if typs.nonEmpty then newOp.foreach(symbolTable.put(_, typs)) + symbolTable.get(id) + case None => Set.empty[String] } lazy val possibleConstructorPointer = newChildren.astChildren.isFieldIdentifier @@ -146,7 +150,7 @@ private class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBui override protected def visitIdentifierAssignedToOperator(i: Identifier, c: Call, operation: String): Set[String] = { operation match { - case ".new" => + case Defines.OperatorsNew => c.astChildren.l match { case ::(fa: Call, ::(id: Identifier, _)) if fa.name == Operators.fieldAccess => symbolTable.append( diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ObjectPropertyCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ObjectPropertyCallLinker.scala new file mode 100644 index 000000000000..4b77b193ed03 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/ObjectPropertyCallLinker.scala @@ -0,0 +1,45 @@ +package io.joern.x2cpg.frontendspecific.jssrc2cpg + +import io.shiftleft.codepropertygraph.generated.nodes.{Call, MethodRef} +import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} +import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* + +/** Perform a simple analysis to find a common pattern in JavaScript where objects are dynamically assigned function + * pointers. To keep this precise, this will only match objects defined within the scope of the same file. + * + * This relies on JavaScriptTypeHintCallLinker. + */ +class ObjectPropertyCallLinker(cpg: Cpg) extends CpgPass(cpg) { + + override def run(builder: DiffGraphBuilder): Unit = { + + def propertyCallRegexPattern(withMatchingGroup: Boolean): String = + "^(?:\\{.*\\}|.*):\\(" + (if withMatchingGroup then "(.*)" else ".*") + "\\):.*$" + + val propertyCallRegex = propertyCallRegexPattern(true).r + val objectCalls = cpg.call.methodFullName(propertyCallRegexPattern(false)).l + val propertyAccessToCalls = objectCalls + .flatMap { call => + call.methodFullName match { + case propertyCallRegex(baseProperty) => Option(s"$baseProperty.${call.name}" -> call) + case _ => None + } + } + .groupBy(_._1) + .map { case (k, vs) => k -> vs.map(_._2) } + cpg.assignment + .and(_.source.isMethodRef, _.target.isCall.fieldAccess) + .map { a => a.target.asInstanceOf[Call] -> a.source.asInstanceOf[MethodRef].referencedMethod.fullName } + .foreach { (functionTarget, calleeFn) => + propertyAccessToCalls + .filter { case (propertyAccess, _) => functionTarget.code.endsWith(propertyAccess) } + .foreach { case (_, calls) => + calls.where(_.file.nameExact(functionTarget.file.name.toSeq*)).foreach { c => + builder.setNodeProperty(c, PropertyNames.METHOD_FULL_NAME, calleeFn) + } + } + } + } + +} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/package.scala new file mode 100644 index 000000000000..69351ea5773c --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/jssrc2cpg/package.scala @@ -0,0 +1,16 @@ +package io.joern.x2cpg.frontendspecific + +import io.joern.x2cpg.passes.callgraph.NaiveCallLinker +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.CpgPassBase + +package object jssrc2cpg { + + def postProcessingPasses(cpg: Cpg, typeRecoveryConfig: XTypeRecoveryConfig): List[CpgPassBase] = { + List(new JavaScriptInheritanceNamePass(cpg), new ConstClosurePass(cpg), new JavaScriptImportResolverPass(cpg)) + ++ + new JavaScriptTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() ++ + List(new JavaScriptTypeHintCallLinker(cpg), ObjectPropertyCallLinker(cpg), new NaiveCallLinker(cpg)) + } +} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/package.scala new file mode 100644 index 000000000000..7434394eb0b4 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/package.scala @@ -0,0 +1,13 @@ +package io.joern.x2cpg + +/** This package solely exists to extract some code from the frontends that is shared between joern and the frontends, + * e.g. for parsing commandline arguments and running postprocessing passes. + * + * If this code was to be in the frontend's subproject, joern would need to have classpath-dependencies on the + * frontends, inheriting all their transitive dependencies. As discussed in e.g. + * https://github.com/joernio/joern/issues/4625#issuecomment-2166427270 we want to avoid having classpath dependencies + * on the frontends and instead invoke them frontends as external processes (i.e. execute their start script). + * Otherwise we'll end in jar hell with various incompatible versions of many different dependencies, and complex + * issues with things like OSGI and JPMS. + */ +package object frontendspecific diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ComposerAutoloadPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/ComposerAutoloadPass.scala similarity index 98% rename from joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ComposerAutoloadPass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/ComposerAutoloadPass.scala index 5bd1972fb6e2..aa57e561c2fe 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/ComposerAutoloadPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/ComposerAutoloadPass.scala @@ -1,4 +1,4 @@ -package io.joern.php2cpg.passes +package io.joern.x2cpg.frontendspecific.php2cpg import io.joern.x2cpg.{Defines, X2Cpg} import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeHintCallLinker.scala similarity index 83% rename from joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeHintCallLinker.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeHintCallLinker.scala index 16ede6d5331c..fc4a9c850adc 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeHintCallLinker.scala @@ -1,13 +1,11 @@ -package io.joern.php2cpg.passes +package io.joern.x2cpg.frontendspecific.php2cpg import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* import io.shiftleft.codepropertygraph.generated.nodes.Call -import java.util.regex.Pattern - class PhpTypeHintCallLinker(cpg: Cpg) extends XTypeHintCallLinker(cpg) { override protected val pathSep = "->" diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeRecovery.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeRecovery.scala similarity index 85% rename from joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeRecovery.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeRecovery.scala index 36eee23b683a..6399506585c6 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeRecovery.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeRecovery.scala @@ -1,15 +1,14 @@ -package io.joern.php2cpg.passes +package io.joern.x2cpg.frontendspecific.php2cpg import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.frontend.* import io.joern.x2cpg.passes.frontend.XTypeRecovery.AllNodeTypesFromNodeExt -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Cpg, DispatchTypes, Operators, PropertyNames} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.{Assignment, FieldAccess} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import scala.collection.mutable @@ -151,7 +150,7 @@ private class RecoverForPhpFile(cpg: Cpg, cu: NamespaceBlock, builder: DiffGraph symbolTable.append(head, callees) case _ => Set.empty } - val returnTypes = extractTypes(ret.argumentOut.l) + val returnTypes = extractTypes(ret.argumentOut.cast[CfgNode].l) existingTypes.addAll(returnTypes) /* Check whether method return is already known, and if so, remove dummy value */ @@ -222,7 +221,7 @@ private class RecoverForPhpFile(cpg: Cpg, cu: NamespaceBlock, builder: DiffGraph .getOrElse(XTypeRecovery.DummyIndexAccess) else x.name - val collectionVar = Option(c.argumentOut.l match { + val collectionVar = Option(c.argumentOut.cast[CfgNode].l match { case List(i: Identifier, idx: Literal) => CollectionVar(i.name, idx.code) case List(i: Identifier, idx: Identifier) => CollectionVar(i.name, idx.code) case List(c: Call, idx: Call) => CollectionVar(callName(c), callName(idx)) @@ -285,34 +284,45 @@ private class RecoverForPhpFile(cpg: Cpg, cu: NamespaceBlock, builder: DiffGraph * TODO: Are there methods / instances where this doesn't work? Static methods? * TODO: What if the first parameter could take multiple types? */ - private def visitUnresolvedDynamicCall(c: Call): Unit = { + private def visitUnresolvedDynamicCall(c: Call): Option[String] = { + + def setNodeFullName(tgt: CfgNode, newFullName: String): Option[String] = { + if (tgt.isCall) builder.setNodeProperty(tgt, PropertyNames.METHOD_FULL_NAME, newFullName) + builder.setNodeProperty( + tgt, + PropertyNames.TYPE_FULL_NAME, + s"$newFullName$pathSep${XTypeRecovery.DummyReturnType}" + ) + builder.setNodeProperty(tgt, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq.empty) + Option(newFullName) + } - def setFromKnownTypes(i: CfgNode): Unit = { + def setFromKnownTypes(i: CfgNode, tgt: CfgNode): Option[String] = { i.getKnownTypes.l match { - case t :: Nil => - val newFullName = t + "->" + c.name - builder.setNodeProperty(c, PropertyNames.METHOD_FULL_NAME, newFullName) - builder.setNodeProperty( - c, - PropertyNames.TYPE_FULL_NAME, - s"$newFullName$pathSep${XTypeRecovery.DummyReturnType}" - ) - builder.setNodeProperty(c, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq.empty) - case _ => - /* TODO: case where multiple possible types are identified */ - + case Nil => None + case t :: Nil => setNodeFullName(tgt, s"$t->${c.name}") + case x => None /* TODO: case where multiple possible types are identified */ } } - if (c.argument.exists(_.argumentIndex == 0)) { - c.argument(0) match { - case rc: Call - if rc.methodFullName.startsWith(" - // ignore calls with callees that are unknown - case p: Identifier => setFromKnownTypes(p) - case rc: Call => setFromKnownTypes(rc) - case _ => - } + c.argumentOption(0).flatMap { + case rc: Call if rc.methodFullName.startsWith(" None // ignore operators + case rc: Call if rc.methodFullName.startsWith(Defines.UnresolvedNamespace) => + // Helps deal with with long call chains by attempting to perform an immediate resolve + visitUnresolvedDynamicCall(rc).flatMap { rcFullName => + val newFullName = s"$rcFullName->${c.name}" + setNodeFullName(c, newFullName) + } + case p: Identifier if p.name == "this" => + p.start.method.typeDecl + .flatMap(x => x +: x.baseTypeDeclTransitive.toSeq) + .where(_.method.nameExact(c.name)) + .fullName + .headOption + .flatMap(tfn => setNodeFullName(c, s"$tfn->${c.name}")) + case p: Identifier => setFromKnownTypes(p, c) + case rc: Call => setFromKnownTypes(rc, c) + case _ => None } } } diff --git a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeStubsParser.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeStubsParser.scala similarity index 80% rename from joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeStubsParser.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeStubsParser.scala index df6a72cf5d07..c7d43c33f4e9 100644 --- a/joern-cli/frontends/php2cpg/src/main/scala/io/joern/php2cpg/passes/PhpTypeStubsParser.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/PhpTypeStubsParser.scala @@ -1,22 +1,19 @@ -package io.joern.php2cpg.passes +package io.joern.x2cpg.frontendspecific.php2cpg import better.files.File import io.joern.x2cpg.X2CpgConfig -import io.joern.x2cpg.passes.frontend.{XTypeStubsParserConfig, TypeStubsParserConfig} -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.passes.frontend.{TypeStubsParserConfig, XTypeStubsParserConfig} +import io.shiftleft.codepropertygraph.generated.{Cpg, Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.passes.ForkJoinParallelCpgPass -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.codepropertygraph.generated.PropertyNames -import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate import scopt.OParser -import scala.io.Source -import java.io.{File => JFile} +import java.io.File as JFile import java.nio.file.Paths +import scala.io.Source // Corresponds to a parsed row in the known functions file case class KnownFunction( @@ -41,7 +38,7 @@ class PhpTypeStubsParserPass(cpg: Cpg, config: XTypeStubsParserConfig = XTypeStu val typeStubsFile = config.typeStubsFilePath val source = typeStubsFile match { case Some(file) => Source.fromFile(file) - case _ => Source.fromResource("known_function_signatures.txt") + case _ => Source.fromResource("php_known_function_signatures.txt") } val contents = source.getLines().filterNot(_.startsWith("//")) val arr = contents.flatMap(line => createKnownFunctionFromLine(line)).toArray @@ -49,7 +46,7 @@ class PhpTypeStubsParserPass(cpg: Cpg, config: XTypeStubsParserConfig = XTypeStu arr } - override def runOnPart(builder: overflowdb.BatchedUpdate.DiffGraphBuilder, part: KnownFunction): Unit = { + override def runOnPart(builder: DiffGraphBuilder, part: KnownFunction): Unit = { /* calculate the result of this part - this is done as a concurrent task */ val builtinMethod = cpg.method.fullNameExact(part.name).l builtinMethod.foreach(mNode => { @@ -75,7 +72,7 @@ class PhpTypeStubsParserPass(cpg: Cpg, config: XTypeStubsParserConfig = XTypeStu def scanParamTypes(pTypesRawArr: List[String]): Seq[Seq[String]] = pTypesRawArr.map(paramTypeRaw => paramTypeRaw.split(",").map(_.strip).toSeq).toSeq - protected def setTypes(builder: overflowdb.BatchedUpdate.DiffGraphBuilder, n: StoredNode, types: Seq[String]): Unit = + protected def setTypes(builder: DiffGraphBuilder, n: StoredNode, types: Seq[String]): Unit = if (types.size == 1) builder.setNodeProperty(n, PropertyNames.TYPE_FULL_NAME, types.head) else builder.setNodeProperty(n, PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, types) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/package.scala new file mode 100644 index 000000000000..f00fdfab6800 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/php2cpg/package.scala @@ -0,0 +1,19 @@ +package io.joern.x2cpg.frontendspecific + +import io.joern.x2cpg.passes.frontend.{XTypeRecoveryConfig, XTypeStubsParserConfig} +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.CpgPassBase + +package object php2cpg { + + def postProcessingPasses( + cpg: Cpg, + typeRecoveryConfig: XTypeRecoveryConfig = XTypeRecoveryConfig(iterations = 3), + setKnownTypesConfig: XTypeStubsParserConfig = XTypeStubsParserConfig() + ): List[CpgPassBase] = { + List( + new ComposerAutoloadPass(cpg), + new PhpTypeStubsParserPass(cpg, setKnownTypesConfig) + ) ++ new PhpTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() :+ PhpTypeHintCallLinker(cpg) + } +} diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Constants.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/Constants.scala similarity index 88% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Constants.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/Constants.scala index ed1bb0c359a9..328bb2612c18 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/Constants.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/Constants.scala @@ -1,4 +1,4 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg object Constants { val builtinPrefix = "__builtin." diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DynamicTypeHintFullNamePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/DynamicTypeHintFullNamePass.scala similarity index 94% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DynamicTypeHintFullNamePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/DynamicTypeHintFullNamePass.scala index ac5988b32b30..2e70aea7e38f 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/DynamicTypeHintFullNamePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/DynamicTypeHintFullNamePass.scala @@ -1,12 +1,10 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg import io.joern.x2cpg.passes.frontend.ImportStringHandling -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} import io.shiftleft.codepropertygraph.generated.nodes.{CfgNode, MethodParameterIn, MethodReturn, StoredNode} import io.shiftleft.passes.ForkJoinParallelCpgPass -import io.shiftleft.semanticcpg.language._ -import overflowdb.BatchedUpdate +import io.shiftleft.semanticcpg.language.* import java.io.File import java.util.regex.{Matcher, Pattern} @@ -75,7 +73,7 @@ class DynamicTypeHintFullNamePass(cpg: Cpg) extends ForkJoinParallelCpgPass[CfgN fullName.replaceFirst("\\.py:", "").replaceAll(Pattern.quote(File.separator), ".") private def setTypeHints( - diffGraph: BatchedUpdate.DiffGraphBuilder, + diffGraph: DiffGraphBuilder, node: StoredNode, typeHint: String, alias: String, diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ImportsPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/ImportsPass.scala similarity index 77% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ImportsPass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/ImportsPass.scala index 46b5e3c5f2ce..6ba132c98037 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/ImportsPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/ImportsPass.scala @@ -1,9 +1,9 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg import io.joern.x2cpg.passes.frontend.XImportsPass -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment class ImportsPass(cpg: Cpg) extends XImportsPass(cpg) { diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonImportResolverPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonImportResolverPass.scala similarity index 98% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonImportResolverPass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonImportResolverPass.scala index 4fca5ecc964f..61a0f3b08b36 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonImportResolverPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonImportResolverPass.scala @@ -1,8 +1,8 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg import better.files.File import io.joern.x2cpg.passes.frontend.XImportResolverPass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.* diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonInheritanceNamePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonInheritanceNamePass.scala similarity index 79% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonInheritanceNamePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonInheritanceNamePass.scala index 31157a8994f0..aab1e5d803d0 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonInheritanceNamePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonInheritanceNamePass.scala @@ -1,7 +1,7 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg import io.joern.x2cpg.passes.frontend.XInheritanceFullNamePass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg /** Using some basic heuristics, will try to resolve type full names from types found within the CPG. Requires * ImportPass as a pre-requisite. diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeHintCallLinker.scala similarity index 91% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeHintCallLinker.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeHintCallLinker.scala index 64ee7aded85f..cfaa52cc2d9d 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeHintCallLinker.scala @@ -1,8 +1,8 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker import io.joern.x2cpg.passes.frontend.XTypeRecovery.isDummyType -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeRecovery.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecovery.scala similarity index 90% rename from joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeRecovery.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecovery.scala index f9e595d08f63..ccdbf86c4aec 100644 --- a/joern-cli/frontends/pysrc2cpg/src/main/scala/io/joern/pysrc2cpg/PythonTypeRecovery.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecovery.scala @@ -1,21 +1,19 @@ -package io.joern.pysrc2cpg +package io.joern.x2cpg.frontendspecific.pysrc2cpg +import io.joern.x2cpg.passes.frontend.{RecoverForXCompilationUnit, XTypeRecovery, XTypeRecoveryState} +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.File +import io.shiftleft.semanticcpg.language.* +import io.joern.x2cpg.frontendspecific.pysrc2cpg.Constants import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{Operators, PropertyNames} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.FieldAccess -import overflowdb.BatchedUpdate.DiffGraphBuilder - -class PythonTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) - extends XTypeRecoveryPassGenerator[File](cpg, config) { - - override protected def generateRecoveryPass(state: XTypeRecoveryState, iteration: Int): XTypeRecovery[File] = - new PythonTypeRecovery(cpg, state, iteration) -} +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder private class PythonTypeRecovery(cpg: Cpg, state: XTypeRecoveryState, iteration: Int) extends XTypeRecovery[File](cpg, state, iteration) { @@ -105,7 +103,10 @@ private class RecoverForPythonFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder case ".dictLiteral" => associateTypes(i, Set(s"${Constants.builtinPrefix}dict")) case ".setLiteral" => associateTypes(i, Set(s"${Constants.builtinPrefix}set")) case Operators.conditional => associateTypes(i, Set(s"${Constants.builtinPrefix}bool")) - case _ => super.visitIdentifierAssignedToOperator(i, c, operation) + case Operators.indexAccess => + c.argument.argumentIndex(1).isCall.foreach(setCallMethodFullNameFromBase) + visitIdentifierAssignedToIndexAccess(i, c) + case _ => super.visitIdentifierAssignedToOperator(i, c, operation) } } @@ -227,4 +228,11 @@ private class RecoverForPythonFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder super.handlePotentialFunctionPointer(funcPtr, baseTypes, funcName, baseName) } + override protected def getIndexAccessTypes(ia: Call): Set[String] = { + ia.argument.argumentIndex(1).isCall.headOption match { + case Some(c) => getTypesFromCall(c).map(x => s"$x$pathSep${XTypeRecovery.DummyIndexAccess}") + case _ => super.getIndexAccessTypes(ia) + } + } + } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecoveryPassGenerator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecoveryPassGenerator.scala new file mode 100644 index 000000000000..47fafe84ee6f --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/PythonTypeRecoveryPassGenerator.scala @@ -0,0 +1,17 @@ +package io.joern.x2cpg.frontendspecific.pysrc2cpg + +import io.joern.x2cpg.passes.frontend.{ + XTypeRecovery, + XTypeRecoveryConfig, + XTypeRecoveryPassGenerator, + XTypeRecoveryState +} +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.File + +class PythonTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) + extends XTypeRecoveryPassGenerator[File](cpg, config) { + + override protected def generateRecoveryPass(state: XTypeRecoveryState, iteration: Int): XTypeRecovery[File] = + new PythonTypeRecovery(cpg, state, iteration) +} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/package.scala new file mode 100644 index 000000000000..78dbc6158a00 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/pysrc2cpg/package.scala @@ -0,0 +1,27 @@ +package io.joern.x2cpg.frontendspecific + +import io.joern.x2cpg.passes.base.AstLinkerPass +import io.joern.x2cpg.passes.callgraph.NaiveCallLinker +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.CpgPassBase + +package object pysrc2cpg { + + def postProcessingPasses(cpg: Cpg, typeRecoveryConfig: XTypeRecoveryConfig): List[CpgPassBase] = { + List( + new ImportsPass(cpg), + new PythonImportResolverPass(cpg), + new DynamicTypeHintFullNamePass(cpg), + new PythonInheritanceNamePass(cpg) + ) + ++ new PythonTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() + ++ List ( + new PythonTypeHintCallLinker(cpg), + new NaiveCallLinker(cpg), + // Some of passes above create new methods, so, we + // need to run the ASTLinkerPass one more time + new AstLinkerPass(cpg) + ) + } +} diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ConstClosurePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/ConstClosurePass.scala similarity index 94% rename from joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ConstClosurePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/ConstClosurePass.scala index f9b9c3e64fdb..9a1c68850785 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/ConstClosurePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/ConstClosurePass.scala @@ -1,10 +1,9 @@ -package io.joern.swiftsrc2cpg.passes +package io.joern.x2cpg.frontendspecific.swiftsrc2cpg -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Method, MethodRef} import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* /** A pass that identifies assignments of closures to constants and updates `METHOD` nodes accordingly. */ diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/Defines.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/Defines.scala similarity index 98% rename from joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/Defines.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/Defines.scala index eae51ed6ed2a..b2bfc9d9f98c 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/Defines.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/Defines.scala @@ -1,4 +1,4 @@ -package io.joern.swiftsrc2cpg.passes +package io.joern.x2cpg.frontendspecific.swiftsrc2cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftInheritanceNamePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftInheritanceNamePass.scala similarity index 83% rename from joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftInheritanceNamePass.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftInheritanceNamePass.scala index b8fee1255f89..265e33b0d4fa 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftInheritanceNamePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftInheritanceNamePass.scala @@ -1,7 +1,7 @@ -package io.joern.swiftsrc2cpg.passes +package io.joern.x2cpg.frontendspecific.swiftsrc2cpg import io.joern.x2cpg.passes.frontend.XInheritanceFullNamePass -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal /** Using some basic heuristics, will try to resolve type full names from types found within the CPG. Requires diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeHintCallLinker.scala similarity index 82% rename from joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeHintCallLinker.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeHintCallLinker.scala index 49baa37ab131..e2f724368eec 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeHintCallLinker.scala @@ -1,7 +1,7 @@ -package io.joern.swiftsrc2cpg.passes +package io.joern.x2cpg.frontendspecific.swiftsrc2cpg import io.joern.x2cpg.passes.frontend.XTypeHintCallLinker -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeRecovery.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeRecovery.scala similarity index 94% rename from joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeRecovery.scala rename to joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeRecovery.scala index 96b6e34c3195..50f1f2bc8fcc 100644 --- a/joern-cli/frontends/swiftsrc2cpg/src/main/scala/io/joern/swiftsrc2cpg/passes/SwiftTypeRecovery.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/SwiftTypeRecovery.scala @@ -1,14 +1,14 @@ -package io.joern.swiftsrc2cpg.passes +package io.joern.x2cpg.frontendspecific.swiftsrc2cpg import io.joern.x2cpg.Defines as XDefines import io.joern.x2cpg.Defines.ConstructorMethodName import io.joern.x2cpg.passes.frontend.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{Operators, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Operators, Properties, PropertyNames} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.FieldAccess -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class SwiftTypeRecoveryPassGenerator(cpg: Cpg, config: XTypeRecoveryConfig = XTypeRecoveryConfig()) extends XTypeRecoveryPassGenerator[File](cpg, config) { @@ -47,9 +47,9 @@ private class RecoverForSwiftFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder, override protected def prepopulateSymbolTableEntry(x: AstNode): Unit = x match { case x @ (_: Identifier | _: Local | _: MethodParameterIn) - if x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any) != Defines.Any => - val typeFullName = x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any) - val typeHints = symbolTable.get(LocalVar(x.property(PropertyNames.TYPE_FULL_NAME, Defines.Any))) - typeFullName + if x.propertyOption(Properties.TypeFullName).getOrElse(Defines.Any) != Defines.Any => + val typeFullName = x.propertyOption(Properties.TypeFullName).getOrElse(Defines.Any) + val typeHints = symbolTable.get(LocalVar(typeFullName)) - typeFullName lazy val cpgTypeFullName = cpg.typeDecl.nameExact(typeFullName).fullName.toSet val resolvedTypeHints = if (typeHints.nonEmpty) symbolTable.put(x, typeHints) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/package.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/package.scala new file mode 100644 index 000000000000..ea01519038a3 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/frontendspecific/swiftsrc2cpg/package.scala @@ -0,0 +1,17 @@ +package io.joern.x2cpg.frontendspecific + +import io.joern.x2cpg.passes.callgraph.NaiveCallLinker +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.passes.CpgPassBase + +package object swiftsrc2cpg { + + def postProcessingPasses(cpg: Cpg, typeRecoveryConfig: XTypeRecoveryConfig): List[CpgPassBase] = { + List(new SwiftInheritanceNamePass(cpg), new ConstClosurePass(cpg)) ++ + new SwiftTypeRecoveryPassGenerator(cpg, typeRecoveryConfig).generate() ++ List( + new SwiftTypeHintCallLinker(cpg), + new NaiveCallLinker(cpg) + ) + } +} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/Base.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/Base.scala index 189e6c287095..f53e6f2b348e 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/Base.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/Base.scala @@ -1,10 +1,10 @@ package io.joern.x2cpg.layers -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} -import io.joern.x2cpg.passes.base._ +import io.joern.x2cpg.passes.base.* object Base { val overlayName: String = "base" @@ -32,7 +32,6 @@ class Base extends LayerCreator { override def create(context: LayerCreatorContext): Unit = { val cpg = context.cpg - cpg.graph.indexManager.createNodePropertyIndex(PropertyNames.FULL_NAME) Base.passes(cpg).zipWithIndex.foreach { case (pass, index) => runPass(pass, context, index) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/CallGraph.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/CallGraph.scala index 90f228f153a7..45ec40470400 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/CallGraph.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/CallGraph.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.layers -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} import io.joern.x2cpg.passes.callgraph.{DynamicCallLinker, MethodRefLinker, StaticCallLinker} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/ControlFlow.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/ControlFlow.scala index 8d0a0cd5ab7f..eb992e1f3b85 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/ControlFlow.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/ControlFlow.scala @@ -1,9 +1,9 @@ package io.joern.x2cpg.layers -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.passes.CpgPassBase -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} import io.joern.x2cpg.passes.controlflow.CfgCreationPass import io.joern.x2cpg.passes.controlflow.cfgdominator.CfgDominatorPass diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpAst.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpAst.scala index cbbe9ceaf31d..cf06abf67ed7 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpAst.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpAst.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.layers import better.files.File -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class AstDumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCdg.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCdg.scala index 2528d7107758..6e92efc27ac8 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCdg.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCdg.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.layers import better.files.File -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class CdgDumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCfg.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCfg.scala index 1f78125b4177..0b3000c31fc8 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCfg.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/DumpCfg.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.layers import better.files.File -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} case class CfgDumpOptions(var outDir: String) extends LayerCreatorOptions {} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/TypeRelations.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/TypeRelations.scala index a8e697a58d81..82fc0d70dadd 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/TypeRelations.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/layers/TypeRelations.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.layers import io.joern.x2cpg.passes.typerelations.{AliasLinkerPass, FieldAccessLinkerPass, TypeHierarchyPass} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.layers.{LayerCreator, LayerCreatorContext, LayerCreatorOptions} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/AstLinkerPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/AstLinkerPass.scala index 90f1947006f4..434541394356 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/AstLinkerPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/AstLinkerPass.scala @@ -1,9 +1,8 @@ package io.joern.x2cpg.passes.base import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.StoredNode -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, Properties} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} @@ -68,7 +67,7 @@ class AstLinkerPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { } catch { case ex: Exception => logger.warn( - s"Error in AstLinkerPass for node in file '${astChild.propertyOption(Properties.FILENAME).toString}''", + s"Error in AstLinkerPass for node in file '${astChild.propertyOption(PropertyNames.FILENAME).toString}''", ex ) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/ContainsEdgePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/ContainsEdgePass.scala index eb84a3896afd..5f141b64d926 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/ContainsEdgePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/ContainsEdgePass.scala @@ -1,9 +1,10 @@ package io.joern.x2cpg.passes.base -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.{Cpg, PropertyNames} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, Properties} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} import scala.collection.mutable @@ -12,12 +13,12 @@ import scala.jdk.CollectionConverters.* /** This pass has MethodStubCreator and TypeDeclStubCreator as prerequisite for language frontends which do not provide * method stubs and type decl stubs. */ -class ContainsEdgePass(cpg: Cpg) extends ConcurrentWriterCpgPass[AstNode](cpg) { - import ContainsEdgePass.* +class ContainsEdgePass(cpg: Cpg) extends ForkJoinParallelCpgPass[AstNode](cpg) { + import ContainsEdgePass._ private val logger: Logger = LoggerFactory.getLogger(this.getClass) override def generateParts(): Array[AstNode] = - cpg.graph.nodes(sourceTypes*).asScala.map(_.asInstanceOf[AstNode]).toArray + cpg.graph.nodes(sourceTypes*).cast[AstNode].toArray override def runOnPart(dstGraph: DiffGraphBuilder, source: AstNode): Unit = { try { @@ -33,7 +34,7 @@ class ContainsEdgePass(cpg: Cpg) extends ConcurrentWriterCpgPass[AstNode](cpg) { } catch { case ex: Exception => logger.warn( - s"Error in ContainsEdgePass for node in file '${source.propertyOption(Properties.FILENAME).toString}''", + s"Error in ContainsEdgePass for node in file '${source.propertyOption(PropertyNames.FILENAME).toString}''", ex ) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/FileCreationPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/FileCreationPass.scala index a6e0c33551ef..3ce76fe9431d 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/FileCreationPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/FileCreationPass.scala @@ -1,9 +1,8 @@ package io.joern.x2cpg.passes.base import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes.{NewFile, StoredNode} -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.{File, NewFile, StoredNode} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes, PropertyNames} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.types.structure.FileTraversal @@ -27,7 +26,7 @@ class FileCreationPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { } def createFileIfDoesNotExist(srcNode: StoredNode, destFullName: String): Unit = { - if (destFullName != srcNode.propertyDefaultValue(PropertyNames.FILENAME)) { + if (destFullName != File.PropertyDefaults.Name) { val dstFullName = if (destFullName == "") { FileTraversal.UNKNOWN } else { destFullName } val newFile = newFileNameToNode.getOrElseUpdate( @@ -40,11 +39,12 @@ class FileCreationPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { dstGraph.addEdge(srcNode, newFile, EdgeTypes.SOURCE_FILE) } } + try { // Create SOURCE_FILE edges from nodes of various types to FILE linkToSingle( cpg, - srcNodes = cpg.graph.nodes(srcLabels*).toList, + srcNodes = cpg.graph.nodes(srcLabels*).cast[StoredNode].toList, srcLabels = srcLabels, dstNodeLabel = NodeTypes.FILE, edgeType = EdgeTypes.SOURCE_FILE, @@ -52,6 +52,7 @@ class FileCreationPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { originalFileNameToNode.get(x) }, dstFullNameKey = PropertyNames.FILENAME, + dstDefaultPropertyValue = File.PropertyDefaults.Name, dstGraph, Some(createFileIfDoesNotExist) ) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodDecoratorPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodDecoratorPass.scala index faac38be1ee2..42a44efca291 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodDecoratorPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodDecoratorPass.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.passes.base -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodStubCreator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodStubCreator.scala index 35b7933eece6..d75d733528ff 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodStubCreator.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/MethodStubCreator.scala @@ -2,14 +2,13 @@ package io.joern.x2cpg.passes.base import io.joern.x2cpg.Defines import io.joern.x2cpg.passes.base.MethodStubCreator.createMethodStub -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, EvaluationStrategies, NodeTypes} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder import scala.collection.mutable import scala.util.Try @@ -26,7 +25,7 @@ class MethodStubCreator(cpg: Cpg) extends CpgPass(cpg) { private val methodFullNameToNode = mutable.LinkedHashMap[String, Method]() private val methodToParameterCount = mutable.LinkedHashMap[CallSummary, Int]() - override def run(dstGraph: BatchedUpdate.DiffGraphBuilder): Unit = { + override def run(dstGraph: DiffGraphBuilder): Unit = { try { for (method <- cpg.method) { methodFullNameToNode.put(method.fullName, method) @@ -128,7 +127,7 @@ object MethodStubCreator { val blockNode = NewBlock() .order(1) .argumentIndex(1) - .typeFullName("ANY") + .typeFullName(Defines.Any) dstGraph.addNode(blockNode) dstGraph.addEdge(methodNode, blockNode, EdgeTypes.AST) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/NamespaceCreator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/NamespaceCreator.scala index 18b028c97954..d547b217c082 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/NamespaceCreator.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/NamespaceCreator.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.passes.base -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.NewNamespace import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeDeclStubCreator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeDeclStubCreator.scala index 689cb01648c1..54bfd8da51bb 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeDeclStubCreator.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeDeclStubCreator.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.passes.base -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes import io.shiftleft.codepropertygraph.generated.nodes.{NewTypeDecl, TypeDeclBase} import io.shiftleft.passes.CpgPass diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeEvalPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeEvalPass.scala index 185fe4a9f0b6..629fdb3fefd5 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeEvalPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeEvalPass.scala @@ -1,17 +1,15 @@ package io.joern.x2cpg.passes.base import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.{Local, StoredNode} import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.Node -import overflowdb.traversal.* -class TypeEvalPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[Node]](cpg) with LinkingUtil { +class TypeEvalPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[StoredNode]](cpg) with LinkingUtil { private val logger: Logger = LoggerFactory.getLogger(this.getClass) - - val srcLabels = List( + private val srcLabels = List( NodeTypes.METHOD_PARAMETER_IN, NodeTypes.METHOD_PARAMETER_OUT, NodeTypes.METHOD_RETURN, @@ -26,11 +24,11 @@ class TypeEvalPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[Node]](cpg) wi NodeTypes.UNKNOWN ) - def generateParts(): Array[List[Node]] = { - val nodes = cpg.graph.nodes(srcLabels*).toList - nodes.grouped(getBatchSize(nodes.size)).toArray + def generateParts(): Array[List[StoredNode]] = { + cpg.graph.nodes(srcLabels*).cast[StoredNode].toList.grouped(MAX_BATCH_SIZE).toArray } - def runOnPart(builder: DiffGraphBuilder, part: List[overflowdb.Node]): Unit = { + + def runOnPart(builder: DiffGraphBuilder, part: List[StoredNode]): Unit = { try { linkToSingle( cpg = cpg, @@ -40,6 +38,7 @@ class TypeEvalPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[Node]](cpg) wi edgeType = EdgeTypes.EVAL_TYPE, dstNodeMap = typeFullNameToNode(cpg, _), dstFullNameKey = PropertyNames.TYPE_FULL_NAME, + dstDefaultPropertyValue = Local.PropertyDefaults.TypeFullName, dstGraph = builder, None ) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeRefPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeRefPass.scala index 6121a9b1e6b9..1f1be203b535 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeRefPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/base/TypeRefPass.scala @@ -1,21 +1,21 @@ package io.joern.x2cpg.passes.base import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.{Type, StoredNode} import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.Node -import overflowdb.traversal.* -class TypeRefPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[Node]](cpg) with LinkingUtil { - val srcLabels = List(NodeTypes.TYPE) +class TypeRefPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[StoredNode]](cpg) with LinkingUtil { + private val srcLabels = List(NodeTypes.TYPE) private val logger: Logger = LoggerFactory.getLogger(this.getClass) - def generateParts(): Array[List[Node]] = { - val nodes = cpg.graph.nodes(srcLabels*).toList - nodes.grouped(getBatchSize(nodes.size)).toArray + + def generateParts(): Array[List[StoredNode]] = { + cpg.graph.nodes(srcLabels*).cast[StoredNode].toList.grouped(MAX_BATCH_SIZE).toArray } - def runOnPart(builder: DiffGraphBuilder, part: List[overflowdb.Node]): Unit = { + + def runOnPart(builder: DiffGraphBuilder, part: List[StoredNode]): Unit = { try { linkToSingle( cpg = cpg, @@ -25,6 +25,7 @@ class TypeRefPass(cpg: Cpg) extends ForkJoinParallelCpgPass[List[Node]](cpg) wit edgeType = EdgeTypes.REF, dstNodeMap = typeDeclFullNameToNode(cpg, _), dstFullNameKey = PropertyNames.TYPE_DECL_FULL_NAME, + dstDefaultPropertyValue = Type.PropertyDefaults.TypeDeclFullName, dstGraph = builder, None ) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/DynamicCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/DynamicCallLinker.scala index 658307af8f13..d19c0df8abfd 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/DynamicCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/DynamicCallLinker.scala @@ -1,13 +1,12 @@ package io.joern.x2cpg.passes.callgraph import io.joern.x2cpg.Defines.DynamicCallUnknownFullName -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method, TypeDecl} +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method, StoredNode, Type, TypeDecl} import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, PropertyNames} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.{NodeDb, NodeRef} import scala.collection.mutable import scala.jdk.CollectionConverters.* @@ -23,7 +22,8 @@ import scala.jdk.CollectionConverters.* * Virtual Calls from Memory Corruption Attacks. 10.14722/ndss.2014.23287. */ class DynamicCallLinker(cpg: Cpg) extends CpgPass(cpg) { - import DynamicCallLinker.* + + import DynamicCallLinker._ // Used to track potential method candidates for a given method fullname. Since our method full names contain the type // decl we don't need to specify an addition map to wrap this in. LinkedHashSets are used here to preserve order in // the best interest of reproducibility during debugging. @@ -56,10 +56,10 @@ class DynamicCallLinker(cpg: Cpg) extends CpgPass(cpg) { initMaps() // ValidM maps class C and method name N to the set of // func ptrs implementing N for C and its subclasses - for ( - typeDecl <- cpg.typeDecl; + for { + typeDecl <- cpg.typeDecl method <- typeDecl._methodViaAstOut - ) { + } { val methodName = method.fullName val candidates = allSubclasses(typeDecl.fullName).flatMap { staticLookup(_, method) } validM.put(methodName, candidates) @@ -118,8 +118,8 @@ class DynamicCallLinker(cpg: Cpg) extends CpgPass(cpg) { if (visitedNodes.contains(cur)) return visitedNodes visitedNodes.addOne(cur) - (if (inSuperDirection) cpg.typeDecl.fullNameExact(cur.fullName).flatMap(_.inheritsFromOut.referencedTypeDecl) - else cpg.typ.fullNameExact(cur.fullName).flatMap(_.inheritsFromIn)) + (if (inSuperDirection) cpg.typeDecl.fullNameExact(cur.fullName)._typeViaInheritsFromOut.referencedTypeDecl + else cpg.typ.fullNameExact(cur.fullName).inheritsFromIn) .collectAll[TypeDecl] .to(mutable.LinkedHashSet) match { case classesToEval if classesToEval.isEmpty => visitedNodes @@ -178,16 +178,8 @@ class DynamicCallLinker(cpg: Cpg) extends CpgPass(cpg) { validM.get(call.methodFullName) match { case Some(tgts) => - val callsOut = call.callOut.fullName.toSetImmutable - val tgtMs = tgts - .flatMap(destMethod => - if (cpg.graph.indexManager.isIndexed(PropertyNames.FULL_NAME)) { - methodFullNameToNode(destMethod) - } else { - cpg.method.fullNameExact(destMethod).headOption - } - ) - .toSet + val callsOut = call._callOut.cast[Method].fullName.toSetImmutable + val tgtMs = tgts.flatMap(destMethod => methodFullNameToNode(destMethod)).toSet // Non-overridden methods linked as external stubs should be excluded if they are detected val (externalMs, internalMs) = tgtMs.partition(_.isExternal) (if (externalMs.nonEmpty && internalMs.nonEmpty) internalMs else tgtMs) @@ -213,8 +205,8 @@ class DynamicCallLinker(cpg: Cpg) extends CpgPass(cpg) { } } - private def nodesWithFullName(x: String): Iterable[NodeRef[? <: NodeDb]] = - cpg.graph.indexManager.lookup(PropertyNames.FULL_NAME, x).asScala + private def nodesWithFullName(x: String): Iterator[StoredNode] = + cpg.graph.nodesWithProperty(PropertyNames.FULL_NAME, x).cast[StoredNode] private def methodFullNameToNode(x: String): Option[Method] = nodesWithFullName(x).collectFirst { case x: Method => x } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/MethodRefLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/MethodRefLinker.scala index a942d51c0223..5bded8059ecc 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/MethodRefLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/MethodRefLinker.scala @@ -1,11 +1,11 @@ package io.joern.x2cpg.passes.callgraph import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.Method import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory -import overflowdb.traversal.* /** This pass has MethodStubCreator and TypeDeclStubCreator as prerequisite for language frontends which do not provide * method stubs and type decl stubs. @@ -13,19 +13,18 @@ import overflowdb.traversal.* class MethodRefLinker(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { private val logger = LoggerFactory.getLogger(getClass) - private val srcLabels = List(NodeTypes.METHOD_REF) - override def run(dstGraph: DiffGraphBuilder): Unit = { try { // Create REF edges from METHOD_REFs to METHOD linkToSingle( cpg, - srcNodes = cpg.graph.nodes(srcLabels*).toList, + srcNodes = cpg.methodRef.l, srcLabels = List(NodeTypes.METHOD_REF), dstNodeLabel = NodeTypes.METHOD, edgeType = EdgeTypes.REF, dstNodeMap = methodFullNameToNode(cpg, _), dstFullNameKey = PropertyNames.METHOD_FULL_NAME, + dstDefaultPropertyValue = Method.PropertyDefaults.FullName, dstGraph, None ) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/NaiveCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/NaiveCallLinker.scala index afe2e2665906..f9f1332af728 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/NaiveCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/NaiveCallLinker.scala @@ -1,10 +1,9 @@ package io.joern.x2cpg.passes.callgraph -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames} import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.jIteratortoTraversal +import io.shiftleft.semanticcpg.language.* /** Link remaining unlinked calls to methods only by their name (not full name) * @param cpg diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/StaticCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/StaticCallLinker.scala index 7f5ab2387383..ea8df8646448 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/StaticCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/callgraph/StaticCallLinker.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.passes.callgraph import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes} import io.shiftleft.passes.ForkJoinParallelCpgPass @@ -13,8 +13,7 @@ class StaticCallLinker(cpg: Cpg) extends ForkJoinParallelCpgPass[Seq[Call]](cpg) private val logger: Logger = LoggerFactory.getLogger(classOf[StaticCallLinker]) override def generateParts(): Array[Seq[Call]] = { - val calls = cpg.call.l - calls.grouped(getBatchSize(calls.size)).toArray + cpg.call.toList.grouped(MAX_BATCH_SIZE).toArray } override def runOnPart(builder: DiffGraphBuilder, calls: Seq[Call]): Unit = { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/CfgCreationPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/CfgCreationPass.scala index 67afd3fed686..2f26c8d17144 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/CfgCreationPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/CfgCreationPass.scala @@ -1,8 +1,8 @@ package io.joern.x2cpg.passes.controlflow -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Method -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* import io.joern.x2cpg.passes.controlflow.cfgcreation.CfgCreator import org.slf4j.LoggerFactory @@ -15,12 +15,12 @@ import org.slf4j.LoggerFactory * Note: the version of OverflowDB that we currently use as a storage backend does not assign ids to edges and this * pass only creates edges at the moment. Therefore, we currently do without key pools. */ -class CfgCreationPass(cpg: Cpg) extends ConcurrentWriterCpgPass[Method](cpg) { +class CfgCreationPass(cpg: Cpg) extends ForkJoinParallelCpgPass[Method](cpg) { private val logger = LoggerFactory.getLogger(getClass) override def generateParts(): Array[Method] = cpg.method.toArray override def runOnPart(diffGraph: DiffGraphBuilder, method: Method): Unit = { - val localDiff = new DiffGraphBuilder + val localDiff = Cpg.newDiffGraphBuilder try { new CfgCreator(method, localDiff).run() diffGraph.absorb(localDiff) @@ -29,4 +29,5 @@ class CfgCreationPass(cpg: Cpg) extends ConcurrentWriterCpgPass[Method](cpg) { logger.error(s"Error for the METHOD node -> '${method.fullName}' in file '${method.filename}'") } } + } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgcreation/CfgCreator.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgcreation/CfgCreator.scala index ac157243ac15..f59b5776ffd8 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgcreation/CfgCreator.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgcreation/CfgCreator.scala @@ -4,7 +4,7 @@ import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.CfgEdgeType import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, DispatchTypes, EdgeTypes, Operators} import io.shiftleft.semanticcpg.language.* -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder /** Translation of abstract syntax trees into control flow graphs * @@ -174,10 +174,18 @@ class CfgCreator(entryNode: Method, diffGraph: DiffGraphBuilder) { cfgForChildren(node) case ControlStructureTypes.MATCH => cfgForMatchExpression(node) + case ControlStructureTypes.THROW => + cfgForThrowStatement(node) case _ => Cfg.empty } + protected def cfgForThrowStatement(node: ControlStructure): Cfg = { + val throwExprCfg = node.astChildren.find(_.order == 1).map(cfgFor).getOrElse(Cfg.empty) + val concatedNatedCfg = throwExprCfg ++ Cfg(entryNode = Option(node)) + concatedNatedCfg.copy(edges = concatedNatedCfg.edges ++ singleEdge(node, exitNode)) + } + /** The CFG for a break/continue statements contains only the break/continue statement as a single entry node. The * fringe is empty, that is, appending another CFG to the break statement will not result in the creation of an edge * from the break statement to the entry point of the other CFG. Labeled breaks are treated like gotos and are added @@ -368,16 +376,17 @@ class CfgCreator(entryNode: Method, diffGraph: DiffGraphBuilder) { val loopExprCfg = children.find(_.order == nLocals + 3).map(cfgFor).getOrElse(Cfg.empty) val bodyCfg = children.find(_.order == nLocals + 4).map(cfgFor).getOrElse(Cfg.empty) - val innerCfg = conditionCfg ++ bodyCfg ++ loopExprCfg - val entryNode = (initExprCfg ++ innerCfg).entryNode + val innerCfg = bodyCfg ++ loopExprCfg + val loopEntryNode = conditionCfg.entryNode.orElse(innerCfg.entryNode) + val entryNode = initExprCfg.entryNode.orElse(loopEntryNode) - val newEdges = edgesFromFringeTo(initExprCfg, innerCfg.entryNode) ++ - edgesFromFringeTo(innerCfg, innerCfg.entryNode) ++ - edgesFromFringeTo(conditionCfg, bodyCfg.entryNode, TrueEdge) ++ { + val newEdges = edgesFromFringeTo(initExprCfg, loopEntryNode) ++ + edgesFromFringeTo(innerCfg, loopEntryNode) ++ + edgesFromFringeTo(conditionCfg, innerCfg.entryNode.orElse(conditionCfg.entryNode), TrueEdge) ++ { if (loopExprCfg.entryNode.isDefined) { edges(takeCurrentLevel(bodyCfg.continues), loopExprCfg.entryNode) } else { - edges(takeCurrentLevel(bodyCfg.continues), innerCfg.entryNode) + edges(takeCurrentLevel(bodyCfg.continues), loopEntryNode) } } @@ -385,7 +394,7 @@ class CfgCreator(entryNode: Method, diffGraph: DiffGraphBuilder) { .from(initExprCfg, conditionCfg, loopExprCfg, bodyCfg) .copy( entryNode = entryNode, - edges = newEdges ++ initExprCfg.edges ++ innerCfg.edges, + edges = newEdges ++ initExprCfg.edges ++ conditionCfg.edges ++ innerCfg.edges, fringe = conditionCfg.fringe.withEdgeType(FalseEdge) ++ takeCurrentLevel(bodyCfg.breaks).map((_, AlwaysEdge)), breaks = reduceAndFilterLevel(bodyCfg.breaks), continues = reduceAndFilterLevel(bodyCfg.continues) @@ -461,18 +470,32 @@ class CfgCreator(entryNode: Method, diffGraph: DiffGraphBuilder) { val diffGraphs = edgesFromFringeTo(conditionCfg, trueCfg.entryNode) ++ edgesFromFringeTo(conditionCfg, falseCfg.entryNode) - Cfg - .from(conditionCfg, trueCfg, falseCfg) - .copy( - entryNode = conditionCfg.entryNode, - edges = diffGraphs ++ conditionCfg.edges ++ trueCfg.edges ++ falseCfg.edges, - fringe = trueCfg.fringe ++ { + val ifStatementFringe = + if (trueCfg.entryNode.isEmpty && falseCfg.entryNode.isEmpty) { + conditionCfg.fringe.withEdgeType(AlwaysEdge) + } else { + val trueFringe = if (trueCfg.entryNode.isDefined) { + trueCfg.fringe + } else { + conditionCfg.fringe.withEdgeType(TrueEdge) + } + + val falseFringe = if (falseCfg.entryNode.isDefined) { falseCfg.fringe } else { conditionCfg.fringe.withEdgeType(FalseEdge) } - } + + trueFringe ++ falseFringe + } + + Cfg + .from(conditionCfg, trueCfg, falseCfg) + .copy( + entryNode = conditionCfg.entryNode, + edges = diffGraphs ++ conditionCfg.edges ++ trueCfg.edges ++ falseCfg.edges, + fringe = ifStatementFringe ) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorFrontier.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorFrontier.scala index e0823e835ee7..b05e62aee1be 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorFrontier.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorFrontier.scala @@ -17,7 +17,7 @@ class CfgDominatorFrontier[NodeType](cfgAdapter: CfgAdapter[NodeType], domTreeAd private def withIDom(x: NodeType, preds: Seq[NodeType]) = doms(x).map(i => (x, preds, i)) - def calculate(cfgNodes: Seq[NodeType]): mutable.Map[NodeType, mutable.Set[NodeType]] = { + def calculate(cfgNodes: Iterator[NodeType]): mutable.Map[NodeType, mutable.Set[NodeType]] = { val domFrontier = mutable.Map.empty[NodeType, mutable.Set[NodeType]] for { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorPass.scala index c6861e6cf95c..b9f27be38a86 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/cfgdominator/CfgDominatorPass.scala @@ -1,12 +1,11 @@ package io.joern.x2cpg.passes.controlflow.cfgdominator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{Method, StoredNode} import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory - import scala.collection.mutable /** This pass has no prerequisites. diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/codepencegraph/CdgPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/codepencegraph/CdgPass.scala index ee0ca054a230..fb8dda2fab55 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/codepencegraph/CdgPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/controlflow/codepencegraph/CdgPass.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.passes.controlflow.codepencegraph -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{ Call, @@ -13,7 +13,7 @@ import io.shiftleft.codepropertygraph.generated.nodes.{ Unknown } import io.shiftleft.passes.ForkJoinParallelCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.joern.x2cpg.passes.controlflow.cfgdominator.{CfgDominatorFrontier, ReverseCpgCfgAdapter} import org.slf4j.{Logger, LoggerFactory} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/Dereference.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/Dereference.scala deleted file mode 100644 index 2ee1c7ae355a..000000000000 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/Dereference.scala +++ /dev/null @@ -1,35 +0,0 @@ -package io.joern.x2cpg.passes.frontend - -import io.shiftleft.codepropertygraph.generated.Cpg -import io.shiftleft.codepropertygraph.generated.Languages -import io.shiftleft.semanticcpg.language._ - -object Dereference { - - def apply(cpg: Cpg): Dereference = cpg.metaData.language.headOption match { - case Some(Languages.NEWC) => CDereference() - case _ => DefaultDereference() - } - -} - -sealed trait Dereference { - - def dereferenceTypeFullName(fullName: String): String - -} - -case class CDereference() extends Dereference { - - /** Types from C/C++ can be annotated with * to indicate being a reference. As our CPG schema currently lacks a - * separate field for that information the * is part of the type full name and needs to be removed when linking. - */ - override def dereferenceTypeFullName(fullName: String): String = fullName.replace("*", "") - -} - -case class DefaultDereference() extends Dereference { - - override def dereferenceTypeFullName(fullName: String): String = fullName - -} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/MetaDataPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/MetaDataPass.scala index 51c936391e7b..f6b8bb1ab601 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/MetaDataPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/MetaDataPass.scala @@ -1,7 +1,7 @@ package io.joern.x2cpg.passes.frontend import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{NewMetaData, NewNamespaceBlock} import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.types.structure.{FileTraversal, NamespaceTraversal} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/TypeNodePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/TypeNodePass.scala index 1bd8c6ffe8d6..5aef81da1a82 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/TypeNodePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/TypeNodePass.scala @@ -1,26 +1,22 @@ package io.joern.x2cpg.passes.frontend import io.joern.x2cpg.passes.frontend.TypeNodePass.fullToShortName -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.Defines +import io.shiftleft.codepropertygraph.generated.{Cpg, Properties} import io.shiftleft.codepropertygraph.generated.nodes.NewType -import io.shiftleft.passes.{KeyPool, CpgPass} -import io.shiftleft.semanticcpg.language._ -import io.shiftleft.codepropertygraph.generated.PropertyNames +import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal import scala.collection.mutable -import io.shiftleft.semanticcpg.language.types.structure.NamespaceTraversal /** Creates a `TYPE` node for each type in `usedTypes` as well as all inheritsFrom type names in the CPG * * Alternatively, set `getTypesFromCpg = true`. If this is set, the `registeredTypes` argument will be ignored. * Instead, type nodes will be created for every unique `TYPE_FULL_NAME` value in the CPG. */ -class TypeNodePass protected ( - registeredTypes: List[String], - cpg: Cpg, - keyPool: Option[KeyPool], - getTypesFromCpg: Boolean -) extends CpgPass(cpg, "types", keyPool) { +class TypeNodePass protected (registeredTypes: List[String], cpg: Cpg, getTypesFromCpg: Boolean) + extends CpgPass(cpg, "types") { protected def typeDeclTypes: mutable.Set[String] = { val typeDeclTypes = mutable.Set[String]() @@ -33,9 +29,8 @@ class TypeNodePass protected ( protected def typeFullNamesFromCpg: Set[String] = { cpg.all - .map(_.property(PropertyNames.TYPE_FULL_NAME)) + .map(_.property(Properties.TypeFullName)) .filter(_ != null) - .map(_.toString) .toSet } @@ -51,7 +46,9 @@ class TypeNodePass protected ( val usedTypesSet = typeDeclTypes ++ typeFullNameValues usedTypesSet.remove("") val usedTypes = - (usedTypesSet.filterInPlace(!_.endsWith(NamespaceTraversal.globalNamespaceName)).toArray :+ "ANY").toSet.sorted + (usedTypesSet + .filterInPlace(!_.endsWith(NamespaceTraversal.globalNamespaceName)) + .toArray :+ Defines.Any).toSet.sorted usedTypes.foreach { typeName => val shortName = fullToShortName(typeName) @@ -65,15 +62,20 @@ class TypeNodePass protected ( } object TypeNodePass { - def withTypesFromCpg(cpg: Cpg, keyPool: Option[KeyPool] = None): TypeNodePass = { - new TypeNodePass(Nil, cpg, keyPool, getTypesFromCpg = true) + def withTypesFromCpg(cpg: Cpg): TypeNodePass = { + new TypeNodePass(Nil, cpg, getTypesFromCpg = true) } - def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg, keyPool: Option[KeyPool] = None): TypeNodePass = { - new TypeNodePass(registeredTypes, cpg, keyPool, getTypesFromCpg = false) + def withRegisteredTypes(registeredTypes: List[String], cpg: Cpg): TypeNodePass = { + new TypeNodePass(registeredTypes, cpg, getTypesFromCpg = false) } def fullToShortName(typeName: String): String = { - typeName.takeWhile(_ != ':').split('.').lastOption.getOrElse(typeName) + if (typeName.endsWith(">")) { + // special case for typeFullName with generics as suffix + typeName.takeWhile(c => c != ':' && c != '<').split('.').lastOption.getOrElse(typeName) + } else { + typeName.takeWhile(_ != ':').split('.').lastOption.getOrElse(typeName) + } } } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XConfigFileCreationPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XConfigFileCreationPass.scala index 654fa33fc9ad..252bc2d28e01 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XConfigFileCreationPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XConfigFileCreationPass.scala @@ -1,10 +1,10 @@ package io.joern.x2cpg.passes.frontend import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.NewConfigFile -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import io.shiftleft.utils.IOUtils import org.slf4j.LoggerFactory @@ -15,7 +15,7 @@ import scala.util.{Failure, Success, Try} * to scan, but alternatively one can specify a directory on the `rootDir` parameter. */ abstract class XConfigFileCreationPass(cpg: Cpg, private val rootDir: Option[String] = None) - extends ConcurrentWriterCpgPass[File](cpg) { + extends ForkJoinParallelCpgPass[File](cpg) { private val logger = LoggerFactory.getLogger(this.getClass) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportResolverPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportResolverPass.scala index 2a32fde7d9ac..bae7f68d2938 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportResolverPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportResolverPass.scala @@ -1,9 +1,9 @@ package io.joern.x2cpg.passes.frontend import better.files.File -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, Import, Tag} -import io.shiftleft.passes.ConcurrentWriterCpgPass +import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.EvaluatedImport import org.slf4j.{Logger, LoggerFactory} @@ -12,7 +12,7 @@ import java.io.File as JFile import java.nio.charset.StandardCharsets import java.util.Base64 -abstract class XImportResolverPass(cpg: Cpg) extends ConcurrentWriterCpgPass[Import](cpg) { +abstract class XImportResolverPass(cpg: Cpg) extends ForkJoinParallelCpgPass[Import](cpg) { protected val logger: Logger = LoggerFactory.getLogger(this.getClass) protected val codeRootDir: String = File( diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportsPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportsPass.scala index 563a1b0dd9ac..3d6ab6bbba53 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportsPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XImportsPass.scala @@ -1,13 +1,13 @@ package io.joern.x2cpg.passes.frontend import io.joern.x2cpg.Imports.createImportNodeAndLink -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.passes.ConcurrentWriterCpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.passes.ForkJoinParallelCpgPass +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment -abstract class XImportsPass(cpg: Cpg) extends ConcurrentWriterCpgPass[(Call, Assignment)](cpg) { +abstract class XImportsPass(cpg: Cpg) extends ForkJoinParallelCpgPass[(Call, Assignment)](cpg) { protected val importCallName: String diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XInheritanceFullNamePass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XInheritanceFullNamePass.scala index fc5095c9257c..7a3adaf38617 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XInheritanceFullNamePass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XInheritanceFullNamePass.scala @@ -1,8 +1,8 @@ package io.joern.x2cpg.passes.frontend import io.joern.x2cpg.passes.base.TypeDeclStubCreator -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{EdgeTypes, PropertyNames} import io.shiftleft.passes.ForkJoinParallelCpgPass import io.shiftleft.semanticcpg.language.* @@ -41,7 +41,7 @@ abstract class XInheritanceFullNamePass(cpg: Cpg) extends ForkJoinParallelCpgPas inheritedTypes == Seq("ANY") || inheritedTypes == Seq("object") || inheritedTypes.isEmpty private def extractTypeDeclFromNode(node: AstNode): Option[String] = node match { - case x: Call if x.isCallForImportOut.nonEmpty => + case x: Call if x._isCallForImportOut.nonEmpty => x.isCallForImportOut.importedEntity.map { case imp if relativePathPattern.matcher(imp).matches() => imp.split(pathSep).toList match { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeHintCallLinker.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeHintCallLinker.scala index 615dae980cdc..92733810ca93 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeHintCallLinker.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeHintCallLinker.scala @@ -2,11 +2,10 @@ package io.joern.x2cpg.passes.frontend import io.joern.x2cpg.passes.base.MethodStubCreator import io.joern.x2cpg.passes.frontend.XTypeRecovery.isDummyType -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{DispatchTypes, EdgeTypes, NodeTypes, PropertyNames} import io.shiftleft.passes.CpgPass -import io.shiftleft.proto.cpg.Cpg.DispatchTypes import io.shiftleft.semanticcpg.language.* import java.util.regex.Pattern @@ -151,7 +150,7 @@ abstract class XTypeHintCallLinker(cpg: Cpg) extends CpgPass(cpg) { name, fullName, "", - DispatchTypes.DYNAMIC_DISPATCH.name(), + DispatchTypes.DYNAMIC_DISPATCH, argSize, builder, isExternal, diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeRecovery.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeRecovery.scala index 234f018b8d18..a422c215eb76 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeRecovery.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeRecovery.scala @@ -1,20 +1,26 @@ package io.joern.x2cpg.passes.frontend import io.joern.x2cpg.{Defines, X2CpgConfig} -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.{ + Cpg, + DispatchTypes, + EdgeTypes, + NodeTypes, + Operators, + Properties, + PropertyNames +} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, Operators, PropertyNames} import io.shiftleft.passes.{CpgPass, CpgPassBase, ForkJoinParallelCpgPass} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.{Assignment, FieldAccess} import org.slf4j.{Logger, LoggerFactory} -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder import scopt.OParser -import java.util.regex.{Matcher, Pattern} +import java.util.regex.Pattern import scala.annotation.tailrec import scala.collection.mutable import scala.util.{Failure, Success, Try} @@ -27,6 +33,61 @@ import scala.util.matching.Regex */ case class XTypeRecoveryConfig(iterations: Int = 2, enabledDummyTypes: Boolean = true) +object XTypeRecoveryConfig { + private val logger = LoggerFactory.getLogger(getClass) + + def parse(cmdLineArgs: Seq[String]): XTypeRecoveryConfig = { + OParser + .parse(parserOptions, cmdLineArgs, XTypeRecoveryConfig()) + .getOrElse( + throw new RuntimeException( + s"unable to parse XTypeRecoveryConfig from commandline arguments ${cmdLineArgs.mkString(" ")}" + ) + ) + } + + def parserOptions: OParser[Unit, XTypeRecoveryConfig] = { + _parserOptions[XTypeRecoveryConfig]( + configureNoDummyTypes = _.copy(enabledDummyTypes = false), + configureIterations = (iterations, config) => config.copy(iterations = iterations) + ) + } + + /** Parser options for languages implementing this pass. */ + def parserOptionsForParserConfig[R <: X2CpgConfig[R] & TypeRecoveryParserConfig[R]]: OParser[?, R] = { + _parserOptions[R]( + configureNoDummyTypes = _.withDisableDummyTypes(true), + configureIterations = (iterations, config) => config.withTypePropagationIterations(iterations) + ) + } + + private def _parserOptions[C](configureNoDummyTypes: C => C, configureIterations: (Int, C) => C): OParser[Unit, C] = { + val builder = OParser.builder[C] + import builder.* + OParser.sequence( + opt[Unit]("no-dummyTypes") + .hidden() + .action((_, c) => configureNoDummyTypes(c)) + .text("disable generation of dummy types during type propagation"), + opt[Int]("type-prop-iterations") + .hidden() + .action((x, c) => configureIterations(x, c)) + .text("maximum iterations of type propagation") + .validate { x => + if (x <= 0) { + logger.info("Disabling type propagation as the given iteration count is <= 0") + } else if (x == 1) { + logger.info("Intra-procedural type propagation enabled") + } else if (x > 5) { + logger.warn(s"Large iteration count of $x will take a while to terminate") + } + success + } + ) + } + +} + /** @param config * the user defined config. * @param currentIteration @@ -97,7 +158,7 @@ abstract class XTypeRecoveryPassGenerator[CompilationUnitType <: AstNode]( if (postTypeRecoveryAndPropagation) res.append( new CpgPass(cpg): - override def run(builder: BatchedUpdate.DiffGraphBuilder): Unit = { + override def run(builder: DiffGraphBuilder): Unit = { XTypeRecoveryPassGenerator.linkMembersToTheirRefs(cpg, builder) } ) @@ -187,7 +248,6 @@ abstract class XTypeRecovery[CompilationUnitType <: AstNode](cpg: Cpg, state: XT } object XTypeRecovery { - private val logger = LoggerFactory.getLogger(getClass) val DummyReturnType = "" @@ -204,40 +264,17 @@ object XTypeRecovery { */ def isDummyType(typ: String): Boolean = DummyTokens.exists(typ.contains) - /** Parser options for languages implementing this pass. - */ - def parserOptions[R <: X2CpgConfig[R] & TypeRecoveryParserConfig[R]]: OParser[?, R] = { - val builder = OParser.builder[R] - import builder.* - OParser.sequence( - opt[Unit]("no-dummyTypes") - .hidden() - .action((_, c) => c.withDisableDummyTypes(true)) - .text("disable generation of dummy types during type propagation"), - opt[Int]("type-prop-iterations") - .hidden() - .action((x, c) => c.withTypePropagationIterations(x)) - .text("maximum iterations of type propagation") - .validate { x => - if (x <= 0) { - logger.info("Disabling type propagation as the given iteration count is <= 0") - } else if (x == 1) { - logger.info("Intra-procedural type propagation enabled") - } else if (x > 5) { - logger.warn(s"Large iteration count of $x will take a while to terminate") - } - success - } - ) - } + @deprecated("please use XTypeRecoveryConfig.parserOptionsForParserConfig", since = "2.0.415") + def parserOptions[R <: X2CpgConfig[R] & TypeRecoveryParserConfig[R]]: OParser[?, R] = + XTypeRecoveryConfig.parserOptionsForParserConfig // The below are convenience calls for accessing type properties, one day when this pass uses `Tag` nodes instead of // the symbol table then perhaps this would work out better implicit class AllNodeTypesFromNodeExt(x: StoredNode) { def allTypes: Iterator[String] = - (x.property(PropertyNames.TYPE_FULL_NAME, "ANY") +: - (x.property(PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq.empty) - ++ x.property(PropertyNames.POSSIBLE_TYPES, Seq.empty))).iterator + (x.propertyOption(Properties.TypeFullName).getOrElse("ANY") +: + (x.property(Properties.DynamicTypeHintFullName) ++ + x.property(Properties.PossibleTypes))).iterator def getKnownTypes: Set[String] = { x.allTypes.toSet.filterNot(XTypeRecovery.unknownTypePattern.matches) @@ -406,7 +443,8 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( * @param a * assignment call pointer. */ - protected def visitAssignments(a: Assignment): Set[String] = visitAssignmentArguments(a.argumentOut.l) + protected def visitAssignments(a: Assignment): Set[String] = + visitAssignmentArguments(a.argumentOut.cast[CfgNode].l) protected def visitAssignmentArguments(args: List[AstNode]): Set[String] = args match { case List(i: Identifier, b: Block) => visitIdentifierAssignedToBlock(i, b) @@ -469,7 +507,7 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( visitIdentifierAssignedToConstructor(i, c) } else if (symbolTable.contains(c)) { visitIdentifierAssignedToCallRetVal(i, c) - } else if (c.argument.headOption.exists(symbolTable.contains)) { + } else if (c.argument.argumentIndex(0).headOption.exists(symbolTable.contains)) { setCallMethodFullNameFromBase(c) // Repeat this method now that the call has a type visitIdentifierAssignedToCall(i, c) @@ -525,7 +563,7 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( isFieldCache.getOrElseUpdate(i, isFieldUncached(i)) protected def isFieldUncached(i: Identifier): Boolean = - i.method.typeDecl.member.nameExact(i.name).nonEmpty + Try(i.method.typeDecl.member.nameExact(i.name).nonEmpty).getOrElse(false) /** Associates the types with the identifier. This may sometimes be an identifier that should be considered a field * which this method uses [[isField]] to determine. @@ -539,7 +577,9 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( val fieldName = getFieldName(fa).split(Pattern.quote(pathSep)).last Try(cpg.member.nameExact(fieldName).typeDecl.fullName.filterNot(_.contains("ANY")).toSet) match case Failure(exception) => - logger.warn("Unable to obtain name of member's parent type declaration", exception) + logger.warn( + s"Unable to obtain name of member's parent type declaration: ${cpg.member.nameExact(fieldName).propertiesMap.mkString(",")}" + ) Set.empty case Success(typeDeclNames) => typeDeclNames } @@ -717,6 +757,10 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( protected def getIndexAccessTypes(ia: Call): Set[String] = indexAccessToCollectionVar(ia) match { case Some(cVar) if symbolTable.contains(cVar) => symbolTable.get(cVar) + case Some(cVar) if ia.argument(1).isCall && symbolTable.contains(CallAlias(cVar.identifier)) => + symbolTable + .get(CallAlias(cVar.identifier)) + .map(x => s"$x$pathSep${XTypeRecovery.DummyReturnType}$pathSep${XTypeRecovery.DummyIndexAccess}") case Some(cVar) if symbolTable.contains(LocalVar(cVar.identifier)) => symbolTable.get(LocalVar(cVar.identifier)).map(x => s"$x$pathSep${XTypeRecovery.DummyIndexAccess}") case _ => Set.empty @@ -776,7 +820,8 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( case ::(_: TypeRef, ::(f: FieldIdentifier, _)) => f.canonicalName case xs => - logger.warn(s"Unhandled field structure ${xs.map(x => (x.label, x.code)).mkString(",")} @ ${debugLocation(fa)}") + val debugInfo = xs.collect { case x: CfgNode => (x.label(), x.code) }.mkString(",") + logger.warn(s"Unhandled field structure $debugInfo @ ${debugLocation(fa)}") wrapName("") } } @@ -999,7 +1044,11 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( setTypeForIdentifierAssignedToDefault(call, i) // Case 2: 'i' is the receiver of 'call' case (Some(call: Call), ::(i: Identifier, _)) if call.name != Operators.fieldAccess => - setTypeForDynamicDispatchCall(call, i) + (i.argumentIndex, call.dispatchType) match { + case (0, DispatchTypes.DYNAMIC_DISPATCH) => setTypeForDynamicDispatchCall(call, i) + case (1, DispatchTypes.STATIC_DISPATCH) => setTypeForStaticDispatchCall(call, i) + case _ => + } // Case 3: 'i' is the receiver for a field access on member 'f' case (Some(fieldAccess: Call), ::(i: Identifier, ::(f: FieldIdentifier, _))) if fieldAccess.name == Operators.fieldAccess => @@ -1039,6 +1088,11 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( } } + protected def setTypeForStaticDispatchCall(call: Call, i: Identifier): Unit = { + // TODO: Should it have special handling? + setTypeForDynamicDispatchCall(call, i) + } + protected def setTypeForIdentifierAssignedToDefault(call: Call, i: Identifier): Unit = { val idHints = symbolTable.get(i) persistType(i, idHints) @@ -1100,8 +1154,8 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( baseName: Option[String], funcName: String, methodFullName: String, - lineNo: Option[Integer], - columnNo: Option[Integer] + lineNo: Option[Int], + columnNo: Option[Int] ): NewMethodRef = NewMethodRef() .code(s"${baseName.map(_ + pathSep).getOrElse("")}$funcName") @@ -1188,7 +1242,8 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( lazy val existingTypes = storedNode.getKnownTypes val hasUnknownTypeFullName = storedNode - .property(PropertyNames.TYPE_FULL_NAME, Defines.Any) + .propertyOption(Properties.TypeFullName) + .getOrElse(Defines.Any) .matches(XTypeRecovery.unknownTypePattern.pattern.pattern()) if (types.nonEmpty && (hasUnknownTypeFullName || types.toSet != existingTypes)) { @@ -1227,10 +1282,12 @@ abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode]( */ protected def storeDefaultTypeInfo(n: StoredNode, types: Seq[String]): Unit = val hasUnknownType = - n.property(PropertyNames.TYPE_FULL_NAME, Defines.Any).matches(XTypeRecovery.unknownTypePattern.pattern.pattern()) + n.propertyOption(Properties.TypeFullName) + .getOrElse(Defines.Any) + .matches(XTypeRecovery.unknownTypePattern.pattern.pattern()) if (types.toSet != n.getKnownTypes || (hasUnknownType && types.nonEmpty)) { - setTypes(n, (n.property(PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME, Seq.empty) ++ types).distinct) + setTypes(n, (n.propertyOption(PropertyNames.DYNAMIC_TYPE_HINT_FULL_NAME).getOrElse(Seq.empty) ++ types).distinct) } /** If there is only 1 type hint then this is set to the `typeFullName` property and `dynamicTypeHintFullName` is diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeStubsParser.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeStubsParser.scala index f6ed2db41236..431b4de4e462 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeStubsParser.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/frontend/XTypeStubsParser.scala @@ -23,13 +23,21 @@ trait TypeStubsParserConfig[R <: X2CpgConfig[R]] { this: R => object XTypeStubsParser { def parserOptions[R <: X2CpgConfig[R] & TypeStubsParserConfig[R]]: OParser[?, R] = { - val builder = OParser.builder[R] - import builder.* - OParser.sequence( - opt[String]("type-stubs-file") - .hidden() - .action((path, c) => c.withTypeStubsFilePath(path)) - .text("path to file with type signature stubs for known functions") + _parserOptions[R](configureTypeStubsFilePath = (path, c) => c.withTypeStubsFilePath(path)) + } + + def parserOptions2: OParser[?, XTypeStubsParserConfig] = { + _parserOptions[XTypeStubsParserConfig](configureTypeStubsFilePath = + (path, c) => c.copy(typeStubsFilePath = Option(path)) ) } + + private def _parserOptions[C](configureTypeStubsFilePath: (String, C) => C): OParser[String, C] = { + val builder = OParser.builder[C] + import builder.* + opt[String]("type-stubs-file") + .hidden() + .action((path, c) => configureTypeStubsFilePath(path, c)) + .text("path to file with type signature stubs for known functions") + } } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/AliasLinkerPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/AliasLinkerPass.scala index ebc48afe7be3..b9f4b88e9721 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/AliasLinkerPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/AliasLinkerPass.scala @@ -1,10 +1,11 @@ package io.joern.x2cpg.passes.typerelations -import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.TypeDecl import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* +import io.joern.x2cpg.utils.LinkingUtil import org.slf4j.{Logger, LoggerFactory} class AliasLinkerPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/FieldAccessLinkerPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/FieldAccessLinkerPass.scala index c9d6f7e26261..f3fb6914b5b7 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/FieldAccessLinkerPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/FieldAccessLinkerPass.scala @@ -1,12 +1,14 @@ package io.joern.x2cpg.passes.typerelations -import io.joern.x2cpg.passes.frontend.Dereference import io.joern.x2cpg.utils.LinkingUtil import io.shiftleft.codepropertygraph.generated.* -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Member, StoredNode} +import io.shiftleft.codepropertygraph.generated.nodes.Call +import io.shiftleft.codepropertygraph.generated.nodes.Member +import io.shiftleft.codepropertygraph.generated.nodes.StoredNode import io.shiftleft.passes.CpgPass import io.shiftleft.semanticcpg.language.* -import io.shiftleft.semanticcpg.language.operatorextension.{OpNodes, allFieldAccessTypes} +import io.shiftleft.semanticcpg.language.operatorextension.OpNodes +import io.shiftleft.semanticcpg.language.operatorextension.allFieldAccessTypes import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.* @@ -71,18 +73,16 @@ class FieldAccessLinkerPass(cpg: Cpg) extends CpgPass(cpg) with LinkingUtil { dstFullNameKey: String, dstGraph: DiffGraphBuilder ): Unit = { - val dereference = Dereference(cpg) - cpg.graph.nodes(srcLabels*).asScala.cast[SRC_NODE_TYPE].filterNot(_.outE(edgeType).hasNext).foreach { srcNode => + cpg.graph.nodes(srcLabels*).cast[SRC_NODE_TYPE].filterNot(_.outE(edgeType).hasNext).foreach { srcNode => if (!srcNode.outE(edgeType).hasNext) { getDstFullNames(srcNode).foreach { dstFullName => - val dereferenceDstFullName = dereference.dereferenceTypeFullName(dstFullName) - dstNodeMap(dereferenceDstFullName) match { + dstNodeMap(dstFullName) match { case Some(dstNode) => dstGraph.addEdge(srcNode, dstNode, edgeType) case None if dstNodeMap(dstFullName).isDefined => dstGraph.addEdge(srcNode, dstNodeMap(dstFullName).get, edgeType) case None => - logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dereferenceDstFullName) + logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dstFullName) } } } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/TypeHierarchyPass.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/TypeHierarchyPass.scala index c6abd6ca0f94..6782e61fb649 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/TypeHierarchyPass.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/passes/typerelations/TypeHierarchyPass.scala @@ -1,10 +1,11 @@ package io.joern.x2cpg.passes.typerelations +import io.shiftleft.codepropertygraph.generated.Cpg import io.joern.x2cpg.utils.LinkingUtil -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.nodes.TypeDecl import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes, PropertyNames} import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} /** Create INHERITS_FROM edges from `TYPE_DECL` nodes to `TYPE` nodes. diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/ConcurrentTaskUtil.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/ConcurrentTaskUtil.scala index 3116eed4b0e4..dafc7eb112f1 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/ConcurrentTaskUtil.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/ConcurrentTaskUtil.scala @@ -11,7 +11,7 @@ import scala.util.Try */ object ConcurrentTaskUtil { - val MAX_POOL_SIZE = Runtime.getRuntime.availableProcessors() + private val MAX_POOL_SIZE = Runtime.getRuntime.availableProcessors() /** Uses a thread pool with a limited number of active threads executing a task at any given point. This is effective * when tasks may require large amounts of memory, or single tasks are too short lived. @@ -50,13 +50,16 @@ object ConcurrentTaskUtil { * @return * an array of the executed tasks as either a success or failure. */ - def runUsingSpliterator[V](tasks: Iterator[() => V]): List[Try[V]] = { - StreamSupport - .stream(Spliterators.spliteratorUnknownSize(tasks.asJava, Spliterator.NONNULL), /* parallel */ true) - .map(task => Try(task.apply())) - .collect(Collectors.toList()) - .asScala - .toList + def runUsingSpliterator[V](tasks: Iterator[() => V]): Seq[Try[V]] = { + scala.collection.immutable.ArraySeq + .ofRef( + java.util.Arrays + .stream(tasks.toArray) + .parallel() + .map(task => Try(task.apply())) + .toArray + ) + .asInstanceOf[scala.collection.immutable.ArraySeq[Try[V]]] } } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/Environment.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/Environment.scala index ca1b4cfcb1b3..9c7b1928fc9e 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/Environment.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/Environment.scala @@ -15,7 +15,7 @@ object Environment { object ArchitectureType extends Enumeration { type ArchitectureType = Value - val X86, ARM = Value + val X86, ARMv8 = Value } lazy val operatingSystem: OperatingSystemType.OperatingSystemType = @@ -25,7 +25,7 @@ object Environment { else OperatingSystemType.Unknown lazy val architecture: ArchitectureType.ArchitectureType = - if (scala.util.Properties.propOrNone("os.arch").contains("aarch64")) ArchitectureType.ARM + if (scala.util.Properties.propOrNone("os.arch").contains("aarch64")) ArchitectureType.ARMv8 // We do not distinguish between x86 and x64. E.g, a 64 bit Windows will always lie about // this and will report x86 anyway for backwards compatibility with 32 bit software. else ArchitectureType.X86 diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/KeyPool.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/KeyPool.scala new file mode 100644 index 000000000000..0faa1f1fa216 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/KeyPool.scala @@ -0,0 +1,80 @@ +package io.joern.x2cpg.utils + +import java.util.concurrent.atomic.{AtomicInteger, AtomicLong} + +/** A pool of long integers. Using the method `next`, the pool provides the next id in a thread-safe manner. */ +trait KeyPool { + def next: Long +} + +/** A key pool that returns the integers of the interval [first, last] in a thread-safe manner. + */ +class IntervalKeyPool(val first: Long, val last: Long) extends KeyPool { + + /** Get next number in interval or raise if number is larger than `last` + */ + def next: Long = { + if (!valid) { + throw new IllegalStateException("Call to `next` on invalidated IntervalKeyPool.") + } + val n = cur.incrementAndGet() + if (n > last) { + throw new RuntimeException("Pool exhausted") + } else { + n + } + } + + /** Split key pool into `numberOfPartitions` partitions of mostly equal size. Invalidates the current pool to ensure + * that the user does not continue to use both the original pool and pools derived from it via `split`. + */ + def split(numberOfPartitions: Int): Iterator[IntervalKeyPool] = { + valid = false + if (numberOfPartitions == 0) { + Iterator() + } else { + val curFirst = cur.get() + val k = (last - curFirst) / numberOfPartitions + (1 to numberOfPartitions).map { i => + val poolFirst = curFirst + (i - 1) * k + new IntervalKeyPool(poolFirst, poolFirst + k - 1) + }.iterator + } + } + + private val cur: AtomicLong = new AtomicLong(first - 1) + private var valid: Boolean = true +} + +/** A key pool that returns elements of `seq` in order in a thread-safe manner. + */ +class SequenceKeyPool(seq: Seq[Long]) extends KeyPool { + + val seqLen: Int = seq.size + var cur = new AtomicInteger(-1) + + override def next: Long = { + val i = cur.incrementAndGet() + if (i >= seqLen) { + throw new RuntimeException("Pool exhausted") + } else { + seq(i) + } + } +} + +object KeyPoolCreator { + + /** Divide the keyspace into n intervals and return a list of corresponding key pools. + */ + def obtain(n: Long, minValue: Long = 0, maxValue: Long = Long.MaxValue): List[IntervalKeyPool] = { + val nIntervals = Math.max(n, 1) + val intervalLen: Long = (maxValue - minValue) / nIntervals + List.range(0L, nIntervals).map { i => + val first = i * intervalLen + minValue + val last = first + intervalLen - 1 + new IntervalKeyPool(first, last) + } + } + +} diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/LinkingUtil.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/LinkingUtil.scala index 57885e871e2b..b47a9bed6651 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/LinkingUtil.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/LinkingUtil.scala @@ -1,21 +1,19 @@ package io.joern.x2cpg.utils -import io.joern.x2cpg.passes.frontend.Dereference -import io.shiftleft.codepropertygraph.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{Properties, PropertyNames} +import io.shiftleft.codepropertygraph.generated.{Cpg, Properties, PropertyNames} +import io.shiftleft.codepropertygraph.generated.nodes.NamespaceBlock +import io.shiftleft.codepropertygraph.generated.nodes.Type +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.traversal.* -import overflowdb.traversal.ChainedImplicitsTemp.* -import overflowdb.{Node, NodeDb, NodeRef, PropertyKey} -import scala.collection.mutable import scala.jdk.CollectionConverters.* trait LinkingUtil { - import overflowdb.BatchedUpdate.DiffGraphBuilder - private val MAX_BATCH_SIZE = 100 + import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder + + val MAX_BATCH_SIZE: Int = 100 val logger: Logger = LoggerFactory.getLogger(classOf[LinkingUtil]) @@ -31,69 +29,50 @@ trait LinkingUtil { def namespaceBlockFullNameToNode(cpg: Cpg, x: String): Option[NamespaceBlock] = nodesWithFullName(cpg, x).collectFirst { case x: NamespaceBlock => x } - def nodesWithFullName(cpg: Cpg, x: String): mutable.Seq[NodeRef[? <: NodeDb]] = - cpg.graph.indexManager.lookup(PropertyNames.FULL_NAME, x).asScala - - protected def getBatchSize(totalItems: Int): Int = { - val batchSize = - if totalItems > MAX_BATCH_SIZE then totalItems / ConcurrentTaskUtil.MAX_POOL_SIZE - else MAX_BATCH_SIZE - Math.min(batchSize, MAX_BATCH_SIZE) - } + def nodesWithFullName(cpg: Cpg, x: String): Iterator[StoredNode] = + cpg.graph.nodesWithProperty(propertyName = PropertyNames.FULL_NAME, value = x).cast[StoredNode] /** For all nodes `n` with a label in `srcLabels`, determine the value of `n.\$dstFullNameKey`, use that to lookup the * destination node in `dstNodeMap`, and create an edge of type `edgeType` between `n` and the destination node. */ - protected def linkToSingle( cpg: Cpg, - srcNodes: List[Node], + srcNodes: List[StoredNode], srcLabels: List[String], dstNodeLabel: String, edgeType: String, dstNodeMap: String => Option[StoredNode], dstFullNameKey: String, + dstDefaultPropertyValue: Any, dstGraph: DiffGraphBuilder, dstNotExistsHandler: Option[(StoredNode, String) => Unit] ): Unit = { - val dereference = Dereference(cpg) var loggedDeprecationWarning = false srcNodes.foreach { srcNode => // If the source node does not have any outgoing edges of this type // This check is just required for backward compatibility try { if (srcNode.outE(edgeType).isEmpty) { - val key = new PropertyKey[String](dstFullNameKey) srcNode - .propertyOption(key) - .filter { dstFullName => - val dereferenceDstFullName = dereference.dereferenceTypeFullName(dstFullName) - srcNode.propertyDefaultValue(dstFullNameKey) != dereferenceDstFullName - } - .ifPresent { dstFullName => + .propertyOption[String](dstFullNameKey) + .filter { dstFullName => dstDefaultPropertyValue != dstFullName } + .map { dstFullName => // for `UNKNOWN` this is not always set, so we're using an Option here - val srcStoredNode = srcNode.asInstanceOf[StoredNode] - val dereferenceDstFullName = dereference.dereferenceTypeFullName(dstFullName) - dstNodeMap(dereferenceDstFullName) match { + dstNodeMap(dstFullName) match { case Some(dstNode) => - dstGraph.addEdge(srcStoredNode, dstNode, edgeType) + dstGraph.addEdge(srcNode, dstNode, edgeType) case None if dstNodeMap(dstFullName).isDefined => - dstGraph.addEdge(srcStoredNode, dstNodeMap(dstFullName).get, edgeType) + dstGraph.addEdge(srcNode, dstNodeMap(dstFullName).get, edgeType) case None if dstNotExistsHandler.isDefined => - dstNotExistsHandler.get(srcStoredNode, dereferenceDstFullName) + dstNotExistsHandler.get(srcNode, dstFullName) case _ => - logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dereferenceDstFullName) + logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dstFullName) } } } else { - srcNode.out(edgeType).property(Properties.FULL_NAME).nextOption() match { - case Some(dstFullName) => - dstGraph.setNodeProperty( - srcNode.asInstanceOf[StoredNode], - dstFullNameKey, - dereference.dereferenceTypeFullName(dstFullName) - ) - case None => logger.info(s"Missing outgoing edge of type $edgeType from node $srcNode") + srcNode.out(edgeType).property(Properties.FullName).nextOption() match { + case Some(dstFullName) => dstGraph.setNodeProperty(srcNode, dstFullNameKey, dstFullName) + case None => logger.info(s"Missing outgoing edge of type $edgeType from node $srcNode") } if (!loggedDeprecationWarning) { logger.info( @@ -106,7 +85,7 @@ trait LinkingUtil { } catch { case ex: Exception => logger.warn( - s"Error in linkToSingle for node in file '${srcNode.propertyOption(Properties.FILENAME).toString}''", + s"Error in linkToSingle for node in file '${srcNode.propertyOption(PropertyNames.FILENAME).toString}''", ex ) } @@ -124,24 +103,22 @@ trait LinkingUtil { dstGraph: DiffGraphBuilder ): Unit = { var loggedDeprecationWarning = false - val dereference = Dereference(cpg) - cpg.graph.nodes(srcLabels*).asScala.cast[SRC_NODE_TYPE].foreach { srcNode => + cpg.graph.nodes(srcLabels*).cast[SRC_NODE_TYPE].foreach { srcNode => try { if (!srcNode.outE(edgeType).hasNext) { getDstFullNames(srcNode).foreach { dstFullName => - val dereferenceDstFullName = dereference.dereferenceTypeFullName(dstFullName) - dstNodeMap(dereferenceDstFullName) match { + dstNodeMap(dstFullName) match { case Some(dstNode) => dstGraph.addEdge(srcNode, dstNode, edgeType) case None if dstNodeMap(dstFullName).isDefined => dstGraph.addEdge(srcNode, dstNodeMap(dstFullName).get, edgeType) case None => - logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dereferenceDstFullName) + logFailedDstLookup(edgeType, srcNode.label, srcNode.id.toString, dstNodeLabel, dstFullName) } } } else { - val dstFullNames = srcNode.out(edgeType).property(Properties.FULL_NAME).l - dstGraph.setNodeProperty(srcNode, dstFullNameKey, dstFullNames.map(dereference.dereferenceTypeFullName)) + val dstFullNames = srcNode.out(edgeType).property(Properties.FullName).l + dstGraph.setNodeProperty(srcNode, dstFullNameKey, dstFullNames) if (!loggedDeprecationWarning) { logger.info( s"Using deprecated CPG format with already existing $edgeType edge between" + @@ -153,7 +130,7 @@ trait LinkingUtil { } catch { case ex: Exception => logger.warn( - s"Error in linkToMultiple for node in file '${srcNode.propertyOption(Properties.FILENAME).toString}''", + s"Error in linkToMultiple for node in file '${srcNode.propertyOption(PropertyNames.FILENAME).toString}''", ex ) } diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/NodeBuilders.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/NodeBuilders.scala index 38dd07f80326..0945127db9ef 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/NodeBuilders.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/NodeBuilders.scala @@ -70,8 +70,8 @@ object NodeBuilders { dispatchType: String, argumentTypes: Iterable[String] = Nil, code: String = PropertyDefaults.Code, - lineNumber: Option[Integer] = None, - columnNumber: Option[Integer] = None + lineNumber: Option[Int] = None, + columnNumber: Option[Int] = None ): NewCall = { val signature = composeCallSignature(returnTypeFullName, argumentTypes) val methodFullName = composeMethodFullName(typeDeclFullName, methodName, signature) @@ -92,11 +92,7 @@ object NodeBuilders { .dependencyGroupId(groupId) .version(version) - def newFieldIdentifierNode( - name: String, - line: Option[Integer] = None, - column: Option[Integer] = None - ): NewFieldIdentifier = { + def newFieldIdentifierNode(name: String, line: Option[Int] = None, column: Option[Int] = None): NewFieldIdentifier = { NewFieldIdentifier() .canonicalName(name) .code(name) @@ -114,7 +110,7 @@ object NodeBuilders { name: String, typeFullName: String, dynamicTypeHints: Seq[String], - line: Option[Integer] + line: Option[Int] ): NewIdentifier = { NewIdentifier() .code(name) @@ -128,8 +124,8 @@ object NodeBuilders { name: String, code: String, typeFullName: Option[String] = None, - line: Option[Integer] = None, - column: Option[Integer] = None + line: Option[Int] = None, + column: Option[Int] = None ): NewCall = { NewCall() .name(name) @@ -147,8 +143,8 @@ object NodeBuilders { code: String = "this", typeFullName: String, dynamicTypeHintFullName: Seq[String] = Seq.empty, - line: Option[Integer] = None, - column: Option[Integer] = None, + line: Option[Int] = None, + column: Option[Int] = None, evaluationStrategy: String = EvaluationStrategies.BY_SHARING ): NewMethodParameterIn = { NewMethodParameterIn() @@ -168,8 +164,8 @@ object NodeBuilders { def newMethodReturnNode( typeFullName: String, dynamicTypeHintFullName: Option[String] = None, - line: Option[Integer], - column: Option[Integer] + line: Option[Int], + column: Option[Int] ): NewMethodReturn = NewMethodReturn() .typeFullName(typeFullName) diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/GradleDependencies.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/GradleDependencies.scala index bc8c13918df7..c69af9ea12ac 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/GradleDependencies.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/GradleDependencies.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.utils.dependency -import better.files._ +import better.files.* import org.gradle.tooling.{GradleConnector, ProjectConnection} import org.gradle.tooling.model.GradleProject import org.gradle.tooling.model.build.BuildEnvironment @@ -10,7 +10,7 @@ import java.io.ByteArrayOutputStream import java.nio.file.{Files, Path} import java.io.{File => JFile} import java.util.stream.Collectors -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.{Failure, Random, Success, Try, Using} case class GradleProjectInfo(gradleVersion: String, tasks: Seq[String], hasAndroidSubproject: Boolean = false) { diff --git a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/MavenDependencies.scala b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/MavenDependencies.scala index c5bd5df9040e..4594359e9a31 100644 --- a/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/MavenDependencies.scala +++ b/joern-cli/frontends/x2cpg/src/main/scala/io/joern/x2cpg/utils/dependency/MavenDependencies.scala @@ -9,8 +9,23 @@ import scala.util.{Failure, Success} object MavenDependencies { private val logger = LoggerFactory.getLogger(getClass) + private val MavenCliOpts = "MAVEN_CLI_OPTS" + // we can't use -Dmdep.outputFile because that keeps overwriting its own output for each sub-project it's running for + // also separate this from fetchCommandWithOpts to log a version that clearly separates options we provide from + // options specified by the user via the MAVEN_CLI_OPTS environment variable, while also making it clear that this + // environment variable is being considered. private val fetchCommand = - "mvn --fail-never -B dependency:build-classpath -DincludeScope=compile -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Dorg.slf4j.simpleLogger.logFile=System.out" + s"mvn $$$MavenCliOpts --fail-never -B dependency:build-classpath -DincludeScope=compile -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Dorg.slf4j.simpleLogger.logFile=System.out" + + private val fetchCommandWithOpts = { + // These options suppress output, so if they're provided we won't get any results. + // "-q" and "--quiet" are the only ones that would realistically be used. + val optionsToStrip = Set("-h", "--help", "-q", "--quiet", "-v", "--version") + + val mavenOpts = Option(System.getenv(MavenCliOpts)).getOrElse("") + val mavenOptsStripped = mavenOpts.split(raw"\s").filterNot(optionsToStrip.contains).mkString(" ") + fetchCommand.replace(s"$$$MavenCliOpts", mavenOptsStripped) + } private def logErrors(output: String): Unit = { @@ -25,8 +40,7 @@ object MavenDependencies { } private[dependency] def get(projectDir: Path): Option[collection.Seq[String]] = { - // we can't use -Dmdep.outputFile because that keeps overwriting its own output for each sub-project it's running for - val lines = ExternalCommand.run(fetchCommand, projectDir.toString) match { + val lines = ExternalCommand.run(fetchCommandWithOpts, projectDir.toString) match { case Success(lines) => if (lines.contains("[INFO] Build failures were ignored.")) { logErrors(lines.mkString(System.lineSeparator())) diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/AstTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/AstTests.scala index 86fbb6c1860c..15dbf7497572 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/AstTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/AstTests.scala @@ -1,9 +1,9 @@ package io.joern.x2cpg -import io.shiftleft.codepropertygraph.generated.nodes.{AstNodeNew, NewCall, NewClosureBinding, NewIdentifier} +import flatgraph.SchemaViolationException +import io.shiftleft.codepropertygraph.generated.nodes.{AstNodeNew, Call, NewCall, NewClosureBinding, NewIdentifier} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb.SchemaViolationException class AstTests extends AnyWordSpec with Matchers { @@ -35,7 +35,7 @@ class AstTests extends AnyWordSpec with Matchers { copied.root match { case Some(root: NewCall) => root should not be Some(moo) - root.properties("NAME") shouldBe "moo" + root.properties(Call.PropertyNames.Name) shouldBe "moo" root.argumentIndex shouldBe 123 case _ => fail() } diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/SourceFilesTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/SourceFilesTests.scala index 2ebc2ffab906..cddfdd11d2e6 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/SourceFilesTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/SourceFilesTests.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg -import better.files._ +import better.files.* import io.joern.x2cpg.utils.IgnoreInWindows import io.shiftleft.utils.ProjectRoot import org.scalatest.matchers.should.Matchers @@ -8,7 +8,7 @@ import org.scalatest.wordspec.AnyWordSpec import org.scalatest.Inside import java.nio.file.attribute.PosixFilePermissions -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.Try import java.io.FileNotFoundException @@ -53,6 +53,24 @@ class SourceFilesTests extends AnyWordSpec with Matchers with Inside { } + "do not throw an exception" when { + "one of the input files is a broken symlink" in { + File.usingTemporaryDirectory() { tmpDir => + (tmpDir / "a.c").touch() + val symlink = (tmpDir / "broken.c").symbolicLinkTo(File("does/not/exist.c")) + symlink.exists shouldBe false + symlink.isReadable shouldBe false + val ignored = (tmpDir / "ignored.c").touch() + val result = Try( + SourceFiles + .determine(tmpDir.canonicalPath, cSourceFileExtensions, ignoredFilesPath = Some(Seq(ignored.pathAsString))) + ) + result.isFailure shouldBe false + result.getOrElse(List.empty).size shouldBe 1 + } + } + } + "throw an exception" when { "the input file does not exist" in { diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/X2CpgTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/X2CpgTests.scala index 18ea217c43ef..7c9acf560a51 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/X2CpgTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/X2CpgTests.scala @@ -12,8 +12,7 @@ class X2CpgTests extends AnyWordSpec with Matchers { "create an empty in-memory CPG when no output path is given" in { val cpg = X2Cpg.newEmptyCpg(None) - cpg.graph.V.hasNext shouldBe false - cpg.graph.E.hasNext shouldBe false + cpg.graph.allNodes.hasNext shouldBe false cpg.close() } @@ -22,9 +21,9 @@ class X2CpgTests extends AnyWordSpec with Matchers { file.delete() file.exists shouldBe false val cpg = X2Cpg.newEmptyCpg(Some(file.path.toString)) + cpg.close() file.exists shouldBe true Files.size(file.path) should not be 0 - cpg.close() } "overwrite existing file to create empty CPG" in { @@ -32,11 +31,10 @@ class X2CpgTests extends AnyWordSpec with Matchers { file.exists shouldBe true Files.size(file.path) shouldBe 0 val cpg = X2Cpg.newEmptyCpg(Some(file.path.toString)) - cpg.graph.V.hasNext shouldBe false - cpg.graph.E.hasNext shouldBe false + cpg.graph.allNodes.hasNext shouldBe false + cpg.close() file.exists shouldBe true Files.size(file.path) should not be 0 - cpg.close() } } } diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/datastructures/ProgramSummaryTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/datastructures/ProgramSummaryTests.scala index 4da074066303..21e6c96dc6aa 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/datastructures/ProgramSummaryTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/datastructures/ProgramSummaryTests.scala @@ -31,7 +31,7 @@ class ProgramSummaryTests extends AnyWordSpec with Matchers with Inside { List.empty ) - val mockSummary = SummaryImpl(Map("io.joern" -> Set(mockTyp))) + val mockSummary = SummaryImpl(mutable.Map("io.joern" -> mutable.Set(mockTyp))) "provide the types within a given namespace" in { inside(mockSummary.typesUnderNamespace("io.joern").toList) { @@ -88,7 +88,7 @@ class ProgramSummaryTests extends AnyWordSpec with Matchers with Inside { val mockTyp = Typ("foo.py:", List.empty, List(Field("a", "__builtin.int"))) - val mockSummary = SummaryImpl(Map("foo.py" -> Set(mockTyp))) + val mockSummary = SummaryImpl(mutable.Map("foo.py" -> mutable.Set(mockTyp))) "successfully resolve a module variable if its imported by a known module" in { /* @@ -106,8 +106,8 @@ class ProgramSummaryTests extends AnyWordSpec with Matchers with Inside { } - class SummaryImpl(initMap: Map[String, Set[Typ]]) extends ProgramSummary[Typ] { - override protected val namespaceToType = Map.from(initMap) + class SummaryImpl(initMap: mutable.Map[String, mutable.Set[Typ]]) extends ProgramSummary[Typ, Method, Field] { + override protected val namespaceToType: mutable.Map[String, mutable.Set[Typ]] = mutable.Map.from(initMap) } case class NamespaceScope(fullName: String) extends NamespaceLikeScope diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorFrontierTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorFrontierTests.scala index 9b4d4e59c4d5..eadfe3f51682 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorFrontierTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorFrontierTests.scala @@ -1,48 +1,62 @@ package io.joern.x2cpg.passes -import io.shiftleft.OverflowDbTestInstance +import flatgraph.misc.TestUtils.* import io.joern.x2cpg.passes.controlflow.cfgdominator.{CfgAdapter, CfgDominator, CfgDominatorFrontier, DomTreeAdapter} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes} +import io.shiftleft.codepropertygraph.generated.nodes.{NewUnknown, StoredNode} +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ - -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class CfgDominatorFrontierTests extends AnyWordSpec with Matchers { - private class TestCfgAdapter extends CfgAdapter[Node] { - override def successors(node: Node): IterableOnce[Node] = - node.out("CFG").asScala + private class TestCfgAdapter extends CfgAdapter[StoredNode] { + override def successors(node: StoredNode): Iterator[StoredNode] = + node.out("CFG").cast[StoredNode] - override def predecessors(node: Node): IterableOnce[Node] = - node.in("CFG").asScala + override def predecessors(node: StoredNode): Iterator[StoredNode] = + node.in("CFG").cast[StoredNode] } - private class TestDomTreeAdapter(immediateDominators: scala.collection.Map[Node, Node]) extends DomTreeAdapter[Node] { - override def immediateDominator(cfgNode: Node): Option[Node] = { + private class TestDomTreeAdapter(immediateDominators: scala.collection.Map[StoredNode, StoredNode]) + extends DomTreeAdapter[StoredNode] { + override def immediateDominator(cfgNode: StoredNode): Option[StoredNode] = { immediateDominators.get(cfgNode) } } "Cfg dominance frontier test" in { - val graph = OverflowDbTestInstance.create - - val v0 = graph + "UNKNOWN" - val v1 = graph + "UNKNOWN" - val v2 = graph + "UNKNOWN" - val v3 = graph + "UNKNOWN" - val v4 = graph + "UNKNOWN" - val v5 = graph + "UNKNOWN" - val v6 = graph + "UNKNOWN" - - v0 --- "CFG" --> v1 - v1 --- "CFG" --> v2 - v2 --- "CFG" --> v3 - v2 --- "CFG" --> v5 - v3 --- "CFG" --> v4 - v4 --- "CFG" --> v2 - v4 --- "CFG" --> v5 - v5 --- "CFG" --> v6 + val cpg = Cpg.empty + val graph = cpg.graph + + val v0 = graph.addNode(NewUnknown()) + val v1 = graph.addNode(NewUnknown()) + val v2 = graph.addNode(NewUnknown()) + val v3 = graph.addNode(NewUnknown()) + val v4 = graph.addNode(NewUnknown()) + val v5 = graph.addNode(NewUnknown()) + val v6 = graph.addNode(NewUnknown()) + + // TODO MP get arrow syntax back +// v0 --- "CFG" --> v1 +// v1 --- "CFG" --> v2 +// v2 --- "CFG" --> v3 +// v2 --- "CFG" --> v5 +// v3 --- "CFG" --> v4 +// v4 --- "CFG" --> v2 +// v4 --- "CFG" --> v5 +// v5 --- "CFG" --> v6 + graph.applyDiff { diffGraphBuilder => + diffGraphBuilder.addEdge(v0, v1, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v1, v2, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v2, v3, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v2, v5, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v3, v4, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v4, v2, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v4, v5, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v5, v6, EdgeTypes.CFG) + } val cfgAdapter = new TestCfgAdapter val cfgDominatorCalculator = new CfgDominator(cfgAdapter) @@ -50,7 +64,7 @@ class CfgDominatorFrontierTests extends AnyWordSpec with Matchers { val domTreeAdapter = new TestDomTreeAdapter(immediateDominators) val cfgDominatorFrontier = new CfgDominatorFrontier(cfgAdapter, domTreeAdapter) - val dominanceFrontier = cfgDominatorFrontier.calculate(graph.nodes.asScala.toList) + val dominanceFrontier = cfgDominatorFrontier.calculate(cpg.all) dominanceFrontier.get(v0) shouldBe None dominanceFrontier.get(v1) shouldBe None @@ -62,14 +76,20 @@ class CfgDominatorFrontierTests extends AnyWordSpec with Matchers { } "Cfg domiance frontier with dead code test" in { - val graph = OverflowDbTestInstance.create - - val v0 = graph + "UNKNOWN" - val v1 = graph + "UNKNOWN" // This node simulates dead code as it is not reachable from the entry v0. - val v2 = graph + "UNKNOWN" - - v0 --- "CFG" --> v2 - v1 --- "CFG" --> v2 + val cpg = Cpg.empty + val graph = cpg.graph + + val v0 = graph.addNode(NewUnknown()) + val v1 = graph.addNode(NewUnknown()) // This node simulates dead code as it is not reachable from the entry v0. + val v2 = graph.addNode(NewUnknown()) + + // TODO MP get arrow syntax back +// v0 --- "CFG" --> v2 +// v1 --- "CFG" --> v2 + graph.applyDiff { diffGraphBuilder => + diffGraphBuilder.addEdge(v0, v2, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v1, v2, EdgeTypes.CFG) + } val cfgAdapter = new TestCfgAdapter val cfgDominatorCalculator = new CfgDominator(cfgAdapter) @@ -77,7 +97,7 @@ class CfgDominatorFrontierTests extends AnyWordSpec with Matchers { val domTreeAdapter = new TestDomTreeAdapter(immediateDominators) val cfgDominatorFrontier = new CfgDominatorFrontier(cfgAdapter, domTreeAdapter) - val dominanceFrontier = cfgDominatorFrontier.calculate(graph.nodes.asScala.toList) + val dominanceFrontier = cfgDominatorFrontier.calculate(cpg.all) dominanceFrontier.get(v0) shouldBe None dominanceFrontier.apply(v1) shouldBe Set(v2) diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorPassTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorPassTests.scala index 0dbe34f61dd5..1b5b615676ea 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorPassTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/CfgDominatorPassTests.scala @@ -1,80 +1,93 @@ package io.joern.x2cpg.passes -import io.shiftleft.OverflowDbTestInstance -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes} +import flatgraph.misc.TestUtils.* import io.joern.x2cpg.passes.controlflow.cfgdominator.CfgDominatorPass +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes} +import io.shiftleft.codepropertygraph.generated.nodes.{NewMethod, NewMethodReturn, NewUnknown} +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class CfgDominatorPassTests extends AnyWordSpec with Matchers { "Have correct DOMINATE/POST_DOMINATE edges after CfgDominatorPass run." in { - val graph = OverflowDbTestInstance.create - val cpg = new Cpg(graph) + val cpg = Cpg.empty + val graph = cpg.graph - val v0 = graph + NodeTypes.METHOD - val v1 = graph + NodeTypes.UNKNOWN - val v2 = graph + NodeTypes.UNKNOWN - val v3 = graph + NodeTypes.UNKNOWN - val v4 = graph + NodeTypes.UNKNOWN - val v5 = graph + NodeTypes.UNKNOWN - val v6 = graph + NodeTypes.METHOD_RETURN + val v0 = graph.addNode(NewMethod()) + val v1 = graph.addNode(NewUnknown()) + val v2 = graph.addNode(NewUnknown()) + val v3 = graph.addNode(NewUnknown()) + val v4 = graph.addNode(NewUnknown()) + val v5 = graph.addNode(NewUnknown()) + val v6 = graph.addNode(NewMethodReturn()) - v0 --- EdgeTypes.AST --> v6 + // TODO MP get arrow syntax back +// v0 --- EdgeTypes.AST --> v6 +// +// v0 --- EdgeTypes.CFG --> v1 +// v1 --- EdgeTypes.CFG --> v2 +// v2 --- EdgeTypes.CFG --> v3 +// v2 --- EdgeTypes.CFG --> v5 +// v3 --- EdgeTypes.CFG --> v4 +// v4 --- EdgeTypes.CFG --> v2 +// v4 --- EdgeTypes.CFG --> v5 +// v5 --- EdgeTypes.CFG --> v6 + graph.applyDiff { diffGraphBuilder => + diffGraphBuilder.addEdge(v0, v6, EdgeTypes.AST) - v0 --- EdgeTypes.CFG --> v1 - v1 --- EdgeTypes.CFG --> v2 - v2 --- EdgeTypes.CFG --> v3 - v2 --- EdgeTypes.CFG --> v5 - v3 --- EdgeTypes.CFG --> v4 - v4 --- EdgeTypes.CFG --> v2 - v4 --- EdgeTypes.CFG --> v5 - v5 --- EdgeTypes.CFG --> v6 + diffGraphBuilder.addEdge(v0, v1, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v1, v2, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v2, v3, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v2, v5, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v3, v4, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v4, v5, EdgeTypes.CFG) + diffGraphBuilder.addEdge(v5, v6, EdgeTypes.CFG) + } val dominatorTreePass = new CfgDominatorPass(cpg) dominatorTreePass.createAndApply() - val v0Dominates = v0.out(EdgeTypes.DOMINATE).asScala.toList + val v0Dominates = v0.out(EdgeTypes.DOMINATE).l v0Dominates.size shouldBe 1 v0Dominates.toSet shouldBe Set(v1) - val v1Dominates = v1.out(EdgeTypes.DOMINATE).asScala.toList + val v1Dominates = v1.out(EdgeTypes.DOMINATE).l v1Dominates.size shouldBe 1 v1Dominates.toSet shouldBe Set(v2) - val v2Dominates = v2.out(EdgeTypes.DOMINATE).asScala.toList + val v2Dominates = v2.out(EdgeTypes.DOMINATE).l v2Dominates.size shouldBe 2 v2Dominates.toSet shouldBe Set(v3, v5) - val v3Dominates = v3.out(EdgeTypes.DOMINATE).asScala.toList + val v3Dominates = v3.out(EdgeTypes.DOMINATE).l v3Dominates.size shouldBe 1 v3Dominates.toSet shouldBe Set(v4) - val v4Dominates = v4.out(EdgeTypes.DOMINATE).asScala.toList + val v4Dominates = v4.out(EdgeTypes.DOMINATE).l v4Dominates.size shouldBe 0 - val v5Dominates = v5.out(EdgeTypes.DOMINATE).asScala.toList + val v5Dominates = v5.out(EdgeTypes.DOMINATE).l v5Dominates.size shouldBe 1 v5Dominates.toSet shouldBe Set(v6) - val v6Dominates = v6.out(EdgeTypes.DOMINATE).asScala.toList + val v6Dominates = v6.out(EdgeTypes.DOMINATE).l v6Dominates.size shouldBe 0 - val v6PostDominates = v6.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v6PostDominates = v6.out(EdgeTypes.POST_DOMINATE).l v6PostDominates.size shouldBe 1 v6PostDominates.toSet shouldBe Set(v5) - val v5PostDominates = v5.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v5PostDominates = v5.out(EdgeTypes.POST_DOMINATE).l v5PostDominates.size shouldBe 2 v5PostDominates.toSet shouldBe Set(v2, v4) - val v4PostDominates = v4.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v4PostDominates = v4.out(EdgeTypes.POST_DOMINATE).l v4PostDominates.size shouldBe 1 v4PostDominates.toSet shouldBe Set(v3) - val v3PostDominates = v3.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v3PostDominates = v3.out(EdgeTypes.POST_DOMINATE).l v3PostDominates.size shouldBe 0 - val v2PostDominates = v2.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v2PostDominates = v2.out(EdgeTypes.POST_DOMINATE).l v2PostDominates.size shouldBe 1 v2PostDominates.toSet shouldBe Set(v1) - val v1PostDominates = v1.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v1PostDominates = v1.out(EdgeTypes.POST_DOMINATE).l v1PostDominates.size shouldBe 1 v1PostDominates.toSet shouldBe Set(v0) - val v0PostDominates = v0.out(EdgeTypes.POST_DOMINATE).asScala.toList + val v0PostDominates = v0.out(EdgeTypes.POST_DOMINATE).l v0PostDominates.size shouldBe 0 } } diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/ContainsEdgePassTest.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/ContainsEdgePassTest.scala index 91d0330873e3..ba049a318622 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/ContainsEdgePassTest.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/ContainsEdgePassTest.scala @@ -1,14 +1,13 @@ package io.joern.x2cpg.passes -import io.shiftleft.OverflowDbTestInstance -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes, NodeTypes} +import flatgraph.misc.TestUtils.* import io.joern.x2cpg.passes.base.ContainsEdgePass +import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewFile, NewMethod, NewTypeDecl} +import io.shiftleft.codepropertygraph.generated.{Cpg, EdgeTypes} +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ - -import scala.jdk.CollectionConverters._ class ContainsEdgePassTest extends AnyWordSpec with Matchers { @@ -16,26 +15,26 @@ class ContainsEdgePassTest extends AnyWordSpec with Matchers { "Files " can { "contain Methods" in Fixture { fixture => - fixture.methodVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.fileVertex) + fixture.methodVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.fileVertex) } "contain Classes" in Fixture { fixture => - fixture.typeDeclVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.fileVertex) + fixture.typeDeclVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.fileVertex) } } "Classes " can { "contain Methods" in Fixture { fixture => - fixture.typeMethodVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.typeDeclVertex) + fixture.typeMethodVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.typeDeclVertex) } } "Methods " can { "contain Methods" in Fixture { fixture => - fixture.innerMethodVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.methodVertex) + fixture.innerMethodVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.methodVertex) } "contain expressions" in Fixture { fixture => - fixture.expressionVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.methodVertex) - fixture.innerExpressionVertex.in(EdgeTypes.CONTAINS).asScala.toList shouldBe List(fixture.innerMethodVertex) + fixture.expressionVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.methodVertex) + fixture.innerExpressionVertex.in(EdgeTypes.CONTAINS).l shouldBe List(fixture.innerMethodVertex) } } @@ -43,23 +42,34 @@ class ContainsEdgePassTest extends AnyWordSpec with Matchers { object ContainsEdgePassTest { private class Fixture { - private val graph = OverflowDbTestInstance.create + private val cpg = Cpg.empty + private val graph = cpg.graph - val fileVertex = graph + NodeTypes.FILE - val typeDeclVertex = graph + NodeTypes.TYPE_DECL - val typeMethodVertex = graph + NodeTypes.METHOD - val methodVertex = graph + NodeTypes.METHOD - val innerMethodVertex = graph + NodeTypes.METHOD - val expressionVertex = graph + NodeTypes.CALL - val innerExpressionVertex = graph + NodeTypes.CALL + val fileVertex = graph.addNode(NewFile()) + val typeDeclVertex = graph.addNode(NewTypeDecl()) + val typeMethodVertex = graph.addNode(NewMethod()) + val methodVertex = graph.addNode(NewMethod()) + val innerMethodVertex = graph.addNode(NewMethod()) + val expressionVertex = graph.addNode(NewCall()) + val innerExpressionVertex = graph.addNode(NewCall()) - fileVertex --- EdgeTypes.AST --> typeDeclVertex - typeDeclVertex --- EdgeTypes.AST --> typeMethodVertex + // TODO MP get arrow syntax back +// fileVertex --- EdgeTypes.AST --> typeDeclVertex +// typeDeclVertex --- EdgeTypes.AST --> typeMethodVertex +// +// fileVertex --- EdgeTypes.AST --> methodVertex +// methodVertex --- EdgeTypes.AST --> innerMethodVertex +// methodVertex --- EdgeTypes.AST --> expressionVertex +// innerMethodVertex --- EdgeTypes.AST --> innerExpressionVertex + graph.applyDiff { diffGraphBuilder => + diffGraphBuilder.addEdge(fileVertex, typeDeclVertex, EdgeTypes.AST) + diffGraphBuilder.addEdge(typeDeclVertex, typeMethodVertex, EdgeTypes.AST) - fileVertex --- EdgeTypes.AST --> methodVertex - methodVertex --- EdgeTypes.AST --> innerMethodVertex - methodVertex --- EdgeTypes.AST --> expressionVertex - innerMethodVertex --- EdgeTypes.AST --> innerExpressionVertex + diffGraphBuilder.addEdge(fileVertex, methodVertex, EdgeTypes.AST) + diffGraphBuilder.addEdge(methodVertex, innerMethodVertex, EdgeTypes.AST) + diffGraphBuilder.addEdge(methodVertex, expressionVertex, EdgeTypes.AST) + diffGraphBuilder.addEdge(innerMethodVertex, innerExpressionVertex, EdgeTypes.AST) + } val containsEdgeCalculator = new ContainsEdgePass(new Cpg(graph)) containsEdgeCalculator.createAndApply() diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MemberAccessLinkerTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MemberAccessLinkerTests.scala index cf9a848532ef..208e89d2850c 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MemberAccessLinkerTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MemberAccessLinkerTests.scala @@ -1,8 +1,8 @@ package io.joern.x2cpg.passes -import io.shiftleft.codepropertygraph.generated._ +import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.{NewCall, NewMember} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MethodDecoratorPassTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MethodDecoratorPassTests.scala index 7c70420d8a07..6977bd1456cb 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MethodDecoratorPassTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/MethodDecoratorPassTests.scala @@ -1,30 +1,32 @@ package io.joern.x2cpg.passes -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes.MethodParameterIn +import flatgraph.misc.TestUtils.* +import io.shiftleft.codepropertygraph.generated.* +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.joern.x2cpg.passes.base.MethodDecoratorPass import io.joern.x2cpg.testfixtures.EmptyGraphFixture import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ class MethodDecoratorPassTests extends AnyWordSpec with Matchers { "MethodDecoratorTest" in EmptyGraphFixture { graph => - val method = graph + NodeTypes.METHOD - val parameterIn = graph - .+( - NodeTypes.METHOD_PARAMETER_IN, - Properties.CODE -> "p1", - Properties.ORDER -> 1, - Properties.NAME -> "p1", - Properties.EVALUATION_STRATEGY -> EvaluationStrategies.BY_REFERENCE, - Properties.TYPE_FULL_NAME -> "some.Type", - Properties.LINE_NUMBER -> 10 - ) - .asInstanceOf[MethodParameterIn] + val method = graph.addNode(NewMethod()) + val parameterIn = graph.addNode( + NewMethodParameterIn() + .code("p1") + .order(1) + .name("p1") + .evaluationStrategy(EvaluationStrategies.BY_REFERENCE) + .typeFullName("some.Type") + .lineNumber(10) + ) - method --- EdgeTypes.AST --> parameterIn + // TODO MP get arrow syntax back +// method --- EdgeTypes.AST --> parameterIn + graph.applyDiff { diffGraphBuilder => + diffGraphBuilder.addEdge(method, parameterIn, EdgeTypes.AST) + } val methodDecorator = new MethodDecoratorPass(new Cpg(graph)) methodDecorator.createAndApply() diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/NamespaceCreatorTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/NamespaceCreatorTests.scala index b2996f8e8860..2f22f3c62b2e 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/NamespaceCreatorTests.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/passes/NamespaceCreatorTests.scala @@ -1,22 +1,22 @@ package io.joern.x2cpg.passes -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.{NodeTypes, Properties} -import io.shiftleft.semanticcpg.language._ +import flatgraph.misc.TestUtils.addNode +import io.shiftleft.codepropertygraph.generated.{Cpg, NodeTypes} +import io.shiftleft.semanticcpg.language.* import io.joern.x2cpg.passes.base.NamespaceCreator import io.joern.x2cpg.testfixtures.EmptyGraphFixture +import io.shiftleft.codepropertygraph.generated.nodes.NewNamespaceBlock import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb._ class NamespaceCreatorTests extends AnyWordSpec with Matchers { "NamespaceCreateor test " in EmptyGraphFixture { graph => val cpg = new Cpg(graph) - val block1 = graph + (NodeTypes.NAMESPACE_BLOCK, Properties.NAME -> "namespace1") - val block2 = graph + (NodeTypes.NAMESPACE_BLOCK, Properties.NAME -> "namespace1") - val block3 = graph + (NodeTypes.NAMESPACE_BLOCK, Properties.NAME -> "namespace2") + val block1 = graph.addNode(NewNamespaceBlock().name("namespace1")) + val block2 = graph.addNode(NewNamespaceBlock().name("namespace1")) + val block3 = graph.addNode(NewNamespaceBlock().name("namespace2")) - val namespaceCreator = new NamespaceCreator(new Cpg(graph)) + val namespaceCreator = new NamespaceCreator(cpg) namespaceCreator.createAndApply() val namespaces = cpg.namespace.l diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/CfgTestFixture.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/CfgTestFixture.scala index 75cb0a749270..b8292db40bb4 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/CfgTestFixture.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/CfgTestFixture.scala @@ -2,9 +2,9 @@ package io.joern.x2cpg.testfixtures import io.joern.x2cpg.passes.controlflow.CfgCreationPass import io.joern.x2cpg.passes.controlflow.cfgcreation.Cfg.CfgEdgeType -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{CfgNode, Method} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* abstract class CfgTestCpg extends TestCpg { override protected def applyPasses(): Unit = { @@ -30,7 +30,7 @@ class CfgTestFixture[T <: CfgTestCpg](testCpgFactory: () => T) extends Code2CpgF ExpectationInfo(pair._1, pair._2, pair._3) } - def expected(pairs: ExpectationInfo*)(implicit cpg: Cpg): Set[String] = { + def expected(pairs: ExpectationInfo*)(implicit cpg: Cpg): List[String] = { pairs.map { case ExpectationInfo(code, index, _) => cpg.method.ast.isCfgNode.toVector .collect { @@ -38,11 +38,11 @@ class CfgTestFixture[T <: CfgTestCpg](testCpgFactory: () => T) extends Code2CpgF } .lift(index) .getOrElse(fail(s"No node found for code = '$code' and index '$index'!")) - }.toSet + }.toList } // index is zero based and describes which node to take if multiple node match the code string. - def succOf(code: String, index: Int = 0)(implicit cpg: Cpg): Set[String] = { + def succOf(code: String, index: Int = 0)(implicit cpg: Cpg): List[String] = { cpg.method.ast.isCfgNode.toVector .collect { case node if matchCode(node, code) => node @@ -52,10 +52,10 @@ class CfgTestFixture[T <: CfgTestCpg](testCpgFactory: () => T) extends Code2CpgF ._cfgOut .cast[CfgNode] .code - .toSetImmutable + .toList } - def succOf(code: String, nodeType: String)(implicit cpg: Cpg): Set[String] = { + def succOf(code: String, nodeType: String)(implicit cpg: Cpg): List[String] = { cpg.method.ast.isCfgNode .label(nodeType) .toVector @@ -66,6 +66,6 @@ class CfgTestFixture[T <: CfgTestCpg](testCpgFactory: () => T) extends Code2CpgF ._cfgOut .cast[CfgNode] .code - .toSetImmutable + .toList } } diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/EmptyGraphFixture.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/EmptyGraphFixture.scala index 4a378c095580..36c6dcb2c481 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/EmptyGraphFixture.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/EmptyGraphFixture.scala @@ -1,12 +1,11 @@ package io.joern.x2cpg.testfixtures -import io.shiftleft.OverflowDbTestInstance -import overflowdb.Graph +import flatgraph.Graph +import io.shiftleft.codepropertygraph.generated.Cpg + +import scala.util.Using object EmptyGraphFixture { - def apply[T](fun: Graph => T): T = { - val graph = OverflowDbTestInstance.create - try fun(graph) - finally { graph.close() } - } + def apply[T](fun: Graph => T): T = + Using.resource(Cpg.empty.graph)(fun) } diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/LanguageFrontend.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/LanguageFrontend.scala index 86a37a82733e..3609204de348 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/LanguageFrontend.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/LanguageFrontend.scala @@ -1,6 +1,6 @@ package io.joern.x2cpg.testfixtures -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.io.File import io.joern.x2cpg.X2CpgConfig diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/TestCpg.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/TestCpg.scala index 4115843a8c5f..7dac8f7b7bee 100644 --- a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/TestCpg.scala +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/testfixtures/TestCpg.scala @@ -1,9 +1,9 @@ package io.joern.x2cpg.testfixtures +import flatgraph.Graph import io.joern.x2cpg.X2CpgConfig import io.joern.x2cpg.utils.TestCodeWriter -import io.shiftleft.codepropertygraph.Cpg -import overflowdb.Graph +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.{Files, Path} import java.util.Comparator @@ -11,7 +11,7 @@ import java.util.Comparator // Lazily populated test CPG which is created upon first access to the underlying graph. // The trait LanguageFrontend is mixed in and not property/field of this class in order // to allow the configuration of language frontend specific properties on the CPG object. -abstract class TestCpg extends Cpg() with LanguageFrontend with TestCodeWriter { +abstract class TestCpg extends Cpg(Cpg.empty.graph) with LanguageFrontend with TestCodeWriter { private var _graph = Option.empty[Graph] protected var _withPostProcessing = false diff --git a/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/utils/KeyPoolTests.scala b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/utils/KeyPoolTests.scala new file mode 100644 index 000000000000..4815c4827332 --- /dev/null +++ b/joern-cli/frontends/x2cpg/src/test/scala/io/joern/x2cpg/utils/KeyPoolTests.scala @@ -0,0 +1,74 @@ +package io.joern.x2cpg.utils + +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpec + +class KeyPoolTests extends AnyWordSpec with Matchers { + + "IntervalKeyPool" should { + "return [first, ..., last] and then raise" in { + val keyPool = new IntervalKeyPool(10, 19) + List.range(0, 10).map(_ => keyPool.next) shouldBe List.range(10, 20) + assertThrows[RuntimeException] { keyPool.next } + assertThrows[RuntimeException] { keyPool.next } + } + + "allow splitting into multiple pools" in { + val keyPool = new IntervalKeyPool(1, 1000) + val pools = keyPool.split(11).toList + assertThrows[IllegalStateException] { keyPool.next } + pools.size shouldBe 11 + // Pools should all have the same size + pools + .map { x => + (x.last - x.first) + } + .distinct + .size shouldBe 1 + // Pools should be pairwise disjoint + val keySets = pools.map { x => + (x.first to x.last).toSet + } + keySets.combinations(2).foreach { + case List(x: Set[Long], y: Set[Long]) => + x.intersect(y).isEmpty shouldBe true + case _ => + fail() + } + } + + "return empty iterator when asked to create 0 partitions" in { + val keyPool = new IntervalKeyPool(1, 1000) + keyPool.split(0).hasNext shouldBe false + } + + } + + "SequenceKeyPool" should { + "return elements of sequence one by one and then raise" in { + val seq = List[Long](1, 2, 3) + val keyPool = new SequenceKeyPool(seq) + List.range(0, 3).map(_ => keyPool.next) shouldBe seq + assertThrows[RuntimeException] { keyPool.next } + assertThrows[RuntimeException] { keyPool.next } + } + } + + "KeyPoolCreator" should { + "split into n pools and honor minimum value" in { + val minValue = 10 + val pools = KeyPoolCreator.obtain(3, minValue) + pools.size shouldBe 3 + pools match { + case List(pool1, pool2, pool3) => + pool1.first shouldBe minValue + pool1.last should be < pool2.first + pool2.last should be < pool3.first + pool3.last shouldBe Long.MaxValue - 1 + case _ => fail() + } + } + + } + +} diff --git a/joern-cli/src/main/scala/io/joern/joerncli/CpgBasedTool.scala b/joern-cli/src/main/scala/io/joern/joerncli/CpgBasedTool.scala index 9b761603f1bd..274920f8a7d4 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/CpgBasedTool.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/CpgBasedTool.scala @@ -3,23 +3,24 @@ package io.joern.joerncli import better.files.File import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.cpgloading.CpgLoaderConfig +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.layers.LayerCreatorContext -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.cpgloading.CpgLoader object CpgBasedTool { + def loadFromFile(filename: String): Cpg = + CpgLoader.load(filename) + /** Load code property graph from overflowDB * * @param filename * name of the file that stores the CPG */ - def loadFromOdb(filename: String): Cpg = { - val odbConfig = overflowdb.Config.withDefaults().withStorageLocation(filename) - val config = CpgLoaderConfig().withOverflowConfig(odbConfig).doNotCreateIndexesOnLoad - io.shiftleft.codepropertygraph.cpgloading.CpgLoader.loadFromOverflowDb(config) - } + @deprecated("use `loadFromFile` instead", "joern v3") + def loadFromOdb(filename: String): Cpg = + loadFromFile(filename) /** Add the data flow layer to the CPG if it does not exist yet. */ diff --git a/joern-cli/src/main/scala/io/joern/joerncli/DefaultOverlays.scala b/joern-cli/src/main/scala/io/joern/joerncli/DefaultOverlays.scala index 40e508018e7b..3adc182a4eb3 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/DefaultOverlays.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/DefaultOverlays.scala @@ -2,8 +2,8 @@ package io.joern.joerncli import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.x2cpg.X2Cpg.applyDefaultOverlays -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.layers._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.layers.* object DefaultOverlays { @@ -16,7 +16,7 @@ object DefaultOverlays { * the filename of the cpg */ def create(storeFilename: String, maxNumberOfDefinitions: Int = defaultMaxNumberOfDefinitions): Cpg = { - val cpg = CpgBasedTool.loadFromOdb(storeFilename) + val cpg = CpgBasedTool.loadFromFile(storeFilename) applyDefaultOverlays(cpg) val context = new LayerCreatorContext(cpg) val options = new OssDataFlowOptions(maxNumberOfDefinitions) diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernExport.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernExport.scala index 031c9f4ec463..241893ff5a9a 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernExport.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernExport.scala @@ -2,21 +2,21 @@ package io.joern.joerncli import better.files.Dsl.* import better.files.File +import flatgraph.{Accessors, Edge, GNode} +import flatgraph.formats.ExportResult +import flatgraph.formats.dot.DotExporter +import flatgraph.formats.graphml.GraphMLExporter +import flatgraph.formats.graphson.GraphSONExporter +import flatgraph.formats.neo4jcsv.Neo4jCsvExporter import io.joern.dataflowengineoss.DefaultSemantics import io.joern.dataflowengineoss.layers.dataflows.* import io.joern.dataflowengineoss.semanticsloader.Semantics import io.joern.joerncli.CpgBasedTool.exitIfInvalid import io.joern.x2cpg.layers.* -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.NodeTypes -import io.shiftleft.semanticcpg.language.{toAstNodeMethods, toNodeTypeStarters} +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.layers.* -import overflowdb.formats.ExportResult -import overflowdb.formats.dot.DotExporter -import overflowdb.formats.graphml.GraphMLExporter -import overflowdb.formats.graphson.GraphSONExporter -import overflowdb.formats.neo4jcsv.Neo4jCsvExporter -import overflowdb.{Edge, Node} import java.nio.file.{Path, Paths} import scala.collection.mutable @@ -64,7 +64,7 @@ object JoernExport { exitIfInvalid(outDir, config.cpgFileName) mkdir(File(outDir)) - Using.resource(CpgBasedTool.loadFromOdb(config.cpgFileName)) { cpg => + Using.resource(CpgBasedTool.loadFromFile(config.cpgFileName)) { cpg => exportCpg(cpg, config.repr, config.format, Paths.get(outDir).toAbsolutePath) } } @@ -105,15 +105,15 @@ object JoernExport { format match { case Format.Dot if representation == Representation.All || representation == Representation.Cpg => - exportWithOdbFormat(cpg, representation, outDir, DotExporter) + exportWithFlatgraphFormat(cpg, representation, outDir, DotExporter) case Format.Dot => exportDot(representation, outDir, context) case Format.Neo4jCsv => - exportWithOdbFormat(cpg, representation, outDir, Neo4jCsvExporter) + exportWithFlatgraphFormat(cpg, representation, outDir, Neo4jCsvExporter) case Format.Graphml => - exportWithOdbFormat(cpg, representation, outDir, GraphMLExporter) + exportWithFlatgraphFormat(cpg, representation, outDir, GraphMLExporter) case Format.Graphson => - exportWithOdbFormat(cpg, representation, outDir, GraphSONExporter) + exportWithFlatgraphFormat(cpg, representation, outDir, GraphSONExporter) case other => throw new NotImplementedError(s"repr=$representation not yet supported for format=$format") } @@ -133,11 +133,11 @@ object JoernExport { } } - private def exportWithOdbFormat( + private def exportWithFlatgraphFormat( cpg: Cpg, repr: Representation.Value, outDir: Path, - exporter: overflowdb.formats.Exporter + exporter: flatgraph.formats.Exporter ): Unit = { val ExportResult(nodeCount, edgeCount, _, additionalInfo) = repr match { case Representation.All => @@ -154,7 +154,7 @@ object JoernExport { windowsFilenameDeduplicationHelper ) val outFileName = outDir.resolve(relativeFilename) - exporter.runExport(nodes, subGraph.edges, outFileName) + exporter.runExport(cpg.graph.schema, nodes, subGraph.edges, outFileName) } .reduce(plus) } else { @@ -220,12 +220,12 @@ object JoernExport { private def emptyExportResult = ExportResult(0, 0, Seq.empty, Option("Empty CPG")) - case class MethodSubGraph(methodName: String, methodFilename: String, nodes: Set[Node]) { + case class MethodSubGraph(methodName: String, methodFilename: String, nodes: Set[GNode]) { def edges: Set[Edge] = { for { node <- nodes - edge <- node.bothE.asScala - if nodes.contains(edge.inNode) && nodes.contains(edge.outNode) + edge <- Accessors.getEdgesOut(node) + if nodes.contains(edge.dst) } yield edge } } diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernFlow.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernFlow.scala index bd87eb773bcc..211bcd1ec0b4 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernFlow.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernFlow.scala @@ -4,7 +4,7 @@ import io.joern.dataflowengineoss.DefaultSemantics import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.{EngineConfig, EngineContext} import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.MethodParameterIn import io.shiftleft.semanticcpg.language.* @@ -28,7 +28,7 @@ object JoernFlow { } debugOut("Loading graph... ") - val cpg = CpgBasedTool.loadFromOdb(config.cpgFileName) + val cpg = CpgBasedTool.loadFromFile(config.cpgFileName) debugOut("[DONE]\n") implicit val resolver: ICallResolver = NoResolve diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernParse.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernParse.scala index 34e2ff7a2889..3173559d7e02 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernParse.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernParse.scala @@ -7,7 +7,7 @@ import io.joern.joerncli.CpgBasedTool.newCpgCreatedString import io.shiftleft.codepropertygraph.generated.Languages import scala.collection.mutable -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* import scala.util.{Failure, Success, Try} object JoernParse { diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernScan.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernScan.scala index c5728589c15a..5b7c2232f102 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernScan.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernScan.scala @@ -15,7 +15,7 @@ import java.io.PrintStream import org.json4s.native.Serialization import org.json4s.{Formats, NoTypeHints} import scala.collection.mutable -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* object JoernScanConfig { val defaultDbVersion: String = "latest" diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernSlice.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernSlice.scala index c84854e857a7..453d370eed5b 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernSlice.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernSlice.scala @@ -5,7 +5,7 @@ import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOpti import io.joern.joerncli.JoernParse.ParserConfig import io.joern.x2cpg.X2Cpg import io.joern.x2cpg.layers.Base -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.layers.LayerCreatorContext import scala.language.postfixOps @@ -122,7 +122,7 @@ object JoernSlice { } else { config.inputPath.pathAsString } - Using.resource(CpgBasedTool.loadFromOdb(inputCpgPath)) { cpg => + Using.resource(CpgBasedTool.loadFromFile(inputCpgPath)) { cpg => checkAndApplyOverlays(cpg) // Slice the CPG (config match { diff --git a/joern-cli/src/main/scala/io/joern/joerncli/JoernVectors.scala b/joern-cli/src/main/scala/io/joern/joerncli/JoernVectors.scala index e1deaf7bbfc7..d32bceb28f33 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/JoernVectors.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/JoernVectors.scala @@ -1,7 +1,7 @@ package io.joern.joerncli import io.joern.joerncli.CpgBasedTool.exitIfInvalid -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, Method} import io.shiftleft.semanticcpg.language.* @@ -15,11 +15,10 @@ import scala.util.hashing.MurmurHash3 class BagOfPropertiesForNodes extends EmbeddingGenerator[AstNode, (String, String)] { override def structureToString(pair: (String, String)): String = pair._1 + ":" + pair._2 - override def extractObjects(cpg: Cpg): Iterator[AstNode] = cpg.graph.V.collect { case x: AstNode => x } + override def extractObjects(cpg: Cpg): Iterator[AstNode] = cpg.astNode override def enumerateSubStructures(obj: AstNode): List[(String, String)] = { val relevantFieldTypes = Set(PropertyNames.NAME, PropertyNames.FULL_NAME, PropertyNames.CODE) - val relevantFields = obj - .propertiesMap() + val relevantFields = obj.propertiesMap .entrySet() .asScala .toList @@ -136,7 +135,7 @@ object JoernVectors { def main(args: Array[String]) = { parseConfig(args).foreach { config => exitIfInvalid(config.outDir, config.cpgFileName) - Using.resource(CpgBasedTool.loadFromOdb(config.cpgFileName)) { cpg => + Using.resource(CpgBasedTool.loadFromFile(config.cpgFileName)) { cpg => val generator = new BagOfPropertiesForNodes() val embedding = generator.embed(cpg) println("{") @@ -150,8 +149,8 @@ object JoernVectors { traversalToJson(embedding.vectors, generator.vectorToString) println(",\"edges\":") traversalToJson( - cpg.graph.edges().map { x => - Map("src" -> x.outNode().id(), "dst" -> x.inNode().id(), "label" -> x.label()) + cpg.graph.allEdges.map { edge => + Map("src" -> edge.src.id, "dst" -> edge.dst.id, "label" -> edge.label) }, generator.defaultToString ) diff --git a/joern-cli/src/main/scala/io/joern/joerncli/console/JoernConsole.scala b/joern-cli/src/main/scala/io/joern/joerncli/console/JoernConsole.scala index bd56e63ebf26..607e9a3074aa 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/console/JoernConsole.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/console/JoernConsole.scala @@ -1,13 +1,13 @@ package io.joern.joerncli.console -import better.files._ +import better.files.* import io.joern.console.defaultAvailableWidthProvider import io.joern.console.workspacehandling.{ProjectFile, WorkspaceLoader} import io.joern.console.{Console, ConsoleConfig, InstallConfig} import io.joern.dataflowengineoss.layers.dataflows.{OssDataFlow, OssDataFlowOptions} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path diff --git a/joern-cli/src/main/scala/io/joern/joerncli/console/JoernProject.scala b/joern-cli/src/main/scala/io/joern/joerncli/console/JoernProject.scala index 69ae2178d055..df1bd9fb86e9 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/console/JoernProject.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/console/JoernProject.scala @@ -3,7 +3,7 @@ package io.joern.joerncli.console import io.joern.console.workspacehandling.{Project, ProjectFile} import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import java.nio.file.Path diff --git a/joern-cli/src/main/scala/io/joern/joerncli/console/Predefined.scala b/joern-cli/src/main/scala/io/joern/joerncli/console/Predefined.scala index 41eace961e70..1a263145f0e3 100644 --- a/joern-cli/src/main/scala/io/joern/joerncli/console/Predefined.scala +++ b/joern-cli/src/main/scala/io/joern/joerncli/console/Predefined.scala @@ -6,26 +6,21 @@ object Predefined { val shared: Seq[String] = Seq( - "import _root_.io.joern.console._", - "import _root_.io.joern.joerncli.console.JoernConsole._", - "import _root_.io.shiftleft.codepropertygraph.Cpg", - "import _root_.io.shiftleft.codepropertygraph.Cpg.docSearchPackages", - "import _root_.io.shiftleft.codepropertygraph.cpgloading._", - "import _root_.io.shiftleft.codepropertygraph.generated._", - "import _root_.io.shiftleft.codepropertygraph.generated.nodes._", - "import _root_.io.shiftleft.codepropertygraph.generated.edges._", - "import _root_.io.joern.dataflowengineoss.language._", - "import _root_.io.shiftleft.semanticcpg.language._", - "import overflowdb._", - "import overflowdb.traversal.{`package` => _, help => _, _}", - "import scala.jdk.CollectionConverters._", + "import _root_.io.joern.console.*", + "import _root_.io.joern.joerncli.console.JoernConsole.*", + "import _root_.io.shiftleft.codepropertygraph.cpgloading.*", + "import _root_.io.shiftleft.codepropertygraph.generated.*", + "import _root_.io.shiftleft.codepropertygraph.generated.nodes.*", + "import _root_.io.joern.dataflowengineoss.language.*", + "import _root_.io.shiftleft.semanticcpg.language.*", + "import scala.jdk.CollectionConverters.*", "implicit val resolver: ICallResolver = NoResolve", "implicit val finder: NodeExtensionFinder = DefaultNodeExtensionFinder" ) val forInteractiveShell: Seq[String] = { shared ++ - Seq("import _root_.io.joern.joerncli.console.Joern._") ++ + Seq("import _root_.io.joern.joerncli.console.Joern.*") ++ Run.codeForRunCommand().linesIterator ++ Help.codeForHelpCommand(classOf[io.joern.joerncli.console.JoernConsole]).linesIterator ++ Seq("ossDataFlowOptions = opts.ossdataflow") diff --git a/joern-cli/src/test/scala/io/joern/joerncli/AbstractJoernCliTest.scala b/joern-cli/src/test/scala/io/joern/joerncli/AbstractJoernCliTest.scala index d676c372348d..aff10cdff24f 100644 --- a/joern-cli/src/test/scala/io/joern/joerncli/AbstractJoernCliTest.scala +++ b/joern-cli/src/test/scala/io/joern/joerncli/AbstractJoernCliTest.scala @@ -3,8 +3,9 @@ package io.joern.joerncli import better.files.File import io.joern.console.FrontendConfig import io.joern.console.cpgcreation.{CCpgGenerator, JsSrcCpgGenerator} -import io.joern.jssrc2cpg.{JsSrc2Cpg, Config as JsConfig} -import io.shiftleft.codepropertygraph.Cpg +import io.joern.x2cpg.frontendspecific.jssrc2cpg +import io.joern.x2cpg.passes.frontend.XTypeRecoveryConfig +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Languages import io.shiftleft.utils.ProjectRoot @@ -35,7 +36,7 @@ trait AbstractJoernCliTest { val cpg = DefaultOverlays.create(cpgOutFileName) language match { case Languages.JSSRC | Languages.JAVASCRIPT => - JsSrc2Cpg.postProcessingPasses(cpg, Option(JsConfig().withDisableDummyTypes(true))).foreach(_.createAndApply()) + jssrc2cpg.postProcessingPasses(cpg, XTypeRecoveryConfig(enabledDummyTypes = false)).foreach(_.createAndApply()) case _ => } (cpg, cpgOutFileName) diff --git a/joern-cli/src/test/scala/io/joern/joerncli/GenerationTests.scala b/joern-cli/src/test/scala/io/joern/joerncli/GenerationTests.scala index 6cf0a8e14e88..3f6ae67c4ba8 100644 --- a/joern-cli/src/test/scala/io/joern/joerncli/GenerationTests.scala +++ b/joern-cli/src/test/scala/io/joern/joerncli/GenerationTests.scala @@ -1,7 +1,7 @@ package io.joern.joerncli import better.files.File -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/joern-cli/src/test/scala/io/joern/joerncli/JoernExportTests.scala b/joern-cli/src/test/scala/io/joern/joerncli/JoernExportTests.scala index b5d80cee12d3..25ace38ed858 100644 --- a/joern-cli/src/test/scala/io/joern/joerncli/JoernExportTests.scala +++ b/joern-cli/src/test/scala/io/joern/joerncli/JoernExportTests.scala @@ -2,7 +2,7 @@ package io.joern.joerncli import better.files.File import io.joern.joerncli.JoernExport.Representation -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/joern-cli/src/universal/c2cpg.bat b/joern-cli/src/universal/c2cpg.bat index d8e199f42e28..711a6f5cea0f 100644 --- a/joern-cli/src/universal/c2cpg.bat +++ b/joern-cli/src/universal/c2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\c2cpg\bin\c2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/csharpsrc2cpg.bat b/joern-cli/src/universal/csharpsrc2cpg.bat index eb50669b254f..c44ec14837f1 100755 --- a/joern-cli/src/universal/csharpsrc2cpg.bat +++ b/joern-cli/src/universal/csharpsrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\csharpsrc2cpg\bin\csharpsrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* \ No newline at end of file +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* \ No newline at end of file diff --git a/joern-cli/src/universal/ghidra2cpg.bat b/joern-cli/src/universal/ghidra2cpg.bat index 44ec4c947417..bf08b309f00d 100644 --- a/joern-cli/src/universal/ghidra2cpg.bat +++ b/joern-cli/src/universal/ghidra2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\ghidra2cpg\bin\ghidra2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/gosrc2cpg.bat b/joern-cli/src/universal/gosrc2cpg.bat index c9e0c40ad6d2..d05ee50f2211 100644 --- a/joern-cli/src/universal/gosrc2cpg.bat +++ b/joern-cli/src/universal/gosrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\gosrc2cpg\bin\gosrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/javasrc2cpg.bat b/joern-cli/src/universal/javasrc2cpg.bat index 908070b2962d..73d00e7d37ee 100644 --- a/joern-cli/src/universal/javasrc2cpg.bat +++ b/joern-cli/src/universal/javasrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\javasrc2cpg\bin\javasrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/jimple2cpg.bat b/joern-cli/src/universal/jimple2cpg.bat index 23e2133fa9ce..f8201920ea69 100644 --- a/joern-cli/src/universal/jimple2cpg.bat +++ b/joern-cli/src/universal/jimple2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\jimple2cpg\bin\jimple2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-export.bat b/joern-cli/src/universal/joern-export.bat index cf1daf955456..73abe5537ce1 100644 --- a/joern-cli/src/universal/joern-export.bat +++ b/joern-cli/src/universal/joern-export.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-export.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-flow.bat b/joern-cli/src/universal/joern-flow.bat index a2ea5736d713..3f1faa21836a 100644 --- a/joern-cli/src/universal/joern-flow.bat +++ b/joern-cli/src/universal/joern-flow.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-flow.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-parse.bat b/joern-cli/src/universal/joern-parse.bat index 7bc476ca46c5..ad3f213da2d2 100644 --- a/joern-cli/src/universal/joern-parse.bat +++ b/joern-cli/src/universal/joern-parse.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-parse.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-scan.bat b/joern-cli/src/universal/joern-scan.bat index 6652e942ab31..9dad43faba68 100644 --- a/joern-cli/src/universal/joern-scan.bat +++ b/joern-cli/src/universal/joern-scan.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-scan.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-slice.bat b/joern-cli/src/universal/joern-slice.bat index 04dee0a0b93b..a666aa7b07b2 100644 --- a/joern-cli/src/universal/joern-slice.bat +++ b/joern-cli/src/universal/joern-slice.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-slice.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern-vectors.bat b/joern-cli/src/universal/joern-vectors.bat index f8a5cb60de49..941b4e452cc6 100644 --- a/joern-cli/src/universal/joern-vectors.bat +++ b/joern-cli/src/universal/joern-vectors.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\joern-vectors.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/joern.bat b/joern-cli/src/universal/joern.bat index f2f3f45b81e4..4e44be961e9e 100644 --- a/joern-cli/src/universal/joern.bat +++ b/joern-cli/src/universal/joern.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%bin\repl-bridge.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/jssrc2cpg.bat b/joern-cli/src/universal/jssrc2cpg.bat index 4cb85078a397..17e87b1314e6 100644 --- a/joern-cli/src/universal/jssrc2cpg.bat +++ b/joern-cli/src/universal/jssrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\jssrc2cpg\bin\jssrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/kotlin2cpg.bat b/joern-cli/src/universal/kotlin2cpg.bat index 8780bab737a3..c3b712e6d50e 100644 --- a/joern-cli/src/universal/kotlin2cpg.bat +++ b/joern-cli/src/universal/kotlin2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\kotlin2cpg\bin\kotlin2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/php2cpg.bat b/joern-cli/src/universal/php2cpg.bat index 0b7d783d148b..1e5596217580 100644 --- a/joern-cli/src/universal/php2cpg.bat +++ b/joern-cli/src/universal/php2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\php2cpg\bin\php2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/pysrc2cpg.bat b/joern-cli/src/universal/pysrc2cpg.bat index ff41316b8945..53ff47fe6a58 100644 --- a/joern-cli/src/universal/pysrc2cpg.bat +++ b/joern-cli/src/universal/pysrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\pysrc2cpg\bin\pysrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/rubysrc2cpg.bat b/joern-cli/src/universal/rubysrc2cpg.bat index df8eb21bc3dd..e191d640d419 100644 --- a/joern-cli/src/universal/rubysrc2cpg.bat +++ b/joern-cli/src/universal/rubysrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\rubysrc2cpg\bin\rubysrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-cli/src/universal/schema-extender/build.sbt b/joern-cli/src/universal/schema-extender/build.sbt index de0c357a1ccd..d11311d3f853 100644 --- a/joern-cli/src/universal/schema-extender/build.sbt +++ b/joern-cli/src/universal/schema-extender/build.sbt @@ -1,10 +1,10 @@ name := "schema-extender" -ThisBuild / scalaVersion := "3.4.1" +ThisBuild / scalaVersion := "3.4.2" val cpgVersion = IO.read(file("cpg-version")) -val generateDomainClasses = taskKey[Seq[File]]("generate overflowdb domain classes for our schema") +val generateDomainClasses = taskKey[Seq[File]]("generate domain classes for our schema") val joernInstallPath = settingKey[String]("path to joern installation, e.g. `/home/username/bin/joern/joern-cli` or `../../joern/joern-cli`") @@ -35,9 +35,9 @@ ThisBuild / resolvers += "Github Package Registry" at "https://maven.pkg.github. lazy val schema = project .in(file("schema")) .settings(generateDomainClasses := { - val outputRoot = target.value / "odb-codegen" + val outputRoot = target.value / "fg-codegen" FileUtils.deleteRecursively(outputRoot) - val invoked = (Compile / runMain).toTask(s" CpgExtCodegen schema/target/odb-codegen").value + val invoked = (Compile / runMain).toTask(s" CpgExtCodegen schema/target/fg-codegen").value FileUtils.listFilesRecursively(outputRoot) }) diff --git a/joern-cli/src/universal/schema-extender/project/FileUtils.scala b/joern-cli/src/universal/schema-extender/project/FileUtils.scala index dc61c44afee2..4bd8aaae7980 100644 --- a/joern-cli/src/universal/schema-extender/project/FileUtils.scala +++ b/joern-cli/src/universal/schema-extender/project/FileUtils.scala @@ -1,6 +1,6 @@ import java.io.File import java.nio.file.Files -import scala.collection.JavaConverters._ +import scala.collection.JavaConverters.* object FileUtils { diff --git a/joern-cli/src/universal/schema-extender/schema/src/main/scala/CpgExtCodegen.scala b/joern-cli/src/universal/schema-extender/schema/src/main/scala/CpgExtCodegen.scala index a94cfedd5857..5bdd11cdac44 100644 --- a/joern-cli/src/universal/schema-extender/schema/src/main/scala/CpgExtCodegen.scala +++ b/joern-cli/src/universal/schema-extender/schema/src/main/scala/CpgExtCodegen.scala @@ -1,14 +1,13 @@ -import io.shiftleft.codepropertygraph.schema._ -import overflowdb.codegen.CodeGen -import overflowdb.schema.SchemaBuilder -import overflowdb.schema.Property.ValueType - -import java.io.File +import io.shiftleft.codepropertygraph.schema.* +import flatgraph.codegen.DomainClassesGenerator +import flatgraph.schema.SchemaBuilder +import flatgraph.schema.Property.ValueType +import java.nio.file.Paths object CpgExtCodegen { def main(args: Array[String]): Unit = { val outputDir = args.headOption - .map(new File(_)) + .map(Paths.get(_)) .getOrElse(throw new AssertionError("please pass outputDir as first parameter")) val builder = new SchemaBuilder(domainShortName = "Cpg", basePackage = "io.shiftleft.codepropertygraph.generated") @@ -24,6 +23,6 @@ object CpgExtCodegen { cpgSchema.fs.file.addProperties(exampleProperty) // END extensions for this build - new CodeGen(builder.build).run(outputDir) + new DomainClassesGenerator(builder.build).run(outputDir) } } diff --git a/joern-cli/src/universal/schema-extender/test.sh b/joern-cli/src/universal/schema-extender/test.sh index 309ab80b710a..4c3fba8ac3b6 100755 --- a/joern-cli/src/universal/schema-extender/test.sh +++ b/joern-cli/src/universal/schema-extender/test.sh @@ -9,6 +9,6 @@ set -x #verbose on # we should now be able to use our new `EXAMPLE_NODE` node mkdir -p scripts echo 'assert(nodes.ExampleNode.Label == "EXAMPLE_NODE") -assert(nodes.ExampleNode.PropertyNames.all.contains("EXAMPLE_PROPERTY"))' > scripts/SchemaExtenderTest.sc +assert(nodes.ExampleNode.PropertyNames.ExampleProperty == "EXAMPLE_PROPERTY")' > scripts/SchemaExtenderTest.sc ./joern --script scripts/SchemaExtenderTest.sc diff --git a/joern-cli/src/universal/swiftsrc2cpg.bat b/joern-cli/src/universal/swiftsrc2cpg.bat index 28ae85da252c..0ca7ff605373 100644 --- a/joern-cli/src/universal/swiftsrc2cpg.bat +++ b/joern-cli/src/universal/swiftsrc2cpg.bat @@ -3,4 +3,4 @@ set "SCRIPT_ABS_DIR=%~dp0" set "SCRIPT=%SCRIPT_ABS_DIR%frontends\swiftsrc2cpg\bin\swiftsrc2cpg.bat" -"%SCRIPT%" "-J-XX:+UseG1GC" "-J-XX:CompressedClassSpaceSize=128m" "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* +"%SCRIPT%" -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m "-Dlog4j.configurationFile=%SCRIPT_ABS_DIR%conf\log4j2.xml" %* diff --git a/joern-install.sh b/joern-install.sh index 71940ed8c3a9..9768be89b8fd 100755 --- a/joern-install.sh +++ b/joern-install.sh @@ -152,6 +152,7 @@ mkdir -p $JOERN_INSTALL_DIR # Download and extract the Joern CLI check_installed "curl" +check_installed "unzip" if [ $NO_DOWNLOAD = true ]; then sbt createDistribution @@ -189,7 +190,6 @@ else sudo ln -sf "$JOERN_INSTALL_DIR"/joern-cli/joern-export "$JOERN_LINK_DIR" || true sudo ln -sf "$JOERN_INSTALL_DIR"/joern-cli/joern-flow "$JOERN_LINK_DIR" || true sudo ln -sf "$JOERN_INSTALL_DIR"/joern-cli/joern-scan "$JOERN_LINK_DIR" || true - sudo ln -sf "$JOERN_INSTALL_DIR"/joern-cli/joern-stats "$JOERN_LINK_DIR" || true sudo ln -sf "$JOERN_INSTALL_DIR"/joern-cli/joern-slice "$JOERN_LINK_DIR" || true fi fi diff --git a/macros/build.sbt b/macros/build.sbt index aebb177d753e..17a9c8129e5e 100644 --- a/macros/build.sbt +++ b/macros/build.sbt @@ -3,8 +3,9 @@ name := "macros" dependsOn(Projects.semanticcpg % Test) libraryDependencies ++= Seq( - "io.shiftleft" %% "codepropertygraph" % Versions.cpg, - "org.scalatest" %% "scalatest" % Versions.scalatest % Test + "io.shiftleft" %% "codepropertygraph" % Versions.cpg, + "net.oneandone.reflections8" % "reflections8" % "0.11.7", + "org.scalatest" %% "scalatest" % Versions.scalatest % Test ) enablePlugins(JavaAppPackaging) diff --git a/macros/src/main/scala/io/joern/console/Query.scala b/macros/src/main/scala/io/joern/console/Query.scala index b1d8452fe3a6..9fdc761b8ec1 100644 --- a/macros/src/main/scala/io/joern/console/Query.scala +++ b/macros/src/main/scala/io/joern/console/Query.scala @@ -1,6 +1,6 @@ package io.joern.console -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.StoredNode case class CodeSnippet(content: String, filename: String) diff --git a/macros/src/main/scala/io/joern/console/QueryDatabase.scala b/macros/src/main/scala/io/joern/console/QueryDatabase.scala index 31ca139b5c13..54933ef15478 100644 --- a/macros/src/main/scala/io/joern/console/QueryDatabase.scala +++ b/macros/src/main/scala/io/joern/console/QueryDatabase.scala @@ -5,7 +5,7 @@ import org.reflections8.util.{ClasspathHelper, ConfigurationBuilder} import java.lang.reflect.{Method, Parameter} import scala.annotation.unused -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* trait QueryBundle diff --git a/macros/src/main/scala/io/joern/macros/QueryMacros.scala b/macros/src/main/scala/io/joern/macros/QueryMacros.scala index b04539f7ce63..d011715f7864 100644 --- a/macros/src/main/scala/io/joern/macros/QueryMacros.scala +++ b/macros/src/main/scala/io/joern/macros/QueryMacros.scala @@ -1,7 +1,7 @@ package io.joern.macros import io.joern.console.TraversalWithStrRep -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.StoredNode import scala.quoted.{Expr, Quotes} diff --git a/macros/src/test/scala/io/joern/console/QueryDatabaseTests.scala b/macros/src/test/scala/io/joern/console/QueryDatabaseTests.scala index 6b7e8ebc6295..3dd84bca6ed0 100644 --- a/macros/src/test/scala/io/joern/console/QueryDatabaseTests.scala +++ b/macros/src/test/scala/io/joern/console/QueryDatabaseTests.scala @@ -1,7 +1,7 @@ package io.joern.console -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* import org.scalatest.matchers.should import org.scalatest.wordspec.AnyWordSpec diff --git a/macros/src/test/scala/io/joern/macros/QueryMacroTests.scala b/macros/src/test/scala/io/joern/macros/QueryMacroTests.scala index 5476f9eaa48b..254a7cd3ae9d 100644 --- a/macros/src/test/scala/io/joern/macros/QueryMacroTests.scala +++ b/macros/src/test/scala/io/joern/macros/QueryMacroTests.scala @@ -4,8 +4,8 @@ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import io.joern.macros.QueryMacros.withStrRep -import io.joern.console._ -import io.shiftleft.semanticcpg.language._ +import io.joern.console.* +import io.shiftleft.semanticcpg.language.* class QueryMacroTests extends AnyWordSpec with Matchers { "Query macros" should { diff --git a/project/Environment.scala b/project/Environment.scala index ec3a6ced8a81..9dbf38bcf6fe 100644 --- a/project/Environment.scala +++ b/project/Environment.scala @@ -9,7 +9,7 @@ object Environment { object ArchitectureType extends Enumeration { type ArchitectureType = Value - val X86, ARM = Value + val X86, ARMv8 = Value } lazy val operatingSystem: OperatingSystemType.OperatingSystemType = @@ -19,7 +19,7 @@ object Environment { else OperatingSystemType.Unknown lazy val architecture: ArchitectureType.ArchitectureType = - if (scala.util.Properties.propOrNone("os.arch").contains("aarch64")) ArchitectureType.ARM + if (scala.util.Properties.propOrNone("os.arch").contains("aarch64")) ArchitectureType.ARMv8 // We do not distinguish between x86 and x64. E.g, a 64 bit Windows will always lie about // this and will report x86 anyway for backwards compatibility with 32 bit software. else ArchitectureType.X86 diff --git a/project/Projects.scala b/project/Projects.scala index e0b6d4ccf135..6b1d562cccd3 100644 --- a/project/Projects.scala +++ b/project/Projects.scala @@ -9,7 +9,6 @@ object Projects { lazy val dataflowengineoss = project.in(file("dataflowengineoss")) lazy val macros = project.in(file("macros")) lazy val semanticcpg = project.in(file("semanticcpg")) - lazy val benchmarks = project.in(file("benchmarks")) lazy val c2cpg = project.in(frontendsRoot / "c2cpg") lazy val ghidra2cpg = project.in(frontendsRoot / "ghidra2cpg") diff --git a/project/Versions.scala b/project/Versions.scala index 5cd4deb5d6d9..9e75b78f4c4f 100644 --- a/project/Versions.scala +++ b/project/Versions.scala @@ -5,7 +5,7 @@ object Versions { // causes problems upstreams. val antlr = "4.7.2" val cask = "0.9.2" - val catsCore = "2.10.0" + val catsCore = "2.12.0" val catsEffect = "3.5.4" val cfr = "0.152" val commonsCompress = "1.26.2" diff --git a/project/build.properties b/project/build.properties index 081fdbbc7625..ee4c672cd0d7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.0 +sbt.version=1.10.1 diff --git a/querydb/src/main/scala/io/joern/scanners/android/ArbitraryFileWrites.scala b/querydb/src/main/scala/io/joern/scanners/android/ArbitraryFileWrites.scala index 97e78f177457..987085152d4f 100644 --- a/querydb/src/main/scala/io/joern/scanners/android/ArbitraryFileWrites.scala +++ b/querydb/src/main/scala/io/joern/scanners/android/ArbitraryFileWrites.scala @@ -1,12 +1,12 @@ package io.joern.scanners.android -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* object ArbitraryFileWrites extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/android/Intents.scala b/querydb/src/main/scala/io/joern/scanners/android/Intents.scala index 2b8de93a286e..aa7876897324 100644 --- a/querydb/src/main/scala/io/joern/scanners/android/Intents.scala +++ b/querydb/src/main/scala/io/joern/scanners/android/Intents.scala @@ -1,12 +1,12 @@ package io.joern.scanners.android -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* object Intents extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/android/RootDetection.scala b/querydb/src/main/scala/io/joern/scanners/android/RootDetection.scala index 4586fcccb094..587e1a08adce 100644 --- a/querydb/src/main/scala/io/joern/scanners/android/RootDetection.scala +++ b/querydb/src/main/scala/io/joern/scanners/android/RootDetection.scala @@ -1,12 +1,12 @@ package io.joern.scanners.android -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* object RootDetection extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/android/UnsafeReflection.scala b/querydb/src/main/scala/io/joern/scanners/android/UnsafeReflection.scala index a9c3ec5c3d5b..1152afd803c4 100644 --- a/querydb/src/main/scala/io/joern/scanners/android/UnsafeReflection.scala +++ b/querydb/src/main/scala/io/joern/scanners/android/UnsafeReflection.scala @@ -1,11 +1,11 @@ package io.joern.scanners.android -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* object UnsafeReflection extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/c/CopyLoops.scala b/querydb/src/main/scala/io/joern/scanners/c/CopyLoops.scala index 7b00fb2a9c5a..4495ece033a7 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/CopyLoops.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/CopyLoops.scala @@ -1,9 +1,9 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ +import io.joern.scanners.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* object CopyLoops extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/CredentialDrop.scala b/querydb/src/main/scala/io/joern/scanners/c/CredentialDrop.scala index 966cc3d79022..c8d9cb07c5db 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/CredentialDrop.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/CredentialDrop.scala @@ -1,9 +1,9 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.joern.console._ -import io.shiftleft.semanticcpg.language._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.joern.console.* +import io.shiftleft.semanticcpg.language.* +import io.joern.macros.QueryMacros.* object CredentialDrop extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/DangerousFunctions.scala b/querydb/src/main/scala/io/joern/scanners/c/DangerousFunctions.scala index 9ef4d463a9ee..cd54e9a76625 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/DangerousFunctions.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/DangerousFunctions.scala @@ -1,9 +1,9 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.joern.console._ -import io.shiftleft.semanticcpg.language._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.joern.console.* +import io.shiftleft.semanticcpg.language.* +import io.joern.macros.QueryMacros.* object DangerousFunctions extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/HeapBasedOverflow.scala b/querydb/src/main/scala/io/joern/scanners/c/HeapBasedOverflow.scala index e7e58ca2933c..a85f2a7fc060 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/HeapBasedOverflow.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/HeapBasedOverflow.scala @@ -1,12 +1,12 @@ package io.joern.scanners.c -import io.joern.scanners._ +import io.joern.scanners.* import io.joern.dataflowengineoss.queryengine.EngineContext -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ -import io.joern.console._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* +import io.joern.console.* import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ +import io.joern.macros.QueryMacros.* object HeapBasedOverflow extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/IntegerTruncations.scala b/querydb/src/main/scala/io/joern/scanners/c/IntegerTruncations.scala index 3f5bfe035b2b..405bd68b7ebb 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/IntegerTruncations.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/IntegerTruncations.scala @@ -1,9 +1,9 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.shiftleft.semanticcpg.language._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.shiftleft.semanticcpg.language.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* object IntegerTruncations extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/Metrics.scala b/querydb/src/main/scala/io/joern/scanners/c/Metrics.scala index 7cc521612c18..96acd023b041 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/Metrics.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/Metrics.scala @@ -1,9 +1,9 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.joern.console._ -import io.shiftleft.semanticcpg.language._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.joern.console.* +import io.shiftleft.semanticcpg.language.* +import io.joern.macros.QueryMacros.* object Metrics extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/MissingLengthCheck.scala b/querydb/src/main/scala/io/joern/scanners/c/MissingLengthCheck.scala index ed6b7d17dd92..f82855e5866f 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/MissingLengthCheck.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/MissingLengthCheck.scala @@ -1,14 +1,14 @@ package io.joern.scanners.c import io.shiftleft.semanticcpg.language.{ICallResolver, NoResolve} -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.shiftleft.codepropertygraph.generated.nodes import io.joern.dataflowengineoss.queryengine.EngineContext -import io.shiftleft.semanticcpg.language._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language.operatorextension._ -import QueryLangExtensions._ +import io.shiftleft.semanticcpg.language.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.operatorextension.* +import QueryLangExtensions.* object MissingLengthCheck extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/NullTermination.scala b/querydb/src/main/scala/io/joern/scanners/c/NullTermination.scala index 99bbc63a5b3d..301981588d03 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/NullTermination.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/NullTermination.scala @@ -1,12 +1,12 @@ package io.joern.scanners.c import io.joern.scanners.{Crew, QueryTags} -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ -import io.joern.console._ +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.macros.QueryMacros._ +import io.joern.macros.QueryMacros.* object NullTermination extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/RetvalChecks.scala b/querydb/src/main/scala/io/joern/scanners/c/RetvalChecks.scala index ca0c9e3eaf7d..479ea0c060f8 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/RetvalChecks.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/RetvalChecks.scala @@ -1,10 +1,10 @@ package io.joern.scanners.c import io.joern.scanners.{Crew, QueryTags} -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import QueryLangExtensions._ +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import QueryLangExtensions.* object RetvalChecks extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/SignedLeftShift.scala b/querydb/src/main/scala/io/joern/scanners/c/SignedLeftShift.scala index 232da036f815..7730e7236342 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/SignedLeftShift.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/SignedLeftShift.scala @@ -1,10 +1,10 @@ package io.joern.scanners.c -import io.joern.scanners._ +import io.joern.scanners.* import io.shiftleft.codepropertygraph.generated.Operators -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* object SignedLeftShift extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/c/SocketApi.scala b/querydb/src/main/scala/io/joern/scanners/c/SocketApi.scala index 9fe1d3901450..db5cc5171738 100644 --- a/querydb/src/main/scala/io/joern/scanners/c/SocketApi.scala +++ b/querydb/src/main/scala/io/joern/scanners/c/SocketApi.scala @@ -1,11 +1,11 @@ package io.joern.scanners.c import io.joern.scanners.{Crew, QueryTags} -import io.joern.console._ +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import QueryLangExtensions._ +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import QueryLangExtensions.* object SocketApi extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/ghidra/DangerousFunctions.scala b/querydb/src/main/scala/io/joern/scanners/ghidra/DangerousFunctions.scala index 16216093a627..0ccebc7be7ef 100644 --- a/querydb/src/main/scala/io/joern/scanners/ghidra/DangerousFunctions.scala +++ b/querydb/src/main/scala/io/joern/scanners/ghidra/DangerousFunctions.scala @@ -1,9 +1,9 @@ package io.joern.scanners.ghidra -import io.joern.scanners._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ +import io.joern.scanners.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* object DangerousFunctions extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/ghidra/UserInputIntoDangerousFunctions.scala b/querydb/src/main/scala/io/joern/scanners/ghidra/UserInputIntoDangerousFunctions.scala index 21310c543181..3c47d454a90c 100644 --- a/querydb/src/main/scala/io/joern/scanners/ghidra/UserInputIntoDangerousFunctions.scala +++ b/querydb/src/main/scala/io/joern/scanners/ghidra/UserInputIntoDangerousFunctions.scala @@ -1,10 +1,10 @@ package io.joern.scanners.ghidra -import io.joern.scanners._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ -import io.joern.dataflowengineoss.language._ +import io.joern.scanners.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext object UserInputIntoDangerousFunctions extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/java/CrossSiteScripting.scala b/querydb/src/main/scala/io/joern/scanners/java/CrossSiteScripting.scala index e7265c367e12..66cfe2fe7f28 100644 --- a/querydb/src/main/scala/io/joern/scanners/java/CrossSiteScripting.scala +++ b/querydb/src/main/scala/io/joern/scanners/java/CrossSiteScripting.scala @@ -1,10 +1,10 @@ package io.joern.scanners.java -import io.joern.scanners._ -import io.shiftleft.semanticcpg.language._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.joern.dataflowengineoss.language._ +import io.joern.scanners.* +import io.shiftleft.semanticcpg.language.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext object CrossSiteScripting extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/java/CryptographyMisuse.scala b/querydb/src/main/scala/io/joern/scanners/java/CryptographyMisuse.scala index 1e43586657f0..5b96efcabfbb 100644 --- a/querydb/src/main/scala/io/joern/scanners/java/CryptographyMisuse.scala +++ b/querydb/src/main/scala/io/joern/scanners/java/CryptographyMisuse.scala @@ -1,10 +1,10 @@ package io.joern.scanners.java -import io.joern.scanners._ -import io.shiftleft.semanticcpg.language._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.joern.dataflowengineoss.language._ +import io.joern.scanners.* +import io.shiftleft.semanticcpg.language.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext /** @see diff --git a/querydb/src/main/scala/io/joern/scanners/java/DangerousFunctions.scala b/querydb/src/main/scala/io/joern/scanners/java/DangerousFunctions.scala index cdfabc11b03f..ccee98ccbf3a 100644 --- a/querydb/src/main/scala/io/joern/scanners/java/DangerousFunctions.scala +++ b/querydb/src/main/scala/io/joern/scanners/java/DangerousFunctions.scala @@ -1,9 +1,9 @@ package io.joern.scanners.java -import io.joern.scanners._ -import io.shiftleft.semanticcpg.language._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.shiftleft.semanticcpg.language.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* object DangerousFunctions extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/java/SQLInjection.scala b/querydb/src/main/scala/io/joern/scanners/java/SQLInjection.scala index 67aebe735261..fa987cfd722e 100644 --- a/querydb/src/main/scala/io/joern/scanners/java/SQLInjection.scala +++ b/querydb/src/main/scala/io/joern/scanners/java/SQLInjection.scala @@ -1,10 +1,10 @@ package io.joern.scanners.java -import io.joern.scanners._ -import io.shiftleft.semanticcpg.language._ -import io.joern.console._ -import io.joern.macros.QueryMacros._ -import io.joern.dataflowengineoss.language._ +import io.joern.scanners.* +import io.shiftleft.semanticcpg.language.* +import io.joern.console.* +import io.joern.macros.QueryMacros.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext // The queries are tied to springframework diff --git a/querydb/src/main/scala/io/joern/scanners/kotlin/NetworkCommunication.scala b/querydb/src/main/scala/io/joern/scanners/kotlin/NetworkCommunication.scala index 2f31e6c2800d..34a71b4fe9c9 100644 --- a/querydb/src/main/scala/io/joern/scanners/kotlin/NetworkCommunication.scala +++ b/querydb/src/main/scala/io/joern/scanners/kotlin/NetworkCommunication.scala @@ -1,13 +1,13 @@ package io.joern.scanners.kotlin -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.dataflowengineoss.language._ -import io.joern.macros.QueryMacros._ +import io.joern.dataflowengineoss.language.* +import io.joern.macros.QueryMacros.* import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* object NetworkCommunication extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/kotlin/PathTraversals.scala b/querydb/src/main/scala/io/joern/scanners/kotlin/PathTraversals.scala index fe64c33c1203..c977a5c7795b 100644 --- a/querydb/src/main/scala/io/joern/scanners/kotlin/PathTraversals.scala +++ b/querydb/src/main/scala/io/joern/scanners/kotlin/PathTraversals.scala @@ -1,12 +1,12 @@ package io.joern.scanners.kotlin -import io.joern.scanners._ -import io.joern.console._ +import io.joern.scanners.* +import io.joern.console.* import io.joern.dataflowengineoss.queryengine.EngineContext import io.joern.dataflowengineoss.semanticsloader.Semantics -import io.joern.dataflowengineoss.language._ -import io.joern.macros.QueryMacros._ -import io.shiftleft.semanticcpg.language._ +import io.joern.dataflowengineoss.language.* +import io.joern.macros.QueryMacros.* +import io.shiftleft.semanticcpg.language.* object PathTraversals extends QueryBundle { implicit val engineContext: EngineContext = EngineContext(Semantics.empty) diff --git a/querydb/src/main/scala/io/joern/scanners/php/SQLInjection.scala b/querydb/src/main/scala/io/joern/scanners/php/SQLInjection.scala index 0829f18301c0..7fbaa232ad3d 100644 --- a/querydb/src/main/scala/io/joern/scanners/php/SQLInjection.scala +++ b/querydb/src/main/scala/io/joern/scanners/php/SQLInjection.scala @@ -1,12 +1,12 @@ package io.joern.scanners.php -import io.joern.console._ -import io.joern.dataflowengineoss.language._ +import io.joern.console.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext -import io.joern.macros.QueryMacros._ -import io.joern.scanners._ +import io.joern.macros.QueryMacros.* +import io.joern.scanners.* import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* object SQLInjection extends QueryBundle { diff --git a/querydb/src/main/scala/io/joern/scanners/php/ShellExec.scala b/querydb/src/main/scala/io/joern/scanners/php/ShellExec.scala index 923538116f84..cbf2854c4c56 100644 --- a/querydb/src/main/scala/io/joern/scanners/php/ShellExec.scala +++ b/querydb/src/main/scala/io/joern/scanners/php/ShellExec.scala @@ -1,12 +1,12 @@ package io.joern.scanners.php -import io.joern.console._ -import io.joern.dataflowengineoss.language._ +import io.joern.console.* +import io.joern.dataflowengineoss.language.* import io.joern.dataflowengineoss.queryengine.EngineContext -import io.joern.macros.QueryMacros._ -import io.joern.scanners._ +import io.joern.macros.QueryMacros.* +import io.joern.scanners.* import io.shiftleft.codepropertygraph.generated.Operators -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* object ShellExec extends QueryBundle { diff --git a/querydb/src/test/scala/io/joern/scanners/android/UnprotectedAppPartsTests.scala b/querydb/src/test/scala/io/joern/scanners/android/UnprotectedAppPartsTests.scala index 81d807064d2f..c013457a12fa 100644 --- a/querydb/src/test/scala/io/joern/scanners/android/UnprotectedAppPartsTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/android/UnprotectedAppPartsTests.scala @@ -1,9 +1,9 @@ package io.joern.scanners.android -import io.joern.console.scan._ +import io.joern.console.scan.* import io.shiftleft.codepropertygraph.generated.nodes.CfgNode import io.joern.suites.KotlinQueryTestSuite -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class UnprotectedAppPartsTests extends KotlinQueryTestSuite(UnprotectedAppParts) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/CopyLoopTests.scala b/querydb/src/test/scala/io/joern/scanners/c/CopyLoopTests.scala index 4c20bd6d4791..82520686a738 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/CopyLoopTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/CopyLoopTests.scala @@ -2,8 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.semanticcpg.language._ -import io.joern.console.scan._ +import io.shiftleft.semanticcpg.language.* +import io.joern.console.scan.* class CopyLoopTests extends CQueryTestSuite(CopyLoops) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/HeapBasedOverflowTests.scala b/querydb/src/test/scala/io/joern/scanners/c/HeapBasedOverflowTests.scala index b583fc4ddf61..e3bedcba6b1e 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/HeapBasedOverflowTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/HeapBasedOverflowTests.scala @@ -2,7 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.console.scan._ +import io.joern.console.scan.* +import io.shiftleft.semanticcpg.language.* class HeapBasedOverflowTests extends CQueryTestSuite(HeapBasedOverflow) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/IntegerTruncationsTests.scala b/querydb/src/test/scala/io/joern/scanners/c/IntegerTruncationsTests.scala index b4fac1fd3913..9e3b5d177c99 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/IntegerTruncationsTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/IntegerTruncationsTests.scala @@ -2,8 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.semanticcpg.language._ -import io.joern.console.scan._ +import io.shiftleft.semanticcpg.language.* +import io.joern.console.scan.* class IntegerTruncationsTests extends CQueryTestSuite(IntegerTruncations) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/MetricsTests.scala b/querydb/src/test/scala/io/joern/scanners/c/MetricsTests.scala index 91d0dd61d4eb..a741cea32590 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/MetricsTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/MetricsTests.scala @@ -2,7 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.console.scan._ +import io.joern.console.scan.* +import io.shiftleft.semanticcpg.language.* class MetricsTests extends CQueryTestSuite(Metrics) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/NullTerminationTests.scala b/querydb/src/test/scala/io/joern/scanners/c/NullTerminationTests.scala index 139c01859aec..327618fd92f8 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/NullTerminationTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/NullTerminationTests.scala @@ -2,8 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.shiftleft.semanticcpg.language._ -import io.joern.console.scan._ +import io.shiftleft.semanticcpg.language.* +import io.joern.console.scan.* class NullTerminationTests extends CQueryTestSuite(NullTermination) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/QueryWithReachableBy.scala b/querydb/src/test/scala/io/joern/scanners/c/QueryWithReachableBy.scala index 6a6d21b311df..6eff6c970a4f 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/QueryWithReachableBy.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/QueryWithReachableBy.scala @@ -1,10 +1,10 @@ package io.joern.scanners.c -import io.joern.scanners._ -import io.joern.console._ -import io.joern.dataflowengineoss.language._ -import io.shiftleft.semanticcpg.language._ -import io.joern.macros.QueryMacros._ +import io.joern.scanners.* +import io.joern.console.* +import io.joern.dataflowengineoss.language.* +import io.shiftleft.semanticcpg.language.* +import io.joern.macros.QueryMacros.* import io.joern.dataflowengineoss.queryengine.EngineContext /** Just to make sure that we support reachableBy queries, which did not work before diff --git a/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreePostUsage.scala b/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreePostUsage.scala index 568bb515c515..ed2611ddacbe 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreePostUsage.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreePostUsage.scala @@ -2,8 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.console.scan._ -import io.shiftleft.semanticcpg.language._ +import io.joern.console.scan.* +import io.shiftleft.semanticcpg.language.* class UseAfterFreePostUsage extends CQueryTestSuite(UseAfterFree) { diff --git a/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreeReturnTests.scala b/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreeReturnTests.scala index 3ae07cc654f9..190be8f9bd57 100644 --- a/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreeReturnTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/c/UseAfterFreeReturnTests.scala @@ -2,8 +2,8 @@ package io.joern.scanners.c import io.joern.suites.CQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.console.scan._ -import io.shiftleft.semanticcpg.language._ +import io.joern.console.scan.* +import io.shiftleft.semanticcpg.language.* class UseAfterFreeReturnTests extends CQueryTestSuite(UseAfterFree) { diff --git a/querydb/src/test/scala/io/joern/scanners/kotlin/NetworkProtocolsTests.scala b/querydb/src/test/scala/io/joern/scanners/kotlin/NetworkProtocolsTests.scala index 3c0bbfa01176..ae41b9d9d210 100644 --- a/querydb/src/test/scala/io/joern/scanners/kotlin/NetworkProtocolsTests.scala +++ b/querydb/src/test/scala/io/joern/scanners/kotlin/NetworkProtocolsTests.scala @@ -1,9 +1,9 @@ package io.joern.scanners.kotlin -import io.joern.console.scan._ +import io.joern.console.scan.* import io.joern.suites.KotlinQueryTestSuite import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class NetworkProtocolsTests extends KotlinQueryTestSuite(NetworkProtocols) { "should find calls relevant to insecure network protocol usage" in { diff --git a/querydb/src/test/scala/io/joern/suites/AllBundlesTestSuite.scala b/querydb/src/test/scala/io/joern/suites/AllBundlesTestSuite.scala index 9fc370a5284f..f35909393c30 100644 --- a/querydb/src/test/scala/io/joern/suites/AllBundlesTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/AllBundlesTestSuite.scala @@ -2,7 +2,7 @@ package io.joern.suites import io.joern.console.QueryDatabase import org.scalatest.wordspec.AnyWordSpec -import org.scalatest.matchers.should.Matchers._ +import org.scalatest.matchers.should.Matchers.* class AllBundlesTestSuite extends AnyWordSpec { val argumentProvider = new QDBArgumentProvider(3) diff --git a/querydb/src/test/scala/io/joern/suites/AndroidQueryTestSuite.scala b/querydb/src/test/scala/io/joern/suites/AndroidQueryTestSuite.scala index b45488e38874..f40e1d3f7529 100644 --- a/querydb/src/test/scala/io/joern/suites/AndroidQueryTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/AndroidQueryTestSuite.scala @@ -1,12 +1,12 @@ package io.joern.suites -import io.joern.console.scan._ +import io.joern.console.scan.* import io.joern.console.{CodeSnippet, Query, QueryBundle} import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.joern.util.QueryUtil -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.ConfigFile -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AndroidQueryTestSuite[QB <: QueryBundle](val queryBundle: QB) extends KotlinCode2CpgFixture(withOssDataflow = true, withDefaultJars = true) { diff --git a/querydb/src/test/scala/io/joern/suites/CQueryTestSuite.scala b/querydb/src/test/scala/io/joern/suites/CQueryTestSuite.scala index 93e5d618c08c..97e29744fd44 100644 --- a/querydb/src/test/scala/io/joern/suites/CQueryTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/CQueryTestSuite.scala @@ -2,12 +2,12 @@ package io.joern.suites import io.joern.util.QueryUtil import io.shiftleft.codepropertygraph.generated.nodes -import io.joern.console.scan._ +import io.joern.console.scan.* import io.joern.console.QueryBundle import io.joern.console.Query import io.joern.c2cpg.testfixtures.DataFlowCodeToCpgSuite import io.joern.x2cpg.testfixtures.TestCpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class CQueryTestSuite[QB <: QueryBundle](val queryBundle: QB) extends DataFlowCodeToCpgSuite { diff --git a/querydb/src/test/scala/io/joern/suites/GhidraQueryTestSuite.scala b/querydb/src/test/scala/io/joern/suites/GhidraQueryTestSuite.scala index 1a6d1cc5eadc..81ea14d8af67 100644 --- a/querydb/src/test/scala/io/joern/suites/GhidraQueryTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/GhidraQueryTestSuite.scala @@ -1,12 +1,12 @@ package io.joern.suites import io.joern.console.QueryBundle -import io.joern.console.scan._ +import io.joern.console.scan.* import io.joern.ghidra2cpg.fixtures.DataFlowBinToCpgSuite import io.joern.util.QueryUtil import io.shiftleft.codepropertygraph.generated.nodes import io.joern.console.Query -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.utils.ProjectRoot class GhidraQueryTestSuite[QB <: QueryBundle](val queryBundle: QB) extends DataFlowBinToCpgSuite { diff --git a/querydb/src/test/scala/io/joern/suites/JavaQueryTestSuite.scala b/querydb/src/test/scala/io/joern/suites/JavaQueryTestSuite.scala index 1f8135c68ce4..00711ed73b9b 100644 --- a/querydb/src/test/scala/io/joern/suites/JavaQueryTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/JavaQueryTestSuite.scala @@ -1,12 +1,13 @@ package io.joern.suites -import io.joern.console.scan._ +import io.joern.console.scan.* import io.joern.console.{CodeSnippet, Query, QueryBundle} import io.joern.javasrc2cpg.testfixtures.JavaSrcCode2CpgFixture import io.joern.util.QueryUtil import io.joern.x2cpg.testfixtures.TestCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, Literal, Method, StoredNode} +import io.shiftleft.semanticcpg.language.* class JavaQueryTestSuite[QB <: QueryBundle](val queryBundle: QB) extends JavaSrcCode2CpgFixture(withOssDataflow = true) { diff --git a/querydb/src/test/scala/io/joern/suites/KotlinQueryTestSuite.scala b/querydb/src/test/scala/io/joern/suites/KotlinQueryTestSuite.scala index 49b5a37a3575..469c1517b919 100644 --- a/querydb/src/test/scala/io/joern/suites/KotlinQueryTestSuite.scala +++ b/querydb/src/test/scala/io/joern/suites/KotlinQueryTestSuite.scala @@ -4,9 +4,10 @@ import io.joern.util.QueryUtil import io.joern.console.{CodeSnippet, Query, QueryBundle} import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture import io.joern.x2cpg.testfixtures.TestCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method} -import io.joern.console.scan._ +import io.shiftleft.semanticcpg.language.* +import io.joern.console.scan.* import io.shiftleft.utils.ProjectRoot class KotlinQueryTestSuite[QB <: QueryBundle](val queryBundle: QB) diff --git a/semanticcpg/build.sbt b/semanticcpg/build.sbt index abcc3fa01695..d3957c20f046 100644 --- a/semanticcpg/build.sbt +++ b/semanticcpg/build.sbt @@ -1,11 +1,12 @@ name := "semanticcpg" libraryDependencies ++= Seq( - "io.shiftleft" %% "codepropertygraph" % Versions.cpg, - "com.michaelpollmeier" %% "scala-repl-pp" % Versions.scalaReplPP, - "org.json4s" %% "json4s-native" % Versions.json4s, - "org.apache.commons" % "commons-text" % Versions.commonsText, - "org.scalatest" %% "scalatest" % Versions.scalatest % Test + "io.shiftleft" %% "codepropertygraph" % Versions.cpg, + "com.michaelpollmeier" %% "scala-repl-pp" % Versions.scalaReplPP, + "org.json4s" %% "json4s-native" % Versions.json4s, + "org.scala-lang.modules" %% "scala-xml" % "2.2.0", + "org.apache.commons" % "commons-text" % Versions.commonsText, + "org.scalatest" %% "scalatest" % Versions.scalatest % Test ) Compile / doc / scalacOptions ++= Seq("-doc-title", "semanticcpg apidocs", "-doc-version", version.value) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/Overlays.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/Overlays.scala index 37ad85925588..7a62e226f138 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/Overlays.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/Overlays.scala @@ -1,9 +1,9 @@ package io.shiftleft.semanticcpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.{Cpg, DiffGraphBuilder} import io.shiftleft.codepropertygraph.generated.Properties import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* object Overlays { @@ -13,7 +13,7 @@ object Overlays { cpg.metaData.headOption match { case Some(metaData) => val newValue = metaData.overlays :+ overlayName - diffGraph.setNodeProperty(metaData, Properties.OVERLAYS.name, newValue) + diffGraph.setNodeProperty(metaData, Properties.Overlays.name, newValue) case None => System.err.println("Missing metaData block") } @@ -27,7 +27,7 @@ object Overlays { cpg.metaData.headOption match { case Some(metaData) => val newValue = metaData.overlays.dropRight(1) - diffGraph.setNodeProperty(metaData, Properties.OVERLAYS.name, newValue) + diffGraph.setNodeProperty(metaData, Properties.Overlays.name, newValue) case None => System.err.println("Missing metaData block") } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/accesspath/TrackedBase.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/accesspath/TrackedBase.scala index f1af0f8d8cd3..2f6ff9fd4c27 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/accesspath/TrackedBase.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/accesspath/TrackedBase.scala @@ -1,6 +1,7 @@ package io.shiftleft.semanticcpg.accesspath -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* trait TrackedBase case class TrackedNamedVariable(name: String) extends TrackedBase diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/codedumper/CodeDumper.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/codedumper/CodeDumper.scala index 88bdad3f2966..59dc5ad34514 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/codedumper/CodeDumper.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/codedumper/CodeDumper.scala @@ -102,9 +102,9 @@ object CodeDumper { */ def code( filename: String, - startLine: Integer, - endLine: Integer, - lineToHighlight: Option[Integer] = None, + startLine: Int, + endLine: Int, + lineToHighlight: Option[Int] = None, locationFullName: Option[String] = None ): String = { Try(IOUtils.readLinesInFile(Paths.get(filename))) match { @@ -117,9 +117,9 @@ object CodeDumper { private def sliceCode( lines: Seq[String], - startLine: Integer, - endLine: Integer, - lineToHighlight: Option[Integer] = None, + startLine: Int, + endLine: Int, + lineToHighlight: Option[Int] = None, locationFullName: Option[String] = None ): String = { lines diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/AstGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/AstGenerator.scala index f68afc41afcb..52a649f52ffd 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/AstGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/AstGenerator.scala @@ -3,7 +3,7 @@ package io.shiftleft.semanticcpg.dotgenerator import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, MethodParameterOut} import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.{Edge, Graph} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* class AstGenerator { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CallGraphGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CallGraphGenerator.scala index d06bb6458a97..dfee4db69a23 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CallGraphGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CallGraphGenerator.scala @@ -1,9 +1,9 @@ package io.shiftleft.semanticcpg.dotgenerator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{Method, StoredNode} import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.{Edge, Graph} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import scala.collection.mutable diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CdgGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CdgGenerator.scala index 2507bcf9e3d6..9223d7d98218 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CdgGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CdgGenerator.scala @@ -4,7 +4,7 @@ import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.StoredNode import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.Edge -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* class CdgGenerator extends CfgGenerator { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CfgGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CfgGenerator.scala index 45999fbe46e8..067ce1302792 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CfgGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/CfgGenerator.scala @@ -1,10 +1,9 @@ package io.shiftleft.semanticcpg.dotgenerator import io.shiftleft.codepropertygraph.generated.EdgeTypes -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.{Edge, Graph} -import io.shiftleft.semanticcpg.language._ -import overflowdb.Node +import io.shiftleft.semanticcpg.language.* class CfgGenerator { @@ -44,12 +43,12 @@ class CfgGenerator { protected def expand(v: StoredNode): Iterator[Edge] = v._cfgOut.map(node => Edge(v, node, edgeType = edgeType)) - private def isConditionInControlStructure(v: Node): Boolean = v match { + private def isConditionInControlStructure(v: StoredNode): Boolean = v match { case id: Identifier => id.astParent.isControlStructure case _ => false } - private def cfgNodeShouldBeDisplayed(v: Node): Boolean = + private def cfgNodeShouldBeDisplayed(v: StoredNode): Boolean = isConditionInControlStructure(v) || !(v.isInstanceOf[Literal] || v.isInstanceOf[Identifier] || diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotCallGraphGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotCallGraphGenerator.scala index 21c87ea0087b..05ddb00cef55 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotCallGraphGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotCallGraphGenerator.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.dotgenerator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg object DotCallGraphGenerator { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotSerializer.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotSerializer.scala index 6ee27691b66f..a7429d8e86b2 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotSerializer.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotSerializer.scala @@ -1,5 +1,6 @@ package io.shiftleft.semanticcpg.dotgenerator +import flatgraph.Accessors import io.shiftleft.codepropertygraph.generated.PropertyNames import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* @@ -70,7 +71,10 @@ object DotSerializer { } private def stringRepr(vertex: StoredNode): String = { - val maybeLineNo: Optional[AnyRef] = vertex.propertyOption(PropertyNames.LINE_NUMBER) + // TODO MP after the initial flatgraph migration (where we want to maintain semantics as far as + // possible) this might become `vertex.property(Properties.LineNumber)` which derives to `Option[Int]` + val lineNoMaybe = vertex.propertyOption[Int](PropertyNames.LINE_NUMBER) + StringEscapeUtils.escapeHtml4(vertex match { case call: Call => (call.name, limit(call.code)).toString case contrl: ControlStructure => (contrl.label, contrl.controlStructureType, contrl.code).toString @@ -87,7 +91,7 @@ object DotSerializer { case typeDecl: TypeDecl => (typeDecl.label, typeDecl.name).toString() case member: Member => (member.label, member.name).toString() case _ => "" - }) + (if (maybeLineNo.isPresent) s"${maybeLineNo.get()}" else "") + }) + lineNoMaybe.map(lineNo => s"$lineNo").getOrElse("") } private def toCfgNode(node: StoredNode): CfgNode = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotTypeHierarchyGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotTypeHierarchyGenerator.scala index ca07348cdaf6..15507df7f993 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotTypeHierarchyGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/DotTypeHierarchyGenerator.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.dotgenerator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg object DotTypeHierarchyGenerator { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/TypeHierarchyGenerator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/TypeHierarchyGenerator.scala index e3097cb9ec30..2ec4454d901f 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/TypeHierarchyGenerator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/dotgenerator/TypeHierarchyGenerator.scala @@ -1,9 +1,9 @@ package io.shiftleft.semanticcpg.dotgenerator -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{StoredNode, Type, TypeDecl} import io.shiftleft.semanticcpg.dotgenerator.DotSerializer.{Edge, Graph} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import scala.collection.mutable diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/AccessPathHandling.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/AccessPathHandling.scala index b52fd4054cb8..6292879b1b0d 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/AccessPathHandling.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/AccessPathHandling.scala @@ -1,8 +1,9 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.generated.{Operators, Properties, PropertyNames} -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.accesspath._ +import io.shiftleft.codepropertygraph.generated.{Operators, Properties} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.accesspath.* +import io.shiftleft.semanticcpg.language.* import org.slf4j.LoggerFactory import scala.jdk.CollectionConverters.IteratorHasAsScala @@ -42,9 +43,10 @@ object AccessPathHandling { .collect { case node: Literal => ConstantAccess(node.code) case node: Identifier => ConstantAccess(node.name) - case other if other.propertyOption(PropertyNames.NAME).isPresent => - logger.warn(s"unexpected/deprecated node encountered: $other with properties: ${other.propertiesMap()}") - ConstantAccess(other.property(Properties.NAME)) + case other if other.propertyOption(Properties.Name).isDefined => + val properties = other.propertiesMap + logger.warn(s"unexpected/deprecated node encountered: $other with properties: $properties") + ConstantAccess(other.property(Properties.Name)) } .getOrElse(VariableAccess) :: tail diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/LocationCreator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/LocationCreator.scala index 57028bba54c1..008e87131dbb 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/LocationCreator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/LocationCreator.scala @@ -1,8 +1,8 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import org.slf4j.{Logger, LoggerFactory} -import overflowdb.traversal._ import scala.annotation.tailrec @@ -29,13 +29,7 @@ object LocationCreator { } } - def apply( - node: StoredNode, - symbol: String, - label: String, - lineNumber: Option[Integer], - method: Method - ): NewLocation = { + def apply(node: StoredNode, symbol: String, label: String, lineNumber: Option[Int], method: Method): NewLocation = { if (method == null) { NewLocation().node(node) @@ -70,7 +64,7 @@ object LocationCreator { @tailrec private def findVertex(node: StoredNode, instanceCheck: StoredNode => Boolean): Option[StoredNode] = - node._astIn.nextOption() match { + node._astIn.iterator.nextOption() match { case Some(head) if instanceCheck(head) => Some(head) case Some(head) => findVertex(head, instanceCheck) case None => None diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewNodeSteps.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewNodeSteps.scala index 2a4384e9c7e1..dbcce1aa4807 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewNodeSteps.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewNodeSteps.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language import io.shiftleft.codepropertygraph.generated.nodes.NewNode -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder trait HasStoreMethod { def store()(implicit diffBuilder: DiffGraphBuilder): Unit diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewTagNodePairTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewTagNodePairTraversal.scala index 9248f9e72b1d..44b52836c0ac 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewTagNodePairTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NewTagNodePairTraversal.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{NewNode, NewTagNodePair, StoredNode} -import overflowdb.BatchedUpdate.DiffGraphBuilder +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder class NewTagNodePairTraversal(traversal: Iterator[NewTagNodePair]) extends HasStoreMethod { override def store()(implicit diffGraph: DiffGraphBuilder): Unit = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeExtensionFinder.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeExtensionFinder.scala index 6c7c4024c26b..f0712ce1f87d 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeExtensionFinder.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeExtensionFinder.scala @@ -1,29 +1,8 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.generated.nodes.{ - Call, - Identifier, - Literal, - Local, - Method, - MethodParameterIn, - MethodParameterOut, - MethodRef, - MethodReturn, - StoredNode -} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.nodemethods.{ - CallMethods, - IdentifierMethods, - LiteralMethods, - LocalMethods, - MethodMethods, - MethodParameterInMethods, - MethodParameterOutMethods, - MethodRefMethods, - MethodReturnMethods -} +import io.shiftleft.semanticcpg.language.nodemethods.* trait NodeExtensionFinder { def apply(n: StoredNode): Option[NodeExtension] diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeSteps.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeSteps.scala index f6ab5321990a..337714e94255 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeSteps.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeSteps.scala @@ -1,18 +1,16 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} import io.shiftleft.semanticcpg.codedumper.CodeDumper -import overflowdb.Node -import overflowdb.traversal._ -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} /** Steps for all node types * * This is the base class for all steps defined on */ -@help.Traversal(elementType = classOf[StoredNode]) +@Traversal(elementType = classOf[StoredNode]) class NodeSteps[NodeType <: StoredNode](val traversal: Iterator[NodeType]) extends AnyVal { @Doc( @@ -23,15 +21,16 @@ class NodeSteps[NodeType <: StoredNode](val traversal: Iterator[NodeType]) exten |the file node that represents that source file. |""" ) - def file: Iterator[File] = - traversal - .choose(_.label) { - case NodeTypes.NAMESPACE => _.in(EdgeTypes.REF).out(EdgeTypes.SOURCE_FILE) - case NodeTypes.COMMENT => _.in(EdgeTypes.AST).hasLabel(NodeTypes.FILE) - case _ => - _.repeat(_.coalesce(_.out(EdgeTypes.SOURCE_FILE), _.in(EdgeTypes.AST)))(_.until(_.hasLabel(NodeTypes.FILE))) - } - .cast[File] + def file: Iterator[File] = { + traversal.flatMap { + case namespace: Namespace => + namespace.refIn.sourceFileOut + case comment: Comment => + comment.astIn + case node => + Iterator(node).repeat(_.coalesce(_._sourceFileOut, _._astIn))(_.until(_.hasLabel(File.Label))).cast[File] + } + } @Doc( info = "Location, including filename and line number", @@ -84,11 +83,6 @@ class NodeSteps[NodeType <: StoredNode](val traversal: Iterator[NodeType]) exten }.l } - /* follow the incoming edges of the given type as long as possible */ - protected def walkIn(edgeType: String): Iterator[Node] = - traversal - .repeat(_.in(edgeType))(_.until(_.in(edgeType).countTrav.filter(_ == 0))) - @Doc( info = "Tag node with `tagName`", longInfo = """ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeTypeStarters.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeTypeStarters.scala index c7e1f59971e5..4f45f3f3bea3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeTypeStarters.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/NodeTypeStarters.scala @@ -1,318 +1,92 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{NodeTypes, Properties} -import overflowdb._ -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc -import overflowdb.traversal.{InitialTraversal, TraversalSource} +import io.shiftleft.codepropertygraph.generated.help.{Doc, TraversalSource} +import io.shiftleft.semanticcpg.language.* -import scala.jdk.CollectionConverters.IteratorHasAsScala +/** Starting point for a new traversal, e.g. + * - `cpg.method`, `cpg.call` etc. - these are generated by the flatgraph codegenerator and automatically inherited + * - `cpg.method.name` + */ +@TraversalSource +class NodeTypeStarters(cpg: Cpg) { -@help.TraversalSource -class NodeTypeStarters(cpg: Cpg) extends TraversalSource(cpg.graph) { - - /** Traverse to all nodes. - */ - @Doc(info = "All nodes of the graph") - override def all: Traversal[StoredNode] = - cpg.graph.nodes.asScala.cast[StoredNode] - - /** Traverse to all annotations - */ - def annotation: Traversal[Annotation] = - InitialTraversal.from[Annotation](cpg.graph, NodeTypes.ANNOTATION) - - /** Traverse to all arguments passed to methods - */ + /** Traverse to all arguments passed to methods */ @Doc(info = "All arguments (actual parameters)") - def argument: Traversal[Expression] = - call.argument + def argument: Iterator[Expression] = + cpg.call.argument - /** Shorthand for `cpg.argument.code(code)` - */ - def argument(code: String): Traversal[Expression] = - argument.code(code) + /** Shorthand for `cpg.argument.code(code)` */ + def argument(code: String): Iterator[Expression] = + cpg.argument.code(code) @Doc(info = "All breaks (`ControlStructure` nodes)") - def break: Traversal[ControlStructure] = - controlStructure.isBreak - - /** Traverse to all call sites - */ - @Doc(info = "All call sites") - def call: Traversal[Call] = - InitialTraversal.from[Call](cpg.graph, NodeTypes.CALL) - - /** Shorthand for `cpg.call.name(name)` - */ - def call(name: String): Traversal[Call] = - call.name(name) - - /** Traverse to all comments in source-based CPGs. - */ - @Doc(info = "All comments in source-based CPGs") - def comment: Traversal[Comment] = - InitialTraversal.from[Comment](cpg.graph, NodeTypes.COMMENT) - - /** Shorthand for `cpg.comment.code(code)` - */ - def comment(code: String): Traversal[Comment] = - comment.has(Properties.CODE -> code) - - /** Traverse to all config files - */ - @Doc(info = "All config files") - def configFile: Traversal[ConfigFile] = - InitialTraversal.from[ConfigFile](cpg.graph, NodeTypes.CONFIG_FILE) - - /** Shorthand for `cpg.configFile.name(name)` - */ - def configFile(name: String): Traversal[ConfigFile] = - configFile.name(name) - - /** Traverse to all dependencies - */ - @Doc(info = "All dependencies") - def dependency: Traversal[Dependency] = - InitialTraversal.from[Dependency](cpg.graph, NodeTypes.DEPENDENCY) - - /** Shorthand for `cpg.dependency.name(name)` - */ - def dependency(name: String): Traversal[Dependency] = - dependency.name(name) - - @Doc(info = "All control structures (source-based frontends)") - def controlStructure: Traversal[ControlStructure] = - InitialTraversal.from[ControlStructure](cpg.graph, NodeTypes.CONTROL_STRUCTURE) + def break: Iterator[ControlStructure] = + cpg.controlStructure.isBreak @Doc(info = "All continues (`ControlStructure` nodes)") - def continue: Traversal[ControlStructure] = - controlStructure.isContinue + def continue: Iterator[ControlStructure] = + cpg.controlStructure.isContinue @Doc(info = "All do blocks (`ControlStructure` nodes)") - def doBlock: Traversal[ControlStructure] = - controlStructure.isDo + def doBlock: Iterator[ControlStructure] = + cpg.controlStructure.isDo @Doc(info = "All else blocks (`ControlStructure` nodes)") - def elseBlock: Traversal[ControlStructure] = - controlStructure.isElse + def elseBlock: Iterator[ControlStructure] = + cpg.controlStructure.isElse @Doc(info = "All throws (`ControlStructure` nodes)") - def throws: Traversal[ControlStructure] = - controlStructure.isThrow - - /** Traverse to all source files - */ - @Doc(info = "All source files") - def file: Traversal[File] = - InitialTraversal.from[File](cpg.graph, NodeTypes.FILE) - - /** Shorthand for `cpg.file.name(name)` - */ - def file(name: String): Traversal[File] = - file.name(name) + def throws: Iterator[ControlStructure] = + cpg.controlStructure.isThrow @Doc(info = "All for blocks (`ControlStructure` nodes)") - def forBlock: Traversal[ControlStructure] = - controlStructure.isFor + def forBlock: Iterator[ControlStructure] = + cpg.controlStructure.isFor @Doc(info = "All gotos (`ControlStructure` nodes)") - def goto: Traversal[ControlStructure] = - controlStructure.isGoto - - /** Traverse to all identifiers, e.g., occurrences of local variables or class members in method bodies. - */ - @Doc(info = "All identifier usages") - def identifier: Traversal[Identifier] = - InitialTraversal.from[Identifier](cpg.graph, NodeTypes.IDENTIFIER) - - /** Shorthand for `cpg.identifier.name(name)` - */ - def identifier(name: String): Traversal[Identifier] = - identifier.name(name) + def goto: Iterator[ControlStructure] = + cpg.controlStructure.isGoto @Doc(info = "All if blocks (`ControlStructure` nodes)") - def ifBlock: Traversal[ControlStructure] = - controlStructure.isIf - - /** Traverse to all jump targets - */ - @Doc(info = "All jump targets, i.e., labels") - def jumpTarget: Traversal[JumpTarget] = - InitialTraversal.from[JumpTarget](cpg.graph, NodeTypes.JUMP_TARGET) - - /** Traverse to all local variable declarations - */ - @Doc(info = "All local variables") - def local: Traversal[Local] = - InitialTraversal.from[Local](cpg.graph, NodeTypes.LOCAL) - - /** Shorthand for `cpg.local.name` - */ - def local(name: String): Traversal[Local] = - local.name(name) - - /** Traverse to all literals (constant strings and numbers provided directly in the code). - */ - @Doc(info = "All literals, e.g., numbers or strings") - def literal: Traversal[Literal] = - InitialTraversal.from[Literal](cpg.graph, NodeTypes.LITERAL) - - /** Shorthand for `cpg.literal.code(code)` - */ - def literal(code: String): Traversal[Literal] = - literal.code(code) - - /** Traverse to all methods - */ - @Doc(info = "All methods") - def method: Traversal[Method] = - InitialTraversal.from[Method](cpg.graph, NodeTypes.METHOD) - - /** Shorthand for `cpg.method.name(name)` - */ - @Doc(info = "All methods with a name that matches the given pattern") - def method(namePattern: String): Traversal[Method] = - method.name(namePattern) - - /** Traverse to all formal return parameters - */ - @Doc(info = "All formal return parameters") - def methodReturn: Traversal[MethodReturn] = - InitialTraversal.from[MethodReturn](cpg.graph, NodeTypes.METHOD_RETURN) - - /** Traverse to all class members - */ - @Doc(info = "All members of complex types (e.g., classes/structures)") - def member: Traversal[Member] = - InitialTraversal.from[Member](cpg.graph, NodeTypes.MEMBER) - - /** Shorthand for `cpg.member.name(name)` - */ - def member(name: String): Traversal[Member] = - member.name(name) - - /** Traverse to all meta data entries - */ - @Doc(info = "Meta data blocks for graph") - def metaData: Traversal[MetaData] = - InitialTraversal.from[MetaData](cpg.graph, NodeTypes.META_DATA) - - /** Traverse to all method references - */ - @Doc(info = "All method references") - def methodRef: Traversal[MethodRef] = - InitialTraversal.from[MethodRef](cpg.graph, NodeTypes.METHOD_REF) - - /** Shorthand for `cpg.methodRef.filter(_.referencedMethod.name(name))` - */ - def methodRef(name: String): Traversal[MethodRef] = - methodRef.where(_.referencedMethod.name(name)) - - /** Traverse to all namespaces, e.g., packages in Java. - */ - @Doc(info = "All namespaces") - def namespace: Traversal[Namespace] = - InitialTraversal.from[Namespace](cpg.graph, NodeTypes.NAMESPACE) - - /** Shorthand for `cpg.namespace.name(name)` - */ - def namespace(name: String): Traversal[Namespace] = - namespace.name(name) - - /** Traverse to all namespace blocks, e.g., packages in Java. - */ - def namespaceBlock: Traversal[NamespaceBlock] = - InitialTraversal.from[NamespaceBlock](cpg.graph, NodeTypes.NAMESPACE_BLOCK) - - /** Shorthand for `cpg.namespaceBlock.name(name)` - */ - def namespaceBlock(name: String): Traversal[NamespaceBlock] = - namespaceBlock.name(name) - - /** Traverse to all input parameters - */ + def ifBlock: Iterator[ControlStructure] = + cpg.controlStructure.isIf + + /** Shorthand for `cpg.methodRef.where(_.referencedMethod.name(name))` + * + * Note re API design: this step was supposed to be called `methodRef(name: String)`, but due to limitations in + * Scala's implicit resolution (and the setup of our implicit steps) we have to disambiguate it from `.methodRef` by + * name. + * + * More precisely: Scala's implicit resolution reports 'ambiguous implicits' if two methods with the same name but + * different parameters are defined in two different (implicitly reachable) classes. The `.methodRef` step is defined + * in `generated.CpgNodeStarter`. This step (filter by name) doesn't get generated by the codegen because it's more + * complex than the other 'filter by primary key' starter steps. + */ + def methodRefWithName(name: String): Iterator[MethodRef] = + cpg.methodRef.where(_.referencedMethod.name(name)) + + /** Traverse to all input parameters */ @Doc(info = "All parameters") - def parameter: Traversal[MethodParameterIn] = - InitialTraversal.from[MethodParameterIn](cpg.graph, NodeTypes.METHOD_PARAMETER_IN) + def parameter: Iterator[MethodParameterIn] = + cpg.methodParameterIn - /** Shorthand for `cpg.parameter.name(name)` - */ - def parameter(name: String): Traversal[MethodParameterIn] = + /** Shorthand for `cpg.parameter.name(name)` */ + def parameter(name: String): Iterator[MethodParameterIn] = parameter.name(name) - /** Traverse to all return expressions - */ - @Doc(info = "All actual return parameters") - def ret: Traversal[Return] = - InitialTraversal.from[Return](cpg.graph, NodeTypes.RETURN) - - /** Shorthand for `returns.code(code)` - */ - def ret(code: String): Traversal[Return] = - ret.code(code) - - @Doc(info = "All imports") - def imports: Traversal[Import] = - InitialTraversal.from[Import](cpg.graph, NodeTypes.IMPORT) - @Doc(info = "All switch blocks (`ControlStructure` nodes)") - def switchBlock: Traversal[ControlStructure] = - controlStructure.isSwitch + def switchBlock: Iterator[ControlStructure] = + cpg.controlStructure.isSwitch @Doc(info = "All try blocks (`ControlStructure` nodes)") - def tryBlock: Traversal[ControlStructure] = - controlStructure.isTry - - /** Traverse to all types, e.g., Set - */ - @Doc(info = "All used types") - def typ: Traversal[Type] = - InitialTraversal.from[Type](cpg.graph, NodeTypes.TYPE) - - /** Shorthand for `cpg.typ.name(name)` - */ - @Doc(info = "All used types with given name") - def typ(name: String): Traversal[Type] = - typ.name(name) - - /** Traverse to all declarations, e.g., Set - */ - @Doc(info = "All declarations of types") - def typeDecl: Traversal[TypeDecl] = - InitialTraversal.from[TypeDecl](cpg.graph, NodeTypes.TYPE_DECL) - - /** Shorthand for cpg.typeDecl.name(name) - */ - def typeDecl(name: String): Traversal[TypeDecl] = - typeDecl.name(name) - - /** Traverse to all tags - */ - @Doc(info = "All tags") - def tag: Traversal[Tag] = - InitialTraversal.from[Tag](cpg.graph, NodeTypes.TAG) - - @Doc(info = "All tags with given name") - def tag(name: String): Traversal[Tag] = - tag.name(name) - - /** Traverse to all template DOM nodes - */ - @Doc(info = "All template DOM nodes") - def templateDom: Traversal[TemplateDom] = - InitialTraversal.from[TemplateDom](cpg.graph, NodeTypes.TEMPLATE_DOM) - - /** Traverse to all type references - */ - @Doc(info = "All type references") - def typeRef: Traversal[TypeRef] = - InitialTraversal.from[TypeRef](cpg.graph, NodeTypes.TYPE_REF) + def tryBlock: Iterator[ControlStructure] = + cpg.controlStructure.isTry @Doc(info = "All while blocks (`ControlStructure` nodes)") - def whileBlock: Traversal[ControlStructure] = - controlStructure.isWhile + def whileBlock: Iterator[ControlStructure] = + cpg.controlStructure.isWhile } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Show.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Show.scala index 0194d4dc571b..e6efabae3f28 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Show.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Show.scala @@ -1,9 +1,8 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.generated.nodes.NewNode -import overflowdb.Node +import io.shiftleft.codepropertygraph.generated.nodes.{AbstractNode, NewNode, StoredNode} -import scala.jdk.CollectionConverters._ +import scala.jdk.CollectionConverters.* /** Typeclass for (pretty) printing an object */ @@ -18,20 +17,20 @@ object Show { override def apply(a: Any): String = a match { case node: NewNode => val label = node.label - val properties = propsToString(node.properties.toList) + val properties = propsToString(node.properties) s"($label): $properties" - case node: Node => + case node: StoredNode => val label = node.label val id = node.id().toString - val properties = propsToString(node.propertiesMap.asScala.toList) + val properties = propsToString(node.properties) s"($label,$id): $properties" case other => other.toString } - private def propsToString(keyValues: List[(String, Any)]): String = { - keyValues + private def propsToString(properties: Map[String, Any]): String = { + properties .filter(_._2.toString.nonEmpty) .sortBy(_._1) .map { case (key, value) => s"$key: $value" } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Steps.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Steps.scala index 4aa0fce401d3..3db74bbff3aa 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Steps.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/Steps.scala @@ -1,9 +1,9 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.generated.nodes.AbstractNode +import io.shiftleft.codepropertygraph.generated.nodes.{AbstractNode, StoredNode} import org.json4s.native.Serialization.{write, writePretty} import org.json4s.{CustomSerializer, Extraction, Formats} -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import replpp.Colors import replpp.Operators.* @@ -14,6 +14,7 @@ import scala.jdk.CollectionConverters.* /** Base class for our DSL These are the base steps available in all steps of the query language. There are no * constraints on the element types, unlike e.g. [[NodeSteps]] */ +@Traversal(elementType = classOf[AnyRef]) class Steps[A](val traversal: Iterator[A]) extends AnyVal { /** Execute the traversal and convert it to a mutable buffer @@ -82,7 +83,7 @@ object Steps { private lazy val nodeSerializer = new CustomSerializer[AbstractNode](implicit format => ( { case _ => ??? }, - { case node: (AbstractNode & Product) => + { case node: AbstractNode => val elementMap = (0 until node.productArity).map { i => val label = node.productElementName(i) val element = node.productElement(i) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/ConfigFileTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/ConfigFileTraversal.scala index 936cf1439df9..c2a8d6e5efc9 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/ConfigFileTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/ConfigFileTraversal.scala @@ -1,9 +1,10 @@ package io.shiftleft.semanticcpg.language.android import io.joern.semanticcpg.utils.SecureXmlParsing -import io.shiftleft.codepropertygraph.generated.nodes +import io.shiftleft.codepropertygraph.generated.nodes.ConfigFile +import io.shiftleft.semanticcpg.language.* -class ConfigFileTraversal(val traversal: Iterator[nodes.ConfigFile]) extends AnyVal { +class ConfigFileTraversal(val traversal: Iterator[ConfigFile]) extends AnyVal { def usesCleartextTraffic = traversal .filter(_.name.endsWith(Constants.androidManifestXml)) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/NodeTypeStarters.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/NodeTypeStarters.scala index b2e650f8b519..ad7768a02fce 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/NodeTypeStarters.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/NodeTypeStarters.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.android -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/package.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/package.scala index f0a65a3209e6..f60c517b107e 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/package.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/android/package.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{ConfigFile, Literal, Local, Method} /** Language extensions for android. */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/callgraphextension/MethodTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/callgraphextension/MethodTraversal.scala index 6b627ae47e06..29f08c4af74e 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/callgraphextension/MethodTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/callgraphextension/MethodTraversal.scala @@ -1,9 +1,11 @@ package io.shiftleft.semanticcpg.language.callgraphextension -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Method} +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Method]) class MethodTraversal(val traversal: Iterator[Method]) extends AnyVal { /** Intended for internal use! Traverse to direct and transitive callers of the method. diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/AstNodeDot.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/AstNodeDot.scala index aa10a624c79f..80f3622f27ae 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/AstNodeDot.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/AstNodeDot.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.dotextension import io.shiftleft.codepropertygraph.generated.nodes.AstNode import io.shiftleft.semanticcpg.dotgenerator.DotAstGenerator -import overflowdb.traversal.* +import io.shiftleft.semanticcpg.language.* class AstNodeDot[NodeType <: AstNode](val traversal: Iterator[NodeType]) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/CfgNodeDot.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/CfgNodeDot.scala index 107b19037495..84d1bdf4647d 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/CfgNodeDot.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/CfgNodeDot.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.dotextension import io.shiftleft.codepropertygraph.generated.nodes.Method import io.shiftleft.semanticcpg.dotgenerator.{DotCdgGenerator, DotCfgGenerator} -import overflowdb.traversal.* +import io.shiftleft.semanticcpg.language.* class CfgNodeDot(val traversal: Iterator[Method]) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/InterproceduralNodeDot.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/InterproceduralNodeDot.scala index 2b7e5195345a..3c7072741719 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/InterproceduralNodeDot.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/dotextension/InterproceduralNodeDot.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.dotextension -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.dotgenerator.{DotCallGraphGenerator, DotTypeHierarchyGenerator} class InterproceduralNodeDot(val cpg: Cpg) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/importresolver/ResolvedImportAsTagTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/importresolver/ResolvedImportAsTagTraversal.scala index 4400d389dcd9..1e6b4d6dead8 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/importresolver/ResolvedImportAsTagTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/importresolver/ResolvedImportAsTagTraversal.scala @@ -1,18 +1,17 @@ package io.shiftleft.semanticcpg.language.importresolver +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, Declaration, Member, Tag} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc class ResolvedImportAsTagExt(node: Tag) extends AnyVal { - @Doc(info = "Parses this tag as an EvaluatedImport class") def _toEvaluatedImport: Option[EvaluatedImport] = EvaluatedImport.tagToEvaluatedImport(node) - @Doc(info = "If this tag represents a resolved import, will attempt to find the CPG entities this refers to") def resolvedEntity: Iterator[AstNode] = { - val cpg = Cpg(node.graph()) + val cpg = Cpg(node.graph) node._toEvaluatedImport.iterator .collectAll[ResolvedImport] .flatMap { @@ -25,9 +24,9 @@ class ResolvedImportAsTagExt(node: Tag) extends AnyVal { } .iterator } - } +@Traversal(elementType = classOf[Tag]) class ResolvedImportAsTagTraversal(steps: Iterator[Tag]) extends AnyVal { @Doc(info = "Parses these tags as EvaluatedImport classes") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/Implicits.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/Implicits.scala index 21b2a8deee66..fd8e243bd420 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/Implicits.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/Implicits.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.modulevariable -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.modulevariable.nodemethods.* diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableAsNodeTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableAsNodeTraversal.scala index c115d84a3883..741f650ee6ba 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableAsNodeTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableAsNodeTraversal.scala @@ -1,12 +1,14 @@ package io.shiftleft.semanticcpg.language.modulevariable +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{Cpg, Operators} import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.modulevariable.OpNodes import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.FieldAccess -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Local]) class ModuleVariableAsLocalTraversal(traversal: Iterator[Local]) extends AnyVal { @Doc(info = "Locals representing module variables") @@ -16,6 +18,7 @@ class ModuleVariableAsLocalTraversal(traversal: Iterator[Local]) extends AnyVal } +@Traversal(elementType = classOf[Identifier]) class ModuleVariableAsIdentifierTraversal(traversal: Iterator[Identifier]) extends AnyVal { @Doc(info = "Identifiers representing module variables") @@ -25,12 +28,13 @@ class ModuleVariableAsIdentifierTraversal(traversal: Iterator[Identifier]) exten } +@Traversal(elementType = classOf[FieldIdentifier]) class ModuleVariableAsFieldIdentifierTraversal(traversal: Iterator[FieldIdentifier]) extends AnyVal { @Doc(info = "Field identifiers representing module variables") def moduleVariables: Iterator[OpNodes.ModuleVariable] = { traversal.flatMap { fieldIdentifier => - Cpg(fieldIdentifier.graph()).method + Cpg(fieldIdentifier.graph).method .fullNameExact(fieldIdentifier.inFieldAccess.argument(1).isIdentifier.typeFullName.toSeq*) .isModule .local @@ -40,13 +44,14 @@ class ModuleVariableAsFieldIdentifierTraversal(traversal: Iterator[FieldIdentifi } +@Traversal(elementType = classOf[Member]) class ModuleVariableAsMemberTraversal(traversal: Iterator[Member]) extends AnyVal { @Doc(info = "Members representing module variables") def moduleVariables: Iterator[OpNodes.ModuleVariable] = { val members = traversal.toList lazy val memberNames = members.name.toSeq - members.headOption.map(m => Cpg(m.graph())) match + members.headOption.map(m => Cpg(m.graph)) match case Some(cpg) => cpg.method .fullNameExact(members.typeDecl.fullName.toSeq*) @@ -57,6 +62,7 @@ class ModuleVariableAsMemberTraversal(traversal: Iterator[Member]) extends AnyVa } +@Traversal(elementType = classOf[Expression]) class ModuleVariableAsExpressionTraversal(traversal: Iterator[Expression]) extends AnyVal { @Doc(info = "Expression nodes representing module variables") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableTraversal.scala index 1c58587093c2..23e12cd0fe32 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/ModuleVariableTraversal.scala @@ -1,11 +1,13 @@ package io.shiftleft.semanticcpg.language.modulevariable +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Local]) class ModuleVariableTraversal(traversal: Iterator[OpNodes.ModuleVariable]) extends AnyVal { @Doc(info = "All assignments where the module variables in this traversal are the target across the program") @@ -32,7 +34,7 @@ class ModuleVariableTraversal(traversal: Iterator[OpNodes.ModuleVariable]) exten ) def references: Iterator[Identifier | FieldIdentifier] = { val variables = traversal.toList - variables.headOption.map(node => Cpg(node.graph())) match + variables.headOption.map(node => Cpg(node.graph)) match case Some(cpg) => val modules = cpg.method.isModule.l val variableNames = variables.name.toSet @@ -78,7 +80,7 @@ class ModuleVariableTraversal(traversal: Iterator[OpNodes.ModuleVariable]) exten val variables = traversal.toList lazy val moduleNames = variables.method.isModule.fullName.dedup.toSeq lazy val variableNames = variables.name.toSeq - variables.headOption.map(node => Cpg(node.graph())) match + variables.headOption.map(node => Cpg(node.graph)) match case Some(cpg) => cpg.typeDecl.fullNameExact(moduleNames*).member.nameExact(variableNames*) case None => Iterator.empty } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/NodeTypeStarters.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/NodeTypeStarters.scala index 36580f4f318b..da34b086d2af 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/NodeTypeStarters.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/NodeTypeStarters.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.modulevariable -import io.shiftleft.codepropertygraph.Cpg -import overflowdb.traversal.help.{Doc, TraversalSource} +import io.shiftleft.codepropertygraph.generated.help.{Doc, TraversalSource} +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* @TraversalSource diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/OpNodes.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/OpNodes.scala index dd442178f8af..2c43a8bf567c 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/OpNodes.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/OpNodes.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.modulevariable -import io.shiftleft.codepropertygraph.generated.nodes.{Block, Local, Member, StaticType} +import io.shiftleft.codepropertygraph.generated.nodes.{Local, StaticType} trait ModuleVariableT object OpNodes { @@ -8,7 +8,6 @@ object OpNodes { /** Represents a module-level global variable. This kind of node behaves like both a local variable and a field access * and is common in languages such as Python/JavaScript. */ - type ModuleVariable = Local & StaticType[ModuleVariableT] } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableAsNodeMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableAsNodeMethods.scala index fb80d7092fa2..f70927b3dea2 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableAsNodeMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableAsNodeMethods.scala @@ -2,11 +2,11 @@ package io.shiftleft.semanticcpg.language.modulevariable.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{Identifier, Local, Member} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc class ModuleVariableAsLocalMethods(node: Local) extends AnyVal { - @Doc(info = "If this local is declared on the module-defining method level") + /** If this local is declared on the module-defining method level */ def isModuleVariable: Boolean = node.method.isModule.nonEmpty } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableMethods.scala index ee2a84c2e86d..5a13de925796 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/modulevariable/nodemethods/ModuleVariableMethods.scala @@ -6,19 +6,19 @@ import io.shiftleft.semanticcpg.language.modulevariable.OpNodes import io.shiftleft.semanticcpg.language.operatorextension.OpNodes as OpExtNodes import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.importresolver.{ResolvedMember, ResolvedTypeDecl} -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc class ModuleVariableMethods(node: OpNodes.ModuleVariable) extends AnyVal { - @Doc(info = "References of this module variable across the codebase, as either identifiers or field identifiers") + /** References of this module variable across the codebase, as either identifiers or field identifiers */ def references: Iterator[Identifier | FieldIdentifier] = node.start.references - @Doc(info = "The module members being referenced in the respective module type declaration") + /** The module members being referenced in the respective module type declaration */ def referencingMembers: Iterator[Member] = { - Cpg(node.graph()).typeDecl.fullNameExact(node.method.fullName.toSeq*).member.nameExact(node.name) + Cpg(node.graph).typeDecl.fullNameExact(node.method.fullName.toSeq*).member.nameExact(node.name) } - @Doc(info = "Returns the assignments where the module variable is the target (LHS)") + /** Returns the assignments where the module variable is the target (LHS) */ def definitions: Iterator[OpExtNodes.Assignment] = node.start.definitions } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/AstNodeMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/AstNodeMethods.scala index 14ad5766be64..c23ff1a463d5 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/AstNodeMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/AstNodeMethods.scala @@ -56,7 +56,7 @@ class AstNodeMethods(val node: AstNode) extends AnyVal with NodeExtension { val additionalDepth = if (p(node)) { 1 } else { 0 } - val childDepths = node.astChildren.map(_.depth(p)).l + val childDepths = astChildren.map(_.depth(p)).l additionalDepth + (if (childDepths.isEmpty) { 0 } else { @@ -70,7 +70,7 @@ class AstNodeMethods(val node: AstNode) extends AnyVal with NodeExtension { /** Direct children of node in the AST. Siblings are ordered by their `order` fields */ def astChildren: Iterator[AstNode] = - node._astOut.cast[AstNode].sortBy(_.order).iterator + node._astOut.cast[AstNode].toSeq.sortBy(_.order).iterator /** Siblings of this node in the AST, ordered by their `order` fields */ @@ -108,8 +108,7 @@ class AstNodeMethods(val node: AstNode) extends AnyVal with NodeExtension { case member: Member => member case node: MethodParameterIn => node.method - case node: MethodParameterOut => - node.method.methodReturn + case node: MethodParameterOut => node.method.methodReturn case node: Call if MemberAccess.isGenericMemberAccessName(node.name) => parentExpansion(node) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CallMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CallMethods.scala index b124dcbd0c2e..0d228ce4be7c 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CallMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CallMethods.scala @@ -6,20 +6,27 @@ import io.shiftleft.semanticcpg.NodeExtension import io.shiftleft.semanticcpg.language.* class CallMethods(val node: Call) extends AnyVal with NodeExtension with HasLocation { + + def isStatic: Boolean = + node.dispatchType == "STATIC_DISPATCH" + + def isDynamic: Boolean = + node.dispatchType == "DYNAMIC_DISPATCH" + def receiver: Iterator[Expression] = - node.receiverOut + node.receiverOut.collectAll[Expression] def arguments(index: Int): Iterator[Expression] = - node._argumentOut - .collect { - case expr: Expression if expr.argumentIndex == index => expr - } + node._argumentOut.collect { + case expr: Expression if expr.argumentIndex == index => expr + } + // TODO define as named step in the schema def argument: Iterator[Expression] = node._argumentOut.collectAll[Expression] def argument(index: Int): Expression = - arguments(index).head + arguments(index).next def argumentOption(index: Int): Option[Expression] = node._argumentOut.collectFirst { @@ -32,7 +39,6 @@ class CallMethods(val node: Call) extends AnyVal with NodeExtension with HasLoca node.astChildren.isBlock.maxByOption(_.order).iterator.expressionDown } - override def location: NewLocation = { + override def location: NewLocation = LocationCreator(node, node.code, node.label, node.lineNumber, node.method) - } } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CfgNodeMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CfgNodeMethods.scala index 08ee7d72a7e6..fa14297ad531 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CfgNodeMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/CfgNodeMethods.scala @@ -11,9 +11,8 @@ class CfgNodeMethods(val node: CfgNode) extends AnyVal with NodeExtension { /** Successors in the CFG */ - def cfgNext: Iterator[CfgNode] = { + def cfgNext: Iterator[CfgNode] = Iterator.single(node).cfgNext - } /** Maps each node in the traversal to a traversal returning its n successors. */ @@ -31,9 +30,8 @@ class CfgNodeMethods(val node: CfgNode) extends AnyVal with NodeExtension { /** Predecessors in the CFG */ - def cfgPrev: Iterator[CfgNode] = { + def cfgPrev: Iterator[CfgNode] = Iterator.single(node).cfgPrev - } /** Recursively determine all nodes on which this CFG node is control-dependent. */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/IdentifierMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/IdentifierMethods.scala index e04ff421b06a..134f42ae3397 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/IdentifierMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/IdentifierMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{Declaration, Identifier, NewLocation} import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.{HasLocation, LocationCreator, *} +import io.shiftleft.semanticcpg.language.* class IdentifierMethods(val identifier: Identifier) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LiteralMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LiteralMethods.scala index 3bbc9892b5bc..8962c206ff4a 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LiteralMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LiteralMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{Literal, NewLocation} import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.{HasLocation, LocationCreator, _} +import io.shiftleft.semanticcpg.language.* class LiteralMethods(val literal: Literal) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LocalMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LocalMethods.scala index 9bfa5eac78bc..94abc5458ecd 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LocalMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/LocalMethods.scala @@ -6,7 +6,7 @@ import io.shiftleft.semanticcpg.language.* class LocalMethods(val local: Local) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { - LocationCreator(local, local.name, local.label, local.lineNumber, local.method.head) + LocationCreator(local, local.name, local.label, local.lineNumber, method.head) } /** The method hosting this local variable diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodMethods.scala index 52a2034ae28f..7141f8aa8af0 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodMethods.scala @@ -37,14 +37,14 @@ class MethodMethods(val method: Method) extends AnyVal with NodeExtension with H /** List of CFG nodes in reverse post order */ def reversePostOrder: Iterator[CfgNode] = { - def expand(x: CfgNode) = { x.cfgNext.iterator } + def expand(x: CfgNode) = x.cfgNext.iterator NodeOrdering.reverseNodeList(NodeOrdering.postOrderNumbering(method, expand).toList).iterator } /** List of CFG nodes in post order */ def postOrder: Iterator[CfgNode] = { - def expand(x: CfgNode) = { x.cfgNext.iterator } + def expand(x: CfgNode) = x.cfgNext.iterator NodeOrdering.nodeList(NodeOrdering.postOrderNumbering(method, expand).toList).iterator } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterInMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterInMethods.scala index 1f2a0c5420cc..1b39a89145c3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterInMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterInMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{MethodParameterIn, NewLocation} import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.{HasLocation, LocationCreator} +import io.shiftleft.semanticcpg.language.* class MethodParameterInMethods(val paramIn: MethodParameterIn) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterOutMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterOutMethods.scala index 851c5949abbb..29471342f6ca 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterOutMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodParameterOutMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{MethodParameterOut, NewLocation} import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.{HasLocation, LocationCreator} +import io.shiftleft.semanticcpg.language.* class MethodParameterOutMethods(val paramOut: MethodParameterOut) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodRefMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodRefMethods.scala index fc971fff51c9..03ea62a6dd3a 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodRefMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodRefMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.{MethodRef, NewLocation} import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language.{HasLocation, LocationCreator} +import io.shiftleft.semanticcpg.language.* class MethodRefMethods(val methodRef: MethodRef) extends AnyVal with NodeExtension with HasLocation { override def location: NewLocation = { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodReturnMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodReturnMethods.scala index 4ea458735b3b..8d7494c63773 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodReturnMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/MethodReturnMethods.scala @@ -19,5 +19,6 @@ class MethodReturnMethods(val node: MethodReturn) extends AnyVal with NodeExtens callsites.collectAll[Call] } + // TODO define in schema as named step def typ: Iterator[Type] = node.evalTypeOut } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/NodeMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/NodeMethods.scala index 600fe2c1299a..25325e1faccb 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/NodeMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/nodemethods/NodeMethods.scala @@ -1,11 +1,10 @@ package io.shiftleft.semanticcpg.language.nodemethods -import io.shiftleft.codepropertygraph.generated.nodes.{NewLocation, StoredNode} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.NodeExtension -import io.shiftleft.semanticcpg.language._ -import overflowdb.NodeOrDetachedNode +import io.shiftleft.semanticcpg.language.* -class NodeMethods(val node: NodeOrDetachedNode) extends AnyVal with NodeExtension { +class NodeMethods(val node: AbstractNode) extends AnyVal with NodeExtension { def location(implicit finder: NodeExtensionFinder): NewLocation = node match { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/ArrayAccessTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/ArrayAccessTraversal.scala index cc3b25194d16..4cc8d1d7d840 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/ArrayAccessTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/ArrayAccessTraversal.scala @@ -1,9 +1,11 @@ package io.shiftleft.semanticcpg.language.operatorextension -import io.shiftleft.codepropertygraph.generated.nodes.{Expression, Identifier} -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} +import io.shiftleft.codepropertygraph.generated.nodes.{Call, Expression, Identifier} +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Call]) class ArrayAccessTraversal(val traversal: Iterator[OpNodes.ArrayAccess]) extends AnyVal { @Doc(info = "The expression representing the array") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/AssignmentTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/AssignmentTraversal.scala index f7751bedab93..31cf82c39a6b 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/AssignmentTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/AssignmentTraversal.scala @@ -1,11 +1,12 @@ package io.shiftleft.semanticcpg.language.operatorextension +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes +import io.shiftleft.codepropertygraph.generated.nodes.{Call, Expression} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc -@help.Traversal(elementType = classOf[nodes.Call]) +@Traversal(elementType = classOf[Call]) class AssignmentTraversal(val traversal: Iterator[OpNodes.Assignment]) extends AnyVal { @Doc(info = "Left-hand sides of assignments") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/FieldAccessTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/FieldAccessTraversal.scala index 6bb06f0ce627..2a0a535afce9 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/FieldAccessTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/FieldAccessTraversal.scala @@ -1,9 +1,11 @@ package io.shiftleft.semanticcpg.language.operatorextension -import io.shiftleft.codepropertygraph.generated.nodes.{FieldIdentifier, Member, TypeDecl} +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} +import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Member, TypeDecl} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Call]) class FieldAccessTraversal(val traversal: Iterator[OpNodes.FieldAccess]) extends AnyVal { @Doc(info = "Attempts to resolve the type declaration for this field access") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/Implicits.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/Implicits.scala index bfea44dba931..5f63f72efef3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/Implicits.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/Implicits.scala @@ -1,23 +1,28 @@ package io.shiftleft.semanticcpg.language.operatorextension -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, Expression} -import io.shiftleft.semanticcpg.language.operatorextension.nodemethods._ +import io.shiftleft.semanticcpg.language.operatorextension.nodemethods.* trait Implicits { + implicit def toNodeTypeStartersOperatorExtension(cpg: Cpg): NodeTypeStarters = new NodeTypeStarters(cpg) implicit def toArrayAccessExt(arrayAccess: OpNodes.ArrayAccess): ArrayAccessMethods = new ArrayAccessMethods(arrayAccess) + implicit def toArrayAccessTrav(steps: Iterator[OpNodes.ArrayAccess]): ArrayAccessTraversal = new ArrayAccessTraversal(steps) implicit def toFieldAccessExt(fieldAccess: OpNodes.FieldAccess): FieldAccessMethods = new FieldAccessMethods(fieldAccess) + implicit def toFieldAccessTrav(steps: Iterator[OpNodes.FieldAccess]): FieldAccessTraversal = new FieldAccessTraversal(steps) - implicit def toAssignmentExt(assignment: OpNodes.Assignment): AssignmentMethods = new AssignmentMethods(assignment) + implicit def toAssignmentExt(assignment: OpNodes.Assignment): AssignmentMethods = + new AssignmentMethods(assignment) + implicit def toAssignmentTrav(steps: Iterator[OpNodes.Assignment]): AssignmentTraversal = new AssignmentTraversal(steps) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/NodeTypeStarters.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/NodeTypeStarters.scala index 092bfeb0d593..c012b035b506 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/NodeTypeStarters.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/NodeTypeStarters.scala @@ -1,11 +1,10 @@ package io.shiftleft.semanticcpg.language.operatorextension -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.help.{Doc, TraversalSource} +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.{Doc, TraversalSource} -/** Steps that allow traversing from `cpg` to operators. - */ +/** Steps that allow traversing from `cpg` to operators. */ @TraversalSource class NodeTypeStarters(cpg: Cpg) { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/OpAstNodeTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/OpAstNodeTraversal.scala index d5c61829abb7..ab9ccd10a6af 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/OpAstNodeTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/OpAstNodeTraversal.scala @@ -1,9 +1,11 @@ package io.shiftleft.semanticcpg.language.operatorextension +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.AstNode import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[AstNode]) class OpAstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal { @Doc(info = "Any assignments that this node is a part of (traverse up)") diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/TargetTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/TargetTraversal.scala index 3a17608b98e3..4e8b700c8ae8 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/TargetTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/TargetTraversal.scala @@ -1,9 +1,11 @@ package io.shiftleft.semanticcpg.language.operatorextension +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.Expression import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc +@Traversal(elementType = classOf[Expression]) class TargetTraversal(val traversal: Iterator[Expression]) extends AnyVal { @Doc( diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/ArrayAccessMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/ArrayAccessMethods.scala index 8675591639b8..578c429f54ed 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/ArrayAccessMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/ArrayAccessMethods.scala @@ -22,7 +22,7 @@ class ArrayAccessMethods(val arrayAccess: OpNodes.ArrayAccess) extends AnyVal { } def simpleName: Iterator[String] = { - arrayAccess.array match { + array match { case id: Identifier => Iterator.single(id.name) case _ => Iterator.empty } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/AssignmentMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/AssignmentMethods.scala index 4faa072246f2..d470dbe92a12 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/AssignmentMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/AssignmentMethods.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.operatorextension.nodemethods import io.shiftleft.codepropertygraph.generated.nodes.Expression -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.OpNodes class AssignmentMethods(val assignment: OpNodes.Assignment) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/TargetMethods.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/TargetMethods.scala index 1a301475a3eb..dc633f06599b 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/TargetMethods.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/operatorextension/nodemethods/TargetMethods.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.operatorextension.nodemethods import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.{Call, Expression} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.language.operatorextension.{OpNodes, allArrayAccessTypes} class TargetMethods(val expr: Expression) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/package.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/package.scala index f1db42d98137..cb36c6d7deb3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/package.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/package.scala @@ -1,8 +1,9 @@ package io.shiftleft.semanticcpg -import io.shiftleft.codepropertygraph.Cpg +import flatgraph.help.DocSearchPackages +import io.shiftleft.codepropertygraph.generated +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.traversal.NodeTraversalImplicits import io.shiftleft.semanticcpg.language.bindingextension.{ MethodTraversal as BindingMethodTraversal, TypeDeclTraversal as BindingTypeDeclTraversal @@ -10,16 +11,11 @@ import io.shiftleft.semanticcpg.language.bindingextension.{ import io.shiftleft.semanticcpg.language.callgraphextension.{CallTraversal, MethodTraversal} import io.shiftleft.semanticcpg.language.dotextension.{AstNodeDot, CfgNodeDot, InterproceduralNodeDot} import io.shiftleft.semanticcpg.language.nodemethods.* -import io.shiftleft.semanticcpg.language.types.expressions.generalizations.{ - AstNodeTraversal, - CfgNodeTraversal, - DeclarationTraversal, - ExpressionTraversal -} +import io.shiftleft.semanticcpg.language.types.expressions.generalizations.* import io.shiftleft.semanticcpg.language.types.expressions.{CallTraversal as OriginalCall, *} import io.shiftleft.semanticcpg.language.types.propertyaccessors.* import io.shiftleft.semanticcpg.language.types.structure.{MethodTraversal as OriginalMethod, *} -import overflowdb.NodeOrDetachedNode +import io.shiftleft.semanticcpg.language.types.structure.* /** Language for traversing the code property graph * @@ -27,20 +23,19 @@ import overflowdb.NodeOrDetachedNode * `steps` package, e.g. `Steps` */ package object language - extends operatorextension.Implicits + extends generated.language + with operatorextension.Implicits with modulevariable.Implicits with importresolver.Implicits - with LowPrioImplicits - with NodeTraversalImplicits { + with LowPrioImplicits { // Implicit conversions from generated node types. We use these to add methods // to generated node types. + implicit def cfgNodeToAstNode(node: CfgNode): AstNodeMethods = new AstNodeMethods(node) + implicit def toExtendedNode(node: AbstractNode): NodeMethods = new NodeMethods(node) + implicit def toExtendedStoredNode(node: StoredNode): StoredNodeMethods = new StoredNodeMethods(node) + implicit def toAstNodeMethods(node: AstNode): AstNodeMethods = new AstNodeMethods(node) + implicit def toExpressionMethods(node: Expression): ExpressionMethods = new ExpressionMethods(node) - implicit def cfgNodeToAsNode(node: CfgNode): AstNodeMethods = new AstNodeMethods(node) - implicit def toExtendedNode(node: NodeOrDetachedNode): NodeMethods = new NodeMethods(node) - implicit def toExtendedStoredNode(node: StoredNode): StoredNodeMethods = new StoredNodeMethods(node) - implicit def toAstNodeMethods(node: AstNode): AstNodeMethods = new AstNodeMethods(node) - implicit def toCfgNodeMethods(node: CfgNode): CfgNodeMethods = new CfgNodeMethods(node) - implicit def toExpressionMethods(node: Expression): ExpressionMethods = new ExpressionMethods(node) implicit def toMethodMethods(node: Method): MethodMethods = new MethodMethods(node) implicit def toMethodReturnMethods(node: MethodReturn): MethodReturnMethods = new MethodReturnMethods(node) implicit def toCallMethods(node: Call): CallMethods = new CallMethods(node) @@ -68,8 +63,7 @@ package object language implicit def iterOnceToTypeDeclTrav[A <: TypeDecl](a: IterableOnce[A]): TypeDeclTraversal = new TypeDeclTraversal(a.iterator) - implicit def iterOnceToOriginalCallTrav[A <: Call](a: IterableOnce[A]): OriginalCall = - new OriginalCall(a.iterator) + implicit def iterOnceToOriginalCallTrav(traversal: IterableOnce[Call]): OriginalCall = new OriginalCall(traversal) implicit def singleToControlStructureTrav[A <: ControlStructure](a: A): ControlStructureTraversal = new ControlStructureTraversal(Iterator.single(a)) @@ -110,8 +104,6 @@ package object language implicit def iterOnceToMethodParameterInTrav[A <: MethodParameterIn](a: IterableOnce[A]): MethodParameterTraversal = new MethodParameterTraversal(a.iterator) - implicit def singleToMethodParameterOutTrav[A <: MethodParameterOut](a: A): MethodParameterOutTraversal = - new MethodParameterOutTraversal(Iterator.single(a)) implicit def iterOnceToMethodParameterOutTrav[A <: MethodParameterOut]( a: IterableOnce[A] ): MethodParameterOutTraversal = @@ -163,11 +155,6 @@ package object language implicit def iterOnceToBindingTypeDeclTrav[A <: TypeDecl](a: IterableOnce[A]): BindingTypeDeclTraversal = new BindingTypeDeclTraversal(a.iterator) - implicit def singleToAstNodeDot[A <: AstNode](a: A): AstNodeDot[A] = - new AstNodeDot(Iterator.single(a)) - implicit def iterOnceToAstNodeDot[A <: AstNode](a: IterableOnce[A]): AstNodeDot[A] = - new AstNodeDot(a.iterator) - implicit def singleToCfgNodeDot[A <: Method](a: A): CfgNodeDot = new CfgNodeDot(Iterator.single(a)) implicit def iterOnceToCfgNodeDot[A <: Method](a: IterableOnce[A]): CfgNodeDot = @@ -268,11 +255,29 @@ package object language implicit def toExpression[A <: Expression](a: IterableOnce[A]): ExpressionTraversal[A] = new ExpressionTraversal[A](a.iterator) + + object NonStandardImplicits { + + // note: this causes problems because MethodParameterOut has an `index` property and the `MethodParameterOutTraversal` defines an `index` step... + implicit def singleToMethodParameterOutTrav[A <: MethodParameterOut](a: A): MethodParameterOutTraversal = + new MethodParameterOutTraversal(Iterator.single(a)) + + } } -trait LowPrioImplicits extends overflowdb.traversal.Implicits { - implicit def singleToCfgNodeTraversal[A <: CfgNode](a: A): CfgNodeTraversal[A] = - new CfgNodeTraversal[A](Iterator.single(a)) +trait LowPrioImplicits { + implicit val docSearchPackages: DocSearchPackages = + Cpg.defaultDocSearchPackage + .withAdditionalPackage("io.joern") + .withAdditionalPackage("io.shiftleft") + + implicit def singleToAstNodeDot[A <: AstNode](a: A): AstNodeDot[A] = + new AstNodeDot(Iterator.single(a)) + implicit def iterOnceToAstNodeDot[A <: AstNode](a: IterableOnce[A]): AstNodeDot[A] = + new AstNodeDot(a.iterator) + + implicit def toCfgNodeMethods(node: CfgNode): CfgNodeMethods = new CfgNodeMethods(node) + implicit def iterOnceToCfgNodeTraversal[A <: CfgNode](a: IterableOnce[A]): CfgNodeTraversal[A] = new CfgNodeTraversal[A](a.iterator) diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/CallTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/CallTraversal.scala index ef2337133894..5fc9724a0c34 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/CallTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/CallTraversal.scala @@ -2,20 +2,24 @@ package io.shiftleft.semanticcpg.language.types.expressions import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* +import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.Assignment +import io.shiftleft.semanticcpg.language.operatorextension.allAssignmentTypes -/** A call site - */ +/** A call site. */ class CallTraversal(val traversal: Iterator[Call]) extends AnyVal { - /** Only statically dispatched calls - */ + /** Only statically dispatched calls */ def isStatic: Iterator[Call] = - traversal.dispatchType("STATIC_DISPATCH") + traversal.filter(_.isStatic) - /** Only dynamically dispatched calls - */ + /** Only dynamically dispatched calls */ def isDynamic: Iterator[Call] = - traversal.dispatchType("DYNAMIC_DISPATCH") + traversal.filter(_.isDynamic) + + /** Only assignment calls + */ + def isAssignment: Iterator[Assignment] = + traversal.methodFullNameExact(allAssignmentTypes.toSeq*).collectAll[Assignment] /** The receiver of a call if the call has a receiver associated. */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/ControlStructureTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/ControlStructureTraversal.scala index e3f7a5b1f91a..831e6358b5bf 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/ControlStructureTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/ControlStructureTraversal.scala @@ -1,15 +1,17 @@ package io.shiftleft.semanticcpg.language.types.expressions +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, ControlStructure, Expression} -import io.shiftleft.codepropertygraph.generated.{ControlStructureTypes, Properties} +import io.shiftleft.codepropertygraph.generated.ControlStructureTypes import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc object ControlStructureTraversal { val secondChildIndex = 2 val thirdChildIndex = 3 } +@Traversal(elementType = classOf[ControlStructure]) class ControlStructureTraversal(val traversal: Iterator[ControlStructure]) extends AnyVal { import ControlStructureTraversal.* @@ -23,11 +25,11 @@ class ControlStructureTraversal(val traversal: Iterator[ControlStructure]) exten @Doc(info = "Sub tree taken when condition evaluates to true") def whenTrue: Iterator[AstNode] = - traversal.out.has(Properties.ORDER, secondChildIndex: Int).cast[AstNode] + traversal.out.collectAll[AstNode].order(secondChildIndex) @Doc(info = "Sub tree taken when condition evaluates to false") def whenFalse: Iterator[AstNode] = - traversal.out.has(Properties.ORDER, thirdChildIndex).cast[AstNode] + traversal.out.collectAll[AstNode].order(thirdChildIndex) @Doc(info = "Only `Try` control structures") def isTry: Iterator[ControlStructure] = diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/IdentifierTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/IdentifierTraversal.scala index 8b11e5635c21..b9c6ea9f7e69 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/IdentifierTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/IdentifierTraversal.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.expressions import io.shiftleft.codepropertygraph.generated.nodes.{Declaration, Identifier} -import io.shiftleft.semanticcpg.language.toTraversalSugarExt +import io.shiftleft.semanticcpg.language.* /** An identifier, e.g., an instance of a local variable, or a temporary variable */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/AstNodeTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/AstNodeTraversal.scala index 33bfa563f290..7a66de691219 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/AstNodeTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/AstNodeTraversal.scala @@ -1,20 +1,18 @@ package io.shiftleft.semanticcpg.language.types.expressions.generalizations +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.* -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc -@help.Traversal(elementType = classOf[AstNode]) +@Traversal(elementType = classOf[AstNode]) class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal { /** Nodes of the AST rooted in this node, including the node itself. */ @Doc(info = "All nodes of the abstract syntax tree") - def ast: Iterator[AstNode] = { - traversal.repeat(_.out(EdgeTypes.AST))(_.emit).cast[AstNode] - } + def ast: Iterator[AstNode] = + traversal.repeat(_._astOut)(_.emit).cast[AstNode] /** All nodes of the abstract syntax tree rooted in this node, which match `predicate`. Equivalent of `match` in the * original CPG paper. @@ -38,7 +36,7 @@ class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal /** Nodes of the AST rooted in this node, minus the node itself */ def astMinusRoot: Iterator[AstNode] = - traversal.repeat(_.out(EdgeTypes.AST))(_.emitAllButFirst).cast[AstNode] + traversal.repeat(_._astOut)(_.emitAllButFirst).cast[AstNode] /** Direct children of node in the AST. Siblings are ordered by their `order` fields */ @@ -48,7 +46,7 @@ class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal /** Parent AST node */ def astParent: Iterator[AstNode] = - traversal.in(EdgeTypes.AST).cast[AstNode] + traversal._astIn.cast[AstNode] /** Siblings of this node in the AST, ordered by their `order` fields */ @@ -58,7 +56,7 @@ class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal /** Traverses up the AST and returns the first block node. */ def parentBlock: Iterator[Block] = - traversal.repeat(_.in(EdgeTypes.AST))(_.emit.until(_.hasLabel(NodeTypes.BLOCK))).collectAll[Block] + traversal.repeat(_._astIn)(_.emit.until(_.hasLabel(Block.Label))).collectAll[Block] /** Nodes of the AST obtained by expanding AST edges backwards until the method root is reached */ @@ -72,24 +70,26 @@ class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal /** Nodes of the AST obtained by expanding AST edges backwards until `root` or the method root is reached */ - def inAst(root: AstNode): Iterator[AstNode] = + def inAst(root: AstNode): Iterator[AstNode] = { traversal - .repeat(_.in(EdgeTypes.AST))( + .repeat(_._astIn)( _.emit - .until(_.or(_.hasLabel(NodeTypes.METHOD), _.filter(n => root != null && root == n))) + .until(_.or(_.hasLabel(Method.Label), _.filter(n => root != null && root == n))) ) .cast[AstNode] + } /** Nodes of the AST obtained by expanding AST edges backwards until `root` or the method root is reached, minus this * node */ - def inAstMinusLeaf(root: AstNode): Iterator[AstNode] = + def inAstMinusLeaf(root: AstNode): Iterator[AstNode] = { traversal - .repeat(_.in(EdgeTypes.AST))( + .repeat(_._astIn)( _.emitAllButFirst - .until(_.or(_.hasLabel(NodeTypes.METHOD), _.filter(n => root != null && root == n))) + .until(_.or(_.hasLabel(Method.Label), _.filter(n => root != null && root == n))) ) .cast[AstNode] + } /** Traverse only to those AST nodes that are also control flow graph nodes */ @@ -208,10 +208,11 @@ class AstNodeTraversal[A <: AstNode](val traversal: Iterator[A]) extends AnyVal def isTypeDecl: Iterator[TypeDecl] = traversal.collectAll[TypeDecl] - def walkAstUntilReaching(labels: List[String]): Iterator[StoredNode] = + def walkAstUntilReaching(labels: List[String]): Iterator[StoredNode] = { traversal - .repeat(_.out(EdgeTypes.AST))(_.emitAllButFirst.until(_.hasLabel(labels*))) + .repeat(_._astOut)(_.emitAllButFirst.until(_.hasLabel(labels*))) .dedup .cast[StoredNode] + } } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversal.scala index 3a3d22f7840f..99843e52b96f 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversal.scala @@ -1,11 +1,12 @@ package io.shiftleft.semanticcpg.language.types.expressions.generalizations -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.neighboraccessors.Lang.* +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.generated.help.Doc -@help.Traversal(elementType = classOf[CfgNode]) +@Traversal(elementType = classOf[CfgNode]) class CfgNodeTraversal[A <: CfgNode](val traversal: Iterator[A]) extends AnyVal { /** Textual representation of CFG node @@ -21,7 +22,6 @@ class CfgNodeTraversal[A <: CfgNode](val traversal: Iterator[A]) extends AnyVal /** Traverse to next expression in CFG. */ - @Doc(info = "Nodes directly reachable via outgoing CFG edges") def cfgNext: Iterator[CfgNode] = traversal._cfgOut diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/DeclarationTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/DeclarationTraversal.scala index f1075dad19c3..be7e4c5566cc 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/DeclarationTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/DeclarationTraversal.scala @@ -1,28 +1,27 @@ package io.shiftleft.semanticcpg.language.types.expressions.generalizations +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help -/** A declaration, such as a local or parameter. - */ -@help.Traversal(elementType = classOf[Declaration]) +/** A declaration, such as a local or parameter. */ +@Traversal(elementType = classOf[Declaration]) class DeclarationTraversal[NodeType <: Declaration](val traversal: Iterator[NodeType]) extends AnyVal { - /** The closure binding node referenced by this declaration - */ + /** The closure binding node referenced by this declaration */ + @Doc(info = "The closure binding node referenced by this declaration") def closureBinding: Iterator[ClosureBinding] = traversal.flatMap(_._refIn).collectAll[ClosureBinding] - /** Methods that capture this declaration - */ + /** Methods that capture this declaration */ + @Doc(info = "Methods that capture this declaration") def capturedByMethodRef: Iterator[MethodRef] = closureBinding.flatMap(_._captureIn).collectAll[MethodRef] - /** Types that capture this declaration - */ + /** Types that capture this declaration */ + @Doc(info = "Types that capture this declaration") def capturedByTypeRef: Iterator[TypeRef] = closureBinding.flatMap(_._captureIn).collectAll[TypeRef] - /** The parent method. - */ + /** The parent method. */ + @Doc(info = "The parent method.") def method: Iterator[Method] = traversal.flatMap { case x: Local => x.method case x: MethodParameterIn => x.method diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversal.scala index 741f69202624..c3e22ff0dfc7 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversal.scala @@ -59,8 +59,8 @@ class ExpressionTraversal[NodeType <: Expression](val traversal: Iterator[NodeTy */ def method: Iterator[Method] = traversal._containsIn - .flatMap { - case x: Method => x.start + .map { + case x: Method => x case x: TypeDecl => x.astParent } .collectAll[Method] diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/EvalTypeAccessors.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/EvalTypeAccessors.scala index 27af5cc625b1..bf0a3776b2ed 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/EvalTypeAccessors.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/EvalTypeAccessors.scala @@ -41,6 +41,6 @@ class EvalTypeAccessors[A <: AstNode](val traversal: Iterator[A]) extends AnyVal } private def evalType(traversal: Iterator[A]): Iterator[String] = - traversal.flatMap(_._evalTypeOut).flatMap(_._refOut).property(Properties.FULL_NAME) + traversal.flatMap(_._evalTypeOut).flatMap(_._refOut).property(Properties.FullName) } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/ModifierAccessors.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/ModifierAccessors.scala index 679b220aafaa..76b7d1672f61 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/ModifierAccessors.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/propertyaccessors/ModifierAccessors.scala @@ -1,10 +1,8 @@ package io.shiftleft.semanticcpg.language.types.propertyaccessors import io.shiftleft.codepropertygraph.generated.ModifierTypes -import io.shiftleft.codepropertygraph.generated.nodes.{AstNode, Modifier} -import io.shiftleft.codepropertygraph.generated.traversal.toModifierTraversalExtGen +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.* class ModifierAccessors[A <: AstNode](val traversal: Iterator[A]) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/AnnotationTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/AnnotationTraversal.scala index a597e668bf1f..104ebab2ea2d 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/AnnotationTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/AnnotationTraversal.scala @@ -1,34 +1,34 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes -import overflowdb.traversal._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* /** An (Java-) annotation, e.g., @Test. */ -class AnnotationTraversal(val traversal: Iterator[nodes.Annotation]) extends AnyVal { +class AnnotationTraversal(val traversal: Iterator[Annotation]) extends AnyVal { /** Traverse to parameter assignments */ - def parameterAssign: Iterator[nodes.AnnotationParameterAssign] = + def parameterAssign: Iterator[AnnotationParameterAssign] = traversal.flatMap(_._annotationParameterAssignViaAstOut) /** Traverse to methods annotated with this annotation. */ - def method: Iterator[nodes.Method] = + def method: Iterator[Method] = traversal.flatMap(_._methodViaAstIn) /** Traverse to type declarations annotated by this annotation */ - def typeDecl: Iterator[nodes.TypeDecl] = + def typeDecl: Iterator[TypeDecl] = traversal.flatMap(_._typeDeclViaAstIn) /** Traverse to member annotated by this annotation */ - def member: Iterator[nodes.Member] = + def member: Iterator[Member] = traversal.flatMap(_._memberViaAstIn) /** Traverse to parameter annotated by this annotation */ - def parameter: Iterator[nodes.MethodParameterIn] = + def parameter: Iterator[MethodParameterIn] = traversal.flatMap(_._methodParameterInViaAstIn) } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/DependencyTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/DependencyTraversal.scala index 36309ff44325..93dbb4f4ce87 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/DependencyTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/DependencyTraversal.scala @@ -1,9 +1,9 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes.Import -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, nodes} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -class DependencyTraversal(val traversal: Iterator[nodes.Dependency]) extends AnyVal { - def imports: Iterator[Import] = traversal.in(EdgeTypes.IMPORTS).cast[Import] +class DependencyTraversal(val traversal: Iterator[Dependency]) extends AnyVal { + def imports: Iterator[Import] = + traversal.importsIn } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/FileTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/FileTraversal.scala index c9aec5674e6f..f520f09db339 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/FileTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/FileTraversal.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* /** A compilation unit diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/ImportTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/ImportTraversal.scala index e5131658039a..e46ff2b324e6 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/ImportTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/ImportTraversal.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Import, NamespaceBlock} +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* class ImportTraversal(val traversal: Iterator[Import]) extends AnyVal { diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/LocalTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/LocalTraversal.scala index 26c73041412c..5319bfc24365 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/LocalTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/LocalTraversal.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.codepropertygraph.generated.{EdgeTypes, NodeTypes} import io.shiftleft.semanticcpg.language.* @@ -13,8 +13,8 @@ class LocalTraversal(val traversal: Iterator[Local]) extends AnyVal { def method: Iterator[Method] = { // TODO The following line of code is here for backwards compatibility. // Use the lower commented out line once not required anymore. - traversal.repeat(_.in(EdgeTypes.AST))(_.until(_.hasLabel(NodeTypes.METHOD))).cast[Method] - // definingBlock.method + traversal.repeat(_._astIn)(_.until(_.hasLabel(Method.Label))).cast[Method] +// definingBlock.method } } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTraversal.scala index d83a7062a256..5f45484923ea 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTraversal.scala @@ -1,7 +1,6 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated._ -import io.shiftleft.codepropertygraph.generated.nodes.{Call, Member} +import io.shiftleft.codepropertygraph.generated.nodes.{Annotation, Call, Member} import io.shiftleft.semanticcpg.language.* /** A member variable of a class/type. @@ -10,7 +9,7 @@ class MemberTraversal(val traversal: Iterator[Member]) extends AnyVal { /** Traverse to annotations of member */ - def annotation: Iterator[nodes.Annotation] = + def annotation: Iterator[Annotation] = traversal.flatMap(_._annotationViaAstOut) /** Places where diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterOutTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterOutTraversal.scala index abb9778a1fd6..3ef123059d5f 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterOutTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterOutTraversal.scala @@ -3,11 +3,12 @@ package io.shiftleft.semanticcpg.language.types.structure import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import scala.jdk.CollectionConverters.* - class MethodParameterOutTraversal(val traversal: Iterator[MethodParameterOut]) extends AnyVal { - def paramIn: Iterator[MethodParameterIn] = traversal.flatMap(_.parameterLinkIn.headOption) + def paramIn: Iterator[MethodParameterIn] = { + // TODO define a named step in schema + traversal.flatMap(_.parameterLinkIn.collectAll[MethodParameterIn]) + } /* method parameter indexes are based, i.e. first parameter has index (that's how java2cpg generates it) */ def index(num: Int): Iterator[MethodParameterOut] = @@ -27,9 +28,10 @@ class MethodParameterOutTraversal(val traversal: Iterator[MethodParameterOut]) e for { paramOut <- traversal method = paramOut.method - call <- method.callIn - arg <- call.argumentOut.collectAll[Expression] - if paramOut.parameterLinkIn.index.headOption.contains(arg.argumentIndex) + call <- method._callIn + arg <- call._argumentOut.collectAll[Expression] + // TODO define 'parameterLinkIn' as named step in schema + if paramOut.parameterLinkIn.collectAll[MethodParameterIn].index.headOption.contains(arg.argumentIndex) } yield arg } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTraversal.scala index 2f2af5ea8302..8d5a74d56ba3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTraversal.scala @@ -1,33 +1,32 @@ package io.shiftleft.semanticcpg.language.types.structure +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help import scala.jdk.CollectionConverters.* -/** Formal method input parameter - */ -@help.Traversal(elementType = classOf[MethodParameterIn]) +/** Formal method input parameter */ +@Traversal(elementType = classOf[MethodParameterIn]) class MethodParameterTraversal(val traversal: Iterator[MethodParameterIn]) extends AnyVal { - /** Traverse to parameter annotations - */ + /** Traverse to parameter annotations */ + @Doc(info = "Traverse to parameter annotations") def annotation: Iterator[Annotation] = traversal.flatMap(_._annotationViaAstOut) - /** Traverse to all parameters with index greater or equal than `num` - */ + /** Traverse to all parameters with index greater or equal than `num` */ + @Doc(info = "Traverse to all parameters with index greater or equal than `num`") def indexFrom(num: Int): Iterator[MethodParameterIn] = traversal.filter(_.index >= num) - /** Traverse to all parameters with index smaller or equal than `num` - */ + /** Traverse to all parameters with index smaller or equal than `num` */ + @Doc(info = "Traverse to all parameters with index smaller or equal than `num`") def indexTo(num: Int): Iterator[MethodParameterIn] = traversal.filter(_.index <= num) - /** Traverse to arguments (actual parameters) associated with this formal parameter - */ + /** Traverse to arguments (actual parameters) associated with this formal parameter */ + @Doc(info = "Traverse to arguments (actual parameters) associated with this formal parameter") def argument(implicit callResolver: ICallResolver): Iterator[Expression] = for { paramIn <- traversal diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodReturnTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodReturnTraversal.scala index a96b5fb9baf7..fb1dc0660ea1 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodReturnTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodReturnTraversal.scala @@ -1,16 +1,16 @@ package io.shiftleft.semanticcpg.language.types.structure +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc -@help.Traversal(elementType = classOf[MethodReturn]) +@Traversal(elementType = classOf[MethodReturn]) class MethodReturnTraversal(val traversal: Iterator[MethodReturn]) extends AnyVal { @Doc(info = "traverse to parent method") def method: Iterator[Method] = - traversal.flatMap(_._methodViaAstIn) + traversal._methodViaAstIn def returnUser(implicit callResolver: ICallResolver): Iterator[Call] = traversal.flatMap(_.returnUser) @@ -19,11 +19,11 @@ class MethodReturnTraversal(val traversal: Iterator[MethodReturn]) extends AnyVa */ @Doc(info = "traverse to last expressions in CFG (can be multiple)") def cfgLast: Iterator[CfgNode] = - traversal.flatMap(_.cfgIn) + traversal.cfgIn /** Traverse to return type */ @Doc(info = "traverse to return type") def typ: Iterator[Type] = - traversal.flatMap(_.evalTypeOut) + traversal.evalTypeOut } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTraversal.scala index ef31a200c906..1e58aca4a55c 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTraversal.scala @@ -1,15 +1,14 @@ package io.shiftleft.semanticcpg.language.types.structure +import io.shiftleft.codepropertygraph.generated.help.{Doc, Traversal} import io.shiftleft.codepropertygraph.generated.* import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* -import overflowdb.* -import overflowdb.traversal.help -import overflowdb.traversal.help.Doc +import io.shiftleft.codepropertygraph.generated.help.Doc /** A method, function, or procedure */ -@help.Traversal(elementType = classOf[Method]) +@Traversal(elementType = classOf[Method]) class MethodTraversal(val traversal: Iterator[Method]) extends AnyVal { /** Traverse to annotations of method @@ -164,7 +163,8 @@ class MethodTraversal(val traversal: Iterator[Method]) extends AnyVal { // some language frontends don't have a TYPE_DECL for a METHOD case Some(namespaceBlock: NamespaceBlock) => namespaceBlock.start // other language frontends always embed their method in a TYPE_DECL - case _ => m.definingTypeDecl.namespaceBlock + case _ => + m.definingTypeDecl.iterator.namespaceBlock } } } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceBlockTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceBlockTraversal.scala index 7f95dee3285a..c6aaecf5b1a3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceBlockTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceBlockTraversal.scala @@ -5,16 +5,17 @@ import io.shiftleft.semanticcpg.language.* class NamespaceBlockTraversal(val traversal: Iterator[NamespaceBlock]) extends AnyVal { - /** Namespaces for namespace blocks. + /** Namespaces for namespace blocks. TODO define a name in the schema */ def namespace: Iterator[Namespace] = - traversal.flatMap(_.refOut) + traversal.flatMap(_._namespaceViaRefOut) - /** The type declarations defined in this namespace + /** The type declarations defined in this namespace TODO define a name in the schema */ def typeDecl: Iterator[TypeDecl] = traversal.flatMap(_._typeDeclViaAstOut) + // TODO define a name in the schema def method: Iterator[Method] = traversal.flatMap(_._methodViaAstOut) } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTraversal.scala index c636047e2dff..3509c5f6a058 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTraversal.scala @@ -10,12 +10,12 @@ class NamespaceTraversal(val traversal: Iterator[Namespace]) extends AnyVal { /** The type declarations defined in this namespace */ def typeDecl: Iterator[TypeDecl] = - traversal.flatMap(_.refIn).flatMap(_._typeDeclViaAstOut) + traversal.refIn.astOut.collectAll[TypeDecl] /** Methods defined in this namespace */ def method: Iterator[Method] = - traversal.flatMap(_.refIn).flatMap(_._methodViaAstOut) + traversal.refIn.astOut.collectAll[Method] /** External namespaces - any namespaces which contain one or more external type. */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeDeclTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeDeclTraversal.scala index 0df69620c7a0..eec2e73c9044 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeDeclTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeDeclTraversal.scala @@ -1,6 +1,5 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* @@ -11,13 +10,13 @@ class TypeDeclTraversal(val traversal: Iterator[TypeDecl]) extends AnyVal { /** Annotations of the type declaration */ - def annotation: Iterator[nodes.Annotation] = + def annotation: Iterator[Annotation] = traversal.flatMap(_._annotationViaAstOut) /** Types referencing to this type declaration. */ def referencingType: Iterator[Type] = - traversal.flatMap(_.refIn) + traversal.refIn /** Namespace in which this type declaration is defined */ diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeTraversal.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeTraversal.scala index ea2bf4e0e536..402ec87b14bc 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeTraversal.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/language/types/structure/TypeTraversal.scala @@ -1,6 +1,5 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes import io.shiftleft.codepropertygraph.generated.nodes.* import io.shiftleft.semanticcpg.language.* @@ -8,7 +7,7 @@ class TypeTraversal(val traversal: Iterator[Type]) extends AnyVal { /** Annotations of the corresponding type declaration. */ - def annotation: Iterator[nodes.Annotation] = + def annotation: Iterator[Annotation] = traversal.referencedTypeDecl.annotation /** Namespaces in which the corresponding type declaration is defined. @@ -59,7 +58,7 @@ class TypeTraversal(val traversal: Iterator[Type]) extends AnyVal { /** Type declarations which derive from this type. */ def derivedTypeDecl: Iterator[TypeDecl] = - traversal.flatMap(_.inheritsFromIn) + traversal.inheritsFromIn /** Direct alias types. */ @@ -72,23 +71,24 @@ class TypeTraversal(val traversal: Iterator[Type]) extends AnyVal { traversal.repeat(_.aliasType)(_.emitAllButFirst) def localOfType: Iterator[Local] = - traversal.flatMap(_._localViaEvalTypeIn) + traversal._localViaEvalTypeIn def memberOfType: Iterator[Member] = - traversal.flatMap(_.evalTypeIn).collectAll[Member] + traversal.evalTypeIn.collectAll[Member] @deprecated("Please use `parameterOfType`") def parameter: Iterator[MethodParameterIn] = parameterOfType def parameterOfType: Iterator[MethodParameterIn] = - traversal.flatMap(_.evalTypeIn).collectAll[MethodParameterIn] + traversal.evalTypeIn.collectAll[MethodParameterIn] def methodReturnOfType: Iterator[MethodReturn] = - traversal.flatMap(_.evalTypeIn).collectAll[MethodReturn] + traversal.evalTypeIn.collectAll[MethodReturn] def expressionOfType: Iterator[Expression] = expression + // TODO define in schema def expression: Iterator[Expression] = - traversal.flatMap(_.evalTypeIn).collectAll[Expression] + traversal.evalTypeIn.collectAll[Expression] } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/layers/LayerCreator.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/layers/LayerCreator.scala index 6fc05d75227e..fd2dd31f09af 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/layers/LayerCreator.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/layers/LayerCreator.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.layers import better.files.File import io.shiftleft.SerializedCpg -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.passes.CpgPassBase import io.shiftleft.semanticcpg.Overlays import org.slf4j.{Logger, LoggerFactory} @@ -36,17 +36,8 @@ abstract class LayerCreator { } } - protected def initSerializedCpg(outputDir: Option[String], passName: String, index: Int = 0): SerializedCpg = { - outputDir match { - case Some(dir) => new SerializedCpg((File(dir) / s"${index}_$passName").path.toAbsolutePath.toString) - case None => new SerializedCpg() - } - } - protected def runPass(pass: CpgPassBase, context: LayerCreatorContext, index: Int = 0): Unit = { - val serializedCpg = initSerializedCpg(context.outputDir, pass.name, index) - pass.createApplySerializeAndStore(serializedCpg) - serializedCpg.close() + pass.createAndApply() } def create(context: LayerCreatorContext): Unit diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/package.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/package.scala index be26a307cb1e..a427ab3d9678 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/package.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/package.scala @@ -1,6 +1,6 @@ package io.shiftleft -import overflowdb.traversal.help.Table.AvailableWidthProvider +import flatgraph.help.Table.AvailableWidthProvider /** Domain specific language for querying code property graphs * @@ -23,7 +23,7 @@ import overflowdb.traversal.help.Table.AvailableWidthProvider * {{{cpg.local}}} * * will start at all local variables. The complete list of starting points can be found at - * {{{io.shiftleft.codepropertygraph.Cpg}}} + * {{{io.shiftleft.codepropertygraph.generated.Cpg}}} * * ==Lazy evaluation== * Queries are lazily evaluated, e.g., `cpg.method` creates a traversal which you can add more steps to. You can, for diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/DummyNode.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/DummyNode.scala index 3c5a80dabddc..b523d8893fd3 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/DummyNode.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/DummyNode.scala @@ -1,52 +1,7 @@ package io.shiftleft.semanticcpg.testing import io.shiftleft.codepropertygraph.generated.nodes.StoredNode -import overflowdb.{Edge, Node, Property, PropertyKey} -import java.util - -/** mixin trait for test nodes */ trait DummyNodeImpl extends StoredNode { - // Members declared in overflowdb.Element - def graph(): overflowdb.Graph = ??? - def property[A](x$1: overflowdb.PropertyKey[A]): A = ??? - def property(x$1: String): Object = ??? - def propertyKeys(): java.util.Set[String] = ??? - def propertiesMap(): java.util.Map[String, Object] = ??? - def propertyOption(x$1: String): java.util.Optional[Object] = ??? - def propertyOption[A](x$1: overflowdb.PropertyKey[A]): java.util.Optional[A] = ??? - override def addEdgeImpl(label: String, inNode: Node, keyValues: Any*): Edge = ??? - override def addEdgeImpl(label: String, inNode: Node, keyValues: util.Map[String, AnyRef]): Edge = ??? - override def addEdgeSilentImpl(label: String, inNode: Node, keyValues: Any*): Unit = ??? - override def addEdgeSilentImpl(label: String, inNode: Node, keyValues: util.Map[String, AnyRef]): Unit = ??? - override def setPropertyImpl(key: String, value: Any): Unit = ??? - override def setPropertyImpl[A](key: PropertyKey[A], value: A): Unit = ??? - override def setPropertyImpl(property: Property[?]): Unit = ??? - override def removePropertyImpl(key: String): Unit = ??? - override def removeImpl(): Unit = ??? - - // Members declared in scala.Equals - def canEqual(that: Any): Boolean = ??? - - def both(x$1: String*): java.util.Iterator[overflowdb.Node] = ??? - def both(): java.util.Iterator[overflowdb.Node] = ??? - def bothE(x$1: String*): java.util.Iterator[overflowdb.Edge] = ??? - def bothE(): java.util.Iterator[overflowdb.Edge] = ??? - def id(): Long = ??? - def in(x$1: String*): java.util.Iterator[overflowdb.Node] = ??? - def in(): java.util.Iterator[overflowdb.Node] = ??? - def inE(x$1: String*): java.util.Iterator[overflowdb.Edge] = ??? - def inE(): java.util.Iterator[overflowdb.Edge] = ??? - def out(x$1: String*): java.util.Iterator[overflowdb.Node] = ??? - def out(): java.util.Iterator[overflowdb.Node] = ??? - def outE(x$1: String*): java.util.Iterator[overflowdb.Edge] = ??? - def outE(): java.util.Iterator[overflowdb.Edge] = ??? - - // Members declared in scala.Product - def productArity: Int = ??? - def productElement(n: Int): Any = ??? - - // Members declared in io.shiftleft.codepropertygraph.generated.nodes.StoredNode - def productElementLabel(n: Int): String = ??? - def valueMap: java.util.Map[String, AnyRef] = ??? + def propertiesMap: java.util.Map[String, Any] = ??? } diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/MockCpg.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/MockCpg.scala new file mode 100644 index 000000000000..96ba88e2ba73 --- /dev/null +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/MockCpg.scala @@ -0,0 +1,229 @@ +package io.shiftleft.semanticcpg.testing + +import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Languages, ModifierTypes} +import io.shiftleft.passes.CpgPass +import io.shiftleft.semanticcpg.language.* +import io.shiftleft.codepropertygraph.generated.DiffGraphBuilder + +object MockCpg { + + def apply(): MockCpg = new MockCpg + + def apply(f: (DiffGraphBuilder, Cpg) => Unit): MockCpg = new MockCpg().withCustom(f) +} + +case class MockCpg(cpg: Cpg = Cpg.emptyCpg) { + + def withMetaData(language: String = Languages.C): MockCpg = withMetaData(language, Nil) + + def withMetaData(language: String, overlays: List[String]): MockCpg = { + withCustom { (diffGraph, _) => + diffGraph.addNode(NewMetaData().language(language).overlays(overlays)) + } + } + + def withFile(filename: String, content: Option[String] = None): MockCpg = + withCustom { (graph, _) => + val newFile = NewFile().name(filename) + content.foreach(newFile.content(_)) + graph.addNode(newFile) + } + + def withNamespace(name: String, inFile: Option[String] = None): MockCpg = + withCustom { (graph, _) => + { + val namespaceBlock = NewNamespaceBlock().name(name) + val namespace = NewNamespace().name(name) + graph.addNode(namespaceBlock) + graph.addNode(namespace) + graph.addEdge(namespaceBlock, namespace, EdgeTypes.REF) + if (inFile.isDefined) { + val fileNode = cpg.file(inFile.get).head + graph.addEdge(namespaceBlock, fileNode, EdgeTypes.SOURCE_FILE) + } + } + } + + def withTypeDecl( + name: String, + isExternal: Boolean = false, + inNamespace: Option[String] = None, + inFile: Option[String] = None, + offset: Option[Int] = None, + offsetEnd: Option[Int] = None + ): MockCpg = + withCustom { (graph, _) => + { + val typeNode = NewType().name(name) + val typeDeclNode = NewTypeDecl() + .name(name) + .fullName(name) + .isExternal(isExternal) + + offset.foreach(typeDeclNode.offset(_)) + offsetEnd.foreach(typeDeclNode.offsetEnd(_)) + + val member = NewMember().name("amember") + val modifier = NewModifier().modifierType(ModifierTypes.STATIC) + + graph.addNode(typeDeclNode) + graph.addNode(typeNode) + graph.addNode(member) + graph.addNode(modifier) + graph.addEdge(typeNode, typeDeclNode, EdgeTypes.REF) + graph.addEdge(typeDeclNode, member, EdgeTypes.AST) + graph.addEdge(member, modifier, EdgeTypes.AST) + + if (inNamespace.isDefined) { + val namespaceBlock = cpg.namespaceBlock(inNamespace.get).head + graph.addEdge(namespaceBlock, typeDeclNode, EdgeTypes.AST) + } + if (inFile.isDefined) { + val fileNode = cpg.file(inFile.get).head + graph.addEdge(typeDeclNode, fileNode, EdgeTypes.SOURCE_FILE) + } + } + } + + def withMethod( + name: String, + external: Boolean = false, + inTypeDecl: Option[String] = None, + fileName: String = "", + offset: Option[Int] = None, + offsetEnd: Option[Int] = None + ): MockCpg = + withCustom { (graph, _) => + val retParam = NewMethodReturn().typeFullName("int").order(10) + val param = NewMethodParameterIn().order(1).index(1).name("param1") + val paramType = NewType().name("paramtype") + val paramOut = NewMethodParameterOut().name("param1").order(1) + val method = + NewMethod().isExternal(external).name(name).fullName(name).signature("asignature").filename(fileName) + offset.foreach(method.offset(_)) + offsetEnd.foreach(method.offsetEnd(_)) + val block = NewBlock().typeFullName("int") + val modifier = NewModifier().modifierType("modifiertype") + + graph.addNode(method) + graph.addNode(retParam) + graph.addNode(param) + graph.addNode(paramType) + graph.addNode(paramOut) + graph.addNode(block) + graph.addNode(modifier) + graph.addEdge(method, retParam, EdgeTypes.AST) + graph.addEdge(method, param, EdgeTypes.AST) + graph.addEdge(param, paramOut, EdgeTypes.PARAMETER_LINK) + graph.addEdge(method, block, EdgeTypes.AST) + graph.addEdge(param, paramType, EdgeTypes.EVAL_TYPE) + graph.addEdge(paramOut, paramType, EdgeTypes.EVAL_TYPE) + graph.addEdge(method, modifier, EdgeTypes.AST) + + if (inTypeDecl.isDefined) { + val typeDeclNode = cpg.typeDecl(inTypeDecl.get).head + graph.addEdge(typeDeclNode, method, EdgeTypes.AST) + } + + if (fileName != "") { + val file = cpg.file + .nameExact(fileName) + .headOption + .getOrElse(throw new RuntimeException(s"file with name='$fileName' not found")) + graph.addEdge(method, file, EdgeTypes.SOURCE_FILE) + } + } + + def withTagsOnMethod( + methodName: String, + methodTags: List[(String, String)] = List(), + paramTags: List[(String, String)] = List() + ): MockCpg = + withCustom { (graph, cpg) => + implicit val diffGraph: DiffGraphBuilder = graph + methodTags.foreach { case (k, v) => + cpg.method(methodName).newTagNodePair(k, v).store()(diffGraph) + } + paramTags.foreach { case (k, v) => + cpg.method(methodName).parameter.newTagNodePair(k, v).store()(diffGraph) + } + } + + def withCallInMethod(methodName: String, callName: String, code: Option[String] = None): MockCpg = + withCustom { (graph, cpg) => + val methodNode = cpg.method(methodName).head + val blockNode = methodNode.block + val callNode = NewCall().name(callName).code(code.getOrElse(callName)) + graph.addNode(callNode) + graph.addEdge(blockNode, callNode, EdgeTypes.AST) + graph.addEdge(methodNode, callNode, EdgeTypes.CONTAINS) + } + + def withMethodCall(calledMethod: String, callingMethod: String, code: Option[String] = None): MockCpg = + withCustom { (graph, cpg) => + val callingMethodNode = cpg.method(callingMethod).head + val calledMethodNode = cpg.method(calledMethod).head + val callNode = NewCall().name(calledMethod).code(code.getOrElse(calledMethod)) + graph.addEdge(callNode, calledMethodNode, EdgeTypes.CALL) + graph.addEdge(callingMethodNode, callNode, EdgeTypes.CONTAINS) + } + + def withLocalInMethod(methodName: String, localName: String): MockCpg = + withCustom { (graph, cpg) => + val methodNode = cpg.method(methodName).head + val blockNode = methodNode.block + val typeNode = NewType().name("alocaltype") + val localNode = NewLocal().name(localName).typeFullName("alocaltype") + graph.addNode(localNode) + graph.addNode(typeNode) + graph.addEdge(blockNode, localNode, EdgeTypes.AST) + graph.addEdge(localNode, typeNode, EdgeTypes.EVAL_TYPE) + } + + def withLiteralArgument(callName: String, literalCode: String): MockCpg = { + withCustom { (graph, cpg) => + val callNode = cpg.call(callName).head + val methodNode = callNode.method + val literalNode = NewLiteral().code(literalCode) + val typeDecl = NewTypeDecl() + .name("ATypeDecl") + .fullName("ATypeDecl") + + graph.addNode(typeDecl) + graph.addNode(literalNode) + graph.addEdge(callNode, literalNode, EdgeTypes.AST) + graph.addEdge(methodNode, literalNode, EdgeTypes.CONTAINS) + } + } + + def withIdentifierArgument(callName: String, name: String, index: Int = 1): MockCpg = + withArgument(callName, NewIdentifier().name(name).argumentIndex(index)) + + def withCallArgument(callName: String, callArgName: String, code: String = "", index: Int = 1): MockCpg = + withArgument(callName, NewCall().name(callArgName).code(code).argumentIndex(index)) + + def withArgument(callName: String, newNode: NewNode): MockCpg = withCustom { (graph, cpg) => + val callNode = cpg.call(callName).head + val methodNode = callNode.method + val typeDecl = NewTypeDecl().name("abc") + graph.addEdge(callNode, newNode, EdgeTypes.AST) + graph.addEdge(callNode, newNode, EdgeTypes.ARGUMENT) + graph.addEdge(methodNode, newNode, EdgeTypes.CONTAINS) + graph.addEdge(newNode, typeDecl, EdgeTypes.REF) + graph.addNode(newNode) + } + + def withCustom(f: (DiffGraphBuilder, Cpg) => Unit): MockCpg = { + val diffGraph = new DiffGraphBuilder(cpg.graph.schema) + f(diffGraph, cpg) + class MyPass extends CpgPass(cpg) { + override def run(builder: DiffGraphBuilder): Unit = { + builder.absorb(diffGraph) + } + } + new MyPass().createAndApply() + this + } +} diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/package.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/package.scala deleted file mode 100644 index bc1fd33422a1..000000000000 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/testing/package.scala +++ /dev/null @@ -1,234 +0,0 @@ -package io.shiftleft.semanticcpg - -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.codepropertygraph.generated.{EdgeTypes, Languages, ModifierTypes} -import io.shiftleft.passes.CpgPass -import io.shiftleft.semanticcpg.language._ -import overflowdb.BatchedUpdate -import overflowdb.BatchedUpdate.DiffGraphBuilder - -package object testing { - - object MockCpg { - - def apply(): MockCpg = new MockCpg - - def apply(f: (DiffGraphBuilder, Cpg) => Unit): MockCpg = new MockCpg().withCustom(f) - } - - case class MockCpg(cpg: Cpg = Cpg.emptyCpg) { - - def withMetaData(language: String = Languages.C): MockCpg = withMetaData(language, Nil) - - def withMetaData(language: String, overlays: List[String]): MockCpg = { - withCustom { (diffGraph, _) => - diffGraph.addNode(NewMetaData().language(language).overlays(overlays)) - } - } - - def withFile(filename: String, content: Option[String] = None): MockCpg = - withCustom { (graph, _) => - val newFile = NewFile().name(filename) - content.foreach(newFile.content(_)) - graph.addNode(newFile) - } - - def withNamespace(name: String, inFile: Option[String] = None): MockCpg = - withCustom { (graph, _) => - { - val namespaceBlock = NewNamespaceBlock().name(name) - val namespace = NewNamespace().name(name) - graph.addNode(namespaceBlock) - graph.addNode(namespace) - graph.addEdge(namespaceBlock, namespace, EdgeTypes.REF) - if (inFile.isDefined) { - val fileNode = cpg.file.name(inFile.get).head - graph.addEdge(namespaceBlock, fileNode, EdgeTypes.SOURCE_FILE) - } - } - } - - def withTypeDecl( - name: String, - isExternal: Boolean = false, - inNamespace: Option[String] = None, - inFile: Option[String] = None, - offset: Option[Int] = None, - offsetEnd: Option[Int] = None - ): MockCpg = - withCustom { (graph, _) => - { - val typeNode = NewType().name(name) - val typeDeclNode = NewTypeDecl() - .name(name) - .fullName(name) - .isExternal(isExternal) - - offset.foreach(typeDeclNode.offset(_)) - offsetEnd.foreach(typeDeclNode.offsetEnd(_)) - - val member = NewMember().name("amember") - val modifier = NewModifier().modifierType(ModifierTypes.STATIC) - - graph.addNode(typeDeclNode) - graph.addNode(typeNode) - graph.addNode(member) - graph.addNode(modifier) - graph.addEdge(typeNode, typeDeclNode, EdgeTypes.REF) - graph.addEdge(typeDeclNode, member, EdgeTypes.AST) - graph.addEdge(member, modifier, EdgeTypes.AST) - - if (inNamespace.isDefined) { - val namespaceBlock = cpg.namespaceBlock(inNamespace.get).head - graph.addEdge(namespaceBlock, typeDeclNode, EdgeTypes.AST) - } - if (inFile.isDefined) { - val fileNode = cpg.file.name(inFile.get).head - graph.addEdge(typeDeclNode, fileNode, EdgeTypes.SOURCE_FILE) - } - } - } - - def withMethod( - name: String, - external: Boolean = false, - inTypeDecl: Option[String] = None, - fileName: String = "", - offset: Option[Int] = None, - offsetEnd: Option[Int] = None - ): MockCpg = - withCustom { (graph, _) => - val retParam = NewMethodReturn().typeFullName("int").order(10) - val param = NewMethodParameterIn().order(1).index(1).name("param1") - val paramType = NewType().name("paramtype") - val paramOut = NewMethodParameterOut().name("param1").order(1) - val method = - NewMethod().isExternal(external).name(name).fullName(name).signature("asignature").filename(fileName) - offset.foreach(method.offset(_)) - offsetEnd.foreach(method.offsetEnd(_)) - val block = NewBlock().typeFullName("int") - val modifier = NewModifier().modifierType("modifiertype") - - graph.addNode(method) - graph.addNode(retParam) - graph.addNode(param) - graph.addNode(paramType) - graph.addNode(paramOut) - graph.addNode(block) - graph.addNode(modifier) - graph.addEdge(method, retParam, EdgeTypes.AST) - graph.addEdge(method, param, EdgeTypes.AST) - graph.addEdge(param, paramOut, EdgeTypes.PARAMETER_LINK) - graph.addEdge(method, block, EdgeTypes.AST) - graph.addEdge(param, paramType, EdgeTypes.EVAL_TYPE) - graph.addEdge(paramOut, paramType, EdgeTypes.EVAL_TYPE) - graph.addEdge(method, modifier, EdgeTypes.AST) - - if (inTypeDecl.isDefined) { - val typeDeclNode = cpg.typeDecl.name(inTypeDecl.get).head - graph.addEdge(typeDeclNode, method, EdgeTypes.AST) - } - - if (fileName != "") { - val file = cpg.file - .nameExact(fileName) - .headOption - .getOrElse(throw new RuntimeException(s"file with name='$fileName' not found")) - graph.addEdge(method, file, EdgeTypes.SOURCE_FILE) - } - } - - def withTagsOnMethod( - methodName: String, - methodTags: List[(String, String)] = List(), - paramTags: List[(String, String)] = List() - ): MockCpg = - withCustom { (graph, cpg) => - implicit val diffGraph: DiffGraphBuilder = graph - methodTags.foreach { case (k, v) => - cpg.method.name(methodName).newTagNodePair(k, v).store()(diffGraph) - } - paramTags.foreach { case (k, v) => - cpg.method.name(methodName).parameter.newTagNodePair(k, v).store()(diffGraph) - } - } - - def withCallInMethod(methodName: String, callName: String, code: Option[String] = None): MockCpg = - withCustom { (graph, cpg) => - val methodNode = cpg.method.name(methodName).head - val blockNode = methodNode.block - val callNode = NewCall().name(callName).code(code.getOrElse(callName)) - graph.addNode(callNode) - graph.addEdge(blockNode, callNode, EdgeTypes.AST) - graph.addEdge(methodNode, callNode, EdgeTypes.CONTAINS) - } - - def withMethodCall(calledMethod: String, callingMethod: String, code: Option[String] = None): MockCpg = - withCustom { (graph, cpg) => - val callingMethodNode = cpg.method.name(callingMethod).head - val calledMethodNode = cpg.method.name(calledMethod).head - val callNode = NewCall().name(calledMethod).code(code.getOrElse(calledMethod)) - graph.addEdge(callNode, calledMethodNode, EdgeTypes.CALL) - graph.addEdge(callingMethodNode, callNode, EdgeTypes.CONTAINS) - } - - def withLocalInMethod(methodName: String, localName: String): MockCpg = - withCustom { (graph, cpg) => - val methodNode = cpg.method.name(methodName).head - val blockNode = methodNode.block - val typeNode = NewType().name("alocaltype") - val localNode = NewLocal().name(localName).typeFullName("alocaltype") - graph.addNode(localNode) - graph.addNode(typeNode) - graph.addEdge(blockNode, localNode, EdgeTypes.AST) - graph.addEdge(localNode, typeNode, EdgeTypes.EVAL_TYPE) - } - - def withLiteralArgument(callName: String, literalCode: String): MockCpg = { - withCustom { (graph, cpg) => - val callNode = cpg.call.name(callName).head - val methodNode = callNode.method - val literalNode = NewLiteral().code(literalCode) - val typeDecl = NewTypeDecl() - .name("ATypeDecl") - .fullName("ATypeDecl") - - graph.addNode(typeDecl) - graph.addNode(literalNode) - graph.addEdge(callNode, literalNode, EdgeTypes.AST) - graph.addEdge(methodNode, literalNode, EdgeTypes.CONTAINS) - } - } - - def withIdentifierArgument(callName: String, name: String, index: Int = 1): MockCpg = - withArgument(callName, NewIdentifier().name(name).argumentIndex(index)) - - def withCallArgument(callName: String, callArgName: String, code: String = "", index: Int = 1): MockCpg = - withArgument(callName, NewCall().name(callArgName).code(code).argumentIndex(index)) - - def withArgument(callName: String, newNode: NewNode): MockCpg = withCustom { (graph, cpg) => - val callNode = cpg.call.name(callName).head - val methodNode = callNode.method - val typeDecl = NewTypeDecl().name("abc") - graph.addEdge(callNode, newNode, EdgeTypes.AST) - graph.addEdge(callNode, newNode, EdgeTypes.ARGUMENT) - graph.addEdge(methodNode, newNode, EdgeTypes.CONTAINS) - graph.addEdge(newNode, typeDecl, EdgeTypes.REF) - graph.addNode(newNode) - } - - def withCustom(f: (DiffGraphBuilder, Cpg) => Unit): MockCpg = { - val diffGraph = new DiffGraphBuilder - f(diffGraph, cpg) - class MyPass extends CpgPass(cpg) { - override def run(builder: BatchedUpdate.DiffGraphBuilder): Unit = { - builder.absorb(diffGraph) - } - } - new MyPass().createAndApply() - this - } - } - -} diff --git a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/utils/Statements.scala b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/utils/Statements.scala index 31e229dae68d..78b76d838b71 100644 --- a/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/utils/Statements.scala +++ b/semanticcpg/src/main/scala/io/shiftleft/semanticcpg/utils/Statements.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.utils -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.Cpg +import io.shiftleft.semanticcpg.language.* object Statements { def countAll(cpg: Cpg): Long = diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/NewNodeStepsTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/NewNodeStepsTests.scala index c2e53ea4c592..da5b1b4e803a 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/NewNodeStepsTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/NewNodeStepsTests.scala @@ -1,25 +1,23 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.generated.nodes._ +import io.shiftleft.codepropertygraph.generated.{Cpg, DiffGraphBuilder} +import flatgraph.DiffGraphApplier.applyDiff +import io.shiftleft.codepropertygraph.generated.nodes.* import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb.BatchedUpdate.{DiffGraphBuilder, applyDiff} - -import scala.jdk.CollectionConverters._ class NewNodeStepsTest extends AnyWordSpec with Matchers { - import io.shiftleft.semanticcpg.language.NewNodeNodeStepsTest._ + import io.shiftleft.semanticcpg.language.NewNodeNodeStepsTest.* "stores NewNodes" in { - implicit val diffGraphBuilder: DiffGraphBuilder = new DiffGraphBuilder + implicit val diffGraphBuilder: DiffGraphBuilder = Cpg.newDiffGraphBuilder val newNode = newTestNode() - val cpg = Cpg.emptyCpg + val cpg = Cpg.empty new NewNodeSteps(newNode.start).store() - cpg.graph.nodes.toList.size shouldBe 0 + cpg.all.size shouldBe 0 applyDiff(cpg.graph, diffGraphBuilder) - cpg.graph.nodes.toList.size shouldBe 1 + cpg.all.size shouldBe 1 } "can access the node label" in { @@ -29,29 +27,31 @@ class NewNodeStepsTest extends AnyWordSpec with Matchers { "stores containedNodes and connecting edge" when { "embedding a StoredNode and a NewNode" in { - implicit val diffGraphBuilder: DiffGraphBuilder = new DiffGraphBuilder - val cpg = Cpg.emptyCpg - val existingContainedNode = cpg.graph.addNode(42L, "MODIFIER").asInstanceOf[StoredNode] - cpg.graph.V().asScala.toSet shouldBe Set(existingContainedNode) - - val newContainedNode = newTestNode() - val newNode = newTestNode(evidence = List(existingContainedNode, newContainedNode)) + val cpg = Cpg.empty + val newModifier = NewModifier() + applyDiff(cpg.graph, Cpg.newDiffGraphBuilder.addNode(newModifier)) + val existingContainedNode = newModifier.storedRef.get + cpg.graph.allNodes.toSet shouldBe Set(existingContainedNode) + + implicit val diffGraphBuilder: DiffGraphBuilder = Cpg.newDiffGraphBuilder + val newContainedNode = newTestNode() + val newNode = newTestNode(evidence = List(existingContainedNode, newContainedNode)) new NewNodeSteps(newNode.start).store() - cpg.graph.V().asScala.length shouldBe 1 + cpg.all.length shouldBe 1 applyDiff(cpg.graph, diffGraphBuilder) - cpg.graph.V().asScala.length shouldBe 3 + cpg.all.length shouldBe 3 } "embedding a NewNode recursively" in { - implicit val diffGraphBuilder: DiffGraphBuilder = new DiffGraphBuilder - val cpg = Cpg.emptyCpg + implicit val diffGraphBuilder: DiffGraphBuilder = Cpg.newDiffGraphBuilder + val cpg = Cpg.empty val newContainedNodeL1 = newTestNode() val newContainedNodeL0 = newTestNode(evidence = List(newContainedNodeL1)) val newNode = newTestNode(evidence = List(newContainedNodeL0)) new NewNodeSteps(newNode.start).store() - cpg.graph.V().asScala.size shouldBe 0 + cpg.all.size shouldBe 0 applyDiff(cpg.graph, diffGraphBuilder) - cpg.graph.V().asScala.size shouldBe 3 + cpg.all.size shouldBe 3 } } diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/OverlaysTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/OverlaysTests.scala similarity index 96% rename from semanticcpg/src/test/scala/io/shiftleft/semanticcpg/OverlaysTests.scala rename to semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/OverlaysTests.scala index f1fcf8098a71..f11d33aed67f 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/OverlaysTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/OverlaysTests.scala @@ -1,6 +1,6 @@ package io.shiftleft.semanticcpg -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/StepsTest.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/StepsTest.scala index 8fd00d9877ed..deafb4044809 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/StepsTest.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/StepsTest.scala @@ -1,18 +1,15 @@ package io.shiftleft.semanticcpg.language -import io.shiftleft.codepropertygraph.Cpg -import io.shiftleft.codepropertygraph.Cpg.docSearchPackages -import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.{NodeTypes, Properties} +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg +import flatgraph.help.Table.{AvailableWidthProvider, ConstantWidth} import org.json4s.* import org.json4s.native.JsonMethods.parse import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec -import overflowdb.traversal.help.Table.{AvailableWidthProvider, ConstantWidth} - -import java.util.Optional -import scala.jdk.CollectionConverters.IteratorHasAsScala class StepsTest extends AnyWordSpec with Matchers { @@ -52,7 +49,7 @@ class StepsTest extends AnyWordSpec with Matchers { val method: Method = cpg.method.head val results: List[Method] = cpg.method.id(method.id).toList results.size shouldBe 1 - results.head.underlying.id + results.head.id } "providing multiple" in { @@ -158,7 +155,7 @@ class StepsTest extends AnyWordSpec with Matchers { val nodeId = mainMethods.head.id val printed = mainMethods.p.head printed.should(startWith(s"""(METHOD,$nodeId):""")) - printed.should(include("IS_EXTERNAL: false")) + printed.should(include("SIGNATURE: asignature")) printed.should(include("FULL_NAME: woo")) } @@ -195,24 +192,24 @@ class StepsTest extends AnyWordSpec with Matchers { implicit val availableWidthProvider: AvailableWidthProvider = new ConstantWidth(120) "show domain overview" in { - val domainStartersHelp = Cpg.emptyCpg.help + val domainStartersHelp = Cpg.empty.help domainStartersHelp should include(".comment") - domainStartersHelp should include("All comments in source-based CPGs") + domainStartersHelp should include("A source code comment") domainStartersHelp should include(".arithmetic") domainStartersHelp should include("All arithmetic operations") } "provide node-specific overview" in { - val methodStepsHelp = Cpg.emptyCpg.method.help - methodStepsHelp should include("Available steps for Method") + val methodStepsHelp = Cpg.empty.method.help + methodStepsHelp should include("Available steps for `Method`") methodStepsHelp should include(".namespace") methodStepsHelp should include(".depth") // from AstNode - val methodStepsHelpVerbose = Cpg.emptyCpg.method.helpVerbose - methodStepsHelpVerbose should include("traversal name") + val methodStepsHelpVerbose = Cpg.empty.method.helpVerbose + methodStepsHelpVerbose should include("implemented in") methodStepsHelpVerbose should include("structure.MethodTraversal") - val assignmentStepsHelp = Cpg.emptyCpg.assignment.help + val assignmentStepsHelp = Cpg.empty.assignment.help assignmentStepsHelp should include("Left-hand sides of assignments") // from AssignmentTraversal } @@ -283,7 +280,6 @@ class StepsTest extends AnyWordSpec with Matchers { def methodParameterOut = cpg.graph .nodes(NodeTypes.METHOD_PARAMETER_OUT) - .asScala .cast[MethodParameterOut] .name("param1") methodParameterOut.typ.name.head shouldBe "paramtype" @@ -305,7 +301,7 @@ class StepsTest extends AnyWordSpec with Matchers { file.typeDecl.name.head shouldBe "AClass" file.head.typeDecl.name.head shouldBe "AClass" - def block = cpg.graph.nodes(NodeTypes.BLOCK).asScala.cast[Block].typeFullName("int") + def block = cpg.graph.nodes(NodeTypes.BLOCK).cast[Block].typeFullName("int") block.local.name.size shouldBe 1 block.flatMap(_.local.name).size shouldBe 1 @@ -321,8 +317,8 @@ class StepsTest extends AnyWordSpec with Matchers { // def cfg: Iterator[CfgNode] = cpg.method.name("add") def ast: Iterator[AstNode] = cpg.method.name("foo").cast[AstNode] - ast.astParent.property(Properties.NAME).head shouldBe "AClass" - ast.head.astParent.property(Properties.NAME) shouldBe "AClass" + ast.astParent.property(Properties.Name).head shouldBe "AClass" + ast.head.astParent.property(Properties.Name) shouldBe "AClass" // methodForCallGraph method.call.size shouldBe 1 @@ -349,13 +345,6 @@ class StepsTest extends AnyWordSpec with Matchers { method.head.modifier.modifierType.toSetMutable shouldBe Set("modifiertype") } - "id starter step" in { - // only verifying what compiles and what doesn't... - // if it compiles, :shipit: - assertCompiles("cpg.id(1).out") - assertDoesNotCompile("cpg.id(1).outV") // `.outV` is only available on Traversal[Edge] - } - "property accessors" in { val cpg = MockCpg().withCustom { (diffGraph, _) => diffGraph @@ -370,21 +359,35 @@ class StepsTest extends AnyWordSpec with Matchers { val (Seq(emptyCall), Seq(callWithProperties)) = cpg.call.l.partition(_.argumentName.isEmpty) - emptyCall.propertyOption(Properties.TYPE_FULL_NAME) shouldBe Optional.of("") - emptyCall.propertyOption(Properties.TYPE_FULL_NAME.name) shouldBe Optional.of("") - emptyCall.propertyOption(Properties.ARGUMENT_NAME) shouldBe Optional.empty - emptyCall.propertyOption(Properties.ARGUMENT_NAME.name) shouldBe Optional.empty + // Cardinality.One + emptyCall.property(Properties.TypeFullName) shouldBe "" + emptyCall.propertyOption(Properties.TypeFullName) shouldBe Some("") + emptyCall.propertyOption(Properties.TypeFullName.name) shouldBe Some("") + // Cardinality.ZeroOrOne + emptyCall.property(Properties.ArgumentName) shouldBe None + emptyCall.propertyOption(Properties.ArgumentName) shouldBe None + emptyCall.propertyOption(Properties.ArgumentName.name) shouldBe None + // Cardinality.List // these ones are rather a historic accident it'd be better and more consistent to return `None` here - // we'll defer that change until after the flatgraph port though and just document it for now - emptyCall.propertyOption(Properties.DYNAMIC_TYPE_HINT_FULL_NAME) shouldBe Optional.of(Seq.empty) - emptyCall.propertyOption(Properties.DYNAMIC_TYPE_HINT_FULL_NAME.name) shouldBe Optional.of(Seq.empty) - - callWithProperties.propertyOption(Properties.TYPE_FULL_NAME) shouldBe Optional.of("aa") - callWithProperties.propertyOption(Properties.TYPE_FULL_NAME.name) shouldBe Optional.of("aa") - callWithProperties.propertyOption(Properties.ARGUMENT_NAME) shouldBe Optional.of("bb") - callWithProperties.propertyOption(Properties.ARGUMENT_NAME.name) shouldBe Optional.of("bb") - callWithProperties.propertyOption(Properties.DYNAMIC_TYPE_HINT_FULL_NAME) shouldBe Optional.of(Seq("cc", "dd")) - callWithProperties.propertyOption(Properties.DYNAMIC_TYPE_HINT_FULL_NAME.name) shouldBe Optional.of(Seq("cc", "dd")) + emptyCall.property(Properties.DynamicTypeHintFullName) shouldBe Seq.empty + emptyCall.propertyOption(Properties.DynamicTypeHintFullName) shouldBe Some(Seq.empty) + emptyCall.propertyOption(Properties.DynamicTypeHintFullName.name) shouldBe Some(Seq.empty) + + // Cardinality.One + callWithProperties.property(Properties.TypeFullName) shouldBe "aa" + callWithProperties.propertyOption(Properties.TypeFullName) shouldBe Some("aa") + callWithProperties.propertyOption(Properties.TypeFullName.name) shouldBe Some("aa") + + // Cardinality.ZeroOrOne + callWithProperties.property(Properties.ArgumentName) shouldBe Some("bb") + callWithProperties.propertyOption(Properties.ArgumentName) shouldBe Some("bb") + callWithProperties.propertyOption(Properties.ArgumentName.name) shouldBe Some("bb") + + // Cardinality.List + callWithProperties.property(Properties.DynamicTypeHintFullName) shouldBe Seq("cc", "dd") + callWithProperties.propertyOption(Properties.DynamicTypeHintFullName) shouldBe Some(Seq("cc", "dd")) + callWithProperties.propertyOption(Properties.DynamicTypeHintFullName.name) shouldBe Some(Seq("cc", "dd")) } } diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/accesspath/AccessPathTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/accesspath/AccessPathTests.scala similarity index 98% rename from semanticcpg/src/test/scala/io/shiftleft/semanticcpg/accesspath/AccessPathTests.scala rename to semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/accesspath/AccessPathTests.scala index 3cb15128a159..8a191132d0a8 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/accesspath/AccessPathTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/accesspath/AccessPathTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.accesspath -import io.shiftleft.semanticcpg.accesspath.MatchResult._ -import org.scalatest.matchers.should.Matchers._ +import io.shiftleft.semanticcpg.accesspath.MatchResult.* +import org.scalatest.matchers.should.Matchers.* import org.scalatest.wordspec.AnyWordSpec class AccessPathTests extends AnyWordSpec { diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/bindingextension/BindingTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/bindingextension/BindingTests.scala index 76db43185dbb..195e5472f2d7 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/bindingextension/BindingTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/bindingextension/BindingTests.scala @@ -1,8 +1,8 @@ package io.shiftleft.semanticcpg.language.bindingextension import io.shiftleft.codepropertygraph.generated.EdgeTypes -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/operatorextension/OperatorExtensionTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/operatorextension/OperatorExtensionTests.scala index d535fc9493ba..650914868147 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/operatorextension/OperatorExtensionTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/operatorextension/OperatorExtensionTests.scala @@ -1,10 +1,9 @@ package io.shiftleft.semanticcpg.language.operatorextension -import io.shiftleft.codepropertygraph.Cpg +import io.shiftleft.codepropertygraph.generated.Cpg import io.shiftleft.codepropertygraph.generated.Operators import io.shiftleft.codepropertygraph.generated.nodes.Identifier -import io.shiftleft.semanticcpg.language._ -import io.shiftleft.semanticcpg.language.operatorextension.OpNodes.ArrayAccess +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversalTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversalTests.scala index 361bc45d222e..aedde1cb4dad 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversalTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/CfgNodeTraversalTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.expressions.generalizations import io.shiftleft.codepropertygraph.generated.EdgeTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversalTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversalTests.scala index 1ec5f62bd598..0a9d459c5b48 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversalTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/expressions/generalizations/ExpressionTraversalTests.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.types.expressions.generalizations import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.Call -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/FileTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/FileTests.scala index 3c9a9728c270..c750f85b538a 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/FileTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/FileTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.structure import io.shiftleft.codepropertygraph.generated.nodes.{File, Namespace, TypeDecl} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.LoneElement import org.scalatest.matchers.should.Matchers diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTests.scala index a12a3a7edb2e..3972b43d70b5 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MemberTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.structure import io.shiftleft.codepropertygraph.generated.ModifierTypes -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTests.scala index d98aa68f5811..5694017e9942 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodParameterTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.structure import io.shiftleft.codepropertygraph.generated.nodes.{Method, MethodParameterIn} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTests.scala index 908a6a3d8a16..c80baace6241 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/MethodTests.scala @@ -2,7 +2,7 @@ package io.shiftleft.semanticcpg.language.types.structure import io.shiftleft.codepropertygraph.generated.EdgeTypes import io.shiftleft.codepropertygraph.generated.nodes.{CfgNode, Expression, Literal, Method, NamespaceBlock, TypeDecl} -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTests.scala index 184c015a0ceb..2e29239b6f0f 100644 --- a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTests.scala +++ b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/types/structure/NamespaceTests.scala @@ -1,7 +1,7 @@ package io.shiftleft.semanticcpg.language.types.structure -import io.shiftleft.codepropertygraph.generated.nodes._ -import io.shiftleft.semanticcpg.language._ +import io.shiftleft.codepropertygraph.generated.nodes.* +import io.shiftleft.semanticcpg.language.* import io.shiftleft.semanticcpg.testing.MockCpg import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/utils/CountStatementsTests.scala b/semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/utils/CountStatementsTests.scala similarity index 100% rename from semanticcpg/src/test/scala/io/shiftleft/semanticcpg/utils/CountStatementsTests.scala rename to semanticcpg/src/test/scala/io/shiftleft/semanticcpg/language/utils/CountStatementsTests.scala diff --git a/test-dataflow-slice.sc b/test-dataflow-slice.sc new file mode 100644 index 000000000000..dfeeb9b23cb9 --- /dev/null +++ b/test-dataflow-slice.sc @@ -0,0 +1,17 @@ +import upickle.default.* +import io.shiftleft.utils.IOUtils +import java.nio.file.Path +import io.joern.dataflowengineoss.slicing.{DataFlowSlice, SliceEdge} + +@main def exec(sliceFile: String) = { + val jsonContent = IOUtils.readLinesInFile(Path.of(sliceFile)).mkString + val dataFlowSlice = read[DataFlowSlice](jsonContent) + val nodeMap = dataFlowSlice.nodes.map(n => n.id -> n).toMap + val edges = dataFlowSlice.edges.toList + .map { case SliceEdge(src, dst, _) => + (nodeMap(src).lineNumber, nodeMap(dst).lineNumber) -> List(nodeMap(src).code, nodeMap(dst).code).distinct + } + .sortBy(_._1) + .flatMap(_._2) + println(edges) +} diff --git a/tests/code/javasrc/SliceTest.java b/tests/code/javasrc/SliceTest.java new file mode 100644 index 000000000000..0d2b2dd099fa --- /dev/null +++ b/tests/code/javasrc/SliceTest.java @@ -0,0 +1,16 @@ + + +public class SliceTest { + + public void foo(boolean b) { + String s = new Foo("MALICIOUS"); + if (b) { + s.setFoo("SAFE"); + } + bar(b); + } + + public void bar(String x) { + System.out.println(s); + } +} \ No newline at end of file diff --git a/upstream_sync.sh b/upstream_sync.sh old mode 100755 new mode 100644 index c77879f1a078..129c4ccd6161 --- a/upstream_sync.sh +++ b/upstream_sync.sh @@ -37,4 +37,4 @@ if [ "$PUBLISH" = true ]; then git checkout master git merge "$BRANCH" git push origin master -fi \ No newline at end of file +fi